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, 2 months ago
0.13 - 1.1
124K
Enemies

g Removing a Faction Mid-Playthrough Throws an Exception

3 years ago
(updated 3 years ago)

Removing a Faction Mid-Playthrough Throws an Exception

This probably only happens if the removed faction has a hive on your map (see my conjecture below).

Save: https://mega.nz/file/55xR1CqZ#lsYAmolUOPTIVUbwqRYbZzMnVBwHS0x5thuoll2Z180

Stack Trace: https://i.imgur.com/IKLW6V8.png

The mod Rampant (1.0.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Rampant::on_land_mine_armed (ID 103)
Rampant/libs/BaseUtils.lua:185: attempt to index field '?' (a nil value)
stack traceback:
Rampant/libs/BaseUtils.lua:185: in function <Rampant/libs/BaseUtils.lua:176>
(...tail calls...)
Rampant/libs/BaseUtils.lua:281: in function 'upgradeEntity'
Rampant/control.lua:768: in function <Rampant/control.lua:752>

(Looks like removing a faction no longer forces Rampant to re-index surfaces. Based on checking out the code referenced in the trace my guess is that if the removed faction has a hive on the map Rampant tries to process hive activities and crashes because the data for that faction no longer exists).

Workaround to remove the faction if you encounter this issue:
1) Pause the game in editor mode (the Hive logic does not execute if the game isn't processing "game play" ticks. You'll crash pretty much instantly in #4 if you skip this step.)
2) Make a save
3) Remove the faction in mod startup settings
4) Load the save
5) Trigger Rampant's surface re-indexing (Note: I couldn't figure out how to do this without editing the source code. So if anyone needs a modified copy of their Rampant version to trigger re-indexing just post a reply and I can edit and upload one for you. The workaround involves creating a surface in editor mode (it can be deleted after). The edit I make is to have Rampant re-index all surfaces instead of just the new surface).

(The re-indexing has the downside of "re-rolling" all hives on your map to a new faction (which is mostly undesired but we've accepted this spike in difficulty in lieu of ending our play through! :P Parts of our solid wall of laser turrets are now fighting the Energy Thief faction and if you're familiar with their resistances we've got a crisis to deal with!)).

3 years ago

Thanks for the report, I will add it to the todo list

3 years ago

Is there a way for you to make a short guide on how to change the code to remove the offending factions dag_ ? Cuz otherwise u might get swamped with requests for your help with this.

3 years ago
(updated 3 years ago)

Here is a modified 1.0.6 with the workaround I described. I suggest backing up your existing Rampant zip, then replacing it with this one and once finished restoring your original zip.

MODIFIED Rampant 1.0.6 download: https://mega.nz/file/h1wSxabS#ttW2F2ovTIYPmc62yQaJAlYbFUgB1_GJ4zxPPQZmc0g

Instructions to remove a faction:

0) Close your game and put the edited rampant zip in your mods folder
1) Pause the game in editor mode (the Hive logic does not execute if the game isn't processing "game play" ticks. You'll crash pretty much instantly in #4 if you skip this step.)
2) Make a save
3) Remove the faction in mod startup settings
4) Load the save
5) In editor mode, add a new surface (you can remove it once finished)
6) Unpause the game and wait 10-15 seconds. If it doesn't crash here it worked. Save your map, close the game and revert to the non-edited Rampant zip

Note that part of Rampant's re-indexing will reroll all the hives on your map so you might be in for a difficulty spike.


If you want to make the edit yourself it's pretty simple in control.lua:

replace this function as follows

local function onSurfaceCreated(event)

https://pastebin.com/h1HAhrbc

3 years ago

First of all thank you very much for taking the time to help out, I really appreciate it.
I followed trough your steps till I tried to add a new surface and it crashed with this error:

The mod Rampant (1.0.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Rampant::on_surface_created (ID 62)
invalid key to 'next'
stack traceback:
[C]: in function 'next'
Rampant/libs/ChunkProcessor.lua:66: in function 'processPendingChunks'
Rampant/control.lua:371: in function 'prepMap'
Rampant/control.lua:898: in function <Rampant/control.lua:895>

Am I adding a surface wrong on the game? I had the editor open and selected "Surfaces" then I put in at the bottom a random width and heght( I have no idea if there is a mininum size for this) , gave it a name and pressed on the green check arrow where it immediately crashed I didn't even get out of editor mode, I understand nothing about surfaces but I have the Space Exploration mod installed, it has several surfaces from my understading of the term, maybe me adding one with a weird size be affecting things? It doesn't show up as a reason on the crash report message so I have no idea where to go from here.
Once again thank you very much for the help you already provided.

3 years ago

Darn that sucks, sorry it didn't work. I didn't get that exception when performing the workaround on my map (Rampant v 1.0.4 and no Space Exploration). You will probably have to wait for Veden to publish a fix. In the meantime you could always re-enable the factions to continue playing.

3 years ago

should be fixed in the latest

3 years ago

Darn that sucks, sorry it didn't work. I didn't get that exception when performing the workaround on my map (Rampant v 1.0.4 and no Space Exploration). You will probably have to wait for Veden to publish a fix. In the meantime you could always re-enable the factions to continue playing.

It was what I did, managed to hang on and continue playing, thank you again for your help!

3 years ago

should be fixed in the latest

Thanks, that will ease my life considerably, great work as always.

3 years ago

The mod Rampant (1.0.7) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Rampant::on_configuration_changed
Rampant/libs/BaseUtils.lua:78: attempt to index local 'universe' (a nil value)
stack traceback:
Rampant/libs/BaseUtils.lua:78: in function 'evoToTier'
Rampant/libs/BaseUtils.lua:112: in function 'findBaseMutation'
Rampant/libs/BaseUtils.lua:239: in function 'findBaseInitialAlignment'
Rampant/libs/BaseUtils.lua:609: in function 'rebuildNativeTables'
Rampant/control.lua:395: in function <Rampant/control.lua:374>

The problem with removing a faction midgame seems to be sticking around, I just tried it after your update and I had to go back to enabling the factions.
Hope this helps.

3 years ago

Hi Heronier,

The trace you provided is from 1.0.7 which is a few verisons behind.

3 years ago

Hi Heronier,

The trace you provided is from 1.0.7 which is a few verisons behind.

You sir were quite right, I had missed that detail, I had a few mods to update in fact thank you.

However it seems to throw this back at me after the update:

The mod Rampant (1.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Rampant::on_configuration_changed
Rampant/libs/BaseUtils.lua:72: attempt to index local 'universe' (a nil value)
stack traceback:
Rampant/libs/BaseUtils.lua:72: in function 'evoToTier'
Rampant/libs/BaseUtils.lua:108: in function 'findBaseMutation'
Rampant/libs/BaseUtils.lua:235: in function 'findBaseInitialAlignment'
Rampant/libs/BaseUtils.lua:597: in function 'rebuildNativeTables'
Rampant/control.lua:405: in function <Rampant/control.lua:384>

3 years ago

If you can it may be helpful to provide the save and which faction you're disabling.

3 years ago
(updated 3 years ago)

e: https://github.com/veden/Rampant/pull/50


It was reproducible for me.

In libs/BaseUtils.lua line 597, change it from:

base.alignment = findBaseInitialAlignment(universe, evoIndex)

to

base.alignment = findBaseInitialAlignment(map, evoIndex)

New response