Hello,
i created a simple 2D Trivia Quiz Game and i wanted to add Multiplayer features to it (max 8 people playing the game at the same time). but i really got confused with the amount of options we have at our disposal (Unet, photon, …).
and the majority of tutorials i found on Online are talking about FPS multiplayer games. and i don’t think a simple quiz Trivia game will ever need all that!
So please help i’m really lost! any guides, suggestions or help on how to make a Multiplayer Trivia Quiz Game will be appreciated.
For this type of games a server authoritative solution is best, as you can validate all the answers from the server side (the “authority”) and make sure no one is cheating. As an additional bonus you can store scores and things like that in a central place be it the local file system or a database etc.
For this kind of work I usually recommend SmartFoxServer, as it’s a battle-tested solution (it’s been around since forever) and offers a ton of options. But it’s also easy to get started with. You can check their documentation and you’ll find very basic tutorials that build on top of each other. Stuff like creating a basic lobby, adding a chat, creating a turn-based game and adding the server side code. www.smartfoxserver.com
I am sure other people will chime in with possible alternatives too.
Hey MrsPiggy,
Thank you so much for your answer it does definitely clear things out for me.
I was at first considering using “Unet” the Built in networking system by unity or Photon, as those are the ones i heard about a lot from people and from youtube. but i really got confused how to use them in a simple Trivia quiz game. because all the tutorials i have seen mostly talking about FPS or 2D platformers games that involves Movement (Transforms) and actions, … and do i really need all of that in my game?
and talking about code do i really need to adjust it for Multiplayer or SmartFoxServer (Lobby) take care of that?
i’m just a beginner in Multiplayer Logic and architecture, any help will be appreciated!
Yes, some changes are necessary. For example you will need to be connected and logged in the server before you can actually play. Other changes may be necessary if you want people participating in the game to interact with each other, such as chatting or seeing their profile etc.
If you choose SmartFoxServer I’d recommend following their tutorials from the documentation. They start very simple and they teach you one thing at a time. Good luck.
Hello MrsPiggy,
i have actually worked with The smartFoxServer, and i have successfully connected my game to their server, but then i didn’t know what to do next! it seems like i need to configure the file extensions with java on their server so that the players can interact with each other.?
and there is no full tutorials from A to Z on how to create a full multiplayer game with the smartFoxServer.
i’m really confused what to do next and how to make my game playable online?
Any help please?
Hello ilyass, did you check this page in the documentation? SmartFoxServer 2X documentation: introduction
You will find 9 tutorials of increasing complexity showing how to create the building blocks of most multiplayer games: a lobby, a chat, the turn-based interaction, movement synchronization, ecc.
If something is still not clear, you can contact us on our support forum and we will be happy to help.
That depends on what you need to do. How does your quiz game work? Are there game tables/rooms or is everyone participating in the same quiz at the same time?
Extensions are useful to add your own game logic on the server side, such as verifying that the player answer to the quiz is correct and so on and so forth.
They have lots of tutorials to get started. Follow the links in @g_a_p post.
yes, there is game rooms, and there is two modes in the game, the first mode is the public mode where player can join a room from 2 players to 8 players and challenge each other. and the second mode is the private mode where players can invite their friend to challenge each other or maybe people they have played with before. (in this mode i was thinking maybe the game will generate a random code that the host player can send it to his friends to join the match! but i have no idea on how i can achieve that, if you have any insights please help!)
yes i know, i have actually read about extensions on the smartFoxServer documentation, but the challenging part is that i can’t write extensions with C# it must be java, right? if it’s in Java, i don’t really have an experience with it. i just know enough in C# to make simple game. so how can i deal with the extensions problem and server side of the project?
thank you @g_a_p for the help, yes i actually went through all the documentation and i have successfully connected the game with the smartFoxServer and i configured the client part, but i’m stuck now in the server side part, i read on the site that there is those extension files are the one controlling the server side and i have no knowledge in the java Programming language! is there is a possibility to write them in C#? and i don’t think my game will need movements or complex multiplayer features, it’s just a multiplayer Trivia Quiz Game. So please how can i manage the server side if i have now knowledge about java?
And for the tutorials i managed to test the first one, but the others i didn’t know how to make the server side working!
Any useful information’s, links or solutions will be so much helpful for me.
thanks for the support.
Java is very similar to C#, so I guess you can write a test Extension following the dedicated documentation quite easily, if you want to give it a try. This document describe how to create your first Java Extension step by step: http://docs2x.smartfoxserver.com/ExtensionsJava/writing-extensions
i will try Java since it’s similar to C# and i will read the documentation, and if i get stuck i will reach to you back again.
thank you so much @g_a_p for the help
Ok. So SmartFoxServer provides an invitation api that gives you all the tools to send invitations between players and accept/refuse them.Also they provide match-making systems for both private and public games.
The base for these interactions is the buddy system. This allows every player to keep track of their friends, see when they are online, change their state, chat etc. You’ll find well don’t tutorial on how this works in their docs.
If you want to start a private game with your friends I believe you create an SFSGame room which allows you to specify a list of people you want to invite, and the minimum # of players required to start a game. All the rest (invitations and invitation replies) are handled by the system.
If you check their example you’ll find a prototype that shows how to use these features.
Server side code can also be written in Javascript, which is more approachable if you’re not a friend of Java.
Check their docs for the details.
Thanks, @MrsPiggy i will try out the examples, and go through the documentation and hopefully i will come up with the right implementation (first time is always the hardest, after that everything will be clear)
i actually have a question regarding the time, how many hours/ days it will take me as a beginner to implement the Multiplayer functionalities? vs an experienced unity developer?