Opened 7 years ago
Closed 6 years ago
#4338 closed defect (fixed)
Large and small stone colliding (SimpleGroup SimpleObject avoidSelf check broken)
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 23 |
Component: | Maps | Keywords: | |
Cc: | Patch: |
Description (last modified by )
Attachments (2)
Change History (11)
by , 7 years ago
Attachment: | replay.txt added |
---|
by , 7 years ago
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Description: | modified (diff) |
---|
comment:3 by , 7 years ago
Thanks for finding that bug!
Fixing rmgen bugs implies different map generations, so all maps would look different if it were fixed (see #4294).
However in this case it might not be as drastic, since it only influences the location within a single group (I hope).
Also if I recall correctly there is some patch at phabricator that addresses the reported issue for one map.
comment:4 by , 7 years ago
Keywords: | simple removed |
---|
Someone was working on this already and came to exactly the same conclusions as you Phab:D189. Well investigated!
comment:5 by , 7 years ago
Summary: | Large and small stone colliding → Large and small stone colliding (SimpleGroup SimpleObject avoidSelf check broken) |
---|
comment:7 by , 6 years ago
Milestone: | Backlog → Alpha 23 |
---|
Only 5 lines copy & paste & modify from Phab:D189 missing.
comment:8 by , 6 years ago
I suspect this is also the cause for nomad units that are spawned at the map border sometimes not being complete. This must be fixed for the release.
There's a big bug in placer.js. It stores the previous coordinates like this:
In entity.js these are converted to meters rather than tiles:
But then in player.js when testing for avoidSelf it mixes the two instead of dividing the position by CELL_SIZE:
So, for example:
The avoidSelf check literally never fails.
So we see berry bushes overlapping even though they have an avoidSelf check. (There probably should be a max radius involved here instead of always checking < 1 tile.)
For big and small stones, each SimpleObject in the SimpleGroup is checked against itself rather than also against previous things, so even if the avoidSelf check had been working we would still have this problem. And again, even if that too had been working it only checks within one tile, and large stones have a 20m = 5 tile diameter and small stones a 10m = 2.5 tile diameter, so they could still overlap. (Their obstructions are squares with sides 13m and 7m.)
This stuff needs a little help. :)