Search Unity

Creating an MMORPG and need help.

Discussion in 'Works In Progress - Archive' started by GameCode4878, Feb 2, 2016.

  1. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    There are many things I need to do but the first issue I am facing is how to make the server for the game. This problem is divided into three other issues that need to be mentioned:
    1) How would I set up the multiplayer to have a login screen? Where would each player's data be stored such as their username and password. Then how would I code the login screen to be functional?
    2) Each player has a strength level (which determines how hard the player can hit), a defense level (which determines how much immunity he has to damage), and a combat level (which is determined with: Combat level = strength level + defense level). The code has to work in a way to where when the player logs in, not only is a player prefab created for him, but the strength level, combat level, and defense level he has are loaded onto that prefab. I already know how to create a code to where when the player joins a game (Note: there are no servers or login with a username and password,) a player prefab is created for him to control. Unfortunately this code does not involve a leveling system. I used the codes from http://www.paladinstudios.com/2013/07/10/how-to-create-an-online-multiplayer-game-with-unity/ to create this basic function. How would I upgrade it to have a login and leveling system?
    3) The final problem is what do I do to have it to where each player's data is persistent. I don't want to create a game to where every time I log off I have to start all over. I want it to where the data can be stored and retrieved on the user's login.

    I know it seems a bit much to ask, but if someone can help me with these things, then I may be able to figure the rest out. If at all possible if there is to be a credits scene in the game, I will list the names of everyone who helps me make this game possible. Thanks to any help.

    ps. If something happens to where if the multiplayer functionality is not similar to what is in the link above, I may have to rewrite some of the scripts, which may take a lot of time.
     
  2. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    Again, Thanks to any help
     
  3. Cdngater

    Cdngater

    Joined:
    May 29, 2014
    Posts:
    65
    Hi, not to discourage you, but this is a very broad question, and the link showing you multi-player is only the tip of the iceberg. The info shown there is more suitable for a simple client/server system than a MMORPG.

    There are many, many configurations of Mmorpg systems. Have you thought about what you want in it? That helps define your requirements.

    One simple and very basic configuration is using a lobby server with multiple game servers. So using this an example I will give you guidance on your questions.

    Login screen is simply a GUI, from there you would accept username and password. (Don't forget encryption)
    Now this information would be sent to the lobby server which validates if it's valid or not. The lobby sever would have some sort of data storage, for example: using simple textfiles, SQLite or MySQL databases. So the lobby server would read the data from storage and compare it to the username and password.

    Assuming it's valid, then the client would be sent the address of the game server it would want to connect to.

    when a connection is made to the game server it to would load data from the data store about that player.

    Now,if this sounds complicated to you, well, maybe a Mmorpg is not what you should be building as the above is very simple in the world of mmorpgs.

    I wish you luck with your project, but the level of your questions makes me believe a Mmorpg will be out of your reach. You would start something simple first.
     
    Teila likes this.
  4. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    how much experience do you have making games?
    not to discourage, but judging by your questions you only have one problem
    1) over ambitious with not enough skill to make your game.

    don't take this wrong, but as long as you've never fully made and finished a very simple game! (think pong or mario clone) this will turn out a discouraging nightmare!

    here is a good start for multiplayer, maybe try to make a 2 player game to start with...?
     
  5. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    I have already seen this webpage. But it does not tell me how to make data persist. Thanks though, but it would be nice if the players could have a way to save their game.
     
  6. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    there are lots of tutorials on how to save a game, there are even free unity assets for that.
    but again, try to scale down your ambitions.
    first make a very simple project for multiplayer. If that succeeds then make a very simple project to learn how to save (playerPrefs, serialization, encryption, ...), i prefer serialization, here's a good intro (but i forgets to mention that all things monobehaviour are not serializable)...
    and most of all learn how to program object oriented (for your leveling and stuff)
     
  7. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    I know this seams like a big project. But that is why I am taking it slowly, one step at a time. The first step is to set up a way for players to log in, save/store their progress on a server/database, and log out. The next step will be creating a database that stores all the items in the game. The third step will be to create a script for the player's inventory. The fourth step is to create the combat and leveling system. The next step will be creating a way for the game to save the items in the player's inventory. Then create a way to save the player's level and stats and other stuff. The next step is to make the game more detailed by adding quests and stuff. Then NPC shops. The last details will include a chat system and player trade system.

    I am not going to take this project on all at once, but step by step as said above. I understand that I will not get immediate results and will not get discouraged by that. I am also trying to get all the help I can. But for now I must face the problem at hand, creating a way for a player to register an account, and log into the game, and log out. That is my priority right now. Another thing I have to mention is the fact that the scripts for saving a player's data must not only include the player's username and password, but it must also store the player's level data, and eventually the items in that player's inventory.

    Also, once the player has logged in, there has to be a way to load that player's data to the entity he is controlling(such as the player's prefab). If I can figure that out, I would have much less problems creating the game.
     
  8. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    Making a database to store all a player's info and a working login GUI to go with it is the first problem I would like to solve.
     
  9. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    did you watch the tutorial?
    and btw i don't think this is the right section to post this in.
    you would be better off asking specific question in the scripting section.

    but before you do i recommend extensive googling first :)
    i'm sure i can across answers to your current problems more than once.
     
  10. beachkid

    beachkid

    Joined:
    Jan 13, 2014
    Posts:
    18
    TBH I think you should focus on the map of the game before you can add the online stuff oh and work on the menus.
     
  11. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    Before I make the map I would like to have made at least some of the codes and networking, because if I do the map first, and I can't figure out how to make the server, then all that work going into the map will have been done in vain, and will no longer have purpose. The main thing I need to focus on is creating the server. The tutorial in the link I put in my first post has a way to create a server, It just does not mention a way to have a database to store all the player's progress. My question is: can the scripts provided by the tutorial, be upgraded to have a database, and if so How?
     
  12. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    the tutorials is out of date. Unity 5 has a new network system that's almost completely drag and drop.

    search for some tuts on Unity UNET.
     
  13. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    Here is something I might need to know:
    If I have to make the game's save feature done manually, such as in a save button on the screen and player prefs, how would i save something like:

    //Coded in C#:

    1) private int playerStrength = 1;
    2) private int playerDefense = 1;
    3) private int playerLevel = playerStrength + playerDefense;

    If the integers have to be public, will the stats of one player affect the stats of another?
     
  14. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Making databases is complex. You need to go find a book or a tutorial that will teach you how to make a database and then learn how to use it with Unity. You will need a good sized database, SQL or a similar one.

    You need to learn all these basics before you can come here here and ask questions because then you can narrow them down and people will be able to help.

    Are you very familiar with C#? If not, learn it before you make an MMO or do what I did and "hire" a programmer.

    You will also need someone who can animate or at the very least, someone who can modify animations. They need to be familiar with whatever you use..legacy or mecanim.

    You will need an artist or a lot of money for asset store products.

    You will need a server. There are some out there, but most die and lose support from the developers. We are on our fourth one. :)

    This is not a journey for those who cannot learn themselves. Sorry, but it is long and tedious and you must climb that learning curve before you can get to the top.
     
  15. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    I can make the models and landscapes and stuff like that on my own, but how do I get a server? I know some C# but don't know where to get SQL or how to set it up. Can you answer these?
     
  16. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    If the player has a string such as:

    private string PlayerName = 'John';

    How can I get that to be saved on a database? Also how would I save all the other player's names to the database?
     
  17. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    You will have to learn the database on your own.

    Here is the thing....you can't make a game if you need people to help you every step of the way. Make a small game, follow the tutorials in the above LEARN link at the top of the page, and then come back and ask for help.

    BTW, Unity does not have an MMO out of the box. It takes a lot of work. I suggest Hero Engine for that.
     
  18. GameTechnix

    GameTechnix

    Joined:
    Oct 5, 2015
    Posts:
    84
  19. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Good idea! I would try uMMORPG if I were you. Atavism is not the best for a beginner and hard to make changes. But I have heard good things about uMMORPG, even if I was skeptical to start with. :)
     
  20. GameCode4878

    GameCode4878

    Joined:
    Jan 5, 2016
    Posts:
    173
    If I make a prefab for a player with a code:
    public string playerName = 'no name';

    would the part 'public' make that one player's name affect the names of all the other players?
     
  21. Cdngater

    Cdngater

    Joined:
    May 29, 2014
    Posts:
    65
  22. GameTechnix

    GameTechnix

    Joined:
    Oct 5, 2015
    Posts:
    84
    You should ask these questions in the scripting forum.
    I would highly recommend buying the asset Cdngater recommended and have a look at their code to see how its done. Its going to be more useful than limping along trying to get answers on the forum.
     
  23. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    SQL isn't a database - it's a language for interacting with databases and its flavor and syntax can vary wildly between vendors.

    So what you're saying is that you don't fully grasp the implications of making a single variable public and yet your expectation was to come here and have the community members provide you with the entire breadth of knowledge required to design, develop, implement, and maintain an MMO? With presumably no other preparation aside from reading a single multiplayer tutorial and copying some code from it?
     
    jister likes this.
  24. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Okay, MySQL...I left off part of it. Sue me.
     
  25. mathiasj

    mathiasj

    Joined:
    Nov 3, 2015
    Posts:
    64
    I hate to break it to you, but if you have to ask these kinds of questions, you are not fit for the challenge to create an MMO.

    Let's think of it in a metaphor:
    ----------------
    I've played piano for about 3 years and I think I understand it pretty well. I've played lots of songs and stuff. I really like the piano and thought I would like to make my own.

    Today I went out and bought a saw (a metal one) and some chisels. I once chopped some wood with an axe a bunch of times so I'm sort of familiar with wood already. I'm ready to take it to the next level!!!!11!

    So I totally want to start my piano project right now but I have some simple questions for you guys:
    1) is there some place I can get decent wood for free? I have some logs already.
    2) Will I be able to use my axe for this project? Can someone recommend some other tools? (Preferably free, lol)
    3) What kind of wood should I use? I remember seeing that there are some reddish ones and some whitish ones but I don't know which is best.
    4) Do I use nails or screws?
    5) Is there a free glue recipe?

    Also, the little hammers in the piano really confuse me. Can someone make me one so I can copy it a few times? Lots of pictures would also be good... and perhaps a detailed explanation.

    Oh, and now that I think about it, how do you bend the sides and stuff? My piano is something called a "baby grand" (though I could make a grand piano too if that's too hard) and I'd like to make something like it with just a few mods.

    That's it! The rest should be no problem for me.
    ----------------------
    It's great that you are excited to get started in wood working but it seems pretty clear that you are just getting started. I really recommend you try some simpler wood working projects first. Build a few bird houses... move up to a table and then some chairs. You will be on your way in no time flat.
    ------------------------
    What the hell am I going to do with a bunch of bird houses?!? I just want to make a piano. Don't crush my dreams!

    [all credit goes to pspeed ->http://hub.jmonkeyengine.org/t/satire-if-game-development-was-woodworking/33168

    Of course, this is exaggerated. But it shows what this situation is like.

    First, learn how to code. If you do not know how to code properly, you cannot create any game. Do no just read a C# tutorial and then proceed with your MMO, no, create some applications, which do not have to be games, to use your skills and to actually learn coding. You won't be able to code before you have written some code, gone through the process of bugfixing etc. etc. Of course you could learn that all while creating an MMO, but you will then have enough other challenges. Learning how to code should not be one of them.

    Once you know how to code, you should learn a lot about networking, databases, (3D) game programming in general, Unity and so on. This will be quite a challenge and you won't be able to achieve it if you ask for help in every sub sub sub step of the process of creating an MMO or even programming in general.

    However, it is doable. If you really are motivated enough and do want to see your game coming to life, you can do it. But you will have to start to learn how to code properly. Then a lot of the questions you ask will already be self-explanatory.

    As a final note, there are already a lot of tutorials out there (for example for the database part) and if you want to speed up the process, you can also use an asset as others have suggested.
     
    Teila likes this.
  26. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    but to at least answer this:
    a public variable like playerName, would be part of a class Player.
    a class it a blueprint for an object and an object is what your get when you instantiate a class.
    Now what you get is a reference to this object in your memory, and inside the reference is also a reference to the variable playerName from the class Player.
    so now that we sort of laid out a very general observation of what's going on when you execute your code, you can see that for every instance you create of a class (what you call it when you instantiate a class) you get this reference which means that the name can be different for every instance of your class. public just mean it's accessible for other scripts through a reference.
     
  27. ZTB

    ZTB

    Joined:
    Mar 16, 2017
    Posts:
    5
    Hi, I can help you write the Story/Lore for your game, if you'd like, but I'm no good with coding, etc.