[MOD 1.1] Will-o'-the-Wisps updated

Topics and discussion about specific mods
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

[MOD 1.1] Will-o'-the-Wisps updated

Post by mk-fg »

Good day to you, fellow factorians!

"A glowing enigmatic life form was found to inhabit alien forests at night." - general idea of the mod.
Compatibility update and tweaks to Will-o'-the-wisps mod by Betep3akata (forum thread).

Can be installed and updated directly from factorio Mods menu.
Download link, more up-to-date description and images on factorio mod portal: https://mods.factorio.com/mod/Will-o-the-Wisps_updated
Mod code also lives on github, in mk-fg/games repository, where more technical issues and pull requests can be filed.

This thread is for any feedback on the updated mod version, as remaining bugs here are probably mine anyway.
All feedback is welcome, but please do try to attach exact error message - including filename, line number and error itself - when reporting a bug, if any, as well as what was happening in the game at the time (or ideally steps to reproduce the issue).

See mod page for a full and up-to-date mod description and changelog.

Technical info and debug commands
LuaRemote interfaces
Last edited by mk-fg on Tue Nov 23, 2021 6:52 pm, edited 35 times in total.
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

I really like the idea of this mod. I am trying it out for the first time. But I have questions about the red wisps; as they have overrun me twice in the early game before I was able to research and build UV lamps. What is meant by "physical damage" where they multiply? And boy, do they multiply! Are the UV lamps the only counter to them? In a third game, I had them overrun me and push through an area that had a couple UV lamps. It seems I have not figured out how to prevent the red ones from taking over. Can you help explain these ones a bit more?
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

Thanks.

They haven't been a problem at all for me, prehaps mostly because I almost never bumped into them - default chance for these to spawn on the map is tiny 1%, i.e. 1 wisp out of every 100 spawned.
And then for them to be a nuisance you'd have to start killing wisps in their vicinity, which generally only trains do by accident in my games.
Bulldozing rocks where these live at night should also be rather easy to avoid.

When it comes to actually fighting them, important things are:
  • 20% replication chance should trigger every time damage_type=physical is done to them, which notably doesn't include UV (damage_type=fire).
  • They only have 30hp.
Hence assuming everything is on the table - how do you best kill red wisp?
  • Grenades (35 damage, damage_type=explosive) or explosive rockets will kill any number of red wisps in the area, not to mention cluster grenades.
  • Laser and red-ammo-loaded gun turrets also have >50% chance to kill the things, so they inevitably win if survive long enough, which should be easy, unless it's a horde of reds already.
  • Flamethrower is incredibly effective, as not only it doesn't cause them to multiply, but also makes these low-hp wisps run through fire, killing them en masse.
  • Other explosives like mines work too, and uranium bullets one/two-shot them (dep. on upgrades), hence 65-80% of clean kill.
  • So basically only way to loose vs them seem to be using something physical that damages them slowly, which I think only applies to the most basic ammo and maybe drones.
  • UV should make them flee in addition to dying rapidly, all at once, and without replication.
  • If everything else fails, just running/driving away and waiting until dawn might be an option, they shouldn't chase too far.
So not really sure how you get them to hate you in the early game, and by the time you get trains, flamers, robots and whatever else might spawn or happen to set these things off, there should be multiple ways to deal with them, as listed above.
Though then again, different people play game in different ways, on different maps, with diff mods, and maybe you have game setup in a way that makes these wisps harder than usual?

One tweak for that might be going to Options -> Mod Options -> Map menu, and:
  • Making sure "automated defences target all wisps" is disabled, not to aggro them needlessly.
  • Turning random red wisp spawn chance even lower than 0.01 (which is 1%, 0 is also a valid value) and avoid bulldozing rocks.
  • Lowering "wisp retaliation radius" (default 96 is 3 bold-line 32x squares from you in either direction when you shift+space pause the game).
  • Disabling "wisps can retaliate" in early-game, making them basically cosmetic (though you can still shoot them with C key if you want, they won't fight back).
(hover over names for any of these options in the menu to see more detailed description)
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

Thank you for the prompt response!

I think my problem was I was not damaging them fast enough. My cases are in the game where I do not have a full solid wall of defenses yet, just groups of 2 or 3 turrets, mostly filled with the red piercing ammo, some yellow ammo. In my cases, reloading those saves to see what happens shows a red randomly has spawned in the middle of a forest, but was drawn in when a yellow decided to attack. (I do have the turrets auto attack unchecked in the options). Once the aggression was activated, the red wisp closes in, and multiplies upon death. then those two multiply, and then the four multiply,and so on. Occasionally, one or two will die and turn purple, but once this wave starts, it's over. The third play, I think there were over 100 red wisps tearing through my base, I just did not have enough to stop them. And I seems I am struggling to understand the UV lamps and their interaction. I just think I was in the early game and that is the risk with the red ones. Just not enough damage fast enough to kill them once they are aggressive.

Now, don't get me wrong. I love a good challenge and I like making the game harder. The wisps definitely add an aspect to the game that has really made me think about how I build my base.

Ok, the red wisp. (Now that I understand what physical damage means...)
1. I have not seen an 'only' 20% replication upon damage_type=physical, probably around the 80% range (could it be backwards?), because these things multiply in droves once started.
2. Now that I understand that other damage types, like explosive, laser, electric, acid, etc do not contribute to the replication process, I know what to go after them with. I think because I was primitive in the very early game, I just did not have those things to fight them.
3. The UV lamps was damaging them over time, seemed like one lamp damaging one red wisp at a time. Now, one that is not aggressive does move in, detect the UV lamp and flees back into the forest. Very cool thing to see. Same with green and yellow. They do take a little damage as well. the aggressive ones though, do move in to attack regardless if there are UV lamps, which is fine by me (I prefer this actually), and if there are too many, they can overrun the defense and the lamps. I do not know if this is the intention, but I do like that they are aggressive and ignore the lamps, even if they take damage.

All in all, I really like this mod. It adds a unique perspective to the game. I probably will not adjust the options to make it easier, I just need to understand how the interactions work. Thank you for your help!
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

RocketManChronicles wrote:My cases are in the game where I do not have a full solid wall of defenses yet, just groups of 2 or 3 turrets, mostly filled with the red piercing ammo, some yellow ammo.
Yeah, yellow ammo might be the issue.
Even though chance of replication is 20% per hit, that ammo does 5 damage, so with 30hp, it's 6 hits to kill a wisp, so 6x20% rolls, which adds up to "1 - (1 - 0.2)^6 ~ 75%" chance of replicating *at least once* (can be twice, 3 times, ..., and down to 0.006% chance of replicating 6 times).
Any value >50% here pretty much guarantees that number of these things will keep on growing... which I don't know, maybe a bad thing to just dump on unsuspecting players like that :)
Though then again, just run away, wait until sunrise, repair and rebuild, it'll all be fine!
RocketManChronicles wrote:when a yellow decided to attack
It's a bit weird, as they shouldn't be naturally aggressive, and only become such in the "retaliation radius" around wisp unit (yellow/red/green) killed by non-UV - UV damage doesn't count as player attacks, but bullets, running things over (cars, tanks, trains), fire (burning forests), etc does.

Maybe also worth noting that other mods can mess up with ammo damage values and aggression, though latter seem highly unlikely, and former you can check by looking at popup info for the ammo - should list all mods that tinkered with it in any way under its name there iirc.
RocketManChronicles wrote:In my cases, reloading those saves to see what happens...
Btw you can test and play with different attack scenarios via console ("~" key above "tab" and below "esc"):

- Wait-until or load game at night time, so that wisps won't just disappear due to sunlight.
- /c game.speed=0.2 - to slow things down (note: /c is part of the console command, and you can ctrl+c/ctrl+v these).
- /c game.player.insert{name='wisp-red', count=20} - will give you 20 red wisp capsules that you can place to create them.
- Place any number of turrets with whatever loadout and a bunch of wisps to oppose them.
- /wisp attack - FIGHT! signal - turns all wisps on the map hostile (incl. just-placed ones).

When writing previous message, I did place 4 turrets loaded with red ammo and 10-15 reds to fight them, to check if maybe I did break something in that regard, and turrets won rather easily, though I think they had damage of 10+ due to upgrades there (3-hit-kills).
Oh, also, I think red wisps were stronger (80hp iirc) in one of the earlier mod versions, so you might also want to check that you're running the latest one (check/update buttons under Mods in the main menu).
RocketManChronicles wrote:UV lamps was damaging them over time, seemed like one lamp damaging one red wisp at a time
I'd suggest also testing it out in a way outlined above, they definitely should damage all wisps in their area, not one at a time.
Code there is basically `for wisp in find_entities_filtered{force='wisp', type='unit', area=...} do apply_damage(wisp) end`, so it should always get them all, unless there's some kind of bug.
Should probably be easier to check on slower speed as suggested above, and you can cheat yourself some lamps via "/c game.player.insert{name='UV-lamp', count=20}" (note: letter capitalization matters).
RocketManChronicles wrote:aggressive ones though, do move in to attack regardless if there are UV lamps, which is fine by me (I prefer this actually)
Hm, don't actually remember how attack-vs-flee should work, and you might be right there - aggression might indeed take priority, which yeah, should probably be fine too.
RocketManChronicles wrote:if there are too many, they can overrun the defense and the lamps
I think massive concentrations of these should only happen if either (a) you wander in the forest for a long time, or (b) cut it down aggressively, or (c) pollution is disproportionally high in just one forested area (so most wisps spawn there, configurable via menu too btw).
Or with replicating red ones, of course :)
RocketManChronicles wrote:Thank you for your help!
No problem, thanks for the feedback!
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

