June 6th, 2005
"Battalion Head 2 Head" is a great example of a massively multiplayer game using Flash as the frontend and mixing other technologies for the backend. Inspired by games such as "Advance Wars" and "Fire Emblem", Battalion brings multiplayer war games to the web browser with lots of nice features and addictive gameplay. Here you can read an in-depth interview with it's author: Pany Haritatos.

Q: Can you please introduce "Battalion: Head 2 Head" to our readers?

Battalion is a massively multiplayer online turn based strategy game. All you need is a browser to login and pit your tactical might against armchair generals all across the globe. Players can join squads,purchase equipment upgrades, compete on ladders, design and upload
maps, and most importantly get a nice good fix of a strategy game that is easy to pick up but difficult to master. You can play up to 3 human or AI opponents on up to 75 different maps (or any maps that you design yourself).

Q: When did you come up with this idea and how long did it take to develop?

I was struggling with some code on a 3d engine I was working on and getting very frustrated with my lack of progress. Right before I went to sleep one night I remembered having some fun that day messing around with a few Flash games (I don't remember which). It occurred to
me that Flash might have a mechanism for multiuser connections and that it was something I had to check out. I didn't sleep that night, or much the rest of that weekend. By the end of it, thanks to some very helpful gotoAndPlay.it tutorials, I had the basics for a multiplayer game in place: a C++ chat server with a Flash front end.

Battalion actually began as a massively multiplayer 2d space shooter. I tried to prototype the game in Flash, but as it was my first real project in Flash, it sort of fell to pieces after too many things started happening on screen. I took a step back and tried to figure out exactly what I needed to do to ease myself into Flash and doing a turn based strategy seemed like the right idea at the time (hah! How naive I was!). I really loved the dynamic of Advance War and Fire
Emblem for the GBA (both excellent games), so I used them as my inspiration for Battalion.

The total development schedule was around 12.5 months. The first month was spent on the failed 2d space shooter project. The next 11.5 on Battalion. I thought I would be done in 4. I think it's safe to say that you can take your estimated development time, multiply it by three, and you'll come out with how long your project will take you. In total, Battalion probably represents around 1600 development hours.

Q: How many people worked on this project?

I wrote the server backend, the Flash frontend, and all the glue that holds the Battalion website together (the website has gone through 3 major revisions, the server through 2 and the Flash frontend is a big mess of an FLA). Chris Hildenbrand, the peerless DayDream, did the graphics along with some help from a few contractors to finish up the unit animations (which are not yet in the game). There was a contractor for the music, and a community member, yayitsandrew, worked with me to design and implement the Battalion Map Editor (which is an awesome editor in its own right).

Q: Is Battalion H2H free to play?

Yup. You can do almost anything for free in Battalion. Some stuff is available only to premium members for a really tiny fee (like map uploading, some units, maps, and the squad interfaces), but I'd say 90% of the game can be enjoyed for free.

Q: Can you tell us a little bit more about the server side technology you're using?

The original server was written in C++ and used the MySQL C API to handle persistent storage. The current server is actually a massive C# rewrite of the C++ server. Developing and working with C# is like driving a limousine, where as working with C++ can sometimes feel like driving old Aunt Betty's broken down stationwagon.

Q: Was your server specifically designed for the game or did you start from a more generic implementation?

The server is pretty much geared towards Battalion. The rewrite in C# actually built a reusable core into the server. Every few weeks I refactor subsystems of the server into reusable components. Eventually it will be a nice generic server, but I didn't bother with this up front as I (a) did not fully understand my design goals or feature requirements (b) didn't want to waste the time figuring it out and risk not completing the project. I made the concious decision to build generic systems as they were needed, or put in a simpler solution if it would save me any time. I enjoy the process of refactoring, and when you're not sure about your target specifications, it's much easier to refactor a nice modularized system than it is to design one from scratch (imo :) ).

click thumbnails to
enlarge them.

click thumbnails to
enlarge them.

Q: What were the main difficulties you had to overcome in developing the server side of the game?

This is the first time I had to tango with a complex multithreaded system. Debugging a multithreaded program that only crashes after 3 days of hosting literally thousands of games is not an easy task. I had to develop a pretty complex logging framework to track all the data and try to reduce my signal to noise ratio when I needed to find out why a particular problem was occurring. The system isn't perfect yet, but I'm getting there.

Q: Did you run stress tests for testing stability and performance?

Unfortuanately the only real way to stress test a system as complex (and fragile) as this is with real time actual usage. I developed a suite to do stress tests and they worked well while I was rewriting the server in C#, but humans are a tricky thing to simulate and the only reliable way to make sure everything is behaving is to toss the server into the deep end and see if it sinks or swim (and being prepared to stay up all night giving it swimming lessons if it's having troubles).

Q: Why did you decide to rewrite the server code in C#? What were the advantages?

The C++ version of the server used Winsock which meant there were no portability options. Portability was an eventual goal of mine, so when I hit an impasse with a particular bug in the C++ version (we're talking about crashes every hour or two), I decided to finally check out C#. I liked everything I saw so I rewrote the server. It took a long week of very little sleep learning C# and writing lots and lots of code, but it was well worth it. My only regret is deciding to write the initial server in C++ instead of C#. :)

Q: Did you notice performance differences between the two versions?

The performance differences are neglible. I have noticed that my programming tie is far more efficient with C# though and that is far more important to me.

Q: The XMLSocket object was originally designed to exchange xml data through persistent socket connections. Did you stick with XML or did you create your own protocol?

The original game design was the 2d top down real time space shooter so I developed my own "thin" protocol to exchange the data for that project. When I started Battalion all the code for the thin protocol was implemented, so I just used that.

Q: Let's talk about gameplay, can you tell us about the Battalion game modes?

There are quite a few ways to play Battalion. A player who is undefeated on The Battle of Tilnyne Hill map might not be able to hold his own on the map Cross-Divide. Generally speaking maps fall into two categories: Pre-deployed or deployable. In pre-deployed games, it's more like you are playing chess. There is no possible way to get reinforcements so the game becomes very much about anticipating your opponent and securing any cities that might be able to heal your units.

In deployable maps, the game focuses a lot more on resource collection and building an army that is more cost-effective than your opponent's, then using that army to take and hold strategic choke points around the map. There are several other ways to play Battalion. Some maps revolve around guarding capitals that if lost result in your defeat. You can also ally with other players to play team games of 2 on 2 or 2 on 1. In addition to that there are ranked game types and squad game types. There are also several new game modes planned for future releases.

Q: Did you develop your own tools for editing the game maps?

I hacked a Lua export script for the Mappy map editor when I first started Battalion and while it worked it was a *very* rough tool. One day yayitsandrew and I got in touch and he said he wouldn't mind implementing a publicly consumable map editor for Battalion. We worked out the design together and then he implemented it. It's a really solid piece of engineering and it represents an invaluable contribution to the Battalion community. People can now design their own maps (and there have been many many maps that were designed) and upload them to play them against their friends. The editor is so easy to use it is almost painful.

Q: Is it possibile to add more maps or create custom ones?

Using the Battalion map editor, people can create their own maps, and if they have premium access they can upload them and play them against their friends.

Q: Developing a multiplayer game is quite a long work. What would you suggest to developers willing to create their first mp game?

Start small. Battalion is the third multiplayer game I've built and the 5th multi-user project I've worked on. If you don't know what you're doing, start small, learn the basics, tinker. Will you build your MMORPG dream project the first time you open Visual Studio? As much as you might think "We can do it," and you might be able to, I suggest you sharpen your teeth on a few small proof of concepts first.

Q: Once you're finished with a multiplayer game you're only 50% done. Then you have to make people know it and play it, do some advertising and cover the expenses for servers and bandwidth. From your experience, what are the best ways to promote the game and cover those expenses?

50%? I think you're being conservative. :) Advertising is the most expensive hard cost I have yet to incur and it's one that can not be avoided in any way. I think the best way to promote a game like Battalion is to encourage word of mouth amongst your users (beg if you need to, but try to find ways to integrate rewards for spreading the word.. think Kings of Chaos). Ask your users to invite their friends. Talk to sites that cover multiplayer games about getting a review (I think we have one coming up with mpogd.com for example). You're probably going to need to drop some money on banners as well. My recommendation is do not underestimate how much it will cost you to market your game. It is the single highest expense you will have.

Q: It seems that web-based multiplayer games are becoming more popular. What do you foresee in the next future?

Web-based multiplayer games are already insanely popular. I'm sure you've heard of a little game called Runescape. As I recall a recent article I read put them at owning 3% of the MMOG market. I think we will see a lot more web-based multiplayer games, and also more cellphone multiplayer games. You can't beat the requirements that Battalion and other web games have in order to play. All you need is a browser and you're good to go. You can play at work, on your laptop sitting on a train, at home, a cybercafe, or while relaxing at the beach. Accessibility like that is hard to beat. Let's just hope the next version of Flash handles the performance requirements a little better.

Q: Can you tell us about your future game related projects?

Nope. :) Battalion is just a small stepping stone...

Q: Some of the new features in the next Flash have already been revealed. What do you expect from this next release?

The holy grail, really. If the new Flash performs half as well as they say it will, they will hook me for another generation of games at least. The performance issues with Flash is really the only major problem with the platform, so if they can do anything to improve its rendering speed, I will be a very happy developer. I'm excited to play with some of the new effects I saw demoed, but really, the only thing I looking for is better rendering and faster networking (UDP support would not go unused :) ).

back to SpotLight index

Have you played one of the best web games ever ?
Did you create the latest kick-ass flash game and would you like to seen it reviewed in these pages ?
Suggest us some high quality games to feature in our SpotLight!

Game suggestions HERE
| Homepage | News | Games | Articles | Multiplayer Central | Reviews | Spotlight | Forums | Info | Links | Contact us | Advertise | Credits |

| www.smartfoxserver.com | www.gotoandplay.biz | www.openspace-engine.com |

gotoAndPlay() v 3.0.0 -- (c)2003-2008 gotoAndPlay() Team -- P.IVA 03121770048