Thread: [?] How the server & client communicate about map regions/tiles/etc

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1 [?] How the server & client communicate about map regions/tiles/etc 
    Registered Member
    Join Date
    Feb 2012
    Posts
    142
    Thanks given
    16
    Thanks received
    15
    Rep Power
    40
    Hello everyone

    So I don't sound crazy through this, here's Mopar's documentation of all the game packets.

    I've been reading up on the Mopar Wiki's article on map regions and I noticed that there are a few different packets dedicated to handling map regions; what I saw were downstream 73 and 241, and upstream 121 and 210. This is the #317 revision, by the way.

    I'm trying to fully understand how maps, regions and tiles work. From what I understand, each tile is represented as a coordinate (e.g. 3222, 3222, 0 is I believe Lumbridge Castle) and each "tile chunk" is a chunk of tiles in 8x8 size. Furthermore, a map region is 64x64 tiles in size, therefore being a grouping of 8x8 chunks.

    The special property about a map is that it's 104x104 (containing 13x13 chunks). It as a centre, which is (7, 7) (as if you were assigning coords to each chunk inside the map.)

    I think I understand all of that theory behind it, so moving onto the protocol is where I get confused. I don't know when the server is expected to send/receive data about tile chunks/regions/maps, and I don't know when the client is expected to send/receive data about the aforementioned.

    From what I can tell, the client sends the empty packet #210 to the server, telling it that it needs a new map region. However, it doesn't send what map region it needs.. is the server supposed to know that? How? Or am I missing it somewhere? Regardless, once it's finished, it sends empty packet #121 telling the server that it's finished loading (which implies that the server will continue to send data until it's forced to stop?)

    The two downstream packets are labelled "load" and "construct" map region. What's the difference? Maybe that can explain my confusion on the need for the packet, "Loading completed". Does the client request the map region be loaded, then the server sends that loaded region, then the client confirms that it's gotten it all, then it's actually constructed? Or some other way around?

    Thanks

    TL;DR: How do the client and server communicate about maps/map regions, when do they communicate

    Note: I'm new to RSPS and the entire RuneScape protocol itself, so please forgive me if I'm utterly lost and it seems very primitive here that I not know this very well My goal is to make an RSPS 100% by myself and I need to know everything I can before delving into it


    This is a repost from the Help section, notably because it seemed irrelevant from most of those threads, and because it was on the 2nd page within an hour.
    Thanks for reading I'm new to this community and to RSPS, so if I ask a silly question here and there, please forgive me!
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    29
    Posts
    4,750
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Seems like a reasonable topic, as I've been wondering this myself.
    Reply With Quote  
     

  4. #3  
    Registered Member
    Join Date
    Feb 2012
    Posts
    142
    Thanks given
    16
    Thanks received
    15
    Rep Power
    40
    Thanks It's one of a few things I'm still trying to figure out before I do any actual planning or development, just because it seems like such an essential part of the game, being able to initially load the map and then continue to stream it. This, alongside player updating, is basically all I've got left to learn well before I think I'll be prepared (pathfinding I'm likely to just take, I am not good enough with the math involved in that nor do I want to take the time to do so. Of course, as many crediting as possible to original authors of the algorithms and implementations used.)
    Thanks for reading I'm new to this community and to RSPS, so if I ask a silly question here and there, please forgive me!
    Reply With Quote  
     

  5. #4  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    19
    Posts
    16,488
    Thanks given
    3,387
    Thanks received
    7,726
    Rep Power
    5000
    The big font at the end made it hard to read pls fix.

    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  6. #5  
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,747
    Thanks given
    354
    Thanks received
    1,369
    Rep Power
    3032
    first thing: don't bother with that poorly written wiki article. really. i'll write a longer response in the morning as right now it's 4am, but do a search on the matter and you'll find some enlightening posts on this forum.
    Reply With Quote  
     

  7. Thankful users:


  8. #6  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,093
    Thanks given
    2,629
    Thanks received
    3,610
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Cajun Fries View Post
    I've been reading up on the Mopar Wiki's article on map regions and I noticed that there are a few different packets dedicated to handling map regions; what I saw were downstream 73 and 241, and upstream 121 and 210. This is the #317 revision, by the way.
    Packet 210 from client->server in 317 is sent like this:

    Code:
    		if (super.aFrame_Sub1_15 != null) {
    			aClass30_Sub2_Sub2_1192.putOpcode(210);
    			aClass30_Sub2_Sub2_1192.putInt(0x3f008edd);
    		}
    Seems to be one used for detecting if you aren't using the applet, nothing related to map regions.

    Quote Originally Posted by Cajun Fries View Post
    I think I understand all of that theory behind it, so moving onto the protocol is where I get confused. I don't know when the server is expected to send/receive data about tile chunks/regions/maps, and I don't know when the client is expected to send/receive data about the aforementioned.
    The server can actually send the load/construct map region packets at any time.

    It sends the X/Y chunk coordinates (using the terms you are) of the central chunk (i.e. the one at 7,7).

    The server actually sends it when the player approaches the edge of the 104x104 region that is loaded - when it is within 16 tiles horizontally or vertically of an edge. It knows to do this as it knows the player's position, and it also knows what chunk is at the center 7,7 as it sent this previously (e.g. upon login or the previous time the player got close to an edge.)

    Remembering where the central 7,7 chunk is is important, because many coordinates used later in the protocol are in the range 0-103 (these are local coordinates offset from the top left of the map area the client has loaded), and you need to be able to translate these to/from the absolute coordinates.

    Quote Originally Posted by Cajun Fries View Post
    The two downstream packets are labelled "load" and "construct" map region. What's the difference? Maybe that can explain my confusion on the need for the packet, "Loading completed".
    The construct map region allows the server to combine the 8x8 chunks of tiles from any location on the map to basically form a custom 104x104 map.

    In RuneScape this is used for player-owned houses. You'll notice that each room in a player owned house consists of 8x8 tiles. If you also look in the cache, you'll see some of the map just consists of areas with every possible room packed together tightly.

    When you actually enter your house, the construct map region is sent. It'll send (up to) 169 (13x13) coordinates of chunks to load from other places on the map (each of which is e.g. a room or garden or just that blank grass on the map.)

    Like the load map region packet, it also specifies the X/Y coordinates of the central chunk at 7,7. However these don't really mean much, as even if you specified them as being somewhere like Lumbridge, Lumbridge won't be loaded, it'll load what you specify and group it together into this dynamically-created map.

    Some info on construct map region packet I wrote a while ago is here:

    http://www.rune-server.ee/runescape...on-packet.html
    .
    Reply With Quote  
     


  9. #7  
    Registered Member
    Join Date
    Feb 2012
    Posts
    142
    Thanks given
    16
    Thanks received
    15
    Rep Power
    40
    Thank you very much, Graham! And I look forward to what veer has to say.

    Okay, so let me see if I understand this.

    For loading map regions: the server is supposed to check the player's coordinates periodically to see where they are relative to the central chunk (which is at (7,7)), and if they're within 16 tiles of an edge either horizontally or vertically, it knows to send the new map region that's visible where they are.

    So basically, my understanding:

    1. The server is expected to send the load map region packet by itself because it can detect when the player is within 16 tiles of a corner of the 103x103 region.
    2. The client does send an empty packet (#121) in response to confirm that the loading is done, but the server doesn't actually have any response to it [?]
    3. "Secondary map regions" are just dynamic regions meant for player-owned houses so you can generate the world in a random area with just one 103x103 region.

    That still leaves this packet unexplained (at least as documented by Mopar) : 317:Region change - RSWiki Though it makes sense to me that you'd want to load the near map region before you actually hit the wall between the loaded and not-yet-loaded map regions, so there isn't that lag there, I'm going to go play RS for a minute and see if the region loads as soon as I walk up next to it or a few blocks out.
    Thanks for reading I'm new to this community and to RSPS, so if I ask a silly question here and there, please forgive me!
    Reply With Quote  
     

  10. #8  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,666
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    Graham mentioned that the "region change" packet is completely unrelated.

    I don't recall a packet being sent to the server after a map region is finished loading, but I could be wrong.

    Quote Originally Posted by Cajun Fries View Post
    If that's correct: looking at this, let me try to remember... the absolute X and Y are the player's coordinates, correct? So then you have the region X and Y. But what confuses me is when you get into that bit block... it looks like each time you loop, you write 1 (assuming the player isn't in a corner of the map and doesn't have some data to load anymore) bit, then follow it up with 26 more bits... but what, exactly?
    No idea what that link is saying about loops/arrays, but what bit are you talking about?
    ~iKilem
    Reply With Quote  
     

  11. #9  
    Registered Member
    Join Date
    Feb 2012
    Posts
    142
    Thanks given
    16
    Thanks received
    15
    Rep Power
    40
    Quote Originally Posted by iKilem View Post
    Graham mentioned that the "region change" packet is completely unrelated.

    I don't recall a packet being sent to the server after a map region is finished loading, but I could be wrong.


    No idea what that link is saying about loops/arrays, but what bit are you talking about?
    Damn me for linking to the wrong link I had this wiki opened about 8 different times all with the same title, I must've confused them.

    Here's the proper link: 317:Construct map region - RSWiki

    I also just realised that that is the secondary map region packet, so I don't think it applies to what I was saying at all. My apologies, the packets were otherwise the same. Nevermind my question about bits! I'll cut that out of my original post.
    Thanks for reading I'm new to this community and to RSPS, so if I ask a silly question here and there, please forgive me!
    Reply With Quote  
     

  12. #10  
    Banned

    Join Date
    Sep 2010
    Age
    27
    Posts
    860
    Thanks given
    303
    Thanks received
    203
    Rep Power
    0
    Quote Originally Posted by iKilem View Post
    I don't recall a packet being sent to the server after a map region is finished loading, but I could be wrong.
    The client does write a packet after a region is finished loading. Always had that in multiple revisions in 400-500. I just leave the bitch as a "quiet" packet.
    Reply With Quote  
     

Page 1 of 4 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: 0
    Last Post: 06-25-2012, 08:28 PM
  2. [$5]Clipped tiles for 508 map
    By Donate in forum Buying
    Replies: 0
    Last Post: 01-06-2012, 07:52 PM
  3. Map regions
    By Instigator in forum Help
    Replies: 0
    Last Post: 10-31-2011, 02:01 PM
  4. Another weird map bug (missing tiles)
    By MrClassic in forum Help
    Replies: 6
    Last Post: 10-03-2011, 07:42 AM
  5. Map Regions
    By Wiffles in forum Configuration
    Replies: 13
    Last Post: 12-14-2009, 09:27 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •