- Home /
About photon engine and saving data?
Hi, I want to make a multiplayer game (Like portal with just 2 player) and i found out Photon engine then i watch some tutorials but i coudn't found some thigns like saving the game or loading the game. I though photon is not for this . And I found some saving methods like Binary Formatter. So how can i use photon and some save methods. How can i you them together. Maybe i should use someting different for server or data saving thing? (I dont have any experience about making multiplayer game and save/load system so Im sorry for my language)
Answer by Captain_Pineapple · Oct 14, 2020 at 10:27 PM
No worries about the language, but you should have solid knowledge of some basic things when you want to work on a multiplayer game as it is at least twice as complicated as a normal game. First of yes you can use a binary formatter to write stuff to a file. This can then be read again when you start up the game. However depending on your game (and you did not add any information in that regard) it might (and probably will) not be enough to simply send the file to the other person. Before you dive too deep into this saving/loading topic you should first make clear that you have a good understanding how photon (i guess you mean PUN - be specific here, there are differences) and how to create rooms, connect to rooms and send messages. Then you should understand how saving/loading works without any multiplayer stuff and then you should try to bring these 2 together.
First of all Thank you so much for answer. Well actually this game will be my school project and my teachers demand that the game be multiplayer and use a database. I will do research and as you said, first I will understand the multiplayer and then try to understand the database parts. So are there any other APIs like PUN?
well sorry for the late reply. I wouldn't really think of PUN as a pure api. In the end PUN is a complete multiplayerservice with included matchmaking. If you want other networking solutions you can take a look at $$anonymous$$irror or DarkRift2 (i use the latter one) In addition to that: Using a Database is a different story then writing to a file. If you write to a database you can simply convert a struct you use to save your game data to a json string and insert that into your database. There is no need for a binary formatter here. If you want to save space/bandwidth you can compress/decompress the string before/after sending.
Well thank you very much again! This helped me a lot. I will try my best.
Your answer