Daniel J. Petersen’s Devblog

Documenting my struggle to make a videogame.

Finished a Game I Started a Long Time Ago

I spent the past few days working on an old project that I could never quite get working correctly. It’s a clone of the game Hex Empire which I’m affectionately calling Sins of a Hex Empire. The name is a play on the game Sins of a Solar Empire, which is probably one of the worst names ever, but I think it’s endearing. Anyway, the old version I attempted to make was in C++ with SDL . I’ve been spending the past few weeks studying up on web development stuff, which has been interesting, but I wanted to go back and finish some of my unfinished projects before I go to school. Working on this served to give me a nice sense of progress considering it was something that I was previously unable to get working correctly.

The first thing I did was port it over from SDL 1.2 to SFML . I did this because I’m a lot more familiar with SFML, and the version of SDL it was using was dated, so I wanted to either port it to something else or work on updating it to the latest version of SDL. It was really just a question of porting to SDL 2.0 or SFML, which was a no brainer for me.

I ended up drastically changing the code structure, rewrote a lot of old functions since some of my old code was terrible, fixed a bug with the pathfinding which took forever to figure out, and added in an AI. The AI isn’t that great, but it only has a few hours of work on it, and I don’t think I have enough time to play around with it and improve it some more. It’s managed to beat me a few times so I figure that it’s good enough for a base line level. If you want a harder challenge you can artificially handicap yourself by picking a terrible starting position.

Due to wanting to get back to web development stuff, I also didn’t have enough time to test it out too much, so I’m sure there are some bugs that I don’t know about.

Also, a final disclaimer: Due to VS2012 apparently not liking Windows XP under its default settings, this won’t work on Windows XP.

I present Sins of a Hex Empire

  • Turn based strategy game
  • Your goal is to defeat three opposing AI and conquer the entire map
  • The black dots scattered across the map are cities. If you own a city, it generates one army every turn.
  • Capitals (the stars) generate two armies per turn. If you capture a capital, that enemy will be eliminated
  • Your units have two values – armies and experience. Armies are the thin black crosses, experience is the black outline around those crosses.
  • A unit gains experience whenever it expands your nations borders
  • You have a limited number of moves per turn
  • Pressing enter moves to the next turn
  • Pressing spacebar at any time spawns a new map.