tlongstretch / freeserf-with-AI-plus

THIS PROJECT WAS MOVED TO 'Forkserf', GO THERE INSTEAD
https://github.com/forkserf/forkserf
GNU General Public License v3.0
1 stars 0 forks source link

AI & game logic - how to handle hordes of Lost serfs #72

Open tlongstretch opened 3 years ago

tlongstretch commented 3 years ago

When some buildings are destroyed (such as after losing a battle and territory), many serfs become Lost and wander around territory slowly trying to get back into the castle. Because they are constantly bumping into each other and other non-lost serfs doing their usual duties, it causes a crippling jam that can break the player's economy.

In addition, I noticed that the AI exacerbates this problem because the jam causes the "missing transporter on road" check to trigger and it sends many more serfs out because transporters haven't reached their roads in a reasonable amount of time.

Because generic transporter serfs are essentially infinite, they do not need to be conserved. I am thinking of modifying the core game so that generic serfs simply go to the nearest friendly building of any type and either are deleted entirely or teleported back to the castle.

Professional serfs would still have to walk back to the castle, we can't afford to lose them because they have valuable tools.

p1plp1 commented 2 years ago

how to handle horde of free walking serfs -when fortress is captured, etc. : free walk serf + test if 2 (3,4,5 -test experimentaly) fields is existing path connected to castle, if serf didnt find path in some time (5 or 10 min), just kill him from game.

tlongstretch commented 2 years ago

I ended up getting the code to work where transporter/generic serfs will enter to the nearest friendly building and basically die (because generic serfs are effectively unlimited, it doesn't matter much)