Archive for March, 2006

Random map generation

Thursday, March 30th, 2006
acomplia online cialis cost cialis online pharmacy viagra for order cheapest accutane cheap cialis viagra uk purchase viagra online where to order cialis purchase viagra no rx cheap price cialis accutane sale find discount cialis find discount viagra online generic cialis cheap cialis in uk buy cialis from canada acomplia online stores viagra for sale lowest price for cialis buy viagra on line price of viagra drug viagra online purchase 25mg viagra viagra cost viagra cheap price purchase cialis online buy viagra lowest price pharmacy viagra best price for viagra purchase accutane cialis pills tablet viagra cheap acomplia online order viagra overnight delivery buy cialis overnight delivery viagra in bangkok cialis bangkok purchase cialis no rx cheap cialis no rx purchase acomplia online cheap generic cialis cheapest cialis viagra in us cialis in bangkok order viagra online best price viagra viagra malaysia where to buy acomplia cheapest cialis prices cialis cheap buying cialis order generic viagra viagra order buying generic viagra no prescription cialis buy accutane buy viagra no rx buy cheapest viagra buy acomplia cheap order viagra no prescription required buy viagra in us 20mg cialis order viagra in us acomplia cheap buying viagra viagra cheap buy cheap viagra online fda approved viagra cialis information cost of viagra find cheap cialis cialis from canada purchase viagra overnight delivery acomplia discount fda approved cialis viagra rx find no rx cialis viagra discount certified cialis cialis without a prescription accutane acomplia pharmacy cialis overnight shipping viagra australia sale cialis buy sildenafil citrate buy cialis from us online viagra cialis soft acomplia prices buy discount cialis viagra pill viagra prices buy viagra overnight delivery online cialis order cialis cheap online discount viagra overnight delivery viagra online without prescription compare viagra prices online cheapest generic cialis accutane online overnight cialis cheap cialis without prescription buy sildenafil in uk viagra no rx cialis cheap price 50mg viagra buy accutane online erectile dysfunction cheap viagra overnight delivery cheap cialis tablets viagra pharmacy online acomplia without a prescription cheap accutane tablets buy cialis without prescription lowest price acomplia cialis tablet buy generic accutane find cialis without prescription order accutane cheap cialis overnight delivery cialis price cialis from india cialis no rx buy discount cialis online cialis overnight buy acomplia without prescription cialis tablets cheap viagra in usa buy viagra in canada cialis pharmacy online order cialis in us discount cialis 20 mg cialis acomplia online cheap cheapest viagra online cialis prescription order cialis on internet buy sildenafil in spain buy generic cialis cheap cialis in canada viagra tablets accutane without prescription cialis canada buy cheap acomplia online cheap viagra cheap cialis pharmacy find cialis on internet acomplia prescription buy cialis cheap order cheap cialis online find cialis no prescription required viagra overnight delivery buy viagra low price compare cialis prices 25 mg viagra order viagra no rx viagra online buy cialis no rx impotence treatment impotence cure viagra overnight online pharmacy cialis viagra online cheap find cialis online generic cialis online no rx cialis accutane generic cheapest acomplia prices buy viagra online cheap buy viagra internet acomplia no prescription pfizer viagra drug cialis online purchase order discount cialis cialis 10mg best price for cialis cheap viagra from usa find discount viagra cialis pill order viagra without prescription viagra generic purchase viagra without prescription buy acomplia online accutane cheap order viagra from canada cialis online without prescription cheap accutane cialis side effects cialis for sale buy cheap accutane online cialis generic discount cialis without prescription buy viagra from canada buy cialis internet discount viagra no rx viagra without a prescription drug cialis cialis pharmacy buy cialis generic cialis prices discount accutane order cialis no prescription impotence drugs cost viagra acomplia generic buy viagra online impotence medication order cialis from canada buy discount viagra acomplia acomplia pills purchase accutane online pharmacy online buy sildenafil internet buy accutane cheap viagra canada discount cialis online order cialis overnight delivery where to buy viagra cheap accutane online find no rx viagra cheap cialis from uk lowest price for viagra cheap viagra from canada approved cialis pharmacy 10 mg cialis viagra in uk cialis vs viagra cialis internet cheapest viagra prices accutane prescription buy cialis in us low cost cialis cialis buy online pharmacy cialis buying generic cialis purchase cialis overnight delivery buy discount viagra online order no rx viagra acomplia without prescription viagra buy order viagra from us viagra internet find discount cialis online acomplia for sale purchase cialis without prescription cialis drug discount viagra accutane prices buy sildenafil canada viagra in malaysia accutane online stores generic drugs buy viagra generic cialis purchase cialis us viagra medication price of accutane cheap cialis pill viagra no prescription find viagra buy cialis online cheap cheap cialis from canada cheap generic viagra price of cialis sale viagra viagra free sample order viagra order acomplia online where to order viagra viagra approved cialis for order buy sildenafil cheap buy accutane without prescription discount viagra without prescription cheap cialis from usa buy viagra no prescription required cialis discount cheap viagra on internet order generic cialis buying cialis online accutane without a prescription buy cialis lowest price viagra no rx required buy generic viagra online purchase cialis viagra buy drug order cialis without prescription viagra us 10mg cialis cheap acomplia tablets buy sildenafil in canada find viagra without prescription cialis overnight delivery buy viagra cheap cialis cheapest price cialis sale lowest price cialis cheapest generic viagra viagra soft tab no rx viagra cheap cialis no prescription purchase viagra viagra sale viagra india find viagra no prescription required impotence pills cialis 20mg 100 mg viagra buy cheap accutane buy cialis low price compare viagra prices cheapest viagra price impotence cheap viagra tablet tablet cialis order discount viagra viagra overnight shipping order viagra on internet buy cheap cialis online cost cialis buy sildenafil low cost order cialis no rx cheap viagra in uk cialis medication generic viagra cheap buy sildenafil online buy cheapest cialis on line order cialis no prescription required viagra drug buy viagra without prescription buy cialis on internet viagra cheap drug cheap viagra no prescription cheap viagra in canada cheap generic acomplia cheap viagra internet viagra pills cheap cialis in uk order cheap viagra online buy cialis from india cheap viagra no rx cheapest generic viagra online lowest price viagra cheap cialis in usa viagra sales order accutane online buy and purchase sildenafil online online pharmacy viagra viagra in australia certified viagra cialis malaysia viagra cheapest price cialis no rx required buy cheap acomplia buy sildenafil online without a prescription discount viagra online no prescription viagra viagra tablet viagra from india viagra cheap cialis internet order cialis 50 mg viagra buy cialis in canada order discount cialis online cialis no online prescription approved viagra pharmacy cialis soft tab cialis no prescription buy cialis order cheap cialis 100mg viagra order cialis online compare cialis prices online cheap viagra tablets cheap price viagra cialis cheap viagra online find viagra on internet cialis 20 mg viagra side effects cheap acomplia cialis without rx cialis without prescription cialis 10 mg viagra bangkok purchase acomplia cialis free delivery cheapest viagra buy viagra cialis india viagra vendors low cost viagra order viagra cheap online cheap viagra from uk generic accutane cheapest accutane prices viagra vs cialis generic acomplia accutane pills buy generic viagra generic viagra online generic viagra accutane discount find viagra online find cialis accutane pharmacy viagra online stores cialis buy order viagra in canada cialis online cheap viagra soft find cheap cialis online cheap viagra without prescription order viagra no prescription buy cheapest cialis order cialis in canada cheapest sildenafil citrate cialis uk cialis free sample cialis online review buy generic acomplia price of acomplia drug viagra generic cialis viagra no online prescription free viagra viagra information buy viagra from us buy viagra on internet cheapest acomplia order acomplia viagra buy online viagra online review where to buy cialis buy cheapest viagra online viagra without rx cialis approved viagra pharmacy order cheap viagra buy cialis online discount cialis no rx cheap viagra pill buy generic cialis online cialis online buy no rx viagra viagra online pharmacy cialis online stores buy cheap cialis buy cheapest cialis online buy cheap viagra accutane for sale cialis in australia buy cheap cialis internet acomplia sale buy viagra us overnight viagra lowest price accutane online accutane online acomplia find cheap viagra online best price cialis buy cheap viagra internet viagra free delivery cheap cialis on internet buy viagra from india cialis rx buying viagra online cheap generic accutane find cheap viagra where to buy accutane cialis australia cheapest cialis online order no rx cialis viagra purchase cialis vendors discount acomplia cialis cheap drug discount cialis overnight delivery cialis sales cialis buy drug cheapest generic cialis online buy cheapest viagra on line cheap cialis online cheap viagra pharmacy accutane online cheap buy acomplia viagra without prescription cheap cialis tablet cheapest cialis price buy no rx cialis cialis in us buy cialis on line free cialis order cialis from us cialis in malaysia accutane no prescription order discount viagra online cost of cialis buy cialis us cialis order viagra from canada viagra prescription buy cialis no prescription required viagra price

