#3410 closed defect (fixed)
[PATCH] Units can go through obstructions
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Release Blocker | Milestone: | Alpha 19 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
There are several ways in which units can go into obstructions:
- Move a single unit into the building (second gif is #3532, first gif might be different):
- Units in formation standing at opposite sides of an obstruction and moving somewhere:
- Construct a building and move into it when the construction starts:
Reproduce construction bug:
- place a barracks foundation with a man, move him away before he begins to build.
- move a woman onto the foundation (by clicking behind foundation and stopping her midway)
- let that guy build
- order the woman to build. she will leave the foundation, move her back in immediately and stop
Entity IDs in the replay file:
- woman 7452
- guy 7456
- barracks 7501
Attachments (21)
Change History (49)
by , 9 years ago
Attachment: | commands.txt added |
---|
comment:3 by , 9 years ago
Milestone: | Backlog → Alpha 19 |
---|---|
Owner: | set to |
Priority: | If Time Permits → Must Have |
comment:4 by , 9 years ago
I noticed units being inside buildings as well, but for me it happened differently. It happened when I launched an attack on an enemy and ordered my units to move somewhere while they were touching a building. Some of them ended up just passing through the building. You can reproduce this by having about a hundred units (the bug is more likely to happen / easier to reproduce the more units you have) and ordering them to move to a building so they surround it. Then repeatedly give the order to move somewhere else in a random pattern like click south of the building, click west, click north. Don't click too fast, wait so the units get to move a small bit (100 units tend to create some lag, thus spamming the move order ends up in the units not moving at all).
by , 9 years ago
Attachment: | commands.2.txt added |
---|
As asked, here is the commands.txt of a match where the bug is reproduced. The Map is Siwa Oasis.
comment:5 by , 9 years ago
Thanks to Evulant's (AlThePhoenix) research, I could reproduce this error with a single unit and only move-commands too. Indeed the common denominator seems to be
ordered my units to move somewhere while they were touching a building
The file above uses r17014.
by , 9 years ago
Attachment: | commands.3.txt added |
---|
r17019, a cavalry of player 1 runs to player 2 and then forces its way into the CC.
comment:8 by , 9 years ago
Priority: | Must Have → Release Blocker |
---|
Release blocker since it happens very frequently. Notice that also ships can move on land now.
Should be caused by r16998:
With this change, units will not check their movement against all obstructions when moving
Another way to reproduce using formations (which were reenabled in r17028):
- Select some units and disable formation
- Move units behind a resource (metal/stone)
- When close to the resource, enable a formation
- Press H for stop
-> units will stop inside the resource
Same can be used to climb impassable mountains.
by , 9 years ago
Attachment: | commands_r16998.txt added |
---|
A replay for r16998 where the bug occurs (uses the same method as in commands.3.txt, where you repeatedly tell a cavalry to move inside (beyond) the athen CC).
by , 9 years ago
Attachment: | commands_r17078_cav_in_athen_cc_bottomright.txt added |
---|
Same mechanism as above, repeatedly try to enter an athen CC with a cavalry and eventually make it. Unit got in at the bottom right corner of the cc.
by , 9 years ago
Attachment: | commands_r17078_cav_in_athen_cc_topleft.txt added |
---|
Same as above, but unit made it into the CC from the topleft corner.
comment:9 by , 9 years ago
Another reliable way to reproduce it is to create a ton of units simultaneously at the CC and then issue a move command. By trying to get into formation they will pass through the CC. Start with deathmatch resources, use the cheats "the hive master" and "i am too busy".
comment:10 by , 9 years ago
I saw that, with a fortress but I can search the command was the last week.
comment:11 by , 9 years ago
I have a fix idea I'm currently working on, but I'm not sure I can finish it this weekend. I don't think I have any time to spend on programming the upcoming week so if I'm not quick enough that will have to wait for the next weekend.
Just to keep you updated. Sorry for possibly delaying the release with that.
by , 9 years ago
Attachment: | commands_r17084_cav_inside_athen_cc.txt added |
---|
Again it was a corner of the CC that gave way and happened immediately after the cav went around the corner.
comment:13 by , 9 years ago
The easiest way to reproduce is by walking through berries. Works everytime.
comment:14 by , 9 years ago
Component: | UI & Simulation → Core engine |
---|---|
Keywords: | patch review added |
Summary: | Have a unit stand inside a structure → [PATCH] Units can go through obstructions |
Ok, I did my homework.
The problem we're facing is this one: if a navcell is partially obstructed, it is considered as passable. However, the long-range pathfinder doesn't know about obstructions, it just works with passability. So when creating a path, it computes a list of navcells, then it converts them to real-world coordinates using the center of these navcells. And, of course, the center might be inside an obstruction. Once inside, the short pathfinder won't detect the collision with the obstruction's edge and might lead the unit further inside the obstruction, and at some point the unit will be on an impassable navcell and the long-range pathfinder will allow it to leave the obstructed zone by going through the obstruction.
So the fix is the following: the long-range pathfinder has to know about corners.
This is a big change for a FF. I don't like having that in that late, but well. Attached patch only adds all the corner stuff without using it. So it shouldn't influence the simulation state. If it does, I screwed up somewhere.
When we're sure the patch doesn't change anything, I will only have to make the code use the new system to (hopefully) fix the problem.
by , 9 years ago
Attachment: | corners.patch added |
---|
comment:15 by , 9 years ago
The patch above doesn't seem to change the sim state, so that's good. Here is the complete patch using that new code. Unfortunately, it doesn't fix the reported problem, so I'm puzzled.
by , 9 years ago
Attachment: | corners-complete.patch added |
---|
comment:16 by , 9 years ago
Passing through berries is a feature that has been implemented 5 years ago, see: http://trac.wildfiregames.com/changeset/8899/ps/trunk/binaries/data/mods/public/simulation/templates/template_gaia_flora_bush.xml
comment:17 by , 9 years ago
Owner: | removed |
---|
I won't have time for programming anymore during the upcoming months.
by , 9 years ago
Attachment: | corners-complete_v2.patch added |
---|
Rebased. Diff the patches too see that they are identical, except to the function that was removed in r17103.
comment:18 by , 9 years ago
Keywords: | review removed |
---|
Replay attachment:commands_r17084_cav_inside_athen_cc.txt with that patch to see that it is not sufficient.
by , 9 years ago
Attachment: | commands_patched_r17108_cav_inside_athen_cc.txt added |
---|
Here a replay that was created with that patch applied. Just to be sure.
by , 9 years ago
Attachment: | cav_inside_athen_cc.gif added |
---|
by , 9 years ago
Attachment: | units_in_formation_through_cc.gif added |
---|
by , 9 years ago
Attachment: | construct_bug.gif added |
---|
by , 9 years ago
comment:19 by , 9 years ago
Description: | modified (diff) |
---|
by , 9 years ago
Attachment: | commands.4.txt added |
---|
Replay for r17126. (cav inside CC and units in formation through CC)
by , 9 years ago
Attachment: | cav_inside_athen_cc.2.gif added |
---|
Visualization of attachment:commands.4.txt
by , 9 years ago
Attachment: | commands.5.txt added |
---|
Also for r17126. Cavalry inside CC. Slightly different from the other cases as it doesn't seem to have to do with the corner.
by , 9 years ago
Attachment: | cav_inside_athen_cc3.gif added |
---|
Visualization of attachment:commands.5.txt
comment:20 by , 9 years ago
Description: | modified (diff) |
---|
comment:21 by , 9 years ago
Replacing line 802 of CcmpPathfinder.cpp
if (!cmpObstructionManager || cmpObstructionManager->TestLine(filter, x0, z0, x1, z1, r))
by
if (!cmpObstructionManager || !cmpObstructionManager->TestLine(filter, x0, z0, x1, z1, r))
I cannot get the cavalry into the Civil Centre. Formations on the other side totally ignore the building.
EDIT 1 : Doesn't work so I was trying some other things and came across this removed line in r16998
m_ShortPath.m_Waypoints.clear();
adding it back seems to remove issues when units are not using formations.
comment:22 by , 9 years ago
Description: | modified (diff) |
---|
by , 9 years ago
Attachment: | units_in_formation_in_cc.gif added |
---|
Two units are sufficient to enter buildings in formation. They only must be standing at opposite sites. Maybe those formation issues are related to the clearance being 4.
comment:23 by , 9 years ago
Description: | modified (diff) |
---|
comment:24 by , 9 years ago
Description: | modified (diff) |
---|
comment:25 by , 8 years ago
wraitii's patch (reverting r16998) affects the behavior of the bugs:
- #3532: fixed
- #3450: tested once, seems fixed
- #3538: partial fix:
- prevents the ship from entering the dock / terrain
- still OOS, since the hierarchical pathfinder induces a different longpath for the rejoined client
- (goal is still inside the building, since according to the hierarchical pathfinder it's passable for the host)
- #3410: patial fix:
- fixed with regards to units not actually getting inside
- however the units will become stuck by trying to get into the CC without stopping.
- #3471/#3505: probably not fixed
- #3559: not fixed
comment:26 by , 8 years ago
Keywords: | patch removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I am marking this ticket as fixed and suggest reopening a new ticket for the formation behavior, but that one is definitely not any higher priority than "should have".
All other behaviors are either fixed or documented elsewhere.
Thanks again Elexis for the magnificent debugging job on this issue.
comment:27 by , 4 years ago
Description: | modified (diff) |
---|
Almost a minimum set of instructions for r17003, no AI, no random map.