-3
\$\begingroup\$

I'd like to turn old game engines (such as Doom engine/id Tech 1) that were designed to run on a single core computer into multi-core game engines.

How can I do that?

\$\endgroup\$
8
  • \$\begingroup\$ The performance gain of an application is tied to the ratio of thread/cores, but the number of thread in an application is not limited by the number of cores. What makes you think that adding threads to an app that runs on only one core would be different than an app that runs on multiple cores? \$\endgroup\$
    – Vaillancourt
    Commented Oct 31, 2017 at 15:52
  • \$\begingroup\$ Well take the doom engine from id software that brought us doom in the 90's is it possible to edit the game engine to run off multi cores instead of 1 core any advice on that question if so how would somebody go about any game engine that came out in the 90's to add multi core support \$\endgroup\$
    – John Nay
    Commented Oct 31, 2017 at 15:59
  • \$\begingroup\$ Find one component that doesn't need lock-step synchronization with your core engine (Ragdoll Physics, Pathfinding, Particles, etc) and run it on a separate thread. (You'll need to synchronize periodically, like when you need to update a mesh used by the renderer after a simulation step is complete, and that synchronization part needs to be wrapped in a critical region so as to not disturb the rest of your non-threadsafe engine) \$\endgroup\$
    – Jimmy
    Commented Oct 31, 2017 at 15:59
  • \$\begingroup\$ Jimmy is there any tutorials out there for doing this kind of thing like you said. \$\endgroup\$
    – John Nay
    Commented Oct 31, 2017 at 16:06
  • \$\begingroup\$ Jimmy can you post a code example of what you are saying. \$\endgroup\$
    – John Nay
    Commented Oct 31, 2017 at 16:10

1 Answer 1

5
\$\begingroup\$

You cannot just edit the binary or configuration files of some already-compiled game written under single-threaded assumptions to turn it into a game that effectively utilizes more than one thread. Unless the code has some existing multithreaded features that were just shipped disabled, making this kind of change requires access to the source code. The switch to a multi-threaded computation model from a single-threaded computation model is non-trivial, which is part of why it continues to be so difficult.

If you have access to the source code of the game in question, making this transition is done exactly the same way as you would in building a game to leverage multi-threading in the first place. It will probably be harder because you will first need to learn the existing code base and work around a lot of fundamental design challenges stemming from the fact that the original code probably did not bother to consider concurrency.

The basic process will involve identifying portions of the code that can be rewritten to execute in parallel, and then performing that refactoring. The specifics of the tasks will vary based on the specifics of the code and problems you're dealing with; entire books can be written on the general topic of effective design under concurrency scenarios.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .