Opened 3 years ago
Closed 5 weeks ago
#13177 closed defect (fixed)
TWINE: Tank is stuck
Reported by: | vvs- | Owned by: | mgerhardy |
---|---|---|---|
Priority: | normal | Component: | Engine: TwinE |
Version: | Keywords: | collision-detection | |
Cc: | Game: | Little Big Adventure |
Description
In Hamalayi Range scene 63 after capturing tank it can't leave this scene and become stuck. This makes it impossible to continue without cheating.
You can use the same savegame as in #13168
Attachments (3)
Change History (32)
by , 3 years ago
Attachment: | scummvm-lba-cd-00000.png added |
---|
comment:1 by , 3 years ago
Priority: | normal → high |
---|
by , 3 years ago
Attachment: | script1.2.log added |
---|
comment:2 by , 3 years ago
Priority: | high → blocker |
---|
comment:3 by , 3 years ago
error must be here: Animations::processActorAnimations the if block with actor->_staticFlags.bComputeCollisionWithBricks
comment:4 by , 3 years ago
The problem is in the lines:
checkActorCollisionWithBricks(actor->_boudingBox.mins.x, actor->_boudingBox.mins.y, actor->_boudingBox.mins.z, 1);
checkActorCollisionWithBricks(actor->_boudingBox.maxs.x, actor->_boudingBox.mins.y, actor->_boudingBox.mins.z, 2);
checkActorCollisionWithBricks(actor->_boudingBox.maxs.x, actor->_boudingBox.mins.y, actor->_boudingBox.maxs.z, 4);
checkActorCollisionWithBricks(actor->_boudingBox.mins.x, actor->_boudingBox.mins.y, actor->_boudingBox.maxs.z, 8);
comment:6 by , 3 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:7 by , 2 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
This fix introduced another issue in collision in e.g. scene 35 (the sokoban scene) - you can now move crates into the walls
comment:8 by , 2 years ago
Script of the tank (actor 1)
COMPORTMENT main IF FLAG_GAME 78 == 1 SUICIDE ELSE SET_COMPORTMENT 1 ENDIF END_COMPORTMENT COMPORTMENT 1 ONEIF HIT_BY == 7 SET_TRACK 1 SET_COMPORTMENT_OBJ 8 2 ENDIF END_COMPORTMENT END
Script of the hero (actor 0)
COMPORTMENT main IF FLAG_GAME 74 == 1 SET_COMPORTMENT 1 ELSE SET_COMPORTMENT 3 ENDIF END_COMPORTMENT COMPORTMENT 1 ONEIF LIFE_POINT_OBJ 7 == 0 IF FLAG_GAME 78 == 0 SET_FLAG_GAME 73 0 SET_FLAG_GAME 72 0 SET_FLAG_GAME 74 0 SET_FLAG_GAME 75 1 ENDIF ENDIF IF COL == 1 IF CURRENT_TRACK_OBJ 7 == 107 SET_DIRMODE NO_MOVE INVISIBLE 1 ANIM 0 SET_BEHAVIOUR NORMAL SET_TRACK 0 CAM_FOLLOW 1 SET_TRACK_OBJ 1 0 SET_COMPORTMENT 2 ENDIF ENDIF END_COMPORTMENT COMPORTMENT 2 IF CURRENT_TRACK_OBJ 1 == 100 SET_FLAG_GAME 78 1 IF FLAG_GAME 6 == 1 BODY 0 ELSE BODY 1 ENDIF POS_POINT 15 ENDIF END_COMPORTMENT COMPORTMENT 3 END_COMPORTMENT END
Script of the helper (actor 7)
COMPORTMENT main OR_IF FLAG_GAME 77 == 1 OR_IF FLAG_GAME 89 == 0 IF FLAG_GAME 74 == 0 SUICIDE ELSE SET_COMPORTMENT 1 ENDIF END_COMPORTMENT COMPORTMENT 1 IF ZONE_OBJ 0 == 0 IF ZONE == 0 SET_FLAG_GAME 73 1 SET_FLAG_GAME 72 0 SET_FLAG_GAME 74 0 ENDIF ELSE IF ZONE_OBJ 0 == 1 IF ZONE == 1 SET_FLAG_GAME 73 0 SET_FLAG_GAME 72 0 SET_FLAG_GAME 74 0 ENDIF ELSE SET_FLAG_GAME 73 0 SET_FLAG_GAME 72 0 SET_FLAG_GAME 74 1 ENDIF ENDIF SWIF DISTANCE 0 > 2500 SET_DIRMODE FOLLOW 0 ANIM 27 ENDIF SWIF DISTANCE 0 < 2000 IF DISTANCE 4 < 6000 SET_DIRMODE FOLLOW 4 ANIM 144 SET_COMPORTMENT 2 ELSE ANIM 0 ENDIF ENDIF IF FLAG_GAME 71 == 1 IF LIFE_POINT_OBJ 7 < 50 SET_LIFE_POINT_OBJ 7 50 ENDIF ENDIF ONEIF LIFE_POINT_OBJ 4 == 0 SET_DIRMODE NO_MOVE IF LIFE_POINT_OBJ 2 > 0 IF ZONE == 0 SET_TRACK 10 ELSE SET_TRACK 0 ENDIF ENDIF SET_COMPORTMENT 3 ENDIF ONEIF ZONE == 3 IF FLAG_GAME 78 == 0 SET_DIRMODE NO_MOVE IF LIFE_POINT_OBJ 5 > 0 SET_TRACK 3 ELSE IF LIFE_POINT_OBJ 6 > 0 SET_TRACK 4 ENDIF ENDIF SET_COMPORTMENT 4 ENDIF ENDIF END_COMPORTMENT COMPORTMENT 2 OR_IF DISTANCE 0 > 3000 IF LIFE_POINT_OBJ 4 == 0 SET_DIRMODE FOLLOW 0 ANIM 27 SET_COMPORTMENT 1 ENDIF IF FLAG_GAME 71 == 1 IF LIFE_POINT_OBJ 7 < 50 SET_LIFE_POINT_OBJ 7 50 ENDIF ENDIF END_COMPORTMENT COMPORTMENT 3 ONEIF CURRENT_TRACK == 100 SET_DIRMODE FOLLOW 2 ENDIF ONEIF CURRENT_TRACK == 101 SET_DIRMODE FOLLOW 3 ENDIF ONEIF CURRENT_TRACK == 110 SET_TRACK 0 ENDIF ONEIF LIFE_POINT_OBJ 2 == 0 IF LIFE_POINT_OBJ 3 > 0 SET_DIRMODE NO_MOVE SET_TRACK 1 ENDIF ENDIF IF LIFE_POINT_OBJ 2 == 0 IF LIFE_POINT_OBJ 3 == 0 SET_DIRMODE FOLLOW 0 SET_TRACK 2 SET_COMPORTMENT 1 ENDIF ENDIF END_COMPORTMENT COMPORTMENT 4 ONEIF CURRENT_TRACK == 103 SET_DIRMODE FOLLOW 5 ENDIF ONEIF CURRENT_TRACK == 104 SET_DIRMODE FOLLOW 6 ENDIF ONEIF CURRENT_TRACK == 105 SET_TRACK_OBJ 1 2 MESSAGE 2 SET_DIRMODE FOLLOW 1 ENDIF ONEIF CURRENT_TRACK == 108 EXPLODE_OBJ 1 EXPLODE_OBJ 1 EXPLODE_OBJ 1 EXPLODE_OBJ 1 EXPLODE_OBJ 1 ENDIF ONEIF LIFE_POINT_OBJ 5 == 0 SET_DIRMODE NO_MOVE IF LIFE_POINT_OBJ 6 > 0 SET_TRACK 4 ENDIF ENDIF IF LIFE_POINT_OBJ 5 == 0 ONEIF LIFE_POINT_OBJ 6 == 0 SET_DIRMODE NO_MOVE SET_TRACK 5 ENDIF ENDIF ONEIF CURRENT_TRACK == 106 SET_DIRMODE NO_MOVE ENDIF ONEIF CURRENT_TRACK == 107 SET_DIRMODE FOLLOW 1 ENDIF ONEIF COL == 1 SUICIDE ENDIF END_COMPORTMENT END
comment:9 by , 2 years ago
get the helper with debug commands
set_game_flag 77 0 set_game_flag 89 1 set_game_flag 74 1 change_scene 63 toggle_god_mode
force the track 2 for actor 1 (the tank) to start without playing the scene
scene_actor 1 toggle_free_camera set_track_obj 1 2
by , 2 years ago
Attachment: | Bildschirmfoto vom 2022-05-29 16-03-49.png added |
---|
comment:10 by , 2 years ago
found a revision that worked for both test cases: 0a4460ba343fb394f2385559bab90b404140dd25
comment:13 by , 2 years ago
Priority: | blocker → high |
---|
comment:15 by , 2 years ago
Hmm... Now that you've said this, I remember that there is a bug where Twinsen would get stuck in a corners (doors, bricks). That happens quite often.
comment:16 by , 2 years ago
a report from a user that might also be related to this collision bug:
- you can also sometimes go behind tiles, or get stuck near a door that's opening
comment:17 by , 2 years ago
94e339a382f7f417ca369602c882d4f3c5b8e0ce reduced the hack to the tank scene. this makes the sokoban scene work again.
comment:18 by , 2 years ago
Priority: | high → normal |
---|
Changed prio to normal because a hack is in place.
comment:19 by , 22 months ago
https://github.com/mgerhardy/lba1-classic-community/tree/debug contains a version with a few debug options compiled in
comment:20 by , 18 months ago
I wonder if this issue has to do with Bounding Boxes not rotating when doing the collision check?
The truck doesn't have a squared bounding box, so when it turns, if the Bounding Box has the same orientation it can leave to collision issues.
comment:21 by , 18 months ago
Maybe - I am unsure. I wasn't able to tackle the issue yet. If you maybe still remember those parts... any help would be more than welcome.
comment:24 by , 15 months ago
Keywords: | collision-detection added |
---|
comment:25 by , 5 weeks ago
I've found the cause of the problem - the BodyData instances are shared across several actors - this is wrong. The new loading that was introduced in 8c76c1fac7c9f97fe45a074035ee0ce9e3a31597 removed the BodyData instance in the bodyData array per entity/model - but instead shared the BodyData entry for each model with the same hqr index.
comment:26 by , 5 weeks ago
The BodyData member should maybe be part of the EntityBody struct - so each EntityBody has its own BodyData member.
comment:29 by , 5 weeks ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed with 4ad6a6961cff13bc421e0ce19c5ed1c225b4e9a6
hack removed in af35f3f150a5ae4b4418dced1e922a4889265cef
added script dump for actor 1 (the tank)