Rampant

by Veden

Improves the enemies tactics by using potential fields (pheromones) allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, raids, rallying death cry, and player hunting. Uses blockable biter projectiles. Adds new Enemies which can be disabled in mod settings. Difficulty setting in mod options menu.

Content
1 year, 11 months ago
0.13 - 1.1
125K
Enemies

g Question on code: points/structure destruction

3 years ago
(updated 3 years ago)

Hi,

I am playing this mod with a combination of other hard ones (like Swarmageddon) and I often get completely rekt during the ONSLAUGHT phases but in a very weird way so I am trying to understand why. The issue is, 90% of the time I can handle the waves without loss (and the difficulty feels balanced) but then suddenly there is one wave which has 5x - 10x more biters and I can't beat it even with an exagerated count of gun turrets. I have set every multiplier down, even the AI difficulty to 0.2, and disabled pollution with an other mod, but it doesn't seem to make these disappear, there is always a point where I get completely swarmed.

I am particularly curious about this part of code:

https://github.com/veden/Rampant/blob/master/libs/ChunkUtils.lua#L552

Do I understand correctly, that the AI gains points when it destroys a building, and then it can spawn more squads with these points? What's the logic behind that? I suspect this is the issue in my case, the AI eventually manages to destroy some buildings, so it can spawn more biters, and then by a chain reaction it can destroy more buildings, etc.

In my opinion this should be the other way, during the ONSLAUGHT phase, destroying buildings should make the AI lose points. Otherwise it may create frustrating snowball effects where the AI feels rather easy to beat for a while, until it finally manages to destroy some of your stuff, and then suddenly it becomes a real challenge and the player will not easily associate this with the cause.

3 years ago

By the way, I think what happens in my case is the same thing as I described here 2 years ago: https://mods.factorio.com/mod/Rampant/discussion/5cc0aece560df5000cd6dfa7 , and now I understand why it disappeared after saving/reloading: the AI state random seed must have become different when I save/reload and so I was not in the AI_STATE_ONSLAUGHT anymore.

3 years ago
(updated 3 years ago)

Do I understand correctly, that the AI gains points when it destroys a building, and then it can spawn more squads with these points? What's the logic behind that? I suspect this is the issue in my case, the AI eventually manages to destroy some buildings, so it can spawn more biters, and then by a chain reaction it can destroy more buildings, etc.

Yes, the AI gets more points to work with when it destroys structures. This happens in any state. During Onslaught the AI gets "full" points (approximately 8x what the other states get) which makes it exceptionally dangerous.

(AI_STATE_ONSLAUGHT is very dangerous because it can spiral out of control after losing only a few structures. You also get lulled into a false sense of security since passive states like _PEACEFUL or _AGGRESSIVE allow the AI to build up a point bank. When it swaps to _ONSLAUGHT which has no throttling on point spending, a huge attack occurs as the AI dumps all its points into attacks. If your defenses aren't prepared for this massive build up then the AI destroys some buildings and generates even more attacks.)

(The AI state changes are performed by dice rolls when the appropriate tick/time is reached. So you can save before this happens and reload over and over and you will have a chance to roll different states.)

3 years ago

Rampant has a bunch of options to see whats going on in the mod settings, toggle on the chat output options (see how many points they get and such) and see exactly how much you need to reduce other options by to balance out

3 years ago

The short answer is balance is hard.
If you read through the threads on this mod, the feedback is Rampant is too easy or hard.
I'm open to suggestions.
What happens now is that destroyed buildings cause the ai temperament to drop which eventually causes the ai to change state to something other then onslaught.
The rational for the ai state is to potentially break through fully fortified walls. Otherwise the ai tends to never stress the player unless through attrition.

3 years ago
(updated 3 years ago)

What happens now is that destroyed buildings cause the ai temperament to drop which eventually causes the ai to change state to something other then onslaught.
The rational for the ai state is to potentially break through fully fortified walls. Otherwise the ai tends to never stress the player unless through attrition.

I'm open to suggestions.

I made a few tweaks to the code and managed to find something great for my case (where the AI loses points for destroying structures during ONSLAUGHT) but this is not something that will please all users, as you said some will think it's too hard, some that it's too easy.

This is definitely not an easy topic but I'd say the goal should be to completely ignore destroyed structures in the logic, because this is something that is very counterintuitive and can be exploited by the human player if they know the rule.

If destroyed structures give bonus points to the AI, this will lead to snowball effects like I described in my post, the AI feels easy until it manages to break through and destroy your structures and then it gets more points and destroys more and more structures.
If destroyed structures give negative points to the AI, the player can exploit this by leaving fake buildings undefended.

I'll try to think if there's a better metric to evaluate player resistance than "destroyed buildings"...

3 years ago

How do you stop someone gaming the system with fake structures if the AI loses points when they are destroyed?

3 years ago

One solution: when AI destroys structures in ONSLAUGHT state, it loses points, but these lost points are saved and will be gifted back to biters at the beginning of the next ONSLAUGHT phase. That way, a player can barely exploit this, it will give an advantage short term, but it will lead to stronger and stronger attacks long term, making it probably tedious and not worth it. On the contrary, somebody who doesn't exploit this will simply realize that the base was breached and improve their defenses for next time so the mechanic will not sound unfair for them.

That could be something difficult to implement, and maybe even more to test, so no need to implement this if you don't feel like it. I agree with you that making difficulty mod feel balanced is not easy

3 years ago

The next version will include a small point penalty (0.5) for each unit destroyed by the player.

Also the squads spawned by the vanilla AI when the max number of squads have been reached will no longer refund points to the AI.

New response