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

Alt room refactoring #384

Merged
merged 17 commits into from
Sep 30, 2016
Merged

Alt room refactoring #384

merged 17 commits into from
Sep 30, 2016

Conversation

TeslaRus
Copy link
Contributor

@TeslaRus TeslaRus commented Sep 25, 2016

alt rooms used only for content store;
no more "check flip" functions: only real_room ptr or Sector_CheckRealRoom(...);
Room collision generation is workaround, because real tween collision between rooms depend on room combination (alt / real version) so there are two ways: 1) generate additional tween collision meshes for ALL room / real room combinations; 2) generate on fly after every World_SetFlipState();
UPD: only 2) is sane solution;

in room_sector_s: sector_above, sector_below was replaced by room_above, room_below;
rooms swapping was disabled;
TODO:
delete all unused code from room module;
clean up disabled code in render module;
implement swap room algorithm (big function);
alt room info in room_s: alternate_room_next, alternate_room_prev (just
alt rooms list pointers), real_room (active in game room with portals);
TODO:
using Physics_SetOwnerObject cause problems on level destrucruction;
activate flip room function (and update flip conditions);
check all rooms getting usage (add check real where it is necessary);
fixed real_room pointer calculation;
Fixed Sectors_Is2SidePortals(...) function (I still not complete understand how
tweens generation works between two rooms in case of alt rooms);
World_SetFlipState(...) was partial enabled;
TODO:
fix rendering in case of camera inside portal (in rooms border);
made World_SetFlipState() fully working;
WorldRoom_FindRealRoomInSequence(...): replace "min id" by "where to
portals lead" condition;
World_SetFlipState(...) function is fully enabled;
real room are calculated by near rooms portals;
@vvs-
Copy link
Contributor

vvs- commented Sep 25, 2016

In Tomb of Qualopec portal from room 18 to room 11 doesn't work, Lara can't pass.

In Cistern swapping to water room doesn't transfer its water attribute, only the water surface is seen.

#343 is still valid.

In altroom4 test level Lara starts in a wrong room.

In altroom1 test level room swapping doesn't work.

@TeslaRus
Copy link
Contributor Author

"In altroom1 test level room swapping doesn't work." - I test it, it does not works because I stay as is swapping sequence (if I swap 3 cycled rooms from 1 to 3, then 1 made full turn and no changes for 1 (real room), 2 and 3 changed). How to correctly swap rooms? does I need to mark next_alt_room as swapped / unswapped (like world.cpp str 976)?

@TeslaRus
Copy link
Contributor Author

In Cistern swapping to water room doesn't transfer its water attribute, only the water surface is seen.
Thx, forgot flags

@TeslaRus
Copy link
Contributor Author

about altroom initial pickable objects state: in Natla's mines pistols and large med is accessible before 3 puzzle hole activation (or it is an additional script with objects enabling / disabling)?

… bullet crash);

added paranoid real rooms checking to renderer and frustums building;
fixed Room_SwapContent(...) function;
fixed World_SetFlipState(...) function;
@vvs-
Copy link
Contributor

vvs- commented Sep 25, 2016

1 made full turn and no changes for 1 (real room), 2 and 3 changed)

Are you sure it's altroom1? There are only two that should be swapped. One has a raised cube and the other doesn't.

@TeslaRus
Copy link
Contributor Author

if rooms are cycled, swapping does twice, so no visible changes

@TeslaRus
Copy link
Contributor Author

altroom1 passed;
room_flags fixed;
physics crash fixed;
World_FindRoomByPosCogerrence(...) fixed;

@vvs-
Copy link
Contributor

vvs- commented Sep 26, 2016

There is something wrong with the water rooms in Cistern. After swapping rooms, Lara can still swim in the air after climbing from water.

There are no changes in Tomb of Qualopec and altroom4 also.

@vvs-
Copy link
Contributor

vvs- commented Sep 26, 2016

about altroom initial pickable objects state: in Natla's mines pistols and large med is accessible before 3 puzzle hole activation (or it is an additional script with objects enabling / disabling)?

I'm not sure. But in TR3 NPC inventory is kept under their feet. Maybe that's the same?

fixed character height info calculation;
fixed HACK in World_SetFlipState(...) function;
@vvs-
Copy link
Contributor

vvs- commented Sep 27, 2016

about altroom initial pickable objects state: in Natla's mines pistols and large med is accessible before 3 puzzle hole activation (or it is an additional script with objects enabling / disabling)?

This is actually described in #259.

@vvs-
Copy link
Contributor

vvs- commented Sep 27, 2016

In Natla's Mines camera repeatedly bumps into invisible boat static near waterfall when she's floating on the surface.

@vvs-
Copy link
Contributor

vvs- commented Sep 28, 2016

In Natla's Mines there is something wrong with sector 4,1 in room 28. Lara consistently loses her room ownership and falls out, sometimes into room 20 and sometimes out of level mesh.

EDIT: ditto for sector 2,1 when rotating the camera and jumping. Overlapping rooms strike back.

@vvs-
Copy link
Contributor

vvs- commented Sep 28, 2016

altroom2 test was (and still is) broken in 1048ab7.

@TeslaRus
Copy link
Contributor Author

thanks for info... next I will fix - alt / normal room collision filter (disable / enable function too).
last commit - only tweens generation fix (waterfall in TR1 map 3)

…om has more priority);

little list generation workaround fix;
@vvs-
Copy link
Contributor

vvs- commented Sep 29, 2016

Seems mature to me. All recent issues that previously appeared in this PR were fixed. #343, #386 and altroom4 are the only problems that were not addressed yet. But maybe that do not belong to this PR after all, I'm not sure.

@TeslaRus TeslaRus merged commit 3282b98 into master Sep 30, 2016
@TeslaRus TeslaRus deleted the alt_room_refactoring branch September 30, 2016 17:01
@TeslaRus
Copy link
Contributor Author

Thanks for feedback - it helps to fix serious bugs in early stage

@vvs-
Copy link
Contributor

vvs- commented Sep 30, 2016

"altroom4 test can not been passed, because at same time only one room (in alt room sequence) is available for entities / rendering"

Then it should be changed to remain compatible, because in the Core engine this level just works as expected. So, obviously there is no such limitation. Camera there sees only one room at a time, depending on its direction relative to a portal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants