OpenRCT2 / OpenRCT2/OpenRCT2

Improve force calculation

Open
#9,642 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion
Dominant language
C++
Stars
16.2k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
80

Description

There are several issues with the current force calculation model. This was written in an era where CPU speeds were measured in Megahertz however, so it was understandable in the 90s.

Now however CPU speeds and math functions are more advanced, making improvements in this practical.

Current issues with force calculation include:

  • no support for Longitudinal G Forces: This is the force experienced with sudden changes in speed. For the most part this wouldn't affect the game, as the human body can withstand high amounts of these. It would make longer brake runs necessary though to keep uncomfortable drops in speed at a minimum. This is a requirement for the next part though:
  • no Consideration of angle of guests: this mainly applies to the Flying Coaster, Laydown Coaster, Suspended Flying Coaster, and the Multidimensional Coaster. Currently the G Forces are always based on a sitting position. This however is not how force would be applied for guests in different angles. Changing would require the loss of assumption of airtime being tied to negative vertical Gs, but would have the huge advantage of making the angle of Multidimensional coasters actually do something (right now it is purely cosmetic and not generally considered worth building). It would also have a smaller effect on Flying Coasters.
  • Constant force factors: Loops are designed in such a way that they have a constant G Force as one travels them. This is not the case in RCT2 however, which instead acts as if the loop were circular and not a "teardrop" shape.
  • Bad implementation of gravity: Crashing coasters have very simplistic physics. In addition, an exploit exists for a perpetual motion machine, which is a very clear violation of the laws of physics.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name implementation files, tests, or entry points. Start by locating the current coaster force and crash-physics calculations, then compare them with the listed requirements: longitudinal G forces, guest angles, constant loop forces, and gravity behavior. Done means these cases are addressed without the described perpetual-motion exploit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.