CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Online game

  1. #1
    Join Date
    Aug 2009
    Posts
    219

    Online game

    Hello,

    I've got some experience in coding C++ with Direct2D from the DirectX 11 version, I know it's Win7 only.

    What my next kind of project is: I would like to make a game like Maplestory, I think I know how to handle this offline, but how do you make a server and client.

    I guess it's something like server, connect with a socket to it (how?) and then Send() and Recv(). But what things are on the server, everything (at least as much as possible)? Does that not make it laggy? I mean if I make the server from my home? But what if my computer is offline, the server will also be, so I've to make some online thing? Is it possible for free?

    I hope someone can point me to tutorials or something in that direction,

    Thanks for reading,

    NM

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Online game

    You know that 'normally' these kind of games are made by entire teams ? Maybe you should start with something simpler... something like tetris.

    I guess it's something like server, connect with a socket to it (how?) and then Send() and Recv().
    Take a look at CSocket and CAsyncSocket.

  3. #3
    Join Date
    Aug 2009
    Posts
    219

    Re: Online game

    Quote Originally Posted by Skizmo View Post
    You know that 'normally' these kind of games are made by entire teams ? Maybe you should start with something simpler... something like tetris.



    Take a look at CSocket and CAsyncSocket.
    but those games are huge. This is for learning purpose and fun. And it will be small.

    EDIT: I don't want to use MFC, but I mean a server, I need mysql etc?

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Online game

    I need mysql etc?
    That all depends on what you need, and how you are going to build your game. I get the idea that you didn't design anything, and just want to start coding without a plan. Designing your idea is the first step... building it is the 2nd step

  5. #5
    Join Date
    Aug 2009
    Posts
    219

    Re: Online game

    Quote Originally Posted by Skizmo View Post
    That all depends on what you need, and how you are going to build your game. I get the idea that you didn't design anything, and just want to start coding without a plan. Designing your idea is the first step... building it is the 2nd step
    Ok that's good advice

    With designing you mean classes and things? Ill make something and post here? Could you comment it?

  6. #6
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Online game

    With designing you mean classes and things? Ill make something and post here? Could you comment it?
    Stuff like ... What is the purpose of the game. What kind of characters are there. How do they interact with their environment. What kind of environment (aka virtual world) is there (how big etc...). Things like a point system, maybe weapons or other things your characters may use. First design the idea behind your game on paper and in your head. If you don't have a working idea, you will get nowhere.

    After that you start thinking about how you think that would be build in code. Don' start coding, just try to imagine a idea of how your code would look like and what it all should do. Try to put that on paper too. By doing that you will start to get an idea of how complex evertything is. My idea would be to start by designing the basics of the virtual world. Is it 1 map, or are there indivual parts that form 1 map. If so, how are you going to 'connect' those parts to make 1 big map. How is the gravity going to work in your map ? etc... etc... By designing the map problem on paper and in your head, you will start to see the problems you need to fix.

  7. #7
    Join Date
    Aug 2009
    Posts
    219

    Re: Online game

    Hey,

    I made a class diagram, linked as attachement.

    Explain of it:

    CMain: The main window + handling of messages
    CUserInput: If a key has pressed handle it, send this to CCharacter so the char has moved
    CDraw: Here the fun starts, I was thinking of a basic map (static) and at top of that draw the [B]unstatic stuff (monsters, characters, (later also skills etc)
    CMap: Check which map and what to draw
    CStaticStuff: Platforms, roads, trees
    CUnstaticStuff: Characters, Monsters
    CCharacter: HAs all the info about curretn hitpoint, mana point, exp, current x, y.
    CMob: Im not sure how to do this yet, Draw for example 20 monsters with all a structure or something and then check the mp/hp/ and everything of it.
    CDirectX: A class wrapper on top of Direct2D, for my personal needs.

    Further, I'll start with the basics of the basics, so a char is just a white ball or something and a mob is a red ball. First I would like to make one map work, so I can walk there and jump and see monsters also walking and I can kill them. Nothing more then build on top of that piece by piece. Fast code the Client/server thing else I can get in trouble later.

    Also all that weapons and things is for me later, else it becomes a year project. This is most for learning and having some fun.

    I hope you could point me in the right direction, are you a game programmer?
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured