Regarding the map editor, do you have any suggestions to improve the workflow?
Currently, in OTC/Things it’s 772, in RME it requires 8.0, and in the map properties it shows 8.4 — which is quite confusing.
While editing and viewing the map in-game works, in RME it’s hard to correctly identify the items used. How can we make this visualization clearer and more reliable?
Now that all dramas looks to be stopping and even Ezzz is helping with questions on this thread, here is the solution with the mess with maps in TVP, here you are the solution that I have been using for like 3 years:
For simplicity, just use the TVPMapEditor that is attached somewhere in this thread
The main difference between OTA-RME / RME and TVPMapEditor is the spawn system and that it can load maps without otbm (only based on items.xml, but useless for this topic).
It is worth to use it just because of the "tvpspawn" tags in xml, but in theory the TFS spawn and TVPSpawn behaves as the same, but the "tvpspawn" tags are converted from Cipsoft .db files, so in theory it has the same spawns as Cipsoft 7.7.
If you want to get rid of this specific TVPMapEditor, convert tvpspawn tags to equivalent spawn tags and maybe it will work. I do not recommend this if you want to keep the tvp spawn system (maybe later I can add a PR with fixes related to this, but I got no time for a couple of weeks)
Now the main part, which should be done in order to load TVP Map in all MapEditors:
- all maps in .otbm format are build based on a given items.otb.
- .otbm files holds on which version of items.otb it was built from
- map editor has a clients.xml file, which is a config-kind file in order to match Spr/Dat -> items.otb -> maps.otbm
1 - We need to check on which version the map is saved, and also the items.otb information
Code snippet to edit in order to print/debug otb and map versions:
at iomap.cpp, at IOMap::loadMap replace:
C++:
std::cout << "> Map size:" << root_header.width << "x" << root_header.height << '.' << std::endl;
to:
C++:
std::cout << "> Map size: " << root_header.width << "x" << root_header.height << std::endl
<< "> Map spawn file: " << map->spawnfile << std::endl
<< "> Map house file: " << map->housefile << std::endl
<< "> Map OTBM version: " << root_header.version << std::endl
<< "> Map build with items.otb version: " << root_header.majorVersionItems << " id:" << root_header.minorVersionItems << std::endl;
after loading the server, you will see something like this in your console:
Code:
>> Loading map
> Loading data/world/map.otbm
> Map size: 65000x65000
> Map spawn file: data/world/spawns.xml
> Map house file: data/world/houses.xml
> Map OTBM version: 2
> Map build with items.otb version: 2 id:7
Here is where the important informations are: OTBM version is 2
items.otb version is 2 and the ID is 7.
2 - Now that we have the map and items information, time to add it to the map editor
at clients.xml, we do not have any entry for otb version 2, ID 7. We need to add this. This way you will avoid map corruption due wrong conversions between 8.0 and 7.4 sprs
so simple add this line under <otbs> tag:
XML:
<otbs>
<!--
Just list all OTB versions here
This is only used as a mapping for parsing the versions later on
-->
<otb client="7.40-tvp" version="2" id="7"/>
<otb client="7.40" version="1" id="1"/>
<otb client="7.50" version="1" id="1"/>
<otb client="7.55" version="1" id="2"/>
<otb client="7.60" version="1" id="3"/>
<otb client="7.70" version="1" id="3"/>
<otb client="7.80" version="1" id="4"/>
<otb client="7.90" version="1" id="5"/>
<otb client="7.92" version="1" id="6"/>
<otb client="8.00" version="3" id="7"/>
<otb client="8.00" version="3" id="100"/> <!-- this is just to remove a warning of duplicated id -->
<otb client="8.10" version="2" id="8"/>
<otb client="8.11" version="2" id="9"/>
<otb client="8.20" version="3" id="10"/>
<!--
below this line, just keep the same
-->
After this changes, we already have a valid otb for this map, but now we need to add a proper directory and valid spr/dat format to it, so under tags <clients>, add this:
XML:
<client name="7.40-tvp" otb="7.40-tvp" visible="true" data_directory="740-tvp">
<otbm version="2"/>
<data format="7.55" dat="0x439D5A33" spr="0x439852BE"/>
</client>
What are we doing here in this clients.xml is:
Given .otb versions, add a relationship between "otbs" and "clients", so we say that otb version 2, ID 7 belongs to client "7.4-tvp"
and at clients definitions we say that client "7.40-tvp" has otbm version 2 and the correct spr/dat format
3 - Now that we already have a proper clients.xml, go to MapEditor data folder, copy the 800 folder, rename it to 740-tvp, replace the items.otb from that folder with the one that is from server
Thats all. Now you will be able to load all kind of maps in TVPMapEditor, from versions 8.0 (or any other), convert it to "740-tvp" and edit your map like a normal server.
I don't know why Ezzz did this conversions but this is the way to use it! Maybe there is a good reason behind this conversions that I dont know, I just prefered to do not make any map conversions and simple adapt this clients.xml in order to do not mess with maps from the servers.
Also Evil Mark is 97.1% correct saying that you can use the normal map editor, the missing 2.9% is that you will not be able to edit/see/add spawns to your maps