PlaceholderGames / Team1-2017

Team 1 CS2S561 game
2 stars 3 forks source link

Gravimetrics engine #24

Closed SharktasticA closed 6 years ago

SharktasticA commented 6 years ago

Due to the complexity of implementing realistic gravity, I have opted to go for simulated interactions for the time being. Actual calculations will be restricted to probes and asteroids.

ghost commented 6 years ago

Sounds good! It will be a lot easier implementing movement and firing scripts with this kind of a system rather than a realistic one.

SharktasticA commented 6 years ago

Indeed. It's quite a bummer since I spend three weeks working on it, but it is for the best right now that we simplify this.

SharktasticA commented 6 years ago

So I now have an idea of how I am going to implement the new system. The new ideal gravity script will have two main methods; GetMovementGravity() and GetStationaryGravity();

GetMovementGravity() will be called every time the object moves, and returns a Vector3 containing the needed adjustments for the movement system to simulate an attraction effect. GetStationaryGravity() will apply an attraction if the movement system is inactive.

@Ajarax , I'd like to discuss how we are going to apply this gravity to your movement system in tomorrow's tutorial. The returned Vector3 should be easy to integrate since you'll just need to add the two forces (the other being player movement Vector3) together. If you're system is too different for that, we should be able to find a way to convert the values to be usable.

Other things I need to iron out is how the script detects if it is in range of a planet. Since instead of calculating the gravity continuously, the script will just calculate a quick attraction vector based on the difference in location when said objects are in a fixed range of each other.

SharktasticA commented 6 years ago

https://github.com/PlaceholderGames/Team1-2017/commit/11cc3f7e3d4346a77328ea911076875d4ca1990f

See this issue for a basic procedure outline of both methods. Aim for basic code completed by the end of tomorrow.

ghost commented 6 years ago

Do you think the new gravimetrics system is stable enough to test movement scripts in? As my movement system is also physics based, combining these two systems shouldn't be hard.

SharktasticA commented 6 years ago

No. Due to other courseworks, I'm a bit behind.

However, if you check master, I have now merged the physics branch into it so you have access to the dummy method GetMovementGravity() which returns a vector3 (which will be raw attraction as explained above a week ago). Whilst I catch up, feel free to experiment on how to access that method from your movement scripts and apply it into the code (which should be into the final processed movement).

The method has some pseudocode inside it so you can understand the procedure of what it does.

SharktasticA commented 6 years ago

I've also set an deadline for my new gravity model as 1st December 2017.

SharktasticA commented 6 years ago

System was completed in time, but due to unforseen issues, this thread will be replaced.

SharktasticA commented 6 years ago

Reopening the issue due to recent improvements of gravimetrics.

Changes since December 2017:

SharktasticA commented 6 years ago

Wiki page for GravityProperties class: https://github.com/PlaceholderGames/Team1-2017/wiki/GravityProperties-class

SharktasticA commented 6 years ago

Updates

SharktasticA commented 6 years ago

The Gravimetrics is done for now.

SharktasticA commented 6 years ago

Minor update f6b58b8e764d4c3e1c783a3b9176568b6a6da903 Engine gets planets via code rather than being manually entered via array.