Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAngled vehicles develop holes [$15] #5684
Comments
This comment has been minimized.
This comment has been minimized.
|
Probably would require a bit of an update with pathing where squares could be flagged as "diagonally impassable", which would mean if two diagonally impassable squares are diagonal to each other you can't cross between them diagonally. |
This comment has been minimized.
This comment has been minimized.
|
So long as it only applies to vehicles, I'd imagine. |
illi-kun
referenced this issue
Aug 29, 2014
Closed
Zombies pass through moving, turning vehicle unhurt #8700
This comment has been minimized.
This comment has been minimized.
|
Any chance of getting a fix? |
This comment has been minimized.
This comment has been minimized.
tyrael93
commented
Aug 30, 2014
|
This issue was opened seven months ago and never resolved. |
This comment has been minimized.
This comment has been minimized.
|
Spewing bile is more likely to slow dev work, since I don't think we code with 3-4 environmental resistance on our eyes. Don't be a boomer! |
This comment has been minimized.
This comment has been minimized.
tyrael93
commented
Aug 30, 2014
|
I'm sorry, I didn't know stating plain facts was a hate crime. My deepest apologies. |
This comment has been minimized.
This comment has been minimized.
|
It'll probably be folded in with a bigger vehicle update once that sort of thing rolls around. I think dev is mostly on some other polish right now, and I think the z-level bounties which are a tough target. But let's just hold out for the moment; even when I put it up it was just to put down the issue for being logged. |
OzoneH3
changed the title
Angled vehicles develop holes
Angled vehicles develop holes 5$ Bounty
Dec 3, 2015
OzoneH3
added
the
Organization: Bounty
label
Dec 3, 2015
illi-kun
added
the
Vehicles
label
Nov 10, 2016
Cyrano7
removed
the
Organization: Bounty
label
Jul 2, 2017
Cyrano7
changed the title
Angled vehicles develop holes 5$ Bounty
Angled vehicles develop holes
Jul 2, 2017
Cyrano7
added
the
Organization: Bounty
label
Jul 27, 2017
Cyrano7
changed the title
Angled vehicles develop holes
Angled vehicles develop holes [$15]
Jul 27, 2017
mlangsdorf
added this to To do
in Extended Vehicle Tune-Up
Sep 4, 2018
This comment has been minimized.
This comment has been minimized.
|
Many years later and I have a proposal to fix it, but no time to implement it at the moment. Any time a vehicle is skewed, add a "clone" of the shifted part that covers the gap. Tiny ascii illustration:
Rotated to NE:
Rotated to NE, plus gap covers:
To make it even simpler, widen the vehicle in the two locations that this scheme avoids, it doesn't prevent problems, but it makes it consistent:
Additionally, when a vehicle is "partially skewed", you can either just block the gaps:
Or widen the whole vehicle:
This effectively makes the vehicle slightly thicker when skewed, which might cause some unexpected collisions, but that's a lot easier to cope with than the existing gaps. The tricky part is taking collisions to the "cloned" parts and allocating the impact correctly to the original part. |
This comment has been minimized.
This comment has been minimized.
A better solution would be to make it so that the gap covers count as one part, even though they appear as two when the vehicle is at an angle, meaning...
Instead of just basically doubling the amount of parts when the vehicle is at an angle...
They are counted as one part. So it appears that two parts are being damaged, even though it's really one part being damaged, and it would show up like that once the vehicle straightens out. I hope I didn't make this too complicated. But I also hope this issue doesn't become five years old, lol |
This comment has been minimized.
This comment has been minimized.
|
Alternative idea: An 8-direction bitfield on every tile, which remains zeroed for terrain, but for vehicles and their neighboring tiles is computed based on the traversability of the original, unrotated vehicle. If the appropriate bit is 0, any checks proceed as they usually would, but if it's 1, a more involved check can be performed to see what other tile the current algorithm(raycasting, movement, pathfinding) should be redirected to. It'd also work for non-boundary walls as well. I'm probably ignorant about how the current code looks, but my intuition says algorithms could probably be changed to use this bitfield, possibly replacing bool->bitfield for visibility also, thus leaving the standard checks( Would probably be a pretty involved change, though it could conceivably be futureproofed against if someone wants to do portals some distant baleful day. One way or the other. |
This comment has been minimized.
This comment has been minimized.
|
I honestly have no idea what that bitfield is supposed to do or how it's supposed to work. Can you explain with a concrete example? For instance: Currently, the NPC movement code checks to see that there are no obstacles between [ 5, 5 ] and [ 3, 3 ]. There aren't, so the NPC walks to [ 4, 4 ] and then [ 3, 3 ] and can take it. How are the bitfields changing this situation? |
This comment has been minimized.
This comment has been minimized.
|
@mlangsdorf Sorry, I guess I botched typing that. The idea is that instead of having a single boolean representing whether a tile is traversable, to have a field of 8 bits representing directional passability. For ordinary terrain, it would always be either With red/orange dots representing bits that are 1. If they're all 0 or 1, code can just treat them exactly as it currently does, alternatively it takes a slower path which checks the individual appropriate bit. E.g. still check obstacles, but situationally(vehicles), do a directional check instead since a boolean is insufficient to represent the fact that only some tile boundaries are impassable. |
This comment has been minimized.
This comment has been minimized.
|
Just to clarify, red dot means it's impassable? So most parts are impassable from all directions, and possible holes (orange) are impassable on diagonals? |
This comment has been minimized.
This comment has been minimized.
|
@Zireael07 Correct. This could hypothetically be used to avoid holes within the vehicle, as well as making diagonal passages impassable, or directionally passable tiles(turnstile). |
This comment has been minimized.
This comment has been minimized.
|
Thanks, I think that's a lot clearer. So the seat tile at mount [ 0, 0 ] has its bitfield set so that diagnol movement is impossible. NPC pathfinding algorithm sees that's impossible to move from [ 4, 4 ] to [ 3, 3 ] and proceeds to bash the windshield. Fair enough. I'll defer to Kevin as how hard it would be to get this to interact with the light, vision, and pathfinding code. |
This comment has been minimized.
This comment has been minimized.
|
The impact to the code would be VERY high, not only would everything that cares about opacity, damage application, navigation or movement have to be updated, but it changes the current "can I enter this square/can I see through this square" check to "can I enter square x from square y/can I see into square x from square y". From the point of view of addressing the diagonal gap issue, I much prefer the other solution, it's completely localized to the vehicle system instead of requiring updates throughout the rest of the code. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, it'd probably touch a lot of code. And you'd probably have to do two branches instead of one, one to cover Still, I wanted to pitch the idea mainly, since idk, creating faux parts strikes me as really inelegant. It does sound efficient and effective, but... well, there's a reason why I have difficulty managing coding nowadays. |
Epictyphlosion
referenced this issue
Feb 1, 2019
Closed
It's coming! (0.D coordination issue) (for real) DONE #27843
This comment has been minimized.
This comment has been minimized.
|
Asmageddon's solution sounds ideal to me, but the impact issue is important too. The bitfield can't be applied only to vehicle tiles? |
This comment has been minimized.
This comment has been minimized.
|
It's not whether it can be applied only to vehicle tiles or not, it's the other areas of the code that need to know about the bitfield. The nice thing about Kevin's hack is that it isolates all the changes to the vehicle code. |

Headjack commentedJan 23, 2014
While all this vehicle renaissance is going on, does it seem feasable to tackle that problem where cars at a 45-degree angle can be entered diagonally between otherwise solid parts? I think you know what I mean, how if two boards are adjacent vertically, at an angle you'll cross between them somehow. Ideally it would check the vehicle structure and make the space beyond functionally impassable/opaque from only that side. It'd probably be a tough fix, but it ought to happen at some point.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.