So, how many of you already know that display has already been split from DF into a separate thread, meaning DF is now a two-thread game that can run faster on a 2 or 4 core computer now?
Granted, with DF's simple display, that increase in FPS is negligible (unless you use graphics packs). But here's a few more things that could (eventually) be split off into their own threads:
- Pathfinding. Suggested a lot, actually, and would take some work to do. But definitely worth it if it happens.
- Injury/syndrome handling. This would only speed things up marginally more then the graphics, but you would eventually notice it.
- Task handling. This would allow the FPS drop from job cancellation spam or from 10+ legendary miners eating through soil to be negated entirely. As well as making it easier to work on improving the system, though it WOULD be difficult to split off in the first place.
- Player interface. By making designations, menu exploration, and other such screens/functions work on a seperate thread from the game, we could save... not much FPS. The game auto-pauses while in these menus, so we naturally see the FPS rise while in them. This would mean that the increase in FPS after unpausing or leaving a menu is delayed a little longer, though, and would cause us to see a few more features implemented. Specifically, the auto-pausing while in a menu could be disabled by hard-core players (like the squads screen, but for all screens), and... see the spoiler for details, but they are OMG MULTYPLR PLEZE related.
Alright, since the Interface Thread would allow any interaction by the player to be handled separately from the fortress, it stands to reason that where the player is looking would be handled by this thread. K?
So we have a player on another computer. You give him a password (after enabling Online Mode), while playing DF on your computer. Your friend loads up DF, goes to a Join menu, puts in your password, and his machine starts up the interface thread - but not the game thread. You can maybe start to see where I'm going with this. Your computer feeds his all the information it needs to display whatever he's looking at (but not information that he doesn't need, like stocks or fluid dynamics or stuff), and his feeds additional commands to your computer, allowing him to designate places to dig and set up workshops and production orders while you build weapon traps and fight off two simultaneous sieges.
The Online Mode handling would of course also be another thread, so if 12 people join you as overseers, your computer only slows down as much as if only 1 or 2 people had joined.
Settings related to this:
AUTOPAUSE_ON_MENU: Automatically pauses when in a menu. Only disable if you're a hard-core challenge fan, or have 4 other players in online mode.
MENU_REMOVE: Automatically removes you from a menu if the game autopauses for some other reason, like damp stone. Only applicable if Menu Autopausing is disabled.
ONLINE_MODE: allows others to join you if they have the password for your game.
ONLINE_MODE_ENABLING: Allows you to turn ONLINE_MODE on or off when saving or loading in game.
ONLINE_MODE_PASSWORD: The password needed to join you. Must be at least 6 characters long.
ONLINE_MODE_OVERSEE: Default on. When this is disabled but ONLINE_MODE is enabled, other players may observe any part of your fortress at any time, but cannot affect anything.
ONLINE_MODE_GUEST_AUTOPAUSE: Affects whether your game will pause or not when a guest goes into a menu that causes autopausing. Default no.
Yes, this thread was mostly created as a way to describe a multiplayer suggestion. But, I hope/think I did it in a new way that could possibly be done within 10 updates with a player-base hack added, or within 20 updates naturally.