resource management

Keeping track of your resources and assets in a game is a crucial point in every game framework.

In Infestation I had a ResourceManager which basically had an array for every resource type. There was an array for images, an array for sounds, etc… On game startup I created an instance of ResourceManager which read all resources and created objects in the corresponding arrays. The references to these resources were hardcoded in ResourceManager.

This served me well but had two major drawbacks: I loaded all resources at once. No biggie if you have just a handful of graphics and oggs. But as the game grows, more assets are added which lead to longer loading times and more references to this ResourceManager are made which makes later refactoring more comlicated. Another drawback is that while loading this blob of resources you can’t give any feedback to the user while the load method runs.

So time for a new ResourceManager until it’s to late

Continue reading

Preview video of 0.1

Just uploaded a sneak peek of the upcoming 0.1 version. I thought it would be time to show some actual graphics before we hit 0.1.

[jwplayer config=”Custom Player” mediaid=”487″]

Sorry or the lack of audio and the overall bad video quality. I’ll do a proper commentated version once I finish v0.1 and get my video codecs working.

What’s basically shown in the video is a first draft of the main menu, loading/saving, the basic equipment screen where you can only swap weapons at the moment and the gameplay. The gameplay has turns implemented, basic “follow-me-AI”, killing, movement directions and finally killing the alien. 🙂

As you’ll notice there’s 1 AP missing on the players turn, the hidden movement screen isn’t a hidden movement screen and the vertical door is missing the proper open door sprite.

Infestation: preparing for v0.1

Seems I did something right during the development process.

I figured out how I want to properly integrate TWL into my game.  I also established some kind of workflow when it comes to creating GUIs with TWL. I’m no longer fumbling around with the layouts and themes for some hours to realize I don’t fully understand TWL. Instead I now have an idea what I want my gui to look like, I put in some lines of code and voila: GUI looks like I imagined.

After making some major changes to the core of the game (mostly in Terms of GUI and save/load func.) I really was surprised as I uncommented my AI and the player turns.

Not only did the AI player move and follow my brave Space soldiers like it did after so many revisions before – also my save+load functionality accepted the AI without any complains.

So as all is looking surprisingly good, expect a release of v0.1 in 1-2 weeks.

I just need to fix some stuff:

  • add unit directions (by dragging the mouse in the direction the soldier should face)
  • add a basic bullet animation (currently the target just falls to the ground)
  • add the vertical doors (currently there’s only a flag for door or no-door – no directions present)
  • make the doors only open if you’re standing directly in front
  • add AP for firing, activating objects
  • make the alien shoot

Continue reading

Infestation: weekend update

Just a really smal update on what’s going on:

Progress came to a crawl. Feeled a little bit burned out and was not really in the mood…

However, I fixed some issues the way the savegames work. This reduces the size of the saves and I learned something about the way Java XML-Serialization works 😉

I added the doors back in which promptly raised a new issue with the saves. Albeit it’s working now… but I’m not really satisfied.

Did some TWL but I’m not really sure what’s the best way to hook up TWL to my events. I’ll do some testing. TWL’s callbacks seem a little bit awkward with StateBasedGames…

Infestation: weekend update

Not much going on lately.

Currently I’m fighting with TWL and it’s lack of documentation – again!

At least I figured out how the whole xml theme concept works and how to properly create themes. However I have a hard time with creating proper layouts. The Layout managers in TWL seem rather complicated and the missing doc doesn’t help in this part.

However I made some notes what states (screens) I need and started implementing them. Currently I have a basic menu w/ TWL and an unfinished (in terms of functionality) equipment screen so I can swap the weapons of my marines. The world map is still a good ol’ plaintext ui.

Oh, and I switched from hardcoded weapon&mission defiitions to xml files so you can easily modify them with a simple texteditor.
In the next update I’ll probably fix some bugs in the load&save functionality and add some gameplay mechanics. I’m a little bit fed up with this gui stuff… :-/