Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Oh noes! Another gameengine rewrite!

Oh noes! Another gameengine rewrite!

Enselic
I update. You read. Ok? · · 1 min read
1,270 1
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!

Discussion

Loading comments...