MMO Map Loading
MMO Map Loading
MMO Map Loading
MMO Map Loading
MMO Map Loading
MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading
MMO Map Loading MMO Map Loading
MMO Map Loading
Go Back  Xtreme Visual Basic Talk > > > MMO Map Loading


Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2008, 10:41 AM
Silux Silux is offline
Newcomer
 
Join Date: Aug 2005
Posts: 9
Default MMO Map Loading


K So I am making an MMORPG in VB6. I don't need to get into much specific detail for this...so heres the downlow.
I'm want the RPG to be 100% Server-side. Basically so no matter how much packet editing, file editing, etc. you do, you can't mess with the game. I've got a good idea of how to do this, and currently all my methods are set up for this concept.

Now for the problem. I'm having a hard time figuring out the most effective way to keep this "un-screwable" idea going when it comes to Maps and map loading. Should I update the persons map file on their computer everytime they move? Should I do it whenever they load the map and update their screen from the map file? or should i load the map into memory once its been updated and not update from the file anymore?

And should I check to see if their map is the same as mine before updating it? ORRRR..should i just update it regardless everytime they load a map? And is there anyway I could encrypt a file so efficiently and well that i could only send them the map once and it encrypts the file on their computer? That way i only have to send them the map if they don't have the map file at all.

By the way, the way the map files are saved on the server are basically in complete english (i did this for easy by-hand editting and bug checking) via WritePrivateProfileString (AddINI).

So many options But which method is the best?
Reply With Quote
  #2  
Old 02-15-2008, 04:53 PM
the master's Avatar
the master the master is offline
Tachikoma
 
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,596
Default

I would store the maps in computer generated format to make them smaller. The method you are currently using is ok for debugging but once you think youve got all the bugs then you should change to something only the computer can understand.

I would give each map an ID and maybe a version number. Each time a user loads a map then all you have to do is send the ID and version number to the server. The server will decide if there is a newer version of that map. If there is then it should be transfered to the client and stored in a file.

Since everything happens in the server anyway then i wouldnt both if a user hacks on of your map files and changes it. They will still be bound by the rules of the server so they still cant cheat but they will mess the game up for themselves
__________________
"That which seems simple is often overlooked" ~ me
Halloween 2014 Yard Haunt
Halloween Special FX
Reply With Quote
  #3  
Old 02-16-2008, 05:13 PM
Silux Silux is offline
Newcomer
 
Join Date: Aug 2005
Posts: 9
Default

I've got the version and ID already set up. Also, I know how to do it in Java, but in VB how would you go about creating a computer generated binary file? Is there an API call?
Reply With Quote
  #4  
Old 02-16-2008, 05:23 PM
the master's Avatar
the master the master is offline
Tachikoma
 
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,596
Default

You wouldnt need an API call at all. It really depends on the kind of format you want to use. I take it you are making a 2D game using tiles. You can invent your own file format for this but i usually have a few bytes at the start to say how many rows and columns there are then i use 1 byte to represent a tile. Since 1 byte ranges from 0 to 255 that allows you to have upto 256 different tiles used in that map. If thats not enough for you then use 2 bytes per tile. That allows you to have 65536 different tiles.

There are only 2 functions that you really need.
Chr() converts a number (0-255) into a character
Asc() converts a character back to a number

If you assign each tile type a number then decide which number goes where you can convert all those numbers to characters and save them to a file.
__________________
"That which seems simple is often overlooked" ~ me
Halloween 2014 Yard Haunt
Halloween Special FX
Reply With Quote
  #5  
Old 02-16-2008, 08:24 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

welp...<cruch crunch> ... what i'm doin' ...<gulp>...is basically..,

once you start using Winsock(or such), (like these people showed me a couple of months ago), you will be sending a line of data across the internet.

if it's like my game , it will look something like this,
Code:
002-034-002-003-144-002-042-005-006-788-004-003-003-
when the data reaches the client, the client is told what to draw.

you send a massive line of data and the client fills up your map arrays.

there is no need to send maps with the client, the user only needs to see the map area that he is active in, BUT you should send the picture tiles with the original client download so the client can use them.

so...the user can screw with the pictures, but there is rarely any advantage to that.


(as far as hacking and corrupting data, i don't know anything about that other then you are supposed to send data encrypted)


in my game, data is updated every character step and every time the server is done with a full update loop (several times per second)
__________________
The Pho·net·ic Programmer
Reply With Quote
  #6  
Old 02-16-2008, 09:03 PM
Rockoon's Avatar
Rockoon Rockoon is offline
Joseph Koss

* Guru *
 
Join Date: Aug 2003
Location: Unfashionable End
Posts: 3,615
Default

I think what he is worried about with the map data is Fog Of War.

An honest client would only display what has been revealed. A dishonest client would display the whole map.

To avoid dishonest clients, you would only want to send tiles as they are revealed.
Reply With Quote
  #7  
Old 02-17-2008, 04:10 AM
the master's Avatar
the master the master is offline
Tachikoma
 
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,596
Default

Ahh. I see what you mean. I guess it depends on the type of game. The things ive done in the past always sent the full map as you got onto it because it didnt really matter.

If it does matter then i guess you could send the current viewing area plus a border of about 2 squares on each side which are normally out of view. That means you have something to walk into while your waiting for the server to send the next lot of data. If someone tried to hack your game they could only see a maximum of 2 squares extra

I cant see it making all the difference to be honest because if i made my own client for your game i could log all the tile data, walk around the map then i could see the full map anyway since your server has sent the whole data (even though it sent it in small bits)
__________________
"That which seems simple is often overlooked" ~ me
Halloween 2014 Yard Haunt
Halloween Special FX
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
MMO Map Loading
MMO Map Loading
MMO Map Loading MMO Map Loading
MMO Map Loading
MMO Map Loading
MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading MMO Map Loading
MMO Map Loading
MMO Map Loading
 
MMO Map Loading
MMO Map Loading
 
-->