Articles View Hits

Yesterday Jim and I talked on the phone for a while.  Both of us trying to get a handle on where we are and where we are going.  One great thing about working with Jim is that he has a handle on EVERYTHING.  There's not a part of this project that he's not up on, so it's great to talk to him when I'm trying to get the overall picture of where we are.

 We made a few decisions yesterday.  First that the new AI code is feature complete.  We are both very happy with the way the new code is working.  It has bugs, lots of bugs, but you can see where it's going and people are going to be very happy with that.  Second thing that we agreed upon is that we are both happy with the progress and the team.  Everyone is pulling their load, this is a very focused team.  Each member has their own part that they are responsible for and they are doing it.  Third was that everyone is waiting for me, I'm the bottleneck right now and I'm working hard to solve that problem.

 The goal of the AI overall was to prevent as much as possible units from walking through each other and walking through lines of fire.  This one little aspect of the game that we all hate, affects everything.  By forcing units to recognize the existance of other units and not allow them to go marching right through other formations, we limit their movement.  By limiting their movement, we in essence make them behave in a more historically accurate manner.

 The first major part of this was pathing around units and areas where units were fighting.  This required a lot of very specific path finding that had to run very fast.  Then we had to move that to another layer and take a picture of the unit and see if they would fit in the requested destination.  This prevents units from moving to invalid locations.

This took a while to get in the system, but it's in now and we're testing it.  Although we have decided that it's feature complete, there are MANY chunks of code that need to be written or rewritten to make use of the new system.  Testing and writing AI is extremely hard, right up there with multiplayer code.  Having done it all before makes it much easier as I don't have to wonder about which things will work and which things won't.

Now that it's in, we discovered that the path finding must be run while they are moving.  Sometimes they will start marching and all is well.  But then a fire fight erupts in their path and they will just march right through it.  So we have to check the path every once in a while.  Of course every once in a while doesn't translate well in multiplayer, so I have to come up with a fixed interval.

Last night I was working on another fallout bug from this new system.  Blocking, when a friendly unit gets between you and your target.  This is a major hassle in the game.  It stops everyone from firing, even if they are just on the tail end of your formation.  So I put in some code to make this all much more reasonable.  This is on the testing plate for tonight.  Part of the reason for getting 3 dedicated testers at this point in the process was to understand how the changes that we are making are going to affect the players.  These guys give us great feedback, not the crazy technical junk that Jim and I see (you can't help it when you're in as deep as we are), but rather more realistic feedback like is it fun?  Does it work?  Does it make sense?  Does it piss you off ? :)  In a good way or bad way?  By having these questions answered during the process we can change the game or at least understand why we can't change it.

Performance has been a big issue lately.  Mostly because I changed the way the clock ticks work and forgot to change the los function to reflect the new system.  Line of site is one of our largest calculations.  It runs for a little while on every frame and constantly updates everyone with their valid targets, close by friends, and all visible enemies.  On large scenarios it is impossible to update every unit on every frame, so we cap the amount of time the los function can run.  Problem is that I had it capped to 1/3 of 1 second.  So the frame rates were getting pretty low on the larger OOBs.  This is moddable by the player, but we set the default to 20 nanoseconds 20/1000 seconds.  So the max frame rate you would get on the largest OOBs would be 50fps.  Of course since los is not the only thing we are running, it's doubtful that you'll hit that.

Another aspect that we're always fighting against is drawing all the sprites.  I was drawing 60,000 last night for a test.  It took 78/1000 seconds to draw all those trees.  It was runing pretty low looking down across the round tops.  I have tried using many methods to draw all these sprites, but have not been able to find anything better than what PowerRender is already doing.  Chris from PowerRender had hinted a while back that he had worked on this for us, but it wasn't until I really understood batching that I realized how nice the new code was.  The sad part is that there are all these cool features to draw this stuff faster, but it's not supported by every card.  There are point sprites and instancing, but we cannot find a solution that works across our dev team's computers let alone our install base.  So we stick to the batching basics.  You can only batch sprites so much though, since they must be drawn in order if you are going to alpha blend them.

With all the improvements over previous projects, we feel that everyone will be very pleased.  We are still shooting to finish up this year.  But we won't release anything until we are very proud of it.  We don't think that every PC game should have a bug, since they are fairly easy to patch.  Sure we'll probably patch, but we hope it's due to improvements rather than bugs.

The art team is currently working on getting some new media out, so stay tuned for some new screenshots and video footage.  Can't wait to see it myself.  Seems the new social networking stuff works wonders on getting the word out about the game.  We have a facebook page, a youtube account, and I try to twitter every night on what I plan to tackle each evening.  We've gotten a lot of responses, but we realize that until we have a game, we are just like the thousands of other teams trying to finish.