- Home /
Building a survival game with dedicated servers?
Hey everyone. I want to create a procedurally generated survival game, with integrated dedicated servers to make playing with your friends easier. However, I haven't found any tutorials on how to actually save the world you are playing on, so you don't have to start over every time you connect to the server. Is this even possible, and do I use Photon, Mirror, or is there another networkings solution I can use? Thanks in in advance.
Answer by Llama_w_2Ls · Jan 12, 2021 at 08:02 AM
You can use Photon Pun/ Pun 2/ Pun Classic, to create easy room joining across the internet, using Photon's dedicated servers. They have some example projects of creating and joining rooms over Wi-Fi.
If you want to save your world for everyone to access, there are multiple ways of going about this. For example, assuming your game is like Minecraft, you could create a text file of the perlin noise settings to proceduraly re-generate the same world as the host, and send that data across the network for all the players to share. Any edited blocks or destroyed blocks must also be saved, and dealt with accordingly. Preferably in the same manner.
Networking is not a simple thing. From experience, I've learnt that learning new things require a lot of effort and time. However, I'm willing to assist you if you choose to use Photon Pun Classic, to create your multiplayer game. @sofuscraft
Hi, thanks for the reply! Right now the only thing I have setup in my game is Pun 2 and a simple character controller, so I haven't made the procedurally generated terrain yet.
I'd really like some help regarding this whole thing, as I can't find any videos or tutorials anywhere about this. I was also wondering if there is any way I can prevent the clients from having to regenerate a word, and just load it from a folder instead?
Have you checked the official website? They walk you through the basics of implementing a networked character and joining rooms etc. Also there are example projects when you open up your Photon Pun folder, in the editor. Try them out, and I can try to explain any scripts for you if you want.
Procedurally generated terrain is another topic that there are plentiful of tutorials on. If you're looking for something voxel-like and blocky, you can follow a $$anonymous$$ecraft tutorial, but if it's using Unity's terrain system, with more realistic terrain, you can try check out Sebastian Lague's tutorial series on creating random and good-looking terrain. You can follow his tutorial series using this link: Procedural Landmass Generation: Tutorial Series 1
Yeah I have all that under control. I just meant that I couldn't find any tutorials on how to do the save/load world part.