Wednesday, June 17, 2009

New videos

I put up some new gameplay videos on YouTube.

Monday, June 15, 2009

I am a twit

Bit the bullet and joined Twitter. You might occasionally see updates about Dune 2 code there. :)

1.44U SP Update

Mostly a bugfix release.
  • Major fix to pathfinding: should be NO more examples of units entering invalid cells
  • Disallowed crags to generate within two cells of edges
  • Fixed selection graphics on the menu bar
  • Re-added code which gave Silos a flag
  • Fixed bug allowing Death Hands to airlift
  • Units that can Deploy now cannot be airlifted (MTP, MCV)
  • Demolish and Retreat Flag buttons cannot both be selected now
  • Several improvements to AI base building and unit placement
Please register at the forums to report any remaining bugs.

Thursday, June 11, 2009

Son of a b...

ene gesserit...

In programming a game like this, there are lots of times when you want to try and find out what cell the unit is in, or to make a comparison of some kind. In these instances you use a simple conditional based on coordinates, such as "If (UnitX = CellX) And (UnitY = CellX)", which will answer true if your unit is in the same cell you are asking about.

Did you see what was wrong with that statement? Because that's exactly the mistake I made a long time ago, only it was so particular I didn't discover it until now. After hours upon hours of debug trapping and testing, tons of seemingly illogical behavior, tracing the error all the way back to some potentially very complicated code, and a handful of expletives, it turned out to be a simple coding error. Nothing a machine or an analyzer could have prevented; this was all on me. I entered the X coordinates for the cell twice instead of the X and Y coordinates. This meant that, when a unit was in a cell that was on the diagonal line on the map that had matching coordinates (65,65 etc), an adjacent cell would be considered as wide open for travel, regardless of what was in it, because the system thought it was the very same cell the unit was in. I know, right?

I could expound much further on this but I'll save us all the headache. Suffice to say pathfinding will be fixed in the next bugfix version. Crashes may still remain but they won't have anything to do with this.

Monday, June 08, 2009

New Single-Player download

Here's a new download for everyone. I'm just calling it the SP version now, instead of a Preview. This will be the last update of this kind until the network version is finished. There may be further bugfix releases but I do not plan to add any more features.

Recent changes:
  • MAJOR performance increase. While adding some debug code recently and analyzing performance, I noticed a few areas I could revisit. This was a case where my original decision in coding was to go for a "blanket effect" in a routine to make sure nothing was missed. But now with things being more stable, I decided to eliminate a lot of overhead and take the risks of a more precise process. The resulting improvement in game speed is very substantial, especially noticeable when hundreds of units are present.
  • Added a debug log. Hitting F12 during gameplay activates it. It doesn't track much info of use to the player yet, although it does dump a lot of data to the hard drive, so be careful using it. I will probably expand upon it in the future.
  • Fixed a bug where hitting an order key multiple times would cause the order to repeat itself by virtue of the input queue.
  • Totally surrounded crags now block ground fire again.
  • Fixed a bug where Sonic Tanks were powering back up after all Windtraps were destroyed.
  • Updated some Mentat entries.