So just to Re-Explain what i posted and i am suggesting toady does....
What Toady needs to do to accomplish muti processor support is pretty simple and requires no real knowledge of threads in a single application at all. It is just learning how to use sockets.
Coding a single application, to use threads is good for certain things. But for games like Dwarf Fortress Using a server / client setup for the game is best.
If dwarf fortress is setup with the ability to use a Dual or Quad Core system that would be Fine. However if it is setup to use any amount of computers or processors, by using multipal applications. It would be able to acquire much more power then just a single computer can dish out.
A single "Server" application would be the core of dwarf fortress. The server application would be the app players interact with. It also is the main "Brain" of the game loading and storing all the information and figuring out what to do with that information.
The server would figure out how many processors the computer has. If the server is on a single processor, then it would then load up a single client application. If its a dual or quad core processor system, 1 or 3 client apps.
The client app would function as a worker unit. Taking orders from the brain / server. Then sending back the results to the server.
Depending on what functions a client app can take on is important. The client app needs to have access to the data the server has already loaded, without having to contact the server for that data. The client will need to sync with any data the server has loaded up when the client first starts up. Any time relevant data is changed which a client needs to know about, the server needs to update that client.
Clients should be able to take on all functions that the server would need it to do. Or it can be set to only perform certain functions. Taking on certain functions would minimize the extra ram usage.
Client Applications accept commands from the server application. The client then takes the command, lets just say for example, Path Find from 0,0,0 to 5,5,5. The client then calculates the path the unit needs to take, then sends back the list of data.
I Could really go on about this for a while but i assume anyone who cares and is reading up to this point has some kind of understand of what im talking about.
This system of course has alot of different things which needs to be thought out and setup so that it works well with DF. Every game is different and this system needs to be thought out and setup correctly to work correctly.
Pros:
>Ability to use any amount of Computers / Processors to run dwarf fortress.
>Being able to split up task between Computers / Processors.
>No annoying threads to worry about in one single application, and No memory errors from those threads if its not programmed correctly.
>Saves a lot of time using a client / server setup, from a normal thread setup in a single app. The single app is limited to one computer, while the client / server setup can be run on 100's of computers.
>No more multi threading, threads in the forums! Yey!
>Multiplayer of course
Cons:
>Extra Ram Usage
>May take some extra testing from us and toady to get working correctly.
>Toady has to learn sockets.... (Is that even a bad thing?)
>Toady will not be able to see annoying post in the forums about multi threading anymore.
>I'm really Trying to think up of cons honestly.....
I'm sure this all sounds really complicated and complex. But its not from the coding point of view. I haven't even skimmed the surface and there's too much to get into, i was just trying to give everyone a general idea of how this idea works and see what the responses are.
I really like this however. Not only with this idea are you able to use multi-processors on 1 computer. You can also use another computer to do work and such, since you are using sockets to talk from the server to client, all you need to do is contact another computer on the same lan line, or even over the internet. However, this method works best when all computers are connected together. Trying to use computers over the internet would defeat the purpose of this.
All the clients function the same. Depending on the computers resources and such would determine what the client does. The server should try to balance the work load to all available clients.
Don't know what much more i can say on this however right now. Anyone have any positive input for this idea?
Dwarf fortress is such a processor intensive game it only makes sense if you can connect it to other comptuers and use the resources from those computer also to run the game.
Allowing the computers to all share the work load.
With this system btw, another Pro. This would instantly make the game internet accessible, as well as pave the way for multiplayer support.
With the server client system i mention here in this thread. It could be expanded so that you could have a separate app which connects to the server app and interacts with the server.
You could have the game running at your home computer, a server app and client app running at home. Then from work, or where ever you are with your laptop, simply connect to your home computer with a separate application which runs on your laptop. You then with that program could then play the game from that laptop. The laptop wouldn't need to do much more then send and receive simple input commands from you, and sending you back visual data so you know whats going on.
The game can run from a lan network you have setup at home, while you sit and connect from the local mc donalds wireless network, and play DF without having to do a thing.
Its Great to Fantasize eh ?
Would love to see all this happen. Wouldnt take that long either and would really take DF to the next level and connecting everyone together more. People could run there own server networks and people could connect to that network from over the internet and play DF which someone else is hosting. Both being able to have there own citys / fortresses.
So many possibility's.....