One of the challenges of writing a game like this is random map generation. Generating random maps isn’t quite as easy as it might sound. For a map to be any good, the map needs to

  • be smooth enough for units to get around
  • have flat spaces to build buildings
  • look reasonably realistic
  • have natural barriers (ledges, etc.) that add a strategic element

In this particular game, maps also need plenty of water since water will play a key role in the game. Lastly, maps definitely need elevated areas. Not only do they make the map look more interesting, they give a strategic advantage: they increase the attack range of ranged units. So elevated areas (mesas and such) should be coveted real estate during gameplay.And from a subjective angle, I want the maps to look nice. As millions of artists will testify, landscapes are one of the most beautiful subjects around. This is an opportunity to do a little artwork alongside writing a good game.

The last couple of days I’ve been experimenting with various fractals and filters to generate maps, and (finally) hit upon a pretty good combination. I’m pretty excited about it, the maps are starting to look really good! The screenshots on the left show an example generated map.

 

Unit formations

Saturday, March 25th, 2006

Got unit animations working (walking, etc.). Also made an initial pass at unit formations. The formations are fun to watch. If there are obstacles in the formation’s path, the formation breaks up, but at the end the units fall back in line.

 

Towers

Monday, March 20th, 2006

Added a few screenshots on the left. The 2nd screenshot shows a soldier attacking a tower. Towers can’t shoot back yet, but the plan is for them to fill the same role that they do in the Age of Empires games.

 

Busy week

Saturday, March 18th, 2006

It’s been a busy week. According to Perforce, I’ve

  • finished converting server code from TorqueScript to C++
  • finished converting building marker (client) code to C++
  • got C++ RPC commands working
  • allowed for a variable # of AI players
  • made buildings solid (units can no longer walk thru them)
  • made units pathfind around buildings
  • made buildings destroyable
  • made workers handle when their base gets destroyed
  • made workers move out of the way when told to build on their current tile
  • fixed a number of issues involving building in crowded areas
  • allowed a player to order soldiers to attack specific targets (including the player’s own units and buildings - handy for testing)
  • did some LAN client/server testing
  • made the join-game screen scan for LAN servers on startup
  • fixed a crash on player/client disconnect
  • made the disconnected player’s team convert to an AI team on the fly
  • started experimenting with putting fire on damaged buildings

I feel like I’ve made a lot of progress. As far as I know, there is now only one crash left in the game. That is when a unit or building dies while it is still in a player’s selection set (i.e., the selection rings). In that case the selection set can contain a stale pointer and cause a crash. It is a little work to fix this because the selection set is contained on both the client and the server, so there is some networking involved. But other than that, I think all other object references get cleaned up properly when objects die.Which is good, because stale pointers were one of my concerns about converting to C++. As it turned out, in most cases a “dying” object knows who is keeping a pointer to itself. So cleaning up stale pointers is just a matter of making the object’s destructor notify the interested parties about its death. In the other cases, a SimObject ID can be used instead of an object pointer. When you have a SimObject ID, you can ask Torque whether or not an object is alive, before using the object. SimObject IDs do not go stale in the same way pointers do.

I feel like things are shaping up reasonably well for this game. My project strategy is to first

  • implement the basic mechanics of an RTS, and get a feel for those
  • get a feel for the Torque game engine

Then, once I have a reasonable idea about what’s easy to implement and what’s not, I’ll take a step back and decide the creative direction of this game. I have a lot of ideas for what could go into this game, but they all have to be filtered against development effort.The creative design stage is where the real fun begins. That’s when the game will take on its unique personality, as something that other human beings will hopefully enjoy. I think all game designers like that stage, because we all like creativity. At that point, you can probably expect all the artwork in the game to get swapped out for new artwork, and it will look and feel quite different. )

I think am getting fairly near that milestone. I would still like better understanding of Torque’s animations, finer control over unit movement, finer control over Torque’s collision model, knowledge of what’s involved in programmatically generating Torque’s terrains, and a better understanding of RTS network optimizations.

 

Exercise

Monday, March 13th, 2006

A funny side-effect of my becoming a full-time indie software developer has been manifesting itself lately. It’s not exactly that I’m feeling more relaxed now, although that is certainly true. It’s that my favorite exercise — walking — just isn’t cutting it anymore, as an exercise.It used to be that walking felt like exercise. It got my blood moving, got my metabolism up, got me a little tired, etc. — all the things you would normally expect from exercise. But since becoming an indie a month ago, walking has been doing less and less for me. No rise in metabolism, no tiredness, and worse no endorphins. It’s just not exercise anymore!

For this, I blame indie software development. Clearly, the problem is that I’m too relaxed now. LOL. Really, the only theory I can come up with is that I am less stressed, so therefore it takes more exercise to get my system going. And walking is no longer enough. Well, as far as problems go, that’s a good problem to have.

However, this problem now takes a dark and sinister turn. I keep taking longer and longer walks, trying to get that “exercised” feeling back again. These longer and longer walks take more and more time. And that means less and less time for software development. And that, my friends, simply won’t do. -) Therefore, I am forced to turn to the unthinkable…the sadistic…the most painful form of exercise I know of…jogging. God help us all.

 

Code metrics

Friday, March 10th, 2006

Code metrics, before and after the TorqueScript-to-C++ conversion:

TorqueScript:  773 lines / 2661 words
C++:          1219 lines / 3750 words

Wow, very impressive. TorqueScript needs only about 2/3rds the code as C++ to implement the same functionality. Very nice. These stats exclude code lines that are blank, comments, or only contain a single curly bracket.

As a side note, strictly speaking, I am actually not writing this game in C++. I’m writing it in my own home-brewed computer language, Meta-C. Meta-C is very C++-like, but is meant to be more concise and easier to write. Meta-C generates C++ code, which can then be compiled in the normal fashion. Here are Meta-C’s code metrics:

Meta-C:        882 lines / 2858 words

Huh, TorqueScript even beats my Meta-C language. My pride is injured -)

Torque and C++

Thursday, March 9th, 2006

Very cool! Orcs vs. Martians is now creating workers, soldiers, and buildings from C++ code. It was exciting to see this work the first time. And both workers and soldiers are now pathfinding (moved that code to a common base class). I still need to move tree creation into C++, and re-hook up the workers’ harvesting behavior.Unfortunately, converting to C++ has made deletion of SimObjects a bit of a challenge. Back when the game logic was in TorqueScript and my objects were all held in SimSets, deletion was easy. Torque magically removes a deleted object from any SimSets that contain it, thus the game logic rarely needs to worry about stale object references. Not so now: my objects are now contained in STL lists, as C++ pointers. And accessing a deleted pointer will bring down the house in a hurry.

Hmm…there are a number of possible approaches here. It’s still possible to use Torque’s SimSets and/or object IDs in C++ code. Presumably the magical deletion can be made to work in C++ too. Also, one can use the SimObjects’ constructors and destructors to automatically add or remove the SimObjects from STL lists. I’ll probably try a combination of both those approaches, and see how it goes.