Author Topic: Map Data Handling  (Read 113 times)

0 Members and 2 Guests are viewing this topic.

Offline Mickey Kudlo

Map Data Handling
« on: October 31, 2018, 01:27:02 pm »
Past versions send map data as you move. You move to the left, the server sends the left edge of the map data(surface, items, players, monsters, etc), then the client displays the move.
So, you can end up getting the same data over and over, increasing bandwidth (and latency?) but it deals with a dynamic world well.

Since V7 is also intended for mobile, I decided to deal with map data differently. It sends a large portion (50x50) at a time to the client and sends updates as they happen.
So it a lot of data at first but should be minimal as the player moves around. The server sends more 50x50 sections as you hit edges. This is for large maps. Smaller ones, like a 100x100 dungeon would send all at once, when you first enter it.

This also gives the client more responsibility and faster reaction. It will start moving right away then send the request to the server. The client knows basic blocking items, etc.

I want to say most/all online games, that use static maps (which is probably most/all), have copies of world maps already. So, I am kinda using that model.

Not sure how it will all work out but will see!
You may have conquered my worlds, but I destroyed them!

Offline Powerfox

Re: Map Data Handling
« Reply #1 on: November 03, 2018, 02:48:06 pm »
This is pretty much the standard for games with large changing worlds anyway.  Minecraft for example, when you join a multiplayer server you receive data for ~500,000 blocks at once and it unloads/loads ~200,000 blocks or so at a time as needed to keep it seamless.   For a 2D game the impact of this should be negligible if the data is stored properly and isn't all being rendered.

Only thing I noticed from giving V7 a whiz was that it the game seems to hang for a good few seconds when receiving new chunks so could probably do with this being handled asynchronously.

Offline Greatest

  • Hero Member
  • *****
  • Posts: 1309
  • Attack: 173
    Defense: 107
    Attack Member
  • Karma: 1
  • Gender: Male
  • I'm better than you!
    • View Profile

  • Total Badges: 36
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary 10 Poll Votes
Re: Map Data Handling
« Reply #2 on: November 06, 2018, 01:32:48 am »
my only concern with this:
since you're not going to see next 50 area til you're in it/near it, when you're near a map edge before it loads and you're within attack range of monsters in that area can they still kill you?

I know you only have rats for now, but long term I'm sure there will be ranged attack units and magic, and getting ganked by monsters that haven't loaded on your client yet sounds worse than possibly having a bit of lag...

why does Fox keep cancelling good shows?

Offline Powerfox

Re: Map Data Handling
« Reply #3 on: November 06, 2018, 03:55:54 am »
my only concern with this:
since you're not going to see next 50 area til you're in it/near it, when you're near a map edge before it loads and you're within attack range of monsters in that area can they still kill you?

I know you only have rats for now, but long term I'm sure there will be ranged attack units and magic, and getting ganked by monsters that haven't loaded on your client yet sounds worse than possibly having a bit of lag...



You don't hit a black wall when then load the next area, once you get within a certain distance of the edge it starts loading in the next area ready to go, it should feel seamless to the player.

Offline Greatest

  • Hero Member
  • *****
  • Posts: 1309
  • Attack: 173
    Defense: 107
    Attack Member
  • Karma: 1
  • Gender: Male
  • I'm better than you!
    • View Profile

  • Total Badges: 36
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary 10 Poll Votes
Re: Map Data Handling
« Reply #4 on: November 06, 2018, 07:14:09 am »
You don't hit a black wall when then load the next area, once you get within a certain distance of the edge it starts loading in the next area ready to go, it should feel seamless to the player.
So it a lot of data at first but should be minimal as the player moves around. The server sends more 50x50 sections as you hit edges. This is for large maps. Smaller ones, like a 100x100 dungeon would send all at once, when you first enter it.
your way of thinking is similar to how it is now, which works fine.  Mickey said new stuff when you hit the edges.  say that edge is considered 5 tiles, and the monsters have an attack range of 8, they can hit you from up to 3 tiles into the next 50 section while that section hasn't loaded in the client...atleast potentially, which is why I have concerns with it.
why does Fox keep cancelling good shows?

Offline Powerfox

Re: Map Data Handling
« Reply #5 on: November 06, 2018, 07:20:50 am »
You don't hit a black wall when then load the next area, once you get within a certain distance of the edge it starts loading in the next area ready to go, it should feel seamless to the player.
So it a lot of data at first but should be minimal as the player moves around. The server sends more 50x50 sections as you hit edges. This is for large maps. Smaller ones, like a 100x100 dungeon would send all at once, when you first enter it.
your way of thinking is similar to how it is now, which works fine.  Mickey said new stuff when you hit the edges.  say that edge is considered 5 tiles, and the monsters have an attack range of 8, they can hit you from up to 3 tiles into the next 50 section while that section hasn't loaded in the client...atleast potentially, which is why I have concerns with it.

I think it's just bad phrasing, if you play the V7 client now you can see it print to the chat when its loading new 50x50 areas and its always off screen, it would be nonsensical to wait until the player can see the edge before loading more versus just doing it a bit further away.

Offline Mickey Kudlo

Re: Map Data Handling
« Reply #6 on: November 07, 2018, 10:42:37 am »
It loads the 50x50 when it is 50 away, so you will never see black/null unless you at edge of a map.

Yes, I need to asynchronously load data. Instead of 50x50 at a time, maybe 50x1 sent every .05 seconds, so no lag is apparent.

Greatest, yes, map data loading is an issue, sort of, for combat risks cuz you are stuck getting data, vulnerable to attack. Loading a smaller amount at a time will solve this but when entering dungeon maps, I plan to first remove player from old map, send whole dungeon map, then add player to new map. This would also apply to going up/down on the main map. Then nothing can attack until the client is ready.

And one things planned, maybe, would be like telescopes, so you can look far out, that why I choose 50.

And thanks all for testing. I have seen about 14+ players made.
You may have conquered my worlds, but I destroyed them!

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
883 Views
Last post May 15, 2015, 05:08:17 pm
by uderghad