Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bashable terrain with FLAT flag always receives collision from vehicle frames #49346

Open
pjf opened this issue Jun 18, 2021 · 12 comments
Open
Labels
<Bug> This needs to be fixed Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions

Comments

@pjf
Copy link
Contributor

pjf commented Jun 18, 2021

Describe the bug

The farm_dairy and farm_dairy_2 maps have lines of t_splitrail_fencegate_c and t_gate_metal_c gates respectively at the end of roads, and sometimes even with vehicles spawning behind them. However these gates act as a line of individual gates, and do not allow vehicle access, even when all are open.

Steps To Reproduce

  1. Explore or debug until you find a farm_dairy or farm_dairy_2 map.
  2. Look at the gates that connect it to the road

Expected behavior

Vehicle-accessible sections of dairy farms have multi-tile gates with pully systems, so vehicles can pass.

Extra notes

Versions and configuration

  • Version: af4b28f (cdda-experimental-2021-06-17-2045)
@BrettDong BrettDong added <Bug> This needs to be fixed Map / Mapgen Overmap, Mapgen, Map extras, Map display Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Jun 18, 2021
@Maleclypse
Copy link
Member

Maleclypse commented Jun 18, 2021

#49153 fixed this but it may not be fixed if the new PR that adds another mirror to the cube van goes through.

Edit: They do allow vehicles to pass if they are all open and the line of them is wide enough to allow passage. I agree with you that it looks weird on tilesets though.

@Maleclypse Maleclypse added the SDL: Tiles / Sound Tiles visual interface and sounds. label Jun 18, 2021
@Maleclypse
Copy link
Member

I've added the Tiles label as I think this could be resolved by tileset makers creating a multitile option that shows them as one single gate.

@pjf
Copy link
Contributor Author

pjf commented Jun 18, 2021

Edit: They do allow vehicles to pass if they are all open and the line of them is wide enough to allow passage. I agree with you that it looks weird on tilesets though.

They do? Hmm, I wonder why I ended up hitting the gate. Do all connected gates need to be open, or just enough to allow passage?

I've added the Tiles label as I think this could be resolved by tileset makers creating a multitile option that shows them as one single gate.

Since gate tile has to be opened individually by hand, would it still look weird if some are open and some are not?

Many thanks!

@Maleclypse
Copy link
Member

Just enough to allow passage but the fix to make the gate wide enough for the cube van is literally days old so your game may not have it. Also I believe right after I increased the gate size someone increased the van size by adding a second mirror so there is literally only a few hours of build where you can get through the gate I'm betting.

@pjf
Copy link
Contributor Author

pjf commented Jun 27, 2021

As an update, I absolutely cannot figure out how the van is supposed to drive through the gate.

In this save the van (the mirrors on which I've removed) will impact with the gates, rather than drive through them.

@jtgibson01
Copy link

jtgibson01 commented Jun 30, 2021

I loaded your save in an older 0.E Experimental build from March (0.E-10003-g48f45e8) and, after getting through the massive slew of bugs from loading a newer save in an older version, it works fine to drive through the fence. So something may have changed in the vehicle code or vehicle frame JSON between March 10th and now that results in this problem.

[edit 1] I can confirm that, at least with this savefile, the latest experimental causes the van to crush every portion of the fence gate it overlaps as it drives through.

[edit 2] Strangely, 48666 and 48316 don't seem to touch any code even remotely close to that, and 49080 doesn't seem like it would have an effect either on a cursory review of the code.

49080 definitely seems like the most likely candidate for causing this, though, since it was literally about testing crushing fences with vehicles.

[edit 3] Cause is likely #49173 which added bash data to fence gates (impacts produce "wham" and "crack" sounds identical to the gate bash results), although why exactly the van is colliding with FLAT, TRANSPARENT map tiles is beyond me. It's possible the TRANSPARENT is identified as a window first and a flat surface second, and so results in a collision.

[edit 4] Confirmed that the experimental build immediately prior to #49173 (2021-06-04-0533) does not have any collision with the fence gate.

[edit 5] Aaaand confirmed that the TRANSPARENT flag isn't what does it, so it is indeed the addition of the bash data to the fence that causes a collision. Most likely the vehicle code is designed such that any bashable terrain tile receives automatic collision even when FLAT.

@jtgibson01
Copy link

Propose renaming this issue to "Bashable terrain with FLAT flag always receives collision from vehicle frames". That'll take a code level fix.

Hard to say whether #49173's added bash data should be reverted or whether the bug should be fixed, but this might be a blocker for 0.F. =)

@pjf
Copy link
Contributor Author

pjf commented Jun 30, 2021

@jtgibson01 : Oh my, this is some top-tier sleuthing! Renaming issue as proposed

@pjf pjf changed the title farm_dairy and farm_dairy_2 have vehicle gates that do not allow vehicles to pass Bashable terrain with FLAT flag always receives collision from vehicle frames Jun 30, 2021
@pjf
Copy link
Contributor Author

pjf commented Jun 30, 2021

@jtgibson01 : I can see that #49173 has added bash to both open and closed split-rail fences.

Having only closed split-rail fences bashable feels like a reasonable compromise if it works. That means one can still drive through an open gate, will still collide with a closed gate, and can still destroy gates as long as they're closed first.

@actual-nh actual-nh added Vehicles Vehicles, parts, mechanics & interactions and removed SDL: Tiles / Sound Tiles visual interface and sounds. labels Jul 1, 2021
@actual-nh
Copy link
Contributor

Ping: @Tairesh?

@Tairesh
Copy link
Contributor

Tairesh commented Jul 1, 2021

I made this gate bashable in #49173 because most of other doors are bashable even in open state. Didn't think about vehicles with more than 1 tile width. I sure if it's a blocker for 0.F it should be temporary removed, but I think there should be some changes in vehicle code, maybe new flag for these "wide" gates, making them just indestructible seems like temporary workaround to me.

@kevingranade
Copy link
Member

This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/split-rail-fence-gate-terrain-blocking-vehicles-on-dairy-farm-stable-0-f/26903/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

No branches or pull requests

7 participants