As predicted, porting the prototype from MOAI to Cocos2d was relatively simple. There were some considerations to be made owing to the procedural nature of Lua vs the object oriented nature of Objective-C. All in all though the port went without a hitch. That means I’m now at a point where my Ludum Dare prototype runs on the iPhone.
The most immediate thing you’ll notice is that the visual style has lost most of its impact. That’s to be expected when moving from the desktop resolution it was designed for to a mobile format. This will all be modified and corrected in the coming months of design and development.
A little aside: I’ve been considering the orientation that I should use for the game. Asking on Twitter, opinions seem to be mixed. A few people raised the point that there are common orientations for certain genres. I think with Mini Mob I’m going to leave it as landscape for now with a mind to switching to portrait (or adding portrait as an option) if it makes more sense.
As I mentioned previously, I have lots of ideas for expanding Mini Mob but, in order to keep the development under control, I first want to focus on its core gameplay deficiencies. The prototype has a number of issues around the lack of strategic depth and I think these need to be corrected first.
Step one therefore is to play the game some more, read the comments from Ludum Dare 25, and write down the issues that are preventing meaningful strategies. Thats what I’ve done below.
- Taking a zone of a higher defence value offers no benefit over lower value zones.
- Fight resolution is random.
- Police AI is dumb and can result in many sequential invalid turns.
- Redistributing units offers no real benefit owing to the point about random fight resolution.
Lets look at each one in detail and come up with some ideas as to how they can be solved?
Taking a zone of a higher value offers no benefit over lower value zones
In the current game, taking a zone increases the new recruit rate (the number of gangsters awarded at each 15 second interval). To calculate this rate a simple division (by 5) is performed on the zone defence value.
For example, a zone with a defence value of 25, when taken, will increase your new recruit rate by 5. A zone with a defence value of 100 will increase your new recruit rate by 20.
You can see the immediate issue. Why bother saving for a zone with a defence value of 100, there is no inherent benefit over taking 4 zones with a defence value of 25 (despite the added risk).
The solution to this, I think, is to make the value exponential. So I think something like…
([zone defence value] / 5) * ([zone defence value] / 25)
If we use this algorithm on the possible zone values heres what we get.
25 = (25 / 5) * (25 / 25) = 5
50 = (50 / 5) * (50 / 25) = 20
75 = (75 / 5) * (75 / 25) = 45
100 = (100 / 5) * (100 / 25) = 80
This immediately gives the player an advantage if they save gangsters and take zones with higher defence values. Taking 4 zones at a defence value of 25 each will result in an increase of 20 to our new recruit rate. Taking a single zone with a defence value of 100 will increase the new recruit rate by 80.
Those numbers will likely need to be tweaked but you get the general idea.
Fight resolution is random
When you take a zone occupied by “the fuzz”, a fight is triggered. This is currently resolved in the most simplistic way you can imagine; the flip of a coin! This severely limits the strategies that can be employed during gameplay and means that there is no benefit to the pattern in which you occupy zones.
There are lots of possible solutions to this. For now we’re going to implement something fairly simple and we’ll add complexity as development progresses.
The simplest way I can think of to increase the elements of strategy that can be employed is to take into consideration the adjacent zones. To do this we’ll simply utilise the occupier of each adjacent zone to push the coin flip (or dice roll) in favour of player with the most adjacent zones occupied.
Lets look at some examples…
You attack a zone that is occupied by the police. Adjacent zones are neutral. P (police) = 1, M (mob) = 1; You have a 1 in 2 chance of winning.
You attack a zone that is occupied by the police. 1 adjacent zone is occupied by the police, the others are neutral. P (police) = 2, M (mob) = 1; You have a 1 in 3 chance of winning.
You attack a zone that is occupied by the police. 1 adjacent zone is occupied by you, the others are neutral. P (police) = 1, M (mob) = 2; You have a 2 in 3 chance of winning.
You attack a zone that is occupied by the police. All 4 adjacent zones are occupied by the police. P (police) = 5, M (mob) = 1; You have a 1 in 6 chance of winning.
You attack a zone that is occupied by the police. All 4 adjacent zones are occupied by you. P (police) = 1, M (mob) = 5; You have a 5 in 6 chance of winning.
This immediately adds a new strategic layer involving picking off adjacent police zones in order to attack. You can also use this strategy inversely to bolster your defences.
Police AI is dumb and can result in many sequential invalid turns
The AI in the game is incredibly basic in its current state. The AI rolls a 25 sided dice (there are 25 zones in the city) once per second. This determines the zone it will try to place police on. One of three things can happen…
1) If its neutral and it has enough police, it will take the square.
2) If its mob controlled and it has enough police, it will initiate a fight.
3) Nothing – Because the zone belonged to itself or it didn’t have enough police to perform one of the above actions.
We can improve this considerably in a few ways.
Firstly, we can use the number of police we have to narrow down our zones. This will reduce the chances of us performing no action (No action is still possible if the AI has less than 25 police at its disposal).
Secondly, we can eliminate squares occupied by the AI from the zones it can choose from.
Thirdly, and only because we’re adding depth to the strategy, we can utilise the adjacent zones to make a more informed decision about what to try and take.
These three things should make the AI much more competitive.
Redistributing units offers no real benefit owing to the point about random fight resolution
You can tap a zone that you control to recall the gangsters that occupy that zone. This returns them to your pot of gangsters but reduces your new recruit rate. Previously there was no real benefit to doing this.
Since introducing a strategic element to fights, above, there is now a very good reason to redistribute; in order to surround a zone you want to attack and increase your odds.
Does this make the ability too powerful? We’ll almost certainly need to add it to the AI’s capability. I’m going to need to test it in order to find out.
We’ll be revisiting strategy later in development. These four items above are intended to solve some of the most immediate issues in the simplest way. The next step for me is to go away and code the algorithms and systems to support these new strategies
See you next time.