Perhaps we could split in several .xml the .ifo and .zon:
For one map:
-> 1 xml for npcs + objects + monster spawns,
-> 1 xml for telegates / respawnareas (or mix it with the one above though as they are coming from .zon... would be easier at first to make a separate one),
-> 1 xml for all that concerns only the client (constructions, trigger events, sounds and so on),
That would mean about 3 to 5 XMLs per map and though should be fast enough to read them and friendly enough rather than having 100s of files...
As for their filenames we should use different names for all maps, at least as "root" so people could copy them to the server.
That would avoid having to copy the whole folder structure and since people are lazy I can only imagine they would just copy everything leading to a 800 MB server thing...
I guess they would already copy all the xml rather than the ones actually needed if we left the ".xml" extension...
Or we could use several file extensions like ".serv" for files to be copied to server and ".cli" for files to be left to client?
The name could be "JPT01_xxxx.yyy" with JPT01 the folder name for example, the one we can find in the STB.
For now when they try to make several maps from one (like clan wars thing) they keep the same map structure so I guess we won't have a problem on this side. The difference is done server side with AIP and QSD summoning more or less strong monsters and so on.
At server loading server would load the stb at each map and would look for the according ".serv" files like "mapname_npc.serv" and would load it.
We shouldn't give the mapid directly in the xml so people can change it in the STB directly. The "name" (JPT01) though is usually only done once and for all and would be changed rarely.
Example for a xml "npc + object + monster spawns", named "JPT01_npc.serv":
-
- <map id="JPT01" name="Junon Polis map">
- <slice x="31" y="31">
- <npclist>
- <npc type="1024" x="5011" y="5052" dir="180" dialog="npc_1024.con">Judy</npc>
- <npc type="1025" x="5000" y="5000" dir="0" dialog="npc_1025.con">Spero</npc>
- </npclist>
- <objlist>
- <obj id="1" x="5051" y="5022" dir="180" qsd="hourglass_5067">hour glass</obj>
- </objlist>
- <spawnlist>
- <spawn x="5200" y="5200" range="10" rtime="10" limit="10" tactic="200" day="0" active="1">
- <group monster="301" nb="2" tactic="0"/>
- <group monster="302" nb="1" tactic="0"/>
- <group monster="303" nb="1" tactic="0"/>
- <group monster="301" nb="4" tactic="1"/>
- <group monster="302" nb="3" tactic="1"/>
- </spawn>
- </spawnlist>
- </slice>
- <slice x="31" y="32">
- <npclist>
- <npc type="1024" x="5011" y="5052" dir="180" dialog="npc_1024.con">Judy</npc>
- <npc type="1025" x="5000" y="5000" dir="0" dialog="npc_1025.con">Spero</npc>
- </npclist>
- <spawnlist>
- <spawn x="5300" y="5300" range="10" rtime="10" limit="10" tactic="200" day="0" active="1">
- <group monster="301" nb="2" tactic="0"/>
- <group monster="302" nb="1" tactic="0"/>
- <group monster="303" nb="1" tactic="0"/>
- <group monster="301" nb="4" tactic="1"/>
- <group monster="302" nb="3" tactic="1"/>
- </spawn>
- </spawnlist>
- </slice>
- </map>
-
for telegates and respawn zones, named "JPT01_gates.serv":
-
- <map id="JPT01" name="Junon Polis map">
- <telegatelist>
- <telegate id="2" x="5200" y="5200" dmap="10" dx="5100" dy="5100"/>
- </telegatelist>
- <respawnlist>
- <respawn id="3" x="5000" y="5000" type="0">
- </respawnlist>
- </map>
-
If we want to continue the slice system instead of simply doing:
We could insert another entry so a generic XPath query would find the according data quickly, even in a single file (like "//slice_31_31" or even a root query "slice_31_31"):
-
- <slice_31_31>
- <slice x="31" y="31">
- <npclist>
- </npclist>
- <objlist>
- </objlist>
- <spawnlist>
- </spawnlist>
- </slice>
- </slice_31_31>
-
The other entry would be used by the server, I would need it to calculate map size or we would have to do this that could lead to confusions if someone puts wrong coordinates:
- <map id="JPT01" lx="4500" ly="4500" width="1024" height="600" name="Junon Polis map">
I know how to get real maps coordinates from slices so I would prefer that server fetches it rather than letting people do this. Experience shows lately that people just don't update the map_grid.csv so we'll have to do it for them.
So I guess they wouldn't do it for their xml...
Now that beeing said, the problem with xmls is that you can't go in database and tell "ok let's stop this event" or see the spawns that are overall on your server, making mysql queries for example.
It's especially true for the npcs who not only have a dialogid but also an eventid that subsets their dialogs...
That would mean keeping at least a list_npc mysql database storing the events for the npcs. Though instead of storing all npcs, we could just store the ones who have their eventid changed.
So I'll have to change that but shouldn't be a big deal.
Another possible issue is the ".serv" size for the file with monster spawns. Could be big.