• Home
  • About
    • Biography
    • Contact Info
  • Projects
    • 2D Map Editor
    • Dodge and Destroy
    • Intruder's Run
    • Procedural Terrain
    • Jim Bob's Jam
Nickpdevelop.net

Quest for cache coherency, and need for work! 11/09/2011 at 03:33

Hope I spelled that right haha.

While looking over the changes I mentioned I have planned in my previous blog post, and after reading several programming articles I have discovered a way to make Dodge and Destroy’s data much more decoupled, and much more cache coherent, and overall easier to read and understand. I honestly don’t know how I didn’t see this new solution way earlier when I was working a lot more on redesigning the code to that project.

My new solution will remove at the least, three classes, and the need for inheritance when dealing with enemies. All that will be needed is the enemy class, which will have less data associated with it then it does now, and will be the same size no matter what enemy type. One of the major drawbacks of using inheritance is that updating enemy objects is in most cases random in the sense that you do not know right away whether it is a “Red” or “Green” enemy without the lookup in the vtable. My new solution will just require the enemy class, who’s data can be stored sequentially in an array or vector, which theoretically will reduce cache misses, and improve performance.

These changes, along with the change to how projectiles are managed and owned by the player class, will clean up and decouple a lot of the code. I am still looking for the best solution to decouple the projectile code but that should come pretty quickly as I get into the code much more. Hopefully this will be done in a day or two, and maybe I can let this project be, and finally be happy with the code.

After doing so however, I feel as if I need a new game to work on thats small in scope. My XNA game’s scope is too large just to hack at it for awhile and finish, so I want to work on a smaller project while I am chipping away on my XNA game. Only problem is right now I don’t have many idea’s for a small arcadey game ><. I really want to work on an Android title and get it on thier app store .. again my problem is the emulator and being able to judge performance/gameplay problems from it. Ultimately that is the platform I want to work on though when it comes to a smaller project. I can probably write the code in a native C++ openGL way, and then transfer it over to the android api whenever I can either get an android device or figure out how to get the emulator to perform well enough. But maybe I'll find a programming job soon, and be able to focus on that. Anyway I just need more work to do >



« Much needed update: Dodge tech design issues, and XNA game! Skyrim happened, possible new project? »