Making a Space 4X Game: Setting the Stage

Hello everyone, I’m dayrinni. I’ve written a few articles on SpaceSector in the past. I did a series called “What Makes a Good Game.” and I am now going to start a new series of articles, called “Making a Space 4X Game.”

I thought it’d be fun to see what goes on behind the scenes and some of the obstacles that I have encountered while making my new space 4X game, whose name will remain hidden for now! The topics for the entries will be varied – some will be technically based, while others more in the game play aspect. I’ve made plenty of mistakes and these journals will talk about what I ran into and how I overcame it.

Before we begin, I’m a One Man Show. I do it all – design, code, test, some art (I try to contract as much as possible out as I’m not much of an artist), I find music, and so on. I like to refer to myself as “Super-Indie”. It is a lot of work, but it is certainly a labor of love. I love games and I love making things. I want to make a great 4X game.

Know What You Want To Do Before You Do It!

I was previously working on a space 4X game titled “SpaceIT”. While this was doing well, when I first originally came up with the design, the only other recent game was Sins of Solar Empire. I like Sins, but I thought I could make a great turn-based 4X game. I wanted something that had a lot of detail and an epic feel. I left some elements of the design empty because I wanted to have some testers to give me feedback and I could make something they like.

I thought that this would be a good idea since it would give a sense of ownership to the testers and they could become community promoters and help spread the fan base. A sense of ownership is something very powerful. While we all had good intentions, the design of the game just did not fit together at the end. It did not play in a unified way. Everything felt very disjointed to me and a few other people. Of course it would – the design was still being made in late Alpha Stages!

On top of that, the game had numerous performance issues. It was beyond me to improve the performance – the library I was using is, well was downright awful for graphics.

SpaceIT Alpha | System management view

This past June, I decided to scrap most of the project and start anew. My ultimate goal is to make a GOOD GAME. I needed to learn from my mistakes and make improvements on everything. That’s exactly what I did…

Solid Design

This time, I would come up with a unified design and ensured that it all fit together. I learned a lot from SpaceIT, especially about the very subtle aspects of 4X games. I previously specialized in RPG Games, and they are very different than 4X Games. On the plus side, I knew that I could reuse much of the code from SpaceIT for the internal game systems – such as galaxy drawing, some art assets, and other portions. SpaceIT did have a lot of good things in it and I shouldn’t let them go to waste.

So, in June 2012, I did a lot of market research, looked into new graphics libraries, and packaging tools. SpaceIT suffered greatly from poor packaging (it was a zip file) – even though it was in Alpha, it still should have been packaged better with an installer.

I spent a few weeks researching the market and then coming up with a solid design. I put in everything I learned from my experiences from working on SpaceIT, and all of the feedback I got into this new design. We did a lot of experimentation with SpaceIT – at one point we had, I think, 4 Fleet Combat Systems. At the end of the new design, I looked at what I had and said “This is good!”. I will be going over some of these systems in the future. I vowed to stay with this design and not falter. I wanted to avoid feature creep, and going around in circles. I didn’t want to waste time. It was time to execute.

One other aspect I wanted to do for the new game was to come up with the lore, races, technological aspects and so on before I coded anything. I had this idea, in the SpaceIT, that I could make the lore fit the game. This didn’t work out for me. I should have known better because I have made RPG games before, and the story/lore aspect is paramount.

I had a solid design – something that told me what the game was, and I had a plan of action. It was time to stick to my guns and pull the trigger.

Write That Lore

I spent the rest of June and all of July, writing lore and implementing the basic packaging of the game. I wrote around 40ish pages of lore and put them on the game’s website. I fleshed out all of the empires, universe, back history, and technologies. It was a huge time investment – but my new game had a basic code infrastructure that would make it easier for testers to test the game, and there was a solid backstory.

The game had a soul, an identity, one that SpaceIT never had. You know how when you play some games and it feels empty, soulless and hollow? I got that with SpaceIT. I do not get that with the new game when I test it. It really is amazing at how much this can impact ones feelings towards a game. Something without an identity is nothing – that was SpaceIT.

SpaceIT Alpha | Starmap

Now that I gave my new game an identity, it was time to write some code…

Write That Code

As mentioned above, I spent a lot of time writing the infrastructure of the game. What is this exactly? It is the repository where the code is stored, the build process, and the installer.

A code repository is simply a place where code is stored with version control. It is good because it can allow for locked files (to prevent editing from other people), logs and backups (since the source is not on your main machine). I’m using Subversion (SVN).

