Update: I've been working on the resource managers the last couple of days. The basic idea of the ResourceManager in moonman is that it:
- provides a centralised abstraction to load and access resources (game data that corresponds to a file on disk, like an image, sound, shader spec, etc.)
- provides an ID/handle system for referencing of resources, and
- can watch the filesystem for changes in resources, reloads them and notifies all dependent resource managers.
This was inspired by the articles:
-
Stay in the Game: Asset Hotloading for Fast Iteration. Noel Llopis and Charles Nicholson (Game Programming Gems 6)-
The Beauty of Weak References and Null Objects. Noel Llopis (GPG4) So far, I've got image hotloading working, which means you can edit a sprite in GIMP, save it, then see the results immediately update in-game. This will hopefully make it easier to test and edit the artwork in the context of the game (with shaders applied etc.)
I also have script hotloading sort of working. This was a little trickier because:
- there is a many-to-one correspondence between scripts and files
- there is a dependence between scripts and resources
Nonetheless, I think I've got the core design down, and just need to iron out a few bugs here and there.
I also updated SFML from v1.6 to v2, which was actually pretty easy. The only changes were to rename sf::Image to sf::Texture, and change a couple of function names. I also checked out
SFGUI which seems like a nice little gui, which I may use for my minimal in-game gui, console, and in some of the tools.
In more exciting news, Moonman development will pick up quite a bit in the next month or two as I'm likely to have another programmer working on it with me. I have also been talking with a musician friend and we've got some interesting ideas about the soundscapes and coupling between game events and the sound. Though that stuff will be left for a few months or so.