Undergrad Faking a Formula For Movement Through Gravity

Click For Summary
SUMMARY

The discussion focuses on syncing projectile movement in a multiplayer game using Unity, specifically when accounting for gravitational forces from multiple planets. The author proposes a solution that involves sending velocity, position, and time to each client, allowing them to calculate the acceleration due to gravity at that specific moment. This method ensures deterministic results across all clients, even with varying gravitational influences. The author also considers simplifying the problem by limiting the gravitational sources affecting a shell at any given time.

PREREQUISITES
  • Understanding of Unity game development
  • Knowledge of projectile motion and gravitational physics
  • Familiarity with networked multiplayer game synchronization techniques
  • Basic concepts of deterministic systems in game design
NEXT STEPS
  • Research "Unity networking for multiplayer games"
  • Explore "deterministic physics in game engines"
  • Learn about "Lagrangian points and their applications in game physics"
  • Investigate "optimizing network traffic for real-time games"
USEFUL FOR

Game developers, particularly those working on multiplayer projects in Unity, and anyone interested in implementing realistic projectile motion influenced by gravity in a networked environment.

AdmiralOlson
Messages
2
Reaction score
1
I have a strange question. It's strange because I don't need a correct answer. I need an answer that seems correct and leads to predictable results. I'm making a multiplayer computer game where the players fire cannons in outer space. The cannon shells will move through the gravitational fields of planets. If there weren't planets, I could sync the location of the shells on all the different computers by giving the velocity and position of the shell at a specific time to each computer. Because the movement is completely deterministic, and because the networking system I'm using provides accurate time measures across all the computers, each computer can calculate the location of the shell at the specified time. Complete accuracy and all I needed to do was send a velocity vector, a position vector, and a time.

There are planets though. The movement of the shells is still completely deterministic, but I don't know what the formula is. I'm hopeful I can still sync the location of the shells, this time by giving three vectors instead of two: the acceleration, velocity, and position of the shell at the specified time. Or is that only true if there is just one gravity source? With two gravity sources, is it impossible to summarize the movement of the shell with three vectors? And if it is possible, how do I derive the vectors? Simplifying the problem, the planets don't move.

There are potentially going to be dozens of cannon shells at any given time, so if I have to have each shell send its location to each player every tenth of a second, it's going to be way too much network traffic. I'm using Unity, which doesn't have a deterministic physics engine, so I can't count on each computer coming to the same results if they calculate the gravity separately.

Also, even if it is impossible to derive the three vectors, it might not matter. If I can come up with something that looks right, and is consistent enough that the player can predict where the shell is going to go, then I don't care if it's inaccurate. The players won't even notice.

Any ideas?
 
Physics news on Phys.org
One possibility is to have only one gravitational source active on a shell at a time. As the shell leaves the sphere of influence of one planet and enters another you can switch the gravitational source to the new planet.
 
  • Like
Likes jedishrfu
Thats not an unreasonable assumption as the interplay of multiple planets will effectively cancel in deep space or one planet will clearly dominate.

Kind of like the lagrange points where gravity is zero between the Earth and Moon.

https://en.m.wikipedia.org/wiki/Lagrangian_point
 
jedishrfu said:
Thats not an unreasonable assumption as the interplay of multiple planets will effectively cancel in deep space or one planet will clearly dominate.

Kind of like the lagrange points where gravity is zero between the Earth and Moon.

https://en.m.wikipedia.org/wiki/Lagrangian_point

I'm sorry it took me so long to reply, but I actually did come up with a solution. The standard method for syncing projectiles in networked multiplayer games is to provide the same velocity, position, and time to each client, as I've stated. I can effectively do the same thing with projectiles being pulled by gravity as long as the location and strength of the gravitational sources, and the times when we calculate the gravitational strength, are the same. SO! I provide velocity, position, and time, and each client calculates the acceleration due to gravity at that specific time. Then we use the acceleration, velocity, and position to estimate where the projectile will be in 1/30 of a second, let's say. Because each client is using the same numbers, they should get the same results. Then we repeat the process. It should be deterministic.

Thanks Drakkith and jedishrfu for your comments. I'm going to keep thinking through your suggestion because it could lead to a much simpler method.
 
  • Like
Likes Negatratoron
Relativistic Momentum, Mass, and Energy Momentum and mass (...), the classic equations for conserving momentum and energy are not adequate for the analysis of high-speed collisions. (...) The momentum of a particle moving with velocity ##v## is given by $$p=\cfrac{mv}{\sqrt{1-(v^2/c^2)}}\qquad{R-10}$$ ENERGY In relativistic mechanics, as in classic mechanics, the net force on a particle is equal to the time rate of change of the momentum of the particle. Considering one-dimensional...

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 78 ·
3
Replies
78
Views
6K
  • · Replies 42 ·
2
Replies
42
Views
7K
  • · Replies 30 ·
2
Replies
30
Views
5K
  • · Replies 21 ·
Replies
21
Views
5K