Im very new, and have many questions...

Options
ColdDog
ColdDog
edited August 2011 in DotNet
Hey, im very confused about how a MMO in unity with photon works..
Im making a 2d MMO game with unity and i chose Photon as a server.
im trying to figure out how does it works...
the client side is unity, and the server side is photon which is in VS C#. am i right?
if so, i believe the enemy AI wont be coded in the client side. so do i code it in VS?
i really need somone to teach me the basics of MMO programming with photon.. i have been looking for tutorials but nothing really helped. it all starts from a certain point which i dont know.
Ive been told that a secure MMO uses the client as an Input and sends the input into the server.
so what do i code in unity, why do i need unity then?
I hope I can find some answers around here. thanks.

Comments

  • Boris
    Options
    Yes, server programming is with C#.
    Easiest way to start is following the learning path as suggested here: http://developer.exitgames.com/demos.
    The blogs listed at viewtopic.php?f=18&t=612 might be helpful as well.
  • ColdDog
    Options
    thanks for the replay.
    can you give me some examples of what do i program in VS C# and what in unity if i want to make a MMO?
  • Boris
    Options
    If you want to prevent cheating don't allow the clients to make any important decisions. What 'important' decisions are depends a lot on your game. Verifying the movement on the server is a good idea and doing this by just sending the input is not uncommon.
    Some people prefer to run a headless unity instance for this and other physics calculations and use photon just for relaying messages. On the downside this approach increases the latency and server resource usage.
  • ColdDog
    Options
    thanks.
    ill give you an example i still dont understand.
    i have programmed the enemy AI in unity.
    but the calculations like checking distance from the player and all the other things like calculating max damage and etc. is it outside unity coding? because the enemy is not moving depand on the players input
    so what do i do in this case? if i want to move the enemy from the server using the tools i have in unity.
    is that possible?

    also, can you explain this sentence please?
    On the downside this approach increases the latency and server resource usage.

    thanks for all your help.
  • Boris
    Options
    You would have to move the enemy AI to the server.
    You can still run the AI in unity, just not on the client side. Instead you can run a headless unity process on the server for it.
    The headless unity process communicates with your clients through photon: Photon just forwards messages between the clients and the unity "server". If you had the AI logic in photon you would not need to forward messages to the headless unity process and back, so you could respond to the client input more quickly. The server resource usage is expected to be higher because of the additional networking and because unity (or mono for these matters) is not as fast as pure .NET would be.
  • ColdDog
    Options
    so i need to make a headless unity process?
    can you explain what that is please?
    what do i put there? using it for AI's and NPC's?
    and acctually just doing there all the calculations of the non player related features of the game instead of doing it in every client?

    also, if id like to do the AI in photon, whats the tactics of doing it in there?
  • Boris
    Options
    It's a normal unity process without front-end. Look at the batchmode command line argument: http://unity3d.com/support/documentatio ... ments.html

    ideally move all decisions that you don't trust the clients to do securely to photon.
    Move everything that's too hard to do in photon (depends on the time and money you can throw at it) to a headless unity process.

    AI often requires knowledge about the physical aspects of the world that you use in unity. So in order to run AI in photon you need a physics engine that runs in photon, one that behaves similar to the unity physics engine. One that knows how the world on the unity client looks like. You can't use the unity physics engine in photon directly. Look at what's out there and either customize it to your needs or write your own from the scratch. In many instances you can use a much simpler model on the server than on the clients. A good start for path-finding is opensteer for example: http://code.google.com/p/opensteerdotnet/
  • ColdDog
    Options
    thanks for all your help. i really appriciate it.