For those who do not know, a build process is the steps to package a piece of software so it can be deployed to consumers. The game is written in Java, so I am using ANT (which is like a Makefile for those familiar with C/C++). In ANT, it is possible to specify different tasks and all their dependencies. So in my build file, I have a series of tasks that will compile the code, obfuscate it (jumble the bytecode to make it hard to re-engineer it), generate an executable(.exe), sign it with a code signing certificate(verifies the identity of the program – me), move art assets, and finally, package everything up in an installer. The beauty is that I can do this at a click of a button! It was a large time investment (took me 71 tries to get it right) to put all of these steps in the build process, but it makes deploying the game easier. Doing a build by hand can be very time consuming and seriously error prone and cause more headaches – so I highly advise in putting the time in first to make a good build process.

There are many ways to do build processes and deploy programs – this is just what I selected. I know, in the Java realm, Maven is very popular (and powerful).

With Java, the executable program is generally a “jar” file instead of an .exe file. But I wanted to use an .exe file (on Windows, for now). I also wanted something that will be able to detect if the user has Java or not, and do proper setup. Java can be fickle sometimes with installations on newer versions of Windows. People are also more familiar with an .exe file rather than a .jar (or a .cmd file). So this increased usability. The last thing a gamer wants is to have a problem when trying to launch a game they are excited about! There are a bunch of different programs out there to package up a Java program to make it be in an .exe file. I am using Jsmooth. It is very cool and gets the job done! I was able to incorporate this into my build process, so it runs seamlessly.

Finally, the last part, is the installer. In SpaceIT Alpha, I had a zip file – not exactly a pretty way to handle installation of a program. This time, I wanted something more robust and official looking. I did a lot of research and found another set of tools that can be used to build a Windows Installer. It is very cool – since I can add in a lot of features, such as putting icons on the desktop and start menu. It looks better than extracting files from a zip. Also, this would handle uninstalling the game, which is important. I’m using NSIS. Again, like Jsmooth, I was able to incorporate this into the build process.

All of the above are in my build process and took me a lot of time to research and setup – but it is done now. I can (and you!) forever reap the benefits for these automated processes. The time I put in now will (and has been) saved later. I can now focus just on making a Great 4X Game!

What Comes Next?

This is my first article of the series and I plan to write many more. I wanted to set the stage for what is to come – there is a lot that has happened! I will be talking about various game systems in future articles and eventually, along with the help of Adam, I will announce the game. I do want to have testers from the community, but I first need to get to a point where the game is playable so that is why it is “secret”.

I realize that many of the games this past year have not been too successful and some of the developers may have led you guys on. This displeases me greatly as I am a player too! I don’t want to do that – especially since I am SUPER-INDIE.

You, the players, are what make games successful, and thus, you can make my game successful. I want everyone to see what my game is about before they decide to purchase it (it will not be expensive). My goal is to make a great game, as best as I can, and not to sell out. If I can show you, the gamers, what the game is about from an early phase, then maybe you will trust me enough to try it out.

I also don’t want to forget about the developers. It is always interesting and fun to see what someone else does for their projects – what tools and libraries they use, different ways of approaching a difficult technical problem and the game play decisions. I don’t have all of the answers, but maybe I do have some! I hope you can benefit from this series in some way, being far out in development already, just starting now or thinking in developing your own game.

Thank you for your time and until the next article!

dayrinni has been a Space Sector contributor since October 2011. This is his first foray into writing articles for any review site. He is an avid gamer in the genres of 4X, Strategy, MMO’s and RPGs. Finally, he has been the implementor of several MUDs and is currently working on a space 4X game that offers large scope and complexity. See all dayrinni’s posts here. In particular, check his “what makes a good game” and “making a space 4X game” series.

There is a lot of things that go on behind the curtains. Things that seem easy, or trivial, can actually be quite difficult or time consuming.

For example, we take tool tips for granted (haha when they exist at least!), and while, it is easy to simply say “This should have a tooltip that explains the industry.” What should it really say? How should the window pop up? Do we want to include this type of information or another type? What about other tooltips? How should should we design the entire tooltip system?

So something simple as a tooltip, it can be expanded into a very large project.

Anyways, I hope to touch on these topics and aspects in future articles. It is easy for players to see the end product, which is usually done well, but the trials and hurdles that had to be crossed to GET there – not so much.

In Beyond Beyaan, I’m often stuck with what many would consider as “simple things”, battling them for days before finally prevailing over them! But then my blog would say “Tool tips implemented.” which grossly understates the amount of work that went into them :)

Hopefully some of my articles will lead you into a fruitful direction!

My initial advice is – scope. I’ve struggled with this for years. I always take on something too big. One time I tried to write a 2D MMORPG. It didn’t work out so well. I’m having a way easier time with this 4X game.

Cool! I’m probably going to include some small code snippets every once in awhile. I think that will be a great way to give a peek into how things work. They’d be simple and I’d explain them because I want to make sure the readers here will be able to understand some of the main points.

It is sorta – I use GIMP as one of my art tools and they have a lot of filters. I found one combination that can generate backgrounds like the one above. I pretty much used the plasma cloud render and then re-colorized it with various colors.

So I made about 8 different backgrounds in different colors and packaged them with the game. I’m sure there would be a way to automatically do that within the Java code – but I don’t have the resources (time, money, etc) to sit down and do that. IIRC, the filters used are all “standard” and so it should be possible to write the code (in any language).

For those who are interested, there a bunch of tutorials available to create Sci-Fi elements. Most of them are for Photoshop, of course, but if you’re willing to spend some time with them, you can figure out how to achieve the same effects in GIMP, Pixelmator, Acorn, etc.

Thanks for the tips. I tried messing around with fractal clouds several months ago, but couldn’t create anything that looked halfway decent. I guess it’s a matter of tweaking settings and perseverance!

Art can be the hardest part of a game, especially if you have little or no artistic skill. Generally, it’s best to contract it out once you’re past all the initial testing phases (where the art doesn’t really matter all that much). I am trying to learn Blender so I can do 3d modeling. I’ve done modeling before with POVRay and a modeling program I can’t remember the name of. I actually got pretty good at it. I seem to do better with 3d art than 2d. There is a blog for 2d game art that is updated on an irregular schedule.

Yeah, I certainly lack that je ne sais quoi when it comes to art. It’s not just that I have no artistic skill, it’s that I have no idea what would even look good in a particular situation. Case in point, my latest attempt at a user interface looks like some awful web 2.0 monstrosity.

The very first design for SpaceIT was over the course of a few months (148 pages). Most of THAT design had a lot of extraneous information that didn’t really impact game systems. For example, I spent a lot of time researching various measurements on planet sizes and stars (including the different classification schemes and whatnot).

I wanted to have a really detailed game, but the information turned out to be “useless” – I had requests from my testers to not have this information presented on the screen. I didn’t spend too much time on market research because there just wasn’t much out there at the time. I also left some systems completely blank as I mentioned above, but that sorta backfired on me – there was lots of discussion on these systems and iteration on them. So it was very time consuming and eventually, the market changed and overcame what I had.

I did find some designs radically different – the trade, technology, espionage, system/planet building. Also, fleet combat is very different. In SpaceIT, my first iteration was a RTS polygonal (not hex based) system. It was similar to HoI with the divisions moving around provinces, but in space. In the new game, it will be a TBS that is very similar to MoO2, with a bunch of improvements to fix the flaws – but this topic is for an article so I will stop here :)

Yep – you could have stacks of fleets and attack from different directions, along with various bonuses and minuses.

I didn’t get as far as implementing the combat window they usually have, but I was planning on it.

I did “like” that type of combat – it worked great for large scales, which is what I was trying to go for. However, it really was a huge disconnect with seeing your ships/fleets in action. I just used counters and you never got to see your creations up close and personal. Sometimes, I also felt a game play disconnect. So I decided to try other types of fleet combat out (in SpaceIT): a TBS version of it. It was OK, didn’t work very well. Then I tried and implemented a “mission” TBS-RTS based system. This was an idea from bert actually. You pretty much give orders/missions to a fleet and hit “Execute” and both sides would carry out their orders. That also worked well and it was different.

In the end though, I always go back to thinking about MoO1/2 and how if I could tweak a few things and did a bit of innovation, I may be able to capture the past but place it in the future (present).

PI is awesome though – I love HoI, and have recently been playing HoI3 again.

I just want to add that I strongly disagree with your attitude towards zip files. You seem to think they are an inferior packaging strategy to an installer. I would say they are a strong alternative to installers, but never meant to fill the same niche.

That is, offering both a zip file and an installer is often times leaps and bounds better than just an installer. Sure, fewer people will use the zip, but it adds flexibility in ways the installer doesn’t.

Well, an installer has a lot of advantages – for example, you can put in a license agreement in it, so the user would have to agree. Another advantage is the ability be able to safely edit the registry (both for installation and un-installations).

