Thread: New Server Designs

Page 1 of 9 123 ... LastLast
Results 1 to 10 of 88
  1. #1 New Server Designs 
    brb ridin da storm

    blakeman8192's Avatar
    Join Date
    Dec 2012
    Age
    31
    Posts
    2,012
    Thanks given
    818
    Thanks received
    1,361
    Rep Power
    329
    Hey guys, I'm making this thread to discuss possible new server designs and their pros and cons. This thread might be too advanced for a lot of people, but it's a good chance for them to start to learn in depth about how servers operate and how to design them for optimal performance and stability.

    So let's make a list of possible server designs!

    Cycle-free design
    super_ and I discussed this a few days ago and kind of worked out the kinks in it all. Basically, the server doesn't have a main cycle that performs packet handling/processing/client updating. Everything is taken care of immediately, the trick is that data is sent out to the clients every 600ms to create the illusion of cycled gameplay.

    How updating works
    All client updates are described in an object. First, you have an interface called UpdateBlock which provides one method "public void encode(ByteBuffer buffer);" and this method is responsible for encoding the update block to a buffer. You have a "PlayerUpdate" class which is the main descriptor of a player update for each cycle, it holds reference to a "MovementBlock implements UpdateBlock" which could be "WalkBlock, RunBlock, TeleportBlock" etc. that encodes their respective information to the update packet. You then have a list of UpdateBlocks that describe things such as animation blocks, appearance blocks, etc. you get the idea.

    This update descriptor object is created on the fly. If a player equips armor, you attach an AppearanceBlock to their PlayerUpdate and forget about it. After 600ms, when the writing process begins, the update is locked down and encoded to a buffer and sent to the client and then completely reset.

    How packet handling works
    Handle the packets immediately. This is an entirely reactive server, just make sure you safely modify the game state if it's being done concurrently. Remember that clients don't receive state updates except every 600ms because of the queued/delayed writing process.

    How logic processing works
    I would assume just a simple scheduled event system, or something. Not sure exactly on this one.

    Detecting movement changes
    This would require a tile system where whenever a player moves an event is fired to nearby players. Remember that there is no cycled looping and no checking that can be done in a reliable manner. Everything must be based on a subscriber/notifier system. The details of the implementation are up to you because I've never made a proactive movement updating system.

    Pros
    • Probably extremely efficient, there is no cycle that can be delayed to cause lag
    • Pretty worry-free as long as you handle concurrent systems properly
    • This is probably how real big MMO servers are designed
    • No event/incoming packet queuing (trust me this is a huge bottleneck)


    Cons
    • Really fucking complicated to design and write
    • The lack of a cycle may cause unforeseen problems in game logic
    • Writing data may be a bottleneck when you have a lot of information to send to a lot of players
    • I/O needs to be asynchronous for this to work in a realistic manner
    rest in peace Qemist, Izzy, Colton, TeChNo PuNk, Impulser, & bootnecklad
    Reply With Quote  
     


  2. #2  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    I think a cycle-free design is the way to go personally. I don't see much point in having cycles while you can do everything immediately. It would probably make the game play smoother as well.
    Reply With Quote  
     

  3. #3  
    brb ridin da storm

    blakeman8192's Avatar
    Join Date
    Dec 2012
    Age
    31
    Posts
    2,012
    Thanks given
    818
    Thanks received
    1,361
    Rep Power
    329
    Quote Originally Posted by Null++ View Post
    I think a cycle-free design is the way to go personally. I don't see much point in having cycles while you can do everything immediately. It would probably make the game play smoother as well.
    The problem is that the client needs to receive updates in a scheduled and consistent manner. That's why writing is delayed until every 600ms, to create the illusion of a cycled RuneScape server. But internally the server handles everything immediately and prepares updates on the fly, only to encode them when it's time for the client to receive them.
    rest in peace Qemist, Izzy, Colton, TeChNo PuNk, Impulser, & bootnecklad
    Reply With Quote  
     

  4. #4  
    RuneFatality

    Join Date
    May 2009
    Age
    27
    Posts
    2,350
    Thanks given
    1,099
    Thanks received
    388
    Rep Power
    531
    @the person above me: Did you just read & absorb that?

    EDIT: FUUU Blake, I meant Null.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member
    Anadyr's Avatar
    Join Date
    Nov 2009
    Posts
    682
    Thanks given
    31
    Thanks received
    100
    Rep Power
    675
    correct me if im wrong but, for the movement detection you could use a queue that the pathfinding fills out with each tile and use tht in the gpi i guess? (for each player)

    edit: lemme reword this..

    Eachplayer has a queue for the tiles they are currently walking and ofc the queue will update whenever the player reaches the specific tile and in the gpi you could use the run direction ect from the queue idk just a raw though tbh
    Reply With Quote  
     

  7. #6  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    Quote Originally Posted by Flux View Post
    @the person above me: Did you just read & absorb that?

    EDIT: FUUU Blake, I meant Null.
    What do you mean? I read it, and responded with my opinion.

    @blake: Why make the illusion of a cycled server?
    Reply With Quote  
     

  8. #7  
    Registered Member
    Polaroid's Avatar
    Join Date
    Jul 2009
    Posts
    936
    Thanks given
    1,088
    Thanks received
    63
    Rep Power
    94
    Just edit the client to process packets the second they are received rather than trying to work around the 600ms cycle.
    Reply With Quote  
     

  9. #8  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    I actually thought about doing this when creating an async c# server, I never really went with it though as no other server had done anything like it. Now I think about it I was so stupid in not doing it. Updating will be difficult, locking stuff such as appearance could go very wrong, as 75% of the time players make mistakes and quickly change, going to have to be able to update the packet in the queue when stuff like this occurs... This will have to be worked out, the amount of load you will be taking off the server using such design rather then having to call everything every cycle will be ridiculous change.

    Im 100% going to have a play around with this sort of design tonight and see if it works out.

    Edit* I didnt completely read through so your saying the update packet is generated on the fly ie changes, then this is added last to the rest of the outbound packets, then sent every cycle?
    Reply With Quote  
     

  10. #9  
    Registered Member
    Anadyr's Avatar
    Join Date
    Nov 2009
    Posts
    682
    Thanks given
    31
    Thanks received
    100
    Rep Power
    675
    Quote Originally Posted by Polaroid View Post
    Just edit the client to process packets the second they are received rather than trying to work around the 600ms cycle.
    LOLWUT? they are handled immediately. The only packet that needs to be sent every 600ms is player updating
    Reply With Quote  
     

  11. #10  
    Registered Member
    Polaroid's Avatar
    Join Date
    Jul 2009
    Posts
    936
    Thanks given
    1,088
    Thanks received
    63
    Rep Power
    94
    Quote Originally Posted by Anadyr View Post
    LOLWUT? they are handled immediately. The only packet that needs to be sent every 600ms is player updating
    that's what i meant.
    Reply With Quote  
     

Page 1 of 9 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 32
    Last Post: 06-13-2011, 07:58 PM
  2. Replies: 30
    Last Post: 12-04-2010, 05:49 PM
  3. My designs
    By kirk in forum Showcase
    Replies: 5
    Last Post: 12-29-2009, 04:40 AM
  4. New Designs
    By Folz in forum Showcase
    Replies: 3
    Last Post: 10-07-2007, 05:29 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •