The Daily Click ::. Projects ::. "Tank Game"
 

Project: "Tank Game"
Project Started: 15th March, 2010 Last Update: 14th December, 2010
Project Owner: HitmanN Project Members:
Project Type: 2D turn-based strategy Project Progress:

Of men and optimization (and build caps)
Posted 28th Mar 10, by HitmanN  
Development has continued steadily.

Men
This time I have a screenshot of a recently added new 'unit'. Infantry! They don't run around though, but rather act as a light version of a turret, as seen in the screenshot. The APC unit can deploy infantry, which is relatively cheap to do. Naturally, the infantry sentries can't take much damage before falling, but they're still a nasty thing to encounter with light units. There will be at least one other type of infantry as well, possibly an anti-tank bunker of some sort.

Caps
Build caps are now in place. It was always the plan that there'd be a limit to how many units you can have deployed at a time. The caps are currently as follows:

10 mobile units
1 turret per every engineer
2 infantry sentries per every APC

Basically, if you don't build any engineers, you don't get to build any turrets (which is pretty obvious, since engineers are the ones building them), and same with APC and infantry. Should it happen that you lose an APC while two infantry sentries are deployed, you don't lose the infantry. You just can't deploy more until you can arrange your cap to be higher than the current amount of deployed units. (In this case 2 APC's, so you have a cap of 4, with 2 infantry active, and can deploy 2 more). Capturable turrets and other such stuff to be added in future won't count towards build caps.

Optimization
Yesterday I sat down and spammed the screen with units, enough to fill the build caps, and couple more for test purposes. The fps went all downhill and stuff started to act wrong. There was absolutely nothing going on on the screen, which made me realize there's something really really wrong somewhere. Turns out that despite all the fastloops being short and to the point, combine them all and it amounts to way too much, and ran way too often.

So, I started going over the code and the loops... again. This time I settled at nothing but obliterating every single unnecessary loop (aside from couple of cases I'm still trying to arrange efficiently), and was able to improve the performance yet again. Earlier, when there were roughly 25 units idle, my CPU (according to StatBar) showed around 50% usage. With the optimizations in place, the usage in same situation is usually under 30%. I do have a gazillion of programs running on the background though, so the actual usage is probably 5-10% less on average. It does allow the game to run properly in an idle state. Explosions and other "count multiple collisions at once" type of loops are still heavy at that point though, but honestly, I'd be surprised to find people having that many units active anyways, so this is a good step towards acceptable. I'm quite satisfied.

Scenery
There's also a mountain on the background now, to add a sense of distance. It's a bit of half-assed thing though, and I might redo it, but anyways.


The to-do list is growing shorter each day, with bugs being squashed all the time. Yesterday, for the first time in a while, I felt the game is starting to feel really good. And what better motivator is there than that.
Preview


Posted by Marko 28th March, 2010

I really really can't wait to see this finished!!
 
Posted by Asholay 29th March, 2010

Great work - looking forward to the release of this!
 
Posted by LB 29th March, 2010

Will the bridges and such be destructable? Not like breaking into peices, but just completely falling apart after a lot of batterybg. ?
 
Posted by HitmanN 29th March, 2010

The bridges are destructible the same way as any of the destructible terrain, tile by tile. But who knows, maybe I'll see later if I can make the bridges act as a single object, or falling apart completely when support on both ends is gone or something like that.
 
Posted by LB 2nd April, 2010

Or when too much weight is on them?
Comment edited by LB on 4/2/2010
 
Posted by HitmanN 2nd April, 2010

Mmm... not sure about that. There's enough stuff to focus on already, without having to worry about how much stuff weighs and how it'd affect things.
 


 



Project Forums


Favourite

Advertisement

Worth A Click