I usually use .zip files for packaging, and have done so for many years, and probably will for other smaller projects. I agree that they are able to fill different roles. I wrote a custom XML parser for this game, and I’m thinking of distributing that and I would put it in a .zip file.

Hi Dayrinni, Nice article, I found it very interesting and informative. I actually have vague aspirations about writing my own indi game at some stage in the future so I will be following your series of articles with interest.

I have to say though that when I buy a 4x game, the LEAST important thing to me is the deployment method. I really couldn’t care less if it deploys professionally with an installer or if I have to unzip to get it working. The only things that really matter to me in a 4x are….

1/ Gameplay: It must be fun, over and above all other considerations.
2/ Depth: It must make you think (and allow you time to do so), have many strategic options and not have easy formulaic ways of beating it.
3/ Immersion: It must make you feel that you are actually there. A lot of designers forget about this one, but it can make all the difference.
4/ Realism: I don’t mean that it has to be totally realistic, abstraction is fine, but it must be plausible enough to enable me to suspend my disbelief. If I can accept the game as plausible (and trust me, I’m willing to work pretty hard at it) then I’m hooked.

Everything else is secondary, at least IMO and can easily be forgiven. If you have many of the above elements in your game, you will have my money, even if everything else sucks.

Thanks for sharing your design story with us and I wish you all the best in getting your game off the ground.

I agree – most gamer’s don’t really care about how the game is packaged – just as long as it installs correctly. I am sorry if I seemed to give the appearance that having the proper packaging is what gamers care about.

Your other points, make complete sense and it is what makes a game good or not (not sure if you’ve seen my other articles – I have an article on immersion for example).

I’m going to be doing future journals about a lot of game play aspects, so you’ll be able to see the direction I’m going with.

“I am sorry if I seemed to give the appearance that having the proper packaging is what gamers care about. ”

You didn’t give that impression, but it appeared from reading your article that you went through a painfully large amount of work to accomplish something that didn’t seem very important, at least to me. Oh well, it’s your time.

“(not sure if you’ve seen my other articles – I have an article on immersion for example)”

I only discovered Adam’s site a couple of weeks ago, so I haven’t seen any of your other stuff. I do plan to read it when I get the chance. Sorry if I was preaching to the choir.

I agree – it doesn’t seem like it isn’t worth the time at first glance, but it is one of those processes/actions that must be done in order to make the game (or any other thing) along. No matter how small the project is, there must be some effort done for packaging, deployment and so on.

At my day job, we have an entire team that works on building, packaging and deployment. People can make a living out of build processes.

These things also help with the “standards” of your project/program. Consumers, over time, as they use your program will be able to get used to how things are handled. By having a good system put in place, it makes their consumption easier.

This is a great site – there are a lot of fantastic articles on it – including game reviews. I hope you enjoy looking at what the site has to offer – Adam has grown the site amazingly over the past few years.

The suspense is killing me! I am super glad there’s a lot of 4X games appearing within the next few years and feel very good to be alive to play them! Please do not be discouraged by all the other 4X games out there and just make what you feel like playing. :)

Thanks for your encouragement. I always cringe when I see Adam (Haha not his fault!) announce a new game. I immediately look at the feature list to see how similar it is and if I need to make adjustments. I haven’t had to make many yet – I’ve put a lot of thought in what the market had back in June. It seems to be paying off. I’ve also given my feature list to Adam and he likes it a quite a bit – this says a lot in my opinion. He is extremely knowledgeable on these games.

The problem with my situation is since I’m just One Man, I have to do a it all. This takes time. And – I do this on my spare time. So it’s really a race against time.

I think with MORE – there are 9-11 guys working on it? They can obviously achieve much more than I, so I do feel pressure from that. Though, I do have advantages – since I’m an infinitely small team, I have more efficiencies in other areas (communications, design decisions, and so on).

On a plus note – I have been able to reuse lots of code from SpaceIT, and that has helped a lot!

I’ve been wanting to write a 4x space game for a long time now. I’m looking forward to the rest of this series. I mostly code in Python, but I’m thinking of learning Objective-C for this game since I’ve been using a Mac for a few years now and there aren’t enough 4x Turn Based games for Mac.

This could have been the case back when Java first came out when it suffered from poor performance. The JVM is very powerful now with the JIT (just in time compilation), the HotSpot JVM, etc. You can read more here: http://en.wikipedia.org/wiki/Java_performance

The JIT is great because it will compile the byte code to native machine (assembly) code during run time. Since Java’s binaries are really bytecode and interpreted, this means you see large performance gains. The JIT has been around for a long time.

