Thursday, July 23, 2009

IC: Tweaking the AI and Game Mechanics

As well as improving the graphics of Island Commander, most of my time has been spent tweaking the AI. This involves playing the game and employing one of 3 basic tactics: build mines and wait for the AI to attack me; rushing the AI; and thirdly something between the two (build quite a few mines and then attack).

After playing it a few times, you begin to notice pitfalls that the AI falls into. For example, it doesn't keep any "reserve" cash, so when it gets attacked, it takes it longer to raise enough money for a defence. This has now been implemented. Also, it never builds any defences before it is actually attacked. I've still yet to add this.

There's also a few tricks that it can use that a human player would; for example, units are far more effective in pairs (or more) since they can get twice as much firepower out, destroying targets much faster. I've now implemented this.

I've also tweaked the balance a bit by adjusting various unit's stats; in particular, mines were a bit weak, meaning that the first player to attack usually managed to decimate the opponents buildings (causing the slippery slope effect). I've also reduced the amount of money that mines give, meaning that if a side does have less mines, they're not necessarily losing out on much more money than their opponent.

Thanks to all who have contacted me with problems and suggestions. It has made my job a lot easier!


qubodup said...

great, the crystal images make it more clear where I should build.

zorful said...

Played the new version. Overall it seems pretty cool. I would suggest making all units price lower by 10 points. You can't make anything massive which is a detriment imho.

First I discovered that Blitzkrieg tactics seems to work ok. 2-3 Fighters + M/Silo support + Mine every 5 or so squares carefully wipes AI out and is fun in the process.

But a few games later I understood that a rush works even better. Hop over to resources with mines while building resource cache from initial mine. Then build a 3x3 square of mines. After that hop close to enemy lines and then start the rush (while slowly expanding you 3x3 mines patch to generate resources more quickly). Build 2-3 fighters with 1 mine each 5 squares while fighters pound on enemy lines. The AI usually haven't built up yet, so he's at a disadvantage. This one is 100% guaranteed win and is also fast.

However I think it's wrong that a simple rush yields a guaranteed player victory. I'd like the game to be tailored more towards the first more careful approach. For that to happen, there needs to be some fighter limitation. I suggest making less hp for fighters while making them cheaper. That way they will always lose in a battle with tanks/silos but will still be a main component in a mines attack.

Some thoughts about gameplay:
- Please make extending conquered area recalculation happen more often, for example, as a 1 second timeout trigger when AI/player builds something. I'm stuck waiting for the timer for seconds which is not good. It seems that it also makes pause before winning/losing.
- M/Silos should extend area too. I have to put M/Silos + Mine combo for my careful assault. Mines should be redundant here.
- Fighters can't move over other units which is wrong.
- Unpassable terrain - and a few different map generator modes - few big mountains/many small hills/a web of passages. It would make a bonus to the tactics aspect.
- When players start at empty areas, AI wastes too much time building mines line to resources while I quickly skip over to the juicy area and have an even bigger advantage than normally.
- You can't build anything under moving fighters, which is wrong.
- Sometimes fighters are stuck doing nothing. Do they have some limit on their active area?

- Make stats window (Cash/Mines/Time) some lighter color, it's kinda hard to read dark blue.
- Please integrate build menu into the main one.
- Keyboard shortcuts for building all units please.

Steve said...

Crikey, where to start!

Well, thanks to your email, I've implemented the following:-

* Reduce the prices of units, tweaked some stats
* Made fighters weaker
* Made mines stronger
* Reduced time between area recalculation
* Fighters now don't get hindered by (or hinder) other units
* Stopped the AI wasting time if there's no resources near its start area
* Increased the "view range" of fighters to cover half the map.
* Changed the colour of the stats window
* Made the menu one big menu
* Added keyboard shortcuts (M, S, T, F - they should be self explanatory)

I've not had much time to fully test the new balance, but I've uploaded the new version (0.5) and it's on the web page now. (Watch out for your browser caching the game so it still shows you the old version). I've also not had time to implement your other idea of different map types with impassable terrain, but fully intend to. However, I have implemented fog-of-war, but I'm still debating whether that adds anything to the game.

Thanks for the feedback, it's making it all much better. I'll be checking the balance again today and may tweak it again if it's not quite right.

qubodup said...

man, I sure like this game..

Steve said...

Thanks a lot. Let me know if you can think of any tweaks and I'll see what I can do.

zorful said...

Ok, finally had the time to check out new version - 0.51b in this case. LOL, every new version has me wiped out by AI pitifully for a few games until I switch into the zerg-rush mode :)

Overall the game has swayed even more towards "build mines until you see enemy then launch fighters one after another" (or zerg-rush) strategy which is not good imho.
It's not feasible to build tanks and silos at all, because they cost x2 and x3 as much yet don't give much advantage - a wave of 3 AI fighters still wipes out that single tank or silo you manage to build in that time.

I suggest making either of these:

* make tanks firepower 2 and silos 3 - would be great to make silos 2.5 but we can't so I think you'll have to rise silo price a bit - to 75.
* or lower the price of silos and tanks as I originally suggested - tanks to 35$ and silos to 50$.

Now the most fun part - to somehow stifle the whole offensive strategy. That can be done if the AI manages to build defensive silos or tanks as it moves forward (it will be feasible after one of the two changes I suggested). Ideally, this AI flag should be flipped at start of each game - will the AI play the offensive strategy, be more careful, but still on the offensive or even be totally defensive like building some 10 mines and then proceed to surround them with heavy defences.

* the new fog of war addition should be switchable at game start imho - it does add to the game somewhat, but not everybody likes it. What it does add is that it becomes harder to project when to stop building mines and start building units.

* separate cash display from time and mines - cash is the only number that matters but it's hard to focus on it, especially moving your eyes between 3 different parts of the screen - numbers, menu and field. I'd suggest moving cash display near building menu - as it's for building.
* just an idea - incorporate cash into menu items for building as numbers - for example when there's 100 money, display "10" in front of mines, 1 in front of m/silo, 2 in front of tank and 4 in front of fighter menu item according to their price.
* shortcuts MSTF won't do imho, they're too away from each other, 1234 is better.
* AI tends to build fighters in packs but all of them are overlayed on one another, so it's hard to discern how much of them there are. One thing that comes to mind is making some random delta to their position. The other one is a gameplay tweak - fighters should be able to move over land units but not over each other which seems reasonable.

Steve said...

Well, thanks again for your detailed comments. I've just released a new version (0.6) with the following tweaks:-

* Rush mode doesn't seem to guarantee success
* Tweaked the stats (like the firepower as you recommended) and costs of the units. Silo's were especially overpriced
* Different types of AI - some defensive, some offensive
* I will make FoW an option in the future, but I've decided to keep it as it gives the AI a much needed advantage.
* Tweaked the display layout
* Added more shortcuts
* Fighters can now overlay other units but not themselves.

I've created a new thread for Island Commander updates and requests at , so I'll be posting details of all new releases there.

BTW, the version at GameJolt is now out of date.