I’m working on a small golf game for fun.
I want to include a feature that, while aiming, let’s you see the path that your ball will take after being hit, as well as where it will land. It’s a pretty standard feature in golf games, but I’m not sure how to implement it.
I am a fan… Is there a way to simulate physics in the background, or simulate it before playing?
Pangya calculates all the results of a shot at the moment you define the power and direction of the shot.
It sends to another client to calculate the physics and take the result back to show the player the animation of the shot.
Besides this technical network approach, how can I run the physics of the ball without showing the player, and after the simulation is done, I playback it to him?
I think Pangya does the calculations server-side and sends back a vector with speed/direction of the ball at every node.
O---------O-----------0--------------- 0 -----------0-----------E
Start ----xyz/rotation | next xyz/rot…End xyz/loc
Client and Sever map would be 100% identical so it should always work.
To be perfectly honest, that’s only how I imagine it working. Since Pangya is no longer a game that is in service, people rely on private servers to play it. This being said, I don’t know if there’s source code available for the game to look at. But this is my best guess.