Skip to content

Fix: Wrong boundboxes for tunnels & terrain.#17312

Merged
duncanspumpkin merged 13 commits into
OpenRCT2:developfrom
karst:boundbox-fix
Jul 21, 2022
Merged

Fix: Wrong boundboxes for tunnels & terrain.#17312
duncanspumpkin merged 13 commits into
OpenRCT2:developfrom
karst:boundbox-fix

Conversation

@karst

@karst karst commented Jun 2, 2022

Copy link
Copy Markdown
Member

Fixes for tunnelsssss.
Thisone Fixes the boundboxes for the wide turn on the mine train,
Large & Small helixes on every coaster type
(Flying) inline twists on B&M Coasters.

This fixes orginal bug #7466 aswell as a bug that was noted in discord.


Before:
image
image

After:
image
image

karst added 3 commits June 2, 2022 02:58
Fixes for tunnelsssss.
Thisone Fixes the boundboxes for the wide turn on the mine train,
Large helixes on every coaster type (EXCEPT THE JUNIOR COASTER)
(Flying) inline twists on B&M Coasters.
@karst

karst commented Jun 2, 2022

Copy link
Copy Markdown
Member Author

I need some help with figuring out what to change in TrackPaint.cpp.

This is to fix the same bug on the junior coaster.

The code is written completely different from what you can find in the other rides. It's extremely confusing and very much a guessing game. I have written a note to one of the lines where I need to change it.

@duncanspumpkin

Copy link
Copy Markdown
Contributor

Can you turn on bound boxes for the images so we can actually see the changes.

@karst

karst commented Jun 2, 2022

Copy link
Copy Markdown
Member Author

image

image

Here's what it does, basically. I'll see if I can fine tune it a bit better so the boundboxes are not a unit too high. (Should only be noticable for people that clip tracks into the ground).

I am wondering if this might not be a boundbox issue in the tunnel itself.

(Picture on current develop version)
image

@duncanspumpkin

Copy link
Copy Markdown
Contributor

It all looks sensible. Are we confident that no one would expect the vanilla behaviour and it wouldn't be used for any hacks? I can't imagine anyone would.

@karst

karst commented Jun 2, 2022

Copy link
Copy Markdown
Member Author

Nah definitely not. This bug is more obtrusive than anything. (Besides this bug was not present in RCT1) I am currently in the works of getting all lines corrected. I have just finished adjusting the boundbox for the B&M track, Mine Train and Alpine Coaster. Should be a fairly straightforward to do the rest as I got all the correct lines I need to change now.

And I have added the Small helix here aswell.
@karst

karst commented Jun 2, 2022

Copy link
Copy Markdown
Member Author

Okay, I have now fixed all coasters but the Junior Coaster.
Junior Coaster isn't necessarily a big deal either since it's not as obtrusive of an issue (as it uses the circular tunnel rather than the square). If someone can point out to me which coordinates like to which, that'd be great. If not, this PR is ready to merge.

I have also noted that there's a small similar drawing issue with the wooden coaster but I'd have to do quite a bit of research again on which sprites those are and it's barely noticeable. I don't think that's really worth investing my time in.

image
image

I have used these notes to help me speed through the process:
Code to add: { 0, 0, height + 6 }

track_left_half_banked_helix_up_small
Case 3
    Case 3
Case 7
    Case 0

track_right_half_banked_helix_up_small
Case 3
    Case 0
Case 7
    Case 3

track_left_half_banked_helix_up_large
Case 6
    Case 3
Case 13;
    Case 0

track_right_half_banked_helix_up_large
 Case 6;
    Case 0
 Case 13
    Case 3

Below I have also attached my test park if you want to check it out yourself.
Download Test Park

Finetunes the Mine Train Coaster a bit more so the train doesn't appear under the track... OOP
@Gymnasiast

Copy link
Copy Markdown
Member

To Do (I'll most likely do this tomorrow):
All Small helixes.
Seemling half of the large helixes.

If you are still working on your code, please mark the PR as Draft. That makes it clear to everyone and makes sure we don’t accidentally waste time reviewing it too early. :-)

@Gymnasiast Gymnasiast marked this pull request as draft June 2, 2022 21:10
@karst

