I’m not quite yet ready to reveal too much (like a screenshot) of game 2. But I would like to document some of the areas that have been a focus. Don’t bother trying to figure out what all of these have in common…. that they are all in my head is about all that seems to relate them.
Scale: More creeper that moves in a more fluid fashion would improve things in game 2. To accomplish this I have rewritten the core creeper flow algorithm and noted a few interesting things.
The creeper flows around like a cellular automata simulation of heat. At least it starts out this way and then the math gets tweaked a bit to make it behave more like a thick, viscous fluid. The performance of the algorithm depends heavily on the number of array (or vector in the case of AS3) accesses. This is because vector member access is so slow in AS3. It isn’t like C, where you can do millions per second with no real performance impact. So any reduction in vector member access will improve performance. In CW for each cell, I have to look at 4 neighbor cells (the three along the bottom and the one to the right). In game 2, I have this down to 2 neighbor cells. Instant double performance improvement! Also, since I am targeting flash 10 only, I have switched to Vectors over Arrays. This is a small gain, but still a gain. Couple these two things with a third: Integer math. In CW I used ‘Number’ for everything, In game 2 I use int’s. So instead of Creeper cells containing 2.3725 for instance, they now contain 237250000. Keeping everything as Integers makes the math faster in AS3. Doing all of these things has helped increase the creeper calculation scale by about a factor of 4…. and this meets my needs for what I have in mind for game 2.
Purpose: In CW you are on the run… it’s the end of all civilization and each mission is a mission of survival. You push back the sentinel creeper long enough to activate the rift. You never really defeat the creeper you just hold it back.
In game 2, it’s payback time. Thousands of worlds remain to be reclaimed and new technologies have been developed to destroy the emitters once and for all. Problem is, they are deep…. I mean DEEP beneath the surface. So guess what, time to start digging! ‘Terrain modification’ is central to game 2 and to the story. This has created a number of interesting technical challenges…. one of which is path finding.
Path Finding: In CW, path finding was done by packets as the moved along your network. This was one of the cooler things about CW. Many people just liked watching those packets find their way. The packets were themselves a kind of “unit” that moved around on the map and made the whole simulation alive and animated. Classic A* was used to route the packets with a new evaluation being done at each place along the path. In game2, the network isn’t made up of straight lines that connect structures. It is made up of tunnels and caves that the player digs. Packets move around through this collection of tunnels to find their targets.
So I also had to rewrite my A* algorithm to get its scale up. It now also works on integer Vectors rather than arrays of objects. I’ve improved it’s performance by about a factor of 5 and this allows me to have lots of little packets making their way through a large collection of user created tunnels and structures (and hopefully avoiding creeper along the way).
Anti Creeper, and Anti Gravity: I always wanted to see what would happen if “good” creeper flooded against “bad” creeper. Well now I know… and soon will you I hope. Balancing is an issue (unlike any kind of unit balancing problem I’ve ever even heard of) but if I can make it work out, game 2 will feature creeper that you can control.
And while on the topic of “anti”, why not throw in some anti-gravity or force fields as well? I’ve implemented them and they are way cool to play with. Whether they will be a defensive system, an offensive weapon, both, or something else is something I am working on.
Adobe AIR: Should I stick with this? Writing the game in AS3 is fine. No complaints there. Performance is well, so-so. AIR gives me access to local files (so importing games works very well). So what is the problem you say? Well to name a few:
- The installer has to be signed. I either have to buy a signing cert and keep up with certificate chains over years of time, or I can do what I do now: Ignore the warning that pops up during the install. I decided to ignore because even with a signed installer, the AIR installation still had a “red” indicator during the install (for a different reason, but it is still red and the eyeballs of the person installing still see red that they have to ignore). If I didn’t use AIR none of this would be an issue.
- About 1 out of 2000 installs of Adobe AIR seem to fail. At least this is true for what is called the ‘sidecar’ install. The sidecar install is when I bundle AIR and the game together in an executable zip file. This allows the user to just run a single executable and they get Adobe AIR if and only if they don’t have it installed already. For some really small number of users, this fails and Adobe AIR has to be installed manually first. Not a bug deal, but still in the negative column.
- Once upon a time I was talking to Steam about making CW available in their store. I mentioned “AIR” and that is the last I heard from them. Maybe they just decided they didn’t like me, or maybe they don’t allow AIR games in their store…..
So that’s it for now. I hope to have an early screen shot (complete with developer art) in a few weeks.