mk-fg wrote:
RocketManChronicles wrote:My cases are in the game where I do not have a full solid wall of defenses yet, just groups of 2 or 3 turrets, mostly filled with the red piercing ammo, some yellow ammo.
Yeah, yellow ammo might be the issue.
Even though chance of replication is 20% per hit, that ammo does 5 damage, so with 30hp, it's 6 hits to kill a wisp, so 6x20% rolls, which adds up to "1 - (1 - 0.2)^6 ~ 75%" chance of replicating *at least once* (can be twice, 3 times, ..., and down to 0.006% chance of replicating 6 times).
Any value >50% here pretty much guarantees that number of these things will keep on growing... which I don't know, maybe a bad thing to just dump on unsuspecting players like that :)
Though then again, just run away, wait until sunrise, repair and rebuild, it'll all be fine!
Yeah, based on what you've taught me, the yellow ammo was the lead to my fail. Even with the math you have here, just proves what I saw happening. So, what I learned here is each damage "hit" rolls the replicating mechanic which allows the high probability of replication. Good to know.
mk-fg wrote:
RocketManChronicles wrote:when a yellow decided to attack
It's a bit weird, as they shouldn't be naturally aggressive, and only become such in the "retaliation radius" around wisp unit (yellow/red/green) killed by non-UV - UV damage doesn't count as player attacks, but bullets, running things over (cars, tanks, trains), fire (burning forests), etc does.

Maybe also worth noting that other mods can mess up with ammo damage values and aggression, though latter seem highly unlikely, and former you can check by looking at popup info for the ammo - should list all mods that tinkered with it in any way under its name there iirc.
I have noticed the yellow ones to spawn as neutral. They wander around minding their own business in the trees, no big deal. But every now and then, they would suddenly charge at my defenses and attack whatever they reach first. When in this state, my defenses activate and kill it. What mechanic drives them to turn "aggressive?" There is no problem with this, as I see it, but am curious if there is something that drives them to aggression other than one being killed by player means. I have been assuming it was pollution levels got too high, or something like that.
mk-fg wrote:
RocketManChronicles wrote:In my cases, reloading those saves to see what happens...
Btw you can test and play with different attack scenarios via console ("~" key above "tab" and below "esc"):

- Wait-until or load game at night time, so that wisps won't just disappear due to sunlight.
- /c game.speed=0.2 - to slow things down (note: /c is part of the console command, and you can ctrl+c/ctrl+v these).
- /c game.player.insert{name='wisp-red', count=20} - will give you 20 red wisp capsules that you can place to create them.
- Place any number of turrets with whatever loadout and a bunch of wisps to oppose them.
- /wisp attack - FIGHT! signal - turns all wisps on the map hostile (incl. just-placed ones).

