Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
477 stars 75 forks source link

Soldiers walk through other soldiers #84

Open Spikeone opened 9 years ago

Spikeone commented 9 years ago

Nach dem Angriff auf den Hafen, liefen die Soldaten zurück, während 2 direkt übereinander gelaufen sind, im originalen sind allerdings soldaten nie durch andere hindurch gelaufen. Zu sehen bei dem Angriff von weiß auf Blau

Spike (fvv1) wrote on 2010-09-11: #1 2010-09-11_15-23-35.rpl Edit (15.0 KiB, application/octet-stream)

https://bugs.launchpad.net/s25rttr/+bug/635753

YES, this bug IS still valid.

Flamefire commented 5 years ago

I don't think we have collision detection somewhere. Every figure just ignores other figures and situations like this are usually avoided by randomizing the walk direction.

Note that fixing this may significantly increase the time it takes for soldiers returning because the path back might be the same for all soldiers so they will queue up on a single point...

Spikeone commented 5 years ago

Well - it'd be quite simple (at least in my mind): If a soldiers moves to a node, that node is occupied. A node that is occupied can't be used by an other soldier for it's pathfinding. When a node is reached, path gets recalculated. That way it should work like it did in the original and would only take some more time.

EDIT: Shall I make a video so we could possibly analyze how it worked in the original?

Spikeone commented 5 years ago

image

Flamefire commented 5 years ago

Possible problem: Returning soldiers could block attacking soldiers leading to a deadlock. Solution: returning soldiers do not block

Spikeone commented 4 years ago

While playing around a bit - soldiers actually walked inside each other when changing occupation for a border group.