There have been games made in Java before, one of the more popular ones is Minecraft.

Large scale companies also use Java in their Enterprise applications with the J2EE APIs.

I like Java a lot just because it makes it easy to write code, is object orientated, I love Eclipse (It is an IDE, where you write the code), and it’s portable.

I’ve also written a text based MUD in Java and had good performance :)

It also has the advantage of being the language used for the Android platform, so knowing Java allows you to develop for multiple targets (though the Dalvik Byte Code interpreter is different from the standard JVM). If you program a game in Java, it’s theoretically possible to port it to Android (though, of course, I doubt many people would want to play a 4x game on their phone. Tablets might be a possibility, though).

Yep! There is a graphics library that specializes in easy porting to Windows and Android (maybe a few other platforms). I didn’t go with that for a few reasons, which I’ll allude to in a future article.

I agree on the phone vs tablet comment – without having actually playing any 4X games on my droid, my initial thought would be “challenging” to play unless the UI was designed correctly for it, and a tablet would be a lot better.

Great little starting article, im currently studying my BSc in Computer Sciences and have always wanted to create my own game. I will be reading all your following articles and look forward to the reveal of your game X4 games are my passion and i have alot of faith in Indie developers (alot more than those that go to publishers).

Im sure you will do a great job of it. I would ask how ever when you are done that you revisit these areas you covered in more detail later on. I dont know alot of about the initial processes of developing a game but i do know that what you are going on about is alot more in-depth than what you seem to be giving away. Maybe even give us new guys to game development some heads up tips on where to begin our research. Things like this could help revitalise the X4 genre.

I was writing a C based text based MUD while in college a long time ago. It was great experience and I learned a lot about programming, especially in maintaining someone else’s code.

I will be going into much more detail about the technical sides – this was just a starting article like you mentioned. The challenge will be to keep it interesting for both the developers (enough detail) and the gamers(easy to understand) since I have vastly different audiences.

For example, I will be talking about some of the websites I used to look up values for stellar objects, and the graphics library I selected, and alternatives.

Yeh I can see what you mean. I used to just be on the gamer side but now that i have knowledge in the field of software development I tend to be more interested in the way it works rather than the high concept. Also much more sympathetic when it comes to Developers declining Ideas, because generally its not because they don’t want to its more lack of time and that it just wouldn’t fit into the existing structure.

I find programming is the easy part i tend to struggle in getting that initial concept worked out as well as knowing where to start my research.

A good article! I also shared some of my experiences in developing Beyond Beyaan that some of you might be interested in reading. Mostly it deals with how my game’s design evolve over time, and how I make decisions to change certain gameplay features:

Awesome. I’m interested in creating a Java based 4X space game that at the least runs on Linux (hey, it’s a new market :-) Would love to hear more on how 4X games compute game turns and so on. How do you manage the model for that? Is it like a spreadsheet where elements react, or is it more like a functional model where world_n+1 = function (world_n). Do you store state in SQLlite or invent your own formats?

I know for myself, the first time I wrote a game, I stored almost everything in doubly linked lists and trees. Not sure if Java supports either (since, as I recall, you would need pointers to do that. Well, I suppose you could use references.)

I keep dreaming myself about doing space games one day, unfortunately have no coding skills or game design education… i guess these things can be perhaps learned just by yourself through sheer persistence, but i am not like that, i like to learn new things for sure, but require diversity after a while :-) additionally for coding, i suppose you kinda need to be good at math, which is not my case. Anyway, i can do visual art at least, perhaps someday i find someone sharing my vision with complementary skills :-).

@dayrinni> maybe i overlooked it in the article, but is your game supposed to be free, or are planning to charge for it? I wonder, if former is true, have you ever thought about using any existing sci-fi show (Star Trek, Babylon 5, Stargate, BSG, etc…) as the setting? Or why exactly have you decided for your own lore? I mean, hypothetically, if you are not planning on making money from the game, i believe you can use anything you like and dont need to think about any “rights” and stuff like that…or am i wrong? Anyway, my point being, i would like to see a proper Star Trek or Babylon 5 game and seems only option is indie scene these days, so i keep wondering why majority of people decides to go with their own creations, when there is so much stuff to work on with…

Anyways, the images above were from my previous game (which was still in Alpha testing) and they are no longer valid. However, I do completely understand and agree with your comment.

I will ensure that the game is playable at all resolution levels. I, infact, am able to play at any resolution, so I will be able to ensure the font is readable. I’m also going to make sure that the testers do not have any issues and I will adjust as needed.