When writing previous message, I did place 4 turrets loaded with red ammo and 10-15 reds to fight them, to check if maybe I did break something in that regard, and turrets won rather easily, though I think they had damage of 10+ due to upgrades there (3-hit-kills).
Oh, also, I think red wisps were stronger (80hp iirc) in one of the earlier mod versions, so you might also want to check that you're running the latest one (check/update buttons under Mods in the main menu).
RocketManChronicles wrote:UV lamps was damaging them over time, seemed like one lamp damaging one red wisp at a time
I'd suggest also testing it out in a way outlined above, they definitely should damage all wisps in their area, not one at a time.
Code there is basically `for wisp in find_entities_filtered{force='wisp', type='unit', area=...} do apply_damage(wisp) end`, so it should always get them all, unless there's some kind of bug.
Should probably be easier to check on slower speed as suggested above, and you can cheat yourself some lamps via "/c game.player.insert{name='UV-lamp', count=20}" (note: letter capitalization matters).
Oh, now I am going to have to try this out! I will try to simulate some cases. Maybe I can even capture a screenshot or two of the devastation I had suffered, lol. It will be interesting to see where the threshold is from when you can be overrun versus total safety where they cannot hurt you. I will have to practice this soon. Also, I downloaded this mod after your latest update, so I have the current version. I may make some tweaks to the mod config, as I do kind of like the idea of having the UV lights demand more energy when on. Gives me a reason to have sensors and on/off circuits set up. I do not want it too easy!
mk-fg wrote:
RocketManChronicles wrote:aggressive ones though, do move in to attack regardless if there are UV lamps, which is fine by me (I prefer this actually)
Hm, don't actually remember how attack-vs-flee should work, and you might be right there - aggression might indeed take priority, which yeah, should probably be fine too.
I say leave this, or make note to have aggression as a priority over fleeing. This definitely is expected, and I kinda welcome the wisps to try to overrun me.
mk-fg wrote:
RocketManChronicles wrote:if there are too many, they can overrun the defense and the lamps
I think massive concentrations of these should only happen if either (a) you wander in the forest for a long time, or (b) cut it down aggressively, or (c) pollution is disproportionally high in just one forested area (so most wisps spawn there, configurable via menu too btw).
Or with replicating red ones, of course :)
I did throw a grenade into a forest at night and had to quickly run! The wisps are fun to fight, especially in the early game. I like that they do provide a challenge VERY early, just something more to keep in mind while expanding. I will say that I do enjoy seeing them wander the forests at night.
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

RocketManChronicles wrote:
mk-fg wrote:It's a bit weird, as they shouldn't be naturally aggressive, and only become such in the "retaliation radius" around wisp unit (yellow/red/green) killed by non-UV - UV damage doesn't count as player attacks, but bullets, running things over (cars, tanks, trains), fire (burning forests), etc does.
But every now and then, they would suddenly charge at my defenses and attack whatever they reach first. When in this state, my defenses activate and kill it.
What mechanic drives them to turn "aggressive?"
There is no problem with this, as I see it, but am curious if there is something that drives them to aggression other than one being killed by player means.
I have been assuming it was pollution levels got too high, or something like that.
It should be just player aggression, as mentioned.
Only two places where wisp_aggression_set() is passed true is on_death hook for wisp units and that "/wisp attack" command.
(note: purple wisp spores don't trigger on_death as they are not really "units", and UV lamps are excluded there because their damage isn't dealt by "player" force)