karst commented Jun 2, 2022

Copy link
Copy Markdown
Member Author

Ah it's not longer in draft now haha.
Forgot to update the original comment.

@karst karst marked this pull request as ready for review June 2, 2022 21:42
Forgot to update these finetuned parameters.
Comment thread src/openrct2/ride/TrackPaint.cpp Outdated
@Gymnasiast Gymnasiast added the testing required PR needs to be tested before it is merged. label Jun 5, 2022
@duncanspumpkin

Copy link
Copy Markdown
Contributor

This kind of breaks one of the assumptions that has been made in that a helix is comprised of two quarters. I'd like to keep that assumption to hold true. So that would mean modifying the same lines for them.
Jnr coaster already forces this as it only considers it as a quarter. You would need to modify the equivalent for that.

track_right_half_banked_helix_up_small
Case 3;
    Case 0
Case 7;
    Case 3

This becomes:
sequence 3, rotation 0
sequence 7 - 4 = 3, rotation 3 + 1 % 4 = 0
sequence 3 becomes index 2 so its (rotation 0, index 2) L992 that this represents

track_left_half_banked_helix_up_small
Case 3;
    Case 3
Case 7;
    Case 0

This becomes:
sequence 3 remaped to 0, rotation 3
sequence 7 - 4 = 3 remapped to 0, rotation 0 - 1 % 4 = 3
sequence 0 becomes index 0 so its L1005 (rotation 3, index 0) that this represents

I haven't looked at the large ones yet.

@karst

karst commented Jun 16, 2022

Copy link
Copy Markdown
Member Author

I believe I have build every single ride in thisone. Maybe I have missed one.

I have also found a few more z-order errors with other rides and ground tiles which you will see aswell.

Order Test Park.zip

@karst

karst commented Jul 14, 2022

Copy link
Copy Markdown
Member Author

Is it an idea to push this PR since we're in an early stage of 0.4.2 and publicly test it like so? My own extensive testing for this has not found any errors with existing builds. I have tens of maps from NE downloaded and I have not found any errors there. If people find errors we can always change those parameters later. Let me know what your opinion is

@Broxzier

Copy link
Copy Markdown
Member

I'm a little concerned with how the bounding boxes look, mostly here:

Why are these two blocks so much higher than the rest? This smells like something else is amiss.

@karst

karst commented Jul 14, 2022

Copy link
Copy Markdown
Member Author

image

image

@Broxzier I am not experiencing this issue. Is it an older version of this PR by any chance?

I have decided to raise the entire bound box of the helixes by 10, which seems to fix the issues with the junior coaster. It about levels it with the rest of the track rather being under it.
@karst

karst commented Jul 14, 2022

Copy link
Copy Markdown
Member Author

I am looking at the code for the TrackPaint.cpp and I seem to have fixed the rending issue there but it requires some finetuning still as there's a singular tile that somehow jumps out now. Have to figure out what happened there, because the train is rendering under it rather than on top.

@Broxzier

Copy link
Copy Markdown
Member

Is it an older version of this PR by any chance?

Probably yeah, it was the screenshot you posted earlier. I didn't see anything regarding this was changed later. I have not yet tested the builds myself.

It's finetuned now. I figured to not change everything and just what was necessary to fix the issue. The train doesnt glitch either now, which is what is closed to the track by far.
@karst

karst commented Jul 14, 2022

Copy link
Copy Markdown
Member Author

Everything should be set for a merge now. I have also edited the necessary parameters in the TrackPaint.cpp so it should be easier to update at later moments in time without reintroducing this bug. As I have stated before I have yet to discover a newly introduced error (or people that abused these parameters) with these changes. I think it's smartest to publicly test this (as we are still near the start of 0.4.2 snapshots) and see if people have complaints about it as I haven't been able to get others to do more testing on this except for you guys.

@Broxzier Broxzier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and everything LGTM

Comment thread src/openrct2/ride/TrackPaint.cpp Outdated
@karst

karst commented Jul 20, 2022

Copy link
Copy Markdown
Member Author

do I need to change anything else or is it good to go now?

