Author Topic: V2 Map Format  (Read 1306 times)

0 Members and 1 Guest are viewing this topic.

Offline Mickey Kudlo

V2 Map Format
« on: February 28, 2017, 03:50:22 pm »
Looks like it saves 1 file per 200x200 area.

Code: [Select]
Type MapType
    flgInUse As Boolean
       
    Xsize As Integer
    Ysize As Integer

    WorldBaseXpos As Integer
    WorldBaseYpos As Integer
    WorldBaseZpos As Integer

    ConnectGrid(-1 To 1, -1 To 1) As Integer

    flgSurface As Boolean
   
    ' 1000
   
    flgChanged As Boolean
   
    ' 998
   
    UpLink As Integer
    DownLink As Integer
   
    xxx(1 To 994) As Byte

    '''''''''''''''

    Elevation_Map() As Byte
   
    Surface_Water_Map() As Byte
   
    BackGround_Map() As Integer
   
    Change_Map() As Integer
   
    Grass_Map() As Byte
   
    Mining_Map() As MiningType
   
    Player_Map() As Integer
   
    Land_Owner_Map() As LandOwnerType
   
    Item_Map() As Long
   
    MonsterSpawnMap() As MonsterSpawnMapType   ' wilderness
 
End Type

Code: [Select]
Sub modMap_Save(MapIndex As Integer, Optional flgClear As Boolean = False)
    On Error GoTo Error_modMap_Save

    Dim filenum As Integer, i As Long, Count As Long, FileName As String
   
    If Map(MapIndex).WorldBaseZpos >= 100 Then
        FileName = "\maps\dungeon" & Format(Map(MapIndex).WorldBaseZpos, "00000") & ".map"
    Else
        FileName = "\maps\map" & Format(Map(MapIndex).WorldBaseXpos, "0000") & "x" & Format(Map(MapIndex).WorldBaseYpos, "0000") & "x" & Format(Map(MapIndex).WorldBaseZpos, "0000") & ".map"
    End If
   
    filenum = FreeFile()
   
    'Open App.path & "\maps\map" & Format(MapIndex, "00000") & ".map" For Binary As filenum
    Open App.path & FileName For Binary As filenum
   
    Put #filenum, , Map(MapIndex).Xsize
    Put #filenum, , Map(MapIndex).Ysize
   
    Put #filenum, , Map(MapIndex).WorldBaseXpos
    Put #filenum, , Map(MapIndex).WorldBaseYpos
    Put #filenum, , Map(MapIndex).WorldBaseZpos
   
    Put #filenum, , Map(MapIndex).ConnectGrid
   
    Put #filenum, , Map(MapIndex).flgSurface
   
    If Map(MapIndex).flgSurface Then
        Put #filenum, , Map(MapIndex).Elevation_Map
        Put #filenum, , Map(MapIndex).Surface_Water_Map
        Put #filenum, , Map(MapIndex).Land_Owner_Map
    Else
        Put #filenum, , Map(MapIndex).Mining_Map
    End If
   
    Put #filenum, , Map(MapIndex).Grass_Map
   
    Put #filenum, , Map(MapIndex).MonsterSpawnMap
   
    If Map(MapIndex).WorldBaseZpos >= 100 Then
        Put #filenum, , Map(MapIndex).Land_Owner_Map
    End If
   
    Put #filenum, , Map(MapIndex).DownLink
    Put #filenum, , Map(MapIndex).UpLink
   
    Close filenum
   
    Map(MapIndex).flgChanged = False

    Exit Sub
   
Error_modMap_Save:
    modMisc_Log "Error_modMap_Save : " & Err.Description
End Sub
You may have conquered my worlds, but I destroyed them!
Like Like x 1 Agree Agree x 1 View List

Offline Jon The Great

Re: V2 Map Format
« Reply #1 on: February 28, 2017, 03:58:56 pm »
Thanks Mickey!

Offline Pokemon Steve

Re: V2 Map Format
« Reply #2 on: March 01, 2017, 11:14:28 am »
just open source already

Offline Powerfox

Re: V2 Map Format
« Reply #3 on: March 02, 2017, 06:27:44 am »
Still unsure about the headers for the .map files, the ones I reversed have 30 bytes of header info before the elevation data, which doesn't seem to match up with the save code before the elevation data:

Quote
    Put #filenum, , Map(MapIndex).Xsize
    Put #filenum, , Map(MapIndex).Ysize
   
    Put #filenum, , Map(MapIndex).WorldBaseXpos
    Put #filenum, , Map(MapIndex).WorldBaseYpos
    Put #filenum, , Map(MapIndex).WorldBaseZpos
   
    Put #filenum, , Map(MapIndex).ConnectGrid
   
    Put #filenum, , Map(MapIndex).flgSurface

The header info for 1x1 looks like so:

Quote
200 0 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 21 0 0 0 3 0 23 0 255 255

1x2 is:

Quote
200 0 200 0 0 0 200 0 0 0 0 0 1 0 21 0 0 0 3 0 23 0 0 0 5 0 25 0 255 255

A lot of the values change fairly predictably when going through sectors but I still can't really say I know what the values are for.

Obviously the first 200 200 is the size of the sector.

I'd like to know how to get maps into the dungeon folder and be able to use them freely, but not sure how to get them into a readable state by the server, I'm guessing having the proper header data is what is missing. That and/or configs.
« Last Edit: March 02, 2017, 06:30:51 am by Powerfox »

Offline Mickey Kudlo

Re: V2 Map Format
« Reply #4 on: March 02, 2017, 11:23:04 am »
Quote
    Xsize As Integer
    Ysize As Integer

    WorldBaseXpos As Integer
    WorldBaseYpos As Integer
    WorldBaseZpos As Integer

    ConnectGrid(-1 To 1, -1 To 1) As Integer

    flgSurface As Boolean

All of these get written in the header. Integers are 2 bytes and Booleans are 2 bytes. I count 14 Integers and 1 Boolean = 15 x 2 = 30.
When it writes out ConnectGrid it writes out the entire array, totaling 9 bytes.

You should be able to add a floating/dungeon map. I forgot the command tho.
You may have conquered my worlds, but I destroyed them!

Offline Mickey Kudlo

Re: V2 Map Format
« Reply #5 on: March 02, 2017, 11:29:16 am »
WorldBaseZpos is tricky. For the main surface map it is 0. For the main underground maps, it goes from 1 to 99. Numbers 100+, are the dungeon/floating maps. So when you warp to them, you use /warp x, y, z or /warp 10, 10, 100, etc. The code is all right there for saving so not sure what a .map file would help with.
You may have conquered my worlds, but I destroyed them!

Offline Powerfox

Re: V2 Map Format
« Reply #6 on: March 02, 2017, 11:47:49 am »
Yeah I clicked on after looking at it for a while that it's two bytes each.

Main thing is just not understanding what a lot of the values are used for or how they are calculated I guess. WorldBaseXpos/Ypos for example don't go in the increments you'd expect, not really sure what connectgrid.

Opened up server with a hex editor and had a look, dungeon command is

Quote
'Usage: /dungeonadd <xsize>, <ysize>, <flgSurface>'

Offline mechanical keyboard enthusiast

  • Full Member
  • ***
  • Posts: 169
  • Attack: 3682
    Defense: 2735
    Attack Member
  • Karma: 2
  • Gender: Male
    • View Profile

  • Total Badges: 25
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Fifth year Anniversary
Re: V2 Map Format
« Reply #7 on: March 02, 2017, 01:54:15 pm »
Wait, in what world is an `int` 2 bytes? Isn't that a short or something?

Offline Jon The Great

Re: V2 Map Format
« Reply #8 on: March 02, 2017, 01:55:36 pm »
A VB6 integer is stored as two bytes. There is no short data type in VB6.  After that comes a long which is 4 bytes.

Offline mechanical keyboard enthusiast

  • Full Member
  • ***
  • Posts: 169
  • Attack: 3682
    Defense: 2735
    Attack Member
  • Karma: 2
  • Gender: Male
    • View Profile

  • Total Badges: 25
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Fifth year Anniversary
Re: V2 Map Format
« Reply #9 on: March 02, 2017, 01:57:54 pm »
that is amazing, I grew up in a world long after that, also probably explains why i always had issues with ports >= than 32k or so on rpgwo?

weird to think about.

Offline Powerfox

Re: V2 Map Format
« Reply #10 on: March 02, 2017, 02:25:09 pm »
Been around 10 years since I last touched VB, even now it just looks like a relic of the past.

Dungeons work, main issue is that I can't warp in there without an @ character, and non @ characters can't move there if they are spawned in there.

Most annoying thing about RPGWO servers is the huge lack of docu'mentation, it wasn't so bad after playing the game for years and when it was all fresh and you could remember everything, but going back to it now it can be a ballache just to do something simple because there's a billion commands and config options with no docu'mentation to back them up.

(Doc'umentation is censored to dopigentation)

Offline mechanical keyboard enthusiast

  • Full Member
  • ***
  • Posts: 169
  • Attack: 3682
    Defense: 2735
    Attack Member
  • Karma: 2
  • Gender: Male
    • View Profile

  • Total Badges: 25
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Fifth year Anniversary
Re: V2 Map Format
« Reply #11 on: March 02, 2017, 02:29:51 pm »
do you think mickey even has dopigentation or comments for himself? i kinda doubt it at this point

Offline Mickey Kudlo

Re: V2 Map Format
« Reply #12 on: March 02, 2017, 02:40:46 pm »
Dungeons work, main issue is that I can't warp in there without an @ character, and non @ characters can't move there if they are spawned in there.

Dungeon maps, unless a surface one, start off as solid rock, so players can't move until an admin edits it.

Most annoying thing about RPGWO servers is the huge lack of docu'mentation, it wasn't so bad after playing the game for years and when it was all fresh and you could remember everything, but going back to it now it can be a ballache just to do something simple because there's a billion commands and config options with no docu'mentation to back them up.

Yeah, it is a complicated mutha. Makes me proud  8)
You may have conquered my worlds, but I destroyed them!
Useful Useful x 1 View List

Offline Powerfox

Re: V2 Map Format
« Reply #13 on: March 02, 2017, 03:02:20 pm »
do you think mickey even has dopigentation or comments for himself? i kinda doubt it at this point

No clue.  There are a few fansites still up with lists of commands, other than that it's searching the forums because there are odd posts here and there with info in them that doesn't exist anywhere else.

Worse that I haven't done anything with V2 before really, so there's a very limited amount of existing server stuff to work from. Using Hexed files atm but no clue what is vanilla and what is player craeted at this point, what is balanced and what isn't etc. It being so long ago and not playing V2 properly at all means a lot of the new items/gameplay is totally new to me.

Gonna keep slogging through and getting used to it, might sort out monster spawns and play a while solo just to get a feel for progression of combat, crafting etc. It sucks that no active servers are up right now because I'd quite like to spend a few weeks playing properly to get a feel for the game so I'm more confident with V2.

Any maps/scripts/config/whatever for V2 anyone can send my way would be a big help. Shoot em over to 1@cushie.co.uk

Dungeons work, main issue is that I can't warp in there without an @ character, and non @ characters can't move there if they are spawned in there.

Dungeon maps, unless a surface one, start off as solid rock, so players can't move until an admin edits it.

Most annoying thing about RPGWO servers is the huge lack of docu'mentation, it wasn't so bad after playing the game for years and when it was all fresh and you could remember everything, but going back to it now it can be a ballache just to do something simple because there's a billion commands and config options with no docu'mentation to back them up.

Yeah, it is a complicated mutha. Makes me proud  8)


Yeah this one was set to surface with all dirt, still couldn't move on non admin.

Weirdly every dungeon I create now seems to be solid rock underground regardless of what I put as the surface flag (True,true,1 etc)

Offline mechanical keyboard enthusiast

  • Full Member
  • ***
  • Posts: 169
  • Attack: 3682
    Defense: 2735
    Attack Member
  • Karma: 2
  • Gender: Male
    • View Profile

  • Total Badges: 25
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Fifth year Anniversary
Re: V2 Map Format
« Reply #14 on: March 02, 2017, 03:25:11 pm »
p sure dungeons only support one z-level; i used staircase/cave images with warp properties to another dungeon

Offline Mickey Kudlo

Re: V2 Map Format
« Reply #15 on: March 02, 2017, 03:45:20 pm »
http://www.rpgwo.com/download/RPGWOServer115.zip has a bunch of .TXT files with info, yo.

And looks like Gallows is opening tomorrow.
You may have conquered my worlds, but I destroyed them!
Like Like x 1 View List

Offline Powerfox

Re: V2 Map Format
« Reply #16 on: March 03, 2017, 07:51:04 am »
p sure dungeons only support one z-level; i used staircase/cave images with warp properties to another dungeon

Yeah you can't go up or down within them.

Can there only be 1 surface dungeon, though? The first dungeon I created (100) with true as the surface flag was surface (Still couldn't move though), but every dungeon I created after that was underground regardless of the surface flag.

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1325 Views
Last post October 05, 2008, 12:10:54 am
by Rokhan