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

AIPlus feature - sailor needs to hold the flag where a serf is dropped off #46

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

I have a stub but this is not implemented yet. When dropping a serf off, the serf doesn't actually become active on the map until the sailor is one tile away from the flag (because they cannot both occupy the same pos). The flag needs to be "held" for that serf so other serfs cannot entire the flag tile, or an exception will be thrown.

tlongstretch commented 3 years ago

There's a few ways to handle this. The approach I am trying now is to create a new Flag bool 'boat_passenger_being_dropped' and have any serf about to enter that tile wait if that flag is true. However, I am realizing this forces me to add code for every single serf state.

Other ways:

tlongstretch commented 3 years ago

ahhh... I didn't need any of that stuff at all. I am now having the sailor's position immediately taken by the dropped off passenger serf rather than doing the one-tile-away method. This looks much smoother too as the dropped serf starts working immediately instead of being frozen at the flag until the sailor reaches one tile away.

tlongstretch commented 3 years ago

need to remove that "hold flag" code, test it a bit more, then this can be closed

tlongstretch commented 3 years ago

works great