@duncanspumpkin duncanspumpkin merged commit a74acee into OpenRCT2:develop Jul 21, 2022
@tupaschoal tupaschoal added this to the v0.4.2 milestone Jul 21, 2022
karst added a commit to karst/OpenRCT2 that referenced this pull request Aug 15, 2022
This is a Hotfix for something I overlooked while making OpenRCT2#17312.

I have fixed the same issue for the flying inline in OpenRCT2#17782. Please let me know if I need to bring that over to this PR.
Gymnasiast added a commit that referenced this pull request Oct 5, 2022
- Feature: [#6326] Ability to load .SV6 files from RCT Classic that have more than 9601 guests.
- Feature: [#6570, #10860, #17929] Fully support RollerCoaster Tycoon Classic as a RCT2 base install path.
- Feature: [#13634] Add ability to sell merchandise in random colours.
- Feature: [#16164] Add new track elements for Flying Coaster and Lay-Down Coaster and add paint code for more elements.
- Feature: [#16283] Added parkinfo command line tool to list objects in a save file.
- Feature: [#16662] Show a warning message when g2.dat is mismatched.
- Feature: [#17107] Ride operating settings can be set via text input.
- Feature: [#17638] Added Zero G rolls, medium loops and large corkscrews to the Hybrid and Single-Rail coasters.
- Feature: [#17821] [Plugin] Add API for track subpositions and vehicle subposition.
- Feature: [#17877] Add three real-life flying roller coaster colour schemes.
- Feature: [#17900] Add “Classic Wooden Coaster” with shallow banked turns.
- Feature: [#18057] Staff members now wait for passing or stalled vehicles before crossing railway tracks.
- Feature: [#18168] Add additional track pieces to the LIM Launched Coaster and the Looping Coaster.
- Feature: [objects#198] Add additional pirate roofs.
- Feature: [objects#205] Add additional glass roofs.
- Feature: [objects#209] Add the Steel Roller Coaster train and 2-across Inverted Train from RollerCoaster Tycoon 1.
- Feature: [#18050] Add asset pack manager and asset packs.
- Improved: [#15358] Park and scenario names can now contain up to 128 characters.
- Improved: [#15589] Numpad Enter can now be used to close text input.
- Improved: [#16819] Don’t prompt to “Save game as” when saving a loaded saved game (excepting autosaves).
- Improved: [#16840] Add support for rectangular heightmaps.
- Improved: [#17575] You can now search for Authors in Object Selection.
- Improved: [#17806] Added warning when using RCT1 objects without RCT1 linked.
- Improved: [#17868] [Plugin] You can now change active tab of a custom window programmatically.
- Improved: [#17909] Track elements that are not supported by any train are now hidden by default.
- Improved: [#17924] Improved performance when loading JSON object images from a .DAT file.
- Improved: [#17955] Modifying ratings via in-game console is now multiplayer-safe and also freezes the ratings.
- Improved: [#18177] [Plugin] Widget tooltips can now be read and changed.
- Change: [#9104] Calculate maze support costs.
- Change: [#17319] Giant screenshots are now cropped to the horizontal view-clipping selection.
- Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements.
- Change: [#17655] Lower default price for the Crooked House.
- Change: [#17745] Make maintenance cost of Mini-Golf more balanced.
- Change: [#17762] Use vertical tabs in the New Game dialog.
- Change: [#18113] Increased limit of Loan Interest in Scenario Editor to 255%.
- Fix: [#5141] Headless server is counted as a player.
- Fix: [#7466] Coaster track not drawn at tunnel exit.
- Fix: [#10535] Guests getting stuck at specific level crossings.
- Fix: [#14337] Guest blocking ride entrance after ride price changed to be unaffordable.
- Fix: [#15328] Wooden Roller Coaster incorrectly draws a railing on the first station piece (original bug).
- Fix: [#16392] Scenery on sloped surface is placed at wrong height.
- Fix: [#16476] The game sometimes crashes when demolishing a maze.
- Fix: [#17053] Crash when trying to open files under 4 bytes in length.
- Fix: [#17312] (Flying) Inline Twist appearing under the surface when placed on ground level.
- Fix: [#17339] Distorted visuals when changing scaling factor between integer numbers in OpenGL rendering mode.
- Fix: [#17394] Six-seater Hyper-Twister Trains focuses ride window camera on Car 2 rather than Car 1 (original bug).
- Fix: [#17430] Possible crash when toggling tile element visibility in multiplayer.
- Fix: [#17444] “Manta Ray” boats slowed down too much in “Ayers Rock” scenario (original bug).
- Fix: [#17503] Parks with staff with an ID of 0 have all staff windows focus on that staff.
- Fix: [#17508] Grid doesn’t disable after setting patrol area.
- Fix: [#17532] Object Selection window allows unselecting all station types.
- Fix: [#17533] Missing audio when specifying ‘--rct2-data-path’.
- Fix: [#17535] Multiplayer desync when placing rides with scenery.
- Fix: [#17541] Station style not correctly saved to TD6.
- Fix: [#17542] Stalls will autorotate towards paths outside the park.
- Fix: [#17544, #17754] Visual glitches in Invention List window.
- Fix: [#17553] Crash when moving invention list items to empty list.
- Fix: [#17571] All researched tracked rides show up as new vehicles in .park scenarios.
- Fix: [#17600] Notifications are not properly cleared when loading a park.
- Fix: [#17605] Crash when opening parks which have had objects removed externally.
- Fix: [#17639, 17735] When building upside down, the special elements list contains many items twice (original bug).
- Fix: [#17664] Unable to save after an extended period of time due to inactive ride music data leaking.
- Fix: [#17703] (undefined string) when building on invalid height.
- Fix: [#17776] “Other Parks” tab uses separate lists for SC4/SC6 and .park scenarios.
- Fix: [#17784] Colour preset RNG is biased (original bug).
- Fix: [#17788] Guests could leave queue if another guest rejoins it from the entrance building.
- Fix: [#17834] Finance window becomes blank after 4096 years.
- Fix: [#17816] Option to pause game when Steam Overlay is active is not greyed out when using the OpenGL renderer.
- Fix: [#17897] Guest can get stuck on tiles with construction rights outside the park.
- Fix: [#17904] Trees are removed at no cost to make way for ride entrance/exits.
- Fix: [#17905] The chain button in the map window is enabled for rectangular maps when (re)opened.
- Fix: [#17931] The in-game command ‘count_objects’ crashes the game.
- Fix: [#17865] With difficult guest generation, tested but unopened rides still contribute to the guest cap.
- Fix: [#17866] [Plugin] Wrong Soft Guest Cap at start of new game.
- Fix: [#17889] Peeps don’t stop at level railway crossings if approached from downhill.
- Fix: [#17980] Queue lines of track designs mess up existing queue lines if dragged through them.
- Fix: [#17959] Areas marked for dirty drawing are too large.
- Fix: [#17963] Some marketing campaigns can’t be started after Finances window tab has been on Research.
- Fix: [#17964] Sprites don’t show up on two sides of the view-clip selection.
- Fix: [#17966] Reversed steel trains do not properly import from S4.
- Fix: [#17973] Bins and lamps overlay parts of the land (original bug).
- Fix: [#18008] Steeplechase S-bends has multiple gaps visible in the tracks (original bug).
- Fix: [#18009] Visual glitch with litter at edge of sloped path.
- Fix: [#18025] Fix land ownership in Six Holland, Six Flags Magic Mountain, North America - Grand Canyon and Asia - Great Wall of China Tourism Enhancement scenarios.
- Fix: [#18026] Park rating drops to 0 with more than 32k guests, total ride excitement or intensity.
- Fix: [#18032] All non-interactive widgets (labels, groupboxes) produce sound when clicked.
- Fix: [#18035] Favourited servers don’t get their online status updated.
- Fix: [#18051] Visual glitch with Mine Ride’s large unbanked turn (original bug).
- Fix: [#18059] [Plugin] Width and height of custom window not changeable via script.
- Fix: [#18063] Guests can stop for all kinds of actions at railway crossing.
- Fix: [#18087] Bank balance is clamped to a 32-bit integer every transaction.
@karst karst deleted the boundbox-fix branch November 26, 2022 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing required PR needs to be tested before it is merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants