[Tutorial - dev rev] Steps to know / do when you add a map.

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Tutorial - dev rev] Steps to know / do when you add a map.

Postby lmame on Thu Feb 18, 2010 10:16 am

When you add a map (or naRose added a map), the file "list_zone.stb" and several other files (list_npc.stb, AIPs, QSDs, IFOs) are updated client side and most of the time there are new respawn points, monster spawns, NPCs and monsters.
Here are the steps you should take care of server side to match those changes.


I°) Update your server files:
It's logical... Don't forget to copy your client STB, STL, LTB, QSD, AIP files to your server so it stays updated.


II°) Get the telegates, respawn areas, NPCs, monster spawns for the new maps:
If you want to have the NPCs and monster spawns (and telegates and respawns), don't forget to use Ifonnpcdumper and spawn_dev.exe to get:
-> list_npcs.sql,
-> list_mobgroups.sql,
-> list_respawnzones.sql,
-> list_telegates.sql,

Those will update all the maps, NPCs, respanws, telegates, monster spawns.
Import them into your database of course, you'll need to DELETE perhaps those old mysql tables prior to import, check error messages when importing...
If you're not sure of what you're doing, backup your database.


III°) checking if enough maps are handled server side:
By default a certain number of maps are handled server side, in file "worldserver.h":
  1. #define NB_MAPS 122        //Nb maps (120 maps, including bad and non existant).
  2. #define NB_GRIDS 92        //nb active grids (active maps)


NB_MAPS: tells the maximum of maps handled, it's basically the number of maps in list_zones.stb (even empty ones) so here we could use 120.
01.png

NB_GRIDS: those are the "real" maps, not the empty ones.

So when you add a map, perhaps the number of maps in list_zone.stb will change or the number of active maps.
When you launch the worldserver, if there are not enough NB_MAPS or NB_GRIDS the server will tell you with some warning messages:
"Incorrect map when loading grids (XX>=XX), change NB_MAPS?"
"We try to load more active maps that we can handle (XX>=XX), change NB_GRIDS"

So you just need to change the values in code (for example change NB_GRIDS from 92 to 94 if you added 2 maps) and rebuild your worldserver and check at next worldserver launch if you added enough NB_MAPS and NB_GRIDS.

Note:
If you don't have those warnings, don't bother.


IV°) Updating map boundaries server side (map_grid.csv):
1°) why?:
Maps are loaded automatically by the server since it reads the file "list_zone.stb" though it needs that you give him the boundaries for each map (up left corner and bottom right corner coordinates).
It's used by monsters to know if they need to be "refreshed" or not, checking if a player is nearby or not.
If you don't do it, server could just eat CPU and memory and ultimatly crash.

2°) what is map_grid.csv?:
Those informations are stored in the file "binary/data/map_grid.csv" like this:
  1. map id,corner up leftx,corner up lefty,corner down rightx,corner down righty,always on

So for example for map 1:
  1. 1,4960,5600,5600,4960,0


What does that mean?:
map id: the map id, see list_zones.stb,
corner up leftx: coordinate of the up left corner of the map (X),
corner up lefty: coordinate of the up left corner of the map (Y),
corner down rightx: coordinate of the bottom right corner of the map (X),
corner down righty: coordinate of the bottom right corner of the map (Y),
always on: should be let to 0. If you set it to 1 monster will always be refreshed (but don't do that).


3°) How to get those coordinates?:
That's easy, just warp to the map and run / walk (whatever) to the up left corner and bottom right corner to get the coordinates, note them.
Then put those values in the map_grid.csv file and just relaunch your world server.

Notes:
If you have some warning messages about NB_MAPS or NB_GRIDS, check part III°).
Little word of warning, be sure to get to the "real" bottoms of the map, sometimes they go over the minimap, especially when there is a sea, it happens for Junon Polis and Junon CF for example (see 4°)).
If you don't have the values for the new map, you can make temporary ones (see example in 4°)).

4°) example with Junon Polis:
Let's work with Junon Polis as if it was a new map, so it's map 2 in list_zone.stb.
03.png


If you don't have the right coordinates values for the new map, you can make temporary ones, like this:
Add the line for the map "2" in map_grid.csv, with those temporary values:

So:


And launch your worldserver.

This way it'll load and you'll be able to teleport into the map and get the real coordinates.
If you want to use /gotomap gm command, you'll need to have imported the respawn for the map so see part I°).

Then just go to the map 2 and run / teleport / whatever you want to the up left and bottom right corner and note the values:
04.png


As you see you're outside the minimap boundaries since the sea goes beyond it, those are the real map coordinates, NEVER stop to the minimap boundaries:
05.png


So here are the definitive values in map_grid.csv, save and relaunch your worldserver:
  1. 2,4800,5600,6080,4640,0



Note:
Don't forget to set "always on" to 0 back once you got the real coordinates (as I did in this example).
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Tutorial - dev rev] Steps to know / do when you add a map.

Postby hasan38 on Fri Mar 19, 2010 7:06 pm

very nice guide :) thanks Imame. That is going to help a lot of us for when we try adding a map.
hasan38
Rackie
Rackie
 
Posts: 246
Joined: Wed Apr 22, 2009 1:43 am

Re: [Tutorial - dev rev] Steps to know / do when you add a map.

Postby lmame on Fri Mar 19, 2010 7:14 pm

Thanks, some typo corrected.
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City


Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 23 guests

cron