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

Boats not updating player position and leaving the player behind after collision with creatures in water #53072

Open
GoLoT opened this issue Nov 27, 2021 · 2 comments
Labels
<Bug> This needs to be fixed Monsters Monsters both friendly and unfriendly. (S2 - Confirmed) Bug that's been confirmed to exist Vehicles Vehicles, parts, mechanics & interactions

Comments

@GoLoT
Copy link
Contributor

GoLoT commented Nov 27, 2021

Describe the bug

Water vehicles sometimes don't update the player position, leaving the player behind and most likely resulting in death if they fall overboard. When this happens there is no feedback and it can't be prevented by seatbelts.

AFAICT, this is caused by the monsters not being pushed far enough from the boat when hit. If they are pushed to the same location the player should be after the boat moves, the player position isn't updated to prevent stacking multiple creatures on the same tile.

The code in

calc_ray_end( angle, 2, start_pos, end_pos );
deals with enemy collisions in water, pushing enemies 2 tiles away. For a motorboat (30mph max speed) this is not enough. Changing it to 3 tiles mitigates the issue (i.e. I can't reproduce the bug with a motorboat after the change) but it's a hacky solution that might not work for faster vehicles or for different vehicle layouts.

This block

complete = false;
can be changed to always move the passenger but it sometimes results in having 2 creatures in the same tile. Maybe a solution is to push the existing creature away in the same direction the vehicle is moving one tile at a time until a valid tile is found or find a valid position for the creature around the current tile, so the passenger can be placed where it should be.

Maybe someone with more knowledge of the vehicle code can find a proper solution.

Steps to reproduce

  1. Spawn a motor boat.
  2. Spawn a few enemies in the water (in a 10x10 area to help testing).
  3. "Drive" through the mass of enemies in circles until the character is left behind and falls into the water.

Expected behavior

Player isn't magically pulled from the seat when colliding with creatures in water.

Screenshots

No response

Versions and configuration

  • OS: Windows 11
  • Game Version: 688e5d1
  • Graphics version: Tiles
  • Ingame language: English
  • Mods loaded: [Disable NPC Needs, No Fungal Growth, Bionic Profession, Bionic Slots]

Additional context

No response

@wapcaplet wapcaplet added Monsters Monsters both friendly and unfriendly. Vehicles Vehicles, parts, mechanics & interactions (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Nov 28, 2021
@Nymall
Copy link
Contributor

Nymall commented Dec 11, 2021

Confirmed, Version: C117979

The width of the boat and speed seems to affect the issue - in my long-play I have a houseboat built and I can survive collisions in that(4x6), but any 1 tile wide boats going above 10 MPH will occasionally do this. I've noticed the problem is worse when the boat is going diagonal.

@hexagonrecursion
Copy link
Contributor

hexagonrecursion commented Dec 16, 2021

Confirmed

  • OS: Linux
    • OS Version: LSB Version: :core-4.1-amd64:core-4.1-noarch; Distributor ID: Fedora; Description: Fedora release 34 (Thirty Four); Release: 34; Codename: ThirtyFour;
  • Game Version: cfc00fa [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth],
    Bionic Professions [package_bionic_professions]
    ]

When trying to move after triggering this I get:

 DEBUG    : map::unboard_vehicle: vehicle not found

 FUNCTION : void map::unboard_vehicle(const tripoint&, bool)
 FILE     : src/map.cpp
 LINE     : 1077
 VERSION  : cfc00fa

When trying to take control of the boat again again I get:

 DEBUG    : map::board_vehicle: passenger (Alice Smith) is already there

 FUNCTION : void map::board_vehicle(const tripoint&, Character*)
 FILE     : src/map.cpp
 LINE     : 1038
 VERSION  : cfc00fa

@wapcaplet wapcaplet added (S2 - Confirmed) Bug that's been confirmed to exist <Bug> This needs to be fixed and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Jan 17, 2022
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 Monsters Monsters both friendly and unfriendly. (S2 - Confirmed) Bug that's been confirmed to exist Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

No branches or pull requests

4 participants