Which is why I find it so weird that cause isn't obvious, as it's usually hard to randomly kill a neutral unit, unless you have extensive railway network (unlikely for an early game, and there's kill count on locomotives).

Did think about adding more causes for them to attack, but thought that it might be too annoying for most people (me included), who mostly play to build stuff and are used to putting defences in specific places where biters attack from, not everywhere where forests are, which is usually "all directions".
Roadkills by trains are less annoying cause, as remote stations where trains go to through forests usually need and have defences anyway, plus it encourages building separate power grids and not have undefended power poles and lamps in the middle of nowhere (and e.g. powering small remote stuff via solar or larger installations burning solid fuel coming with train or produced locally).

Should be easy to make option(s) for other kind(s) of aggression though.
Easiest trigger might be to indeed radicalize will-o-wisps in the most polluted places with e.g. some configurable chance variable rolled on darkness level changes or some time intervals (so it'd be rate-limited that way).
Pollution level itself is a hard thing to tie anything to, as it's hard to pin down "this is a lot" threshold - can vary wildly depending on how sparse stuff is laid out, amount of trees or even biters around, etc.
RocketManChronicles wrote: I may make some tweaks to the mod config, as I do kind of like the idea of having the UV lights demand more energy when on. Gives me a reason to have sensors and on/off circuits set up. I do not want it too easy!
They actually used to draw even more - 400kW instead of 160kW in much earlier versions iirc (probably mention in changelog, also accessible via Mods in main menu).

Tweaking stuff should be easy - just unpack it from the zip into same dir where the zip is/was and use something like notepad++ to edit stuff there.
For uv lamps in particular, it's an "energy_usage_per_tick = '160kW'" value in prototypes/uv-lamp.lua, which isn't in the config.lua and kinda tied into other prototype values there - buffer_capacity, input_flow_limit - which you can mostly ignore if you plan to supply enough power to these things.
(if underpowered, lamps do less damage and less likely to kill spores, as per uv_lamp_damage_func/uv_lamp_spore_kill_chance_func in config.lua; fully-powered lamps have ~80% chance to kill spore within 20s [graph link])
RocketManChronicles wrote:I did throw a grenade into a forest at night and had to quickly run!
Try using flamer to set huge forests ablaze at night!
Many trees will die spawning mobs of yellow wisps, and then fire will start killing them and whole forest-sized mob gets angry...
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

RocketManChronicles wrote: But every now and then, they would suddenly charge at my defenses and attack whatever they reach first. When in this state, my defenses activate and kill it.
If you update to just-released 0.0.50, there's now console command "/wisp incidents" to place red labels with timestamps on the map to show causes of recent aggression (up to 300 separate incidents or 8 minutes).
With default settings, should place these markers exactly where wisps were killed, indicating when it happened on the label (time can be compared vs ones displayed in savegames, I guess).
"/wisp incidents remove" command can be used to clean these up from the map.

Hopefully it should be more obvious from such positions what kills these things when cause for aggression is unclear.
Should only start tracking such incidents in 0.0.50 though, so won't show them from before updating to that.

RocketManChronicles wrote: What mechanic drives them to turn "aggressive?"
...
mk-fg wrote:Did think about adding more causes for them to attack, ...
Also in 0.0.50 added a new optional random aggression mechanic for more challenging games.
It is controlled by "Wisp aggression factor" under Mod Options, which has 0-1 range and is 0 by default, meaning "no random aggression".

Anything above 0 there will check that chance ~1/minute (default factorio "day" is ~7-8 minutes iirc, and dark part of it is like 2-3 min) and if it rolls success (setting to 1 will guarantee it), pick random wisp spawn places and generate fake "wisp died" (aggression-triggering) event there, making any wisps in the surrounding area hostile (as per "Wisp retaliation radius" setting).
This might give a good incentive to cut down any forest remains in heavily-polluted areas (note: only 300+ trees in 32-tile radius are considered to be a "forest"), as clustered spawns and aggression from there can be a problem.
(btw, there's "/wisp zone labels" console command to mark all forest chunks and their spawn chances on the map, with corresponding "/wisp zone labels remove" to hide them)

As mentioned, this is disabled by default, so shouldn't make any existing or new games more difficult unless explicitly enabled by (game admin) player.
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

I updated when I got home from work Tuesday night. I have been playing with the new settings and have been really impressed! The wisps make the very early game a challenge, which for me, is a welcomed challenge. They can overrun very early game defenses if you are not prepared to them.

After experimenting for a while, I found some interesting things happening. Our discussion was correct in the Red Wisps. The yellow ammo damage on Red Wisps allows them to multiply! In a matter of a few seconds, one red wisp can turn into an unstoppable 15. And soon those 15 will turn into 60! This of course is when a red wisp becomes hostile. Now, how they were aggressive before the update is probably due to another mod or two. I think the culprit is Rampant AI mod. I get an announcement that a wisp faction is attacking, which by the time I can respond, I have to deal with 20+ red wisps and they are decimating everything. I don't know if the Diplomacy mod is a culprit either, but it might be. Anyway, when I get home tonight I will supply my mod list (it is quite long). [I am setting up for a new major play through, which I plan to start tonight]. What I did see and was hard to capture was wisps attacking other wisps! I think that is the Rampant AI mod, but not sure. It seems they are placed on different factions, which is why I also think it could be the Diplomacy mod. I only have Diplomacy due to using it on a private MP server with friends.

Now, after the settings, I played on some maps I created to "start" new games and see what the mod's settings can change. It is so nice to see wisps turn aggressive on their own and attack. Early game, they are tough. What makes my early game hard as well is the More Science Packs - 30 mod, which can really draw out the early game. I am also using the Day Night Extender mod, playing games where the days are 8x longer, so night is nearly 25 - 30 minutes long! These very long nights make for some spectacular sights of wisps, especially in the heavy forests. The new settings are great, keep up the good work!
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

RocketManChronicles wrote: I think the culprit is Rampant AI mod. I get an announcement that a wisp faction is attacking
Yeah, that mod seem to add a bunch of factions and might be then managing all non-player ones equally, esp. since it seem to clearly announce that it does.

As also mentioned under "Technical Details" spoiler-block in the first post of this thread, there are two wisp forces (how "faction" things are called in factorio api) - "wisp" and "wisp_attack".
"wisp" one is intended to always be neutral to player, and when wisps are supposed to become aggressive, mod just switches intividual units into "wisp_attack" force (which is always hostile), and back if/when they should be pacified.

So Rampant making "wisp" force hostile should make every single one on the map aggressive, which I imagine can indeed be somewhat challenging.
Also note that mod "no retaliation" settings shouldn't help with this, as it only affects how wisps switch between aforementioned forces, and if both are set as hostile anyway, they won't have much effect.
Two ways to have less hostile things on the map then would be to either lower wisp spawn chances or lower general aggression via Rampant mod opts (so it won't turn that whole force hostile as often).

Will-of-the-wisps mod also makes wisps in "wisp_attack" force (if any) form groups and go on a rampage, which shouldn't happen with "wisp" force, even when turned hostile by another mod, but they can still wander and attack on their own as per default game ai logic.
RocketManChronicles wrote: don't know if the Diplomacy mod is a culprit either, but it might be.
Description of that mod is a bit hard to understand for me, but from "If you damage to the entity.max_health >= settings.[...].value, another force become enemy with low probability" line, it does sound like that it can also make whole force hostile permanently in case of any kind of accident.

Though if either one becomes a problem, you can probably ask mod authors or patch them to ignore those two wisp forces (alternatively - implement a way for other mods to tell them to ignore their forces), or disable/remove them of course, if that's an option.
Rampart mod seem to have an inter-mod api to control it from other mods, but no way there to tell it to ignore specific force (or any force-related commands at all, alas).
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

mk-fg wrote:
RocketManChronicles wrote: I think the culprit is Rampant AI mod. I get an announcement that a wisp faction is attacking
Yeah, that mod seem to add a bunch of factions and might be then managing all non-player ones equally, esp. since it seem to clearly announce that it does.

As also mentioned under "Technical Details" spoiler-block in the first post of this thread, there are two wisp forces (how "faction" things are called in factorio api) - "wisp" and "wisp_attack".
"wisp" one is intended to always be neutral to player, and when wisps are supposed to become aggressive, mod just switches intividual units into "wisp_attack" force (which is always hostile), and back if/when they should be pacified.

So Rampant making "wisp" force hostile should make every single one on the map aggressive, which I imagine can indeed be somewhat challenging.
Also note that mod "no retaliation" settings shouldn't help with this, as it only affects how wisps switch between aforementioned forces, and if both are set as hostile anyway, they won't have much effect.
Two ways to have less hostile things on the map then would be to either lower wisp spawn chances or lower general aggression via Rampant mod opts (so it won't turn that whole force hostile as often).

Will-of-the-wisps mod also makes wisps in "wisp_attack" force (if any) form groups and go on a rampage, which shouldn't happen with "wisp" force, even when turned hostile by another mod, but they can still wander and attack on their own as per default game ai logic.
Based on the messages Rampant AI mod announces, only the wisp_attack is noted as being hostile. So, my thought process is that the Rampant AI mod notes the aggressive wisps moving in to attack and if the number is large enough, let's me know. This is probably when the red wisps grow in number to a size the mod recognizes as an attack force, or in its terms, a Raid Attack. Quite interesting. When I get this message, I have already lost turrets in an area to red wisps, and they are large in number. The last play around in experimenting, I had that message hit when three turrets filled with yellow ammo were overrun by about 30 red wisps. I was able to poke at them one-by-one with my sub machine gun and yellow ammo, but it took a lot of time retreating and firing, isolating one from the "herd." I am not about less hostile things yet... I welcome having to fortify my position early, makes the early game both fun and nerve-wracking, lol. Not only do I have biters moving in from Rampant, but wisps too!
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

RocketManChronicles wrote:Based on the messages Rampant AI mod announces, only the wisp_attack is noted as being hostile.
Ah, fair enough, guess it respects force settings then and should be perfectly compatible, which is probably also why there shouldn't be a need for any force-related compat options in its API.
And indeed, announcing such attacks sounds like a nice feature.
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

mk-fg wrote:Ah, fair enough, guess it respects force settings then and should be perfectly compatible, which is probably also why there shouldn't be a need for any force-related compat options in its API.
And indeed, announcing such attacks sounds like a nice feature.
Yeah, the neutral ones have remained neutral so far.
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

Alright, I have been able to play a heavilty modded game and managed to survive the "Red Wisp Apocalypse" long enough to be able to defend against them, lol (I have not died yet). I gotta admit, this mod really adds something special to the game; I will explain below. But thank you for keeping the mod alive from its previous owner! Now, to the fun stuff!

Ok, so I figured this out as I have been able to watch what happens. The very early game is matter of pure survival. You gotta make it through a few nights and tech up before being overrun. I have the setting for wisps turning aggressive set to 0.5, so 50% of the time the check is made, they can turn aggressive. I see plenty of yellow wisps making attack "waves" of 2 - 3 wisps. And with yellow early game ammo, three will nearly kill you. It is not bad, just requires backing away and firing outside their range. But before you can have turrets, they will catch you by surprise!

Here are yellow ones moving in to attack from the west:
Image


And if you manage to defeat a wave, the purple ones resulting are a great aspect of the wisps. Here is a small wave of 3 Red Wisps that resulted in nearly two dozen Purple Wisps even with Piercing Ammo in Turrets. These are wandering into my base behind the turrets:
Image


And now if the attack wave is crazy, you get this as a result (again, this different wave started with 3 Red Wisps):
Image

What is great about all of this is that the Diplomacy mod treats all of the factions as their own teams. So the "Enemy" team (being the biters) will declare war on the wisps. And I finally saw how this happened. It starts with the fact that the biters attack rocks and trees if they are in the way. Well, if it is night time, a wisp will spawn and actually attack the biters that spawned it. The Diplomacy mod then broadcasts "Team Enemy has changed their stance towards team Wisp to Enemy." So, now the biters will attack any neutral Wisp (Yellow, Red, and Green) floating near them. Then immediately, with the Wisps now being in the Wisp_Attack team, they attack the biters in response. And now the Diplomacy mod broadcasts "Team Enemy has changed their stance towards team Wisp_Attack to Enemy." Now the biters will attack all wisps within range. I managed to capture a view of biters and Yellow Wisps fighting near my base:
Image

From all of this I can conclude that what starts the "Red Wisp Apocalypse" is biters destroying rocks, a red wisp spawns, and in the ensuing battle, the biters' physical damage allows teh Red Wisps to multiply until the Red Wisps over power the biters. Then the cloud of Red Wisps will head to my base... It's almost like having a third "team" in the world, but it is 2 vs 1. Which is ok! I am completely entertained by this. And now that I can survive a sea of Red Wisps, I do not have to worry too much about them. The Will-o'-the-Wisps mod is great for early game challenges. I look forward to seeing many purple Wisps at night roaming through the forests.
My Mod List
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

Feel like it's more credit to a fun combination of mods you've discovered than design of this one, as all these faction dynamics weren't supposed to be there :)

Added Diplomacy and Rampant to the mod suggestions list on the mod page with a link to that story post.
Seem to be a good mode for those who want more than a chill city-builder out of their factorio.
Thanks for sharing it.

Adding an option to make will-o-wisp forces to fight biters sounds like a good idea too.
Though probably either with a description comment about "Red Tide" danger or some mechanic to maybe have red replicas die-off quickly, be more limited or not trigger around biters.
RocketManChronicles
Filter Inserter
Filter Inserter
Posts: 362
Joined: Mon Aug 01, 2016 2:38 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by RocketManChronicles »

mk-fg wrote:Adding an option to make will-o-wisp forces to fight biters sounds like a good idea too.
Though probably either with a description comment about "Red Tide" danger or some mechanic to maybe have red replicas die-off quickly, be more limited or not trigger around biters.
"Red Tide" is a great title for that phenominon! There is nothing like seeing a sea of Red Wisps bearing down on you; especially when you weren't the cause! It spells the end of days before you can really handle them. Maybe one day soon I can capture a shot of it occurring and share. Thanks for the shout out!
Bloodymight
Inserter
Inserter
Posts: 20
Joined: Sun Nov 04, 2018 4:21 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by Bloodymight »

Hi I really like this mod but my game keeps crashing to main menu with this error

"Error while running event Will-o-the-Wisps_updated::on_tick (ID 0)
__Will-o-the-Wisps_updated__/libs/zones.lua:143: attempt to index local 'chunk' (a nil value)"
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

Thanks for reporting, I'll look into it.
Forest-picking logic with cache in that place had a problem or two already.
Bloodymight
Inserter
Inserter
Posts: 20
Joined: Sun Nov 04, 2018 4:21 pm
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by Bloodymight »

thx for responding.

I can give you save & mod list if needed.

But there are like >80 mods I'm using....

I stopped getting those errors after I removed and added your wisp mod, currently 6 hours in without any problems.

I'll report if something like that happens again
mk-fg
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Wed May 30, 2018 11:01 am
Contact:

Re: [MOD 0.16.x] Will-o'-the-Wisps updated

Post by mk-fg »

Issue seem to be that "ChunkMap[forest.chunk_key]" lookup returns nil, while (a) forest.chunk_key can only be derived from ChunkMap, and (b) nothing is removed from ChunkMap, only added (as new sectors get scanned), so this lookup should never fail.
But (b) is not actually true, as zones.refresh_chunks() can cleanup ChunkMap (only place in code where something is removed from there) if it sees that on mod updates surface.get_chunks() (essentially map layout) got changed.
And it foesn't discard forest info, which it totally should when map suddenly changes, so pretty sure that's the issue here.

If you still have the save that was latest before the crash and mod-reinstall, maybe you can run a console command to confirm it?

I've attached to this post a version of the mod which has one extra "/wisp zone export" command and json lib included.
Install that version of the mod instead of the one you have, load that save and run the command.
It should create "script-output/wisps" directory under your user data directory ("script-output" there is next to "saves" and "mods" dirs, click wiki link for exact locations).
There will be four .json files with contents of ChunkList, ChunkMap, ChunkSpreadQueue, ForestSet mod globals, which are just a bunch of map coordinates and flags for trees/pollution in these.
Maybe zip or attach these to forum reply here or put up via link somewhere where I can grab them, to check that it's indeed the issue that I suspect.

If you don't have that save anymore or it's just hard to do what I described above for whatever reason - no worries, though maybe drop a message anyway, so I can go ahead and fix what I think is the issue.
Attachments
Will-o-the-Wisps_updated_0.0.52-debug.zip
(1003.32 KiB) Downloaded 122 times
Post Reply

Return to “Mods”