Oh noes! Another gameengine rewrite!

Published November 26, 2005
Advertisement
I just decided to do another gameengine rewrite of my current project, Spatra 2, written in C#.

This must be the, like what, fourth rewrite? I recently rewrote it from the noobish while(notQuit) run; structure to the Kernel/Task structure presented by superpig in his awesome Enginuity series

Moving to a taskbased engine made it *so much more* scalable and modifiable. For instance, if you want a fancy explosion, you just create a RenderExplosionTask which deletes itself from the Kernel after the simulation is done. So the only thing you do is
Kernel.AddTask(new RenderExplosionTask(pos));

And the object renders an explosion, and after it is done, it just deletes itself with
// In RenderExplosionTask.Update()if (explosionRadius > 500.0f)    Kernel.KillTask(this);

I.e. no if (shouldRenderExplosion) updateAndRenderAllExplosions(); mess in some gameloop somewhere.

Anyway, I have tasks that handles core functionallity of the engine. Like there's a InputTask that updates the state of the input, but as it is now, it is hardcoded for DirectInput, so the rewrite will consist in creating generic interfaces for the core classes, and implementing these interfaces with API specific solutions. That way porting the game to Linux will be a *lot* easier since it will only consist of writing a Linux-based inputhandler that implements the generic Input-interface.

Now go rewrite your engine too!
0 likes 1 comments

Comments

Gaheris
Interesting kind of design. Thanks for mentioning it!
November 26, 2005 05:34 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement