Posted in Design Hidden Asset Programming

Behind the scenes work

May 28th, 2012 - 1:34 pm

For the past week, I’ve been doing a lot of behind the scenes work on Hostile Takeover. Some of this work has gone into refactoring the code to make it easier to add environmental sprites and data in the future. And a bunch of work has gone into making the map editor as usable and powerful as possible.

Click to enlarge Click to enlarge

Until know, the information for each object making up the game’s environment has been spread out across multiple files, procedures and units. To draw a chair, for example, depending on whether the code was running in-game or in the map editor, information about which specific sprite to use (based on the map and/or object’s rotation), which texture atlas this sprite could be found on, where it should be drawn on the screen relative to the tile it’s on, whether or not the sprite should be flipped vertically or horizontally, and how the object will block line-of-sight – all this information was scattered around in the code. Not only was this highly inefficient from a coding point of view, as information would be duplicated across procedures and files, but adding new stuff to the game would’ve been a nightmare. I’ve now split everything into three highly structured files, ensuring that this process will be a lot simpler and quicker.

Adding the individual sprites and objects to the game is only the first part, though. I then have to build a map with them. Adding ground, walls, interactive objects, light sources and characters into a coherent whole can quickly become a messy process, so having a powerful and easy to use map editor is essential. I believe it takes a lot of iterations to make a good and challenging map – and the easier it is to build and modify a map, the more willing I’ll probably be to scrap something that simply isn’t working, or refine something that isn’t quite there yet.

So while my map editor may not look very flashy – and is probably very fiddly to work with if you don’t happen to be the guy that programmed it – it does everything I need it to do to build a map as comfortably and easily as possible.

Click to enlarge Click to enlarge

When a map has been built, I’ll move to the scripting language to program the effect of the player’s interaction with the map, as well as dialogues (between the player and NPCs) and conversations (between NPCs).



May 28th, 2012 1:34 pm

Not bad looks like the most simplified map maker I’ve ever seen. And all these wonderful looking cars are they just for decoration? Or will we be able to buy & drive them and get different ones?

Christian Knudsen

May 28th, 2012 1:34 pm

You won’t be able to drive cars. Currently, they can only be used as diversions if you set off their alarms.


May 30th, 2012 1:34 pm

Ah, okay :) it don’t matter it was just a question looks good though :3 what about them money cases? Do I have to buy a bigger one if I become a millionaire? lol


May 28th, 2012 1:34 pm

Wow.. damn. The art style is superb, having some real flashbacks. Quite a nice lighting system as well, from what I can see. How will story triggers/missions/and dialog work, or are they separate from the map editor?

Also, where’s my damn demo. |:<

Leave Comment

You must be logged in to post a comment.