Basically Im making a game around Rocketry, Combat and orbital mechanics. The game takes place on the “moon” which is downscaled to be around 120k studs in diameter. The entire game is basically collect resources build rockets and fight the problem is to do with the orbital mechanics. Its well known that space is huge and it takes a very long time to get from point A to B so I modified physics a little bit and created and significantly reduced the time by making a smaller world and messing with gravity. the 120k stud diameter moon was choosen as a compromise between floating point error’s, Making something big enough for people to hide etc and also give people the “thrill” / realisim of going into orbit as if it were a small planet/moon It would seem strange and not as realistic.
THE PROBLEM: sadly how the math works even changing physics there are still some rules I can’t really get around basically the larger the orbit the longer it takes and its not a linear relationship so we get problems with the orbital period blowing up to an absurd amount from around 3-5 miniutes in low orbit to
this absurd 848 miniutes or 14 hours! which a player can easily get to this kind of orbit by changing there velocity by like 700 studs/s and not to mention the floating point errors if you go out that far
So im wondering what do I do make the moon smaller? I don’t want to make a global rule where theres a time warp of like 3X because landing and flying rockets will be like impossible. Games like KSP get around this by using a timewarp but I would have no idea how to make something like that work in multiplayer.
I can help you make time warp. The first thing you have to do here is run the all the physics separately on each client, then manipulate deltatime to calculate the physics then scale them up when for example the player presses a speed button. What you would have to do here is just multiply the forces acting on the player and rocket by the time factor the player wants. Since you said this game involves combat, you might also want to put a limit on this, like a combat timer that disables using this feature for some amount of time. However, you would have to fix the gravity and sizes a bit so that things make sense again. You would probably end up with some global variable that all the forces are multiplied by to get the right behavior. I dont have experience with very strong or high strength forces, so you might run into trouble. Regardless, its probably the easiest way to do this, since there isn’t really a compromise and just shortens the time. You would struggle most with paying attention to the way your scaling and what forces should be scaled in what ways so that weird stuff doesn’t happen.
Im confused I don’t see how that could work in a multiplayer game. Like if you give the player timewarp control It can easily be abused to simply run away and in the future I want to add mission trajectories to a “flyby” asteroid which people land on. I don’t see how timewarp works for that.
That’s what i mean, you prevent it from being used when they are in combat, or whenever else you dont want them to use it. You can also see that on the flip side, that other people can also time warp to chase people. You could also just limit the time warp so its not that fast either, so that it cant be abused that much. In the case of the asteroid, you can make a radius around it that limits the warp when they get within some distance. Its up to you where you choose to limit it or how strong you want it to be.
That literally breaks the entire game I don’t want to bore you with an explanation of how transfers work and how a timewarp is going to ruin everything. Instead look at KSP when they tried to add multiplayer and the issues they had with trying to implement a timewarp. Also it doesn’t matter if the timewarp is 2X, 3X or 5X the point is if it takes 14 hours to do one orbit its too long.