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 upVehicles now spawn in more interesting ways. #2889
Conversation
kevingranade
reviewed
Sep 7, 2013
| } else if(move_cost(px, py) == 0) { | ||
|
|
||
| //There's an obstacle here; destroy the surroundings with a small explosion... | ||
| g->explosion(px, py, 20, 0, false); |
This comment has been minimized.
This comment has been minimized.
kevingranade
Sep 7, 2013
Member
Two problems, the explosion causes noise (sometimes deafening the player, despite the distance), and causes a delay due to the animation. Actually considering how common it is, I think smash() might be triggering an explosion.
This comment has been minimized.
This comment has been minimized.
ianestrachan
Sep 7, 2013
Author
Contributor
Well, explosion() mostly goes around calling bash() on the terrain; would doing that directly be a better solution?
EDIT: Actually, even better, calling map.destroy(x, y) directly would ensure the wall is demolished.
kevingranade
reviewed
Sep 7, 2013
| //There's a vehicle here; smash them both up lots to look like a collision | ||
| other_veh->smash(); | ||
| veh->smash(); | ||
| smashed = true; |
This comment has been minimized.
This comment has been minimized.
kevingranade
Sep 7, 2013
Member
This still leaves overlapping vehicles, which the system doesn't handle gracefully. Ideally it would fully remove components until none overlap.
This comment has been minimized.
This comment has been minimized.
ianestrachan
Sep 7, 2013
Author
Contributor
Removing components from the car being placed would work, but might result in oddly-shaped, rules-violating holes in the vehicle blueprints.
Other possible alternatives:
- Adjust the vehicle positions so they are next to each other without overlapping
- Fuse the two vehicles into a single vehicle and rename it "Car wreck" or similar
This comment has been minimized.
This comment has been minimized.
kevingranade
Sep 7, 2013
Member
I'm worried about secondary collisions for option 1.
I LOVE option 2.
This comment has been minimized.
This comment has been minimized.
|
Support "car wreck". |
This comment has been minimized.
This comment has been minimized.
|
Still working on it. Trying to convert from local to global to local coordinates and something is getting a bit messed up along the way. Other than that, fusing two cars together works, so this should be done soon. I've tagged this PR with [WIP] for now. |
ianestrachan
added some commits
Sep 8, 2013
This comment has been minimized.
This comment has been minimized.
|
More or less good to go, though there are some problems I ran into that are separate issues:
|
This comment has been minimized.
This comment has been minimized.
|
Fun fact: The vehicle merging can apply multiple times successfully. I had a test world generate a four-car pileup. |
This comment has been minimized.
This comment has been minimized.
|
Sounds good. |
ianestrachan commentedSep 7, 2013
A number of fixes/improvements to how vehicles are spawned:
For maximum amusement, someone should follow this up with a PR to make vehicles occasionally spawn along the walls of House squares, making it look like someone swerved into a wall.
EDIT: Whoops, I accidentally included a fix identical to #2867 that I put in while debugging. Fortunately since it's the exact same fix, it shouldn't cause any conflicts.