Page 1 of 1

idea for possible improvement to pathfinding destroying ups on deathworlds

Posted: Wed Mar 13, 2019 12:04 pm
by Divran
Hi

I'm playing on a deathworld. Here is a picture so you get a sense of just how many enemies there are.
https://cdn.discordapp.com/attachments/ ... nknown.png

The problem is, I'm unable to fire my artilleries at their max range, because firing that far behind enemy lines causes the enemies to attempt to pathfind to me indefinitely, which lowers my UPS from 60 to unplayable levels.
The main issue is that enemy pathfinding gets blocked so far behind enemy lines that they can just never finish calculating. Or at least, it will take a very, very long time.

I had an idea which might solve this issue.

The idea is:
1. When an enemy fails to pathfind to your base for X amount of time, due to being blocked by other enemy bases, it will "pass on its agression" to any random enemy of the same size & type as itself, which happens to be standing within a cone facing the direction of your base.
2. The current enemy becomes passive (loses its agression) and stops pathfinding, and the new enemy will pick up where it left off and try again.
2b. Optionally reduce the amount of time before giving up so that it tries for shorter and shorter intervals each time.
3. Repeat until the "wave" of agression enters the border between the enemy lands and your cleared artillery lands. They are now free to pathfind to your base.

Side note: It would probably be possible to fine-tune the time before "giving up" and passing the agression along, such that the "wave" of agression takes the same amount of time to reach you, as an enemy would if it ran that whole distance in a straight line. That said, it might be better to make it faster, so that the massive UPS drops can clear up quicker.

Thanks.

Re: idea for possible improvement to pathfinding destroying ups on deathworlds

Posted: Wed Mar 13, 2019 12:39 pm
by leadraven
Another idea : let enemies walk over their buildings, at least where it isn't a big deal.

Re: idea for possible improvement to pathfinding destroying ups on deathworlds

Posted: Wed Mar 13, 2019 2:22 pm
by Pin-Lui
Another idea : Trigger the biter attack nearest to the Artillery, not where it hits.

Re: idea for possible improvement to pathfinding destroying ups on deathworlds

Posted: Thu Mar 14, 2019 2:30 am
by Tekky
Divran wrote: Wed Mar 13, 2019 12:04 pm The problem is, I'm unable to fire my artilleries at their max range, because firing that far behind enemy lines causes the enemies to attempt to pathfind to me indefinitely, which lowers my UPS from 60 to unplayable levels.
In this thread, one of the Factorio programmers asked for savegames to be posted that have specific or extreme performance issues. Therefore, I suggest that you post your savegame in that thread.

The Factorio programmers have better possibilities to diagnose performance issues, since they can profile the source code with your savegame loaded.

Re: idea for possible improvement to pathfinding destroying ups on deathworlds

Posted: Thu Mar 14, 2019 8:26 am
by Divran
Tekky wrote: Thu Mar 14, 2019 2:30 am
Divran wrote: Wed Mar 13, 2019 12:04 pm The problem is, I'm unable to fire my artilleries at their max range, because firing that far behind enemy lines causes the enemies to attempt to pathfind to me indefinitely, which lowers my UPS from 60 to unplayable levels.
In this thread, one of the Factorio programmers asked for savegames to be posted that have specific or extreme performance issues. Therefore, I suggest that you post your savegame in that thread.

The Factorio programmers have better possibilities to diagnose performance issues, since they can profile the source code with your savegame loaded.
Sure I can do that as soon as I get home, but it shouldn't be necessary since this is a very simple issue to reproduce.

If you create a new game with enemy frequency and size maxed out (and spawn area radius minimized so that more enemies are nearby) and then immediately just spawn in a bunch of artilleries and fire them at the max radius in a circle it should start lagging as soon as the shots hit. I haven't tested this but it should behave the same way.