Since the title may be doing a bad job at explaining the issue, an example first:
Suppose you have two entities with big collision boxes (that really just makes it easier to test...) that are close together, like solar panels (see picture below). Now, let the player run to the top left starting somewhere in the refined concrete tile.
In my eyes, the expected behaviour would be:
the player runs to the top left, until they touch the right solar panel. at which point their speed in the y-direction will be capped to 0, and they will continue running to the left until they touch the left solar panel, and then perfectly stand still in the corner.
Actual behavior:
when walking to the top left, the player stops walking north about 0.035 tiles too early, not yet touching the solar panels. sometimes it even goes as far as 0.1 tiles too early. when continuing to walk to the left, the player will again stop a fraction of a tile before actually colliding with the collision box of the left solar panel, in my testing typically around 0.04 tiles too early. If one then stops walking entirely, then walks straight to the left and straight up, you will end up perfectly in the corner of the solar panels.
Why this is even important:
this kind of behavior occurs with a lot of entities, including trying to walk between machines when spidertron legs are in between those machines. when you wiggle the character around enough, you do often manage to squeeze through, but when just continuously running in one diagonal direction, it can often be hard getting through there.
One other example would be fluid tanks, in between which the character can normally barely squeeze. when walking diagonally at them however, you can get stuck, making it unnecessarily hard to try and walk through them. (this can be easily seen by just replacing the solar panels in the test setup by fluid tanks.) (I would expect the character to be able to continuously walk diagonally to the top left and manage to run in between the two tanks that way.)
To reproduce:
- Enable the debug menu option "show-collision-rectangles", and, to make it easier to see, the allow-increased-zoom one as well.
- Generate a new world and
- Replicate the testsetup with two solar panels or two storage tanks as per the image
- then walk diagonally at the right one.
- sometimes you might have to try more than once, starting from slightly different positions, but it has been quite reproducible for me overall.
[1.1.104] a player moving diagonally along a collision box won't contact perpendicular collision boxes
-
- Burner Inserter
- Posts: 8
- Joined: Sun Jul 30, 2023 7:32 am
- Contact:
[1.1.104] a player moving diagonally along a collision box won't contact perpendicular collision boxes
- Attachments
-
- collision_box_error.png (309.59 KiB) Viewed 1436 times
Re: [1.1.104] a player moving diagonally along a collision box won't contact perpendicular collision boxes
Thanks for the report,
We have improved the character movement and the 'corner sliding logic' for 2.0,
So for now I will move this to resolved, if it is still frustrating and annoying in 2.0 then please make a new bug report (and link this one)
We have improved the character movement and the 'corner sliding logic' for 2.0,
So for now I will move this to resolved, if it is still frustrating and annoying in 2.0 then please make a new bug report (and link this one)
-
- Burner Inserter
- Posts: 8
- Joined: Sun Jul 30, 2023 7:32 am
- Contact:
Re: [1.1.104] a player moving diagonally along a collision box won't contact perpendicular collision boxes
Thanks, I will be sure to test it out specifically on 2.0 then