- #1
AdmiralOlson
- 2
- 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?
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?