The design which I have been building in my head is an entity-oriented engine (which I wrote about in a previous post). A world reference will be a bag for all the entities in the game. Entities would only contain their state, and their categorizations. For example you could have a player entity, and also have an entity for each projectile currently alive in the game. An interesting idea would be to make each processor of entities a different thread. This would impose the problem of not being able to deterministically order their execution, but the idea of creating a game based on independent modules seems intriguing. My goal is to create a highly concurrent gaming engine. A cool resource to check out is Rich Hickey’s famous ant demo which was used to demo Clojure’s concurrency in the early days of the language. It is pretty mind blowing how much simulation is packed into so little code (the whole thing is 300 lines, with comments and license).
The rendering and world updating will be done by two (maybe more) agents. Clojure’s wonderful STM will trivially (maybe easy is the better terminology :)) allow these tasks to be independent. I haven’t yet chosen what the renderer is going to be yet, but this will be a 2D engine, so for the minimal amount of effort it will probably end up being the Light Weight Java Game Library, which Slick uses underneath. The unfortunate part of this is that LWJGL requires the use of native libraries. An alternative option would be to also include Swing support, thus making the engine support cross platforms easily. I will have to research to see if the Canvas in Swing is performant enough.
This is all just thought development now, but I have the whole summer ahead of me. Maybe this will make a good project :)