|
Thread: Convert H3 maps to H4 | This thread is pages long: 1 2 3 · NEXT» |
|
iliveinabox05
Honorable
Famous Hero
|
posted November 04, 2021 05:15 AM |
|
|
Convert H3 maps to H4
Hello!
In the random map generator thread we talked about a possible solution for H4 not having an rmg would be converting H3 maps to H4 maps. I thought that would be a massive amount of work since I would have to write code to parse an H3 map, but RoseKavalier found several libraries that already handle opening H3 maps.
One specifically can export an H3 map in json format. We're currently evaluating it and have found some issues, but it's at least promising.
So, what's left that needs to be done to start converting H3 maps to H4?
1) We need a mapping of all H3 objects to H4 objects (can be multiple objects on the H4 side that an H3 object maps to). This includes terrain types.
2) Work on an h3 map parser to get to the info I need such as terrain, objects, and events.
For the list of H3 objects mapping to H4 objects, I was hoping someone or multiple someones here would be able to work on that. Posting here in this thread would be fine, and then I can compile them into a document.
I need to know the object id, and the object sub id (if there is a sub id), for the H3 objects.
Object ids can be found here
Object sub ids can be found here, though I don't know if all of the potential sub ids are contained there.
I want to create a config file with the H3 object ids and sub ids mapping to an H4 object.
Any help with getting this would be very much appreciated!
**********************************************************
Edit1. I've started working on mapping h3 creatures to h4 creatures here. Feel free to take a look and add a comment for the ones that don't have a second entry yet.
It's in the form: H3Creature, H4Creature
The missing entries have the h3 creature, but an empty spot for the h4 creature.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted November 05, 2021 04:17 AM |
|
|
I can help with ideas, but seeing the H3 ids is too much work.
However, informally, I can show which oibject converts to which with images.
Another idea since there are more H4 objects than h3 ones is to let the converted randomly turn An h3 object into an H4 one from a list and give a % to each conversion.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 05, 2021 04:24 AM |
|
|
NimoStar said: I can help with ideas, but seeing the H3 ids is too much work.
Unfortunately I do need the ids, as that's how they are output in the json.
I know it's a lot of work, which is why I'm asking everyone here. Even covering just a few of the h3 object -> h4 would be helpful. Even if someone just wants to do the easy ones.
Maybe terrains would be a good place to start?
NimoStar said: Another idea since there are more H4 objects than h3 ones is to let the converted randomly turn An h3 object into an H4 one from a list and give a % to each conversion.
Yep, that's what I meant when I said multiple objects on the H4 side
I definitely plan to do just what you said and select randomly (or with a weighted percentage if someone convinces me that would be better on a case by case basis).
Edit. Probably would be good to take into account the terrain type below the object where things like trees and mountains are concerned.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted November 06, 2021 09:50 PM |
|
|
Quote: Unfortunately I do need the ids, as that's how they are output in the json.
I know it's a lot of work, which is why I'm asking everyone here. Even covering just a few of the h3 object -> h4 would be helpful. Even if someone just wants to do the easy ones.
Maybe terrains would be a good place to start?
OIk, lets say I see the ids in the web you showed.
Even then, how do I format the H4 objects?
Please give an example for a single opbject of what you would like to see
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 06, 2021 10:06 PM |
|
|
Edit2. Just a quick update, I realized I don't actually need to worry about parsing json exported h3 maps since the library I'm using is already Java code.. I just need to read the H3 map, and then take what I need to convert it to h4.
I do still need the object ids and sub ids, but I don't have to write code to read and parse json objects.
I mentioned there was a bug in the Java library for parsing h3 maps, so currently I'm looking at the VCMI code for opening h3 maps, and am working on porting that code for an h3 map parsing class.
----------
Edit1. I've successfully transferred terrain from H3 maps to H4. Looking at an h3 map parsing bug, but again, RK to the rescue with some solid resources.
----------
NimoStar said: OIk, lets say I see the ids in the web you showed.
Even then, how do I format the H4 objects?
Please give an example for a single opbject of what you would like to see
That's a great question! I haven't quite gotten to that yet. I just made a mapping for terrains from h3 -> h4, and am working on transferring those at the moment.
I'll get you a for sure answer soon, but I think what we want is the h3 Object id and sub id mapping to the h4 object filename as follows:
objectid.subid: h4objectFilenames
Where subid can be an empty string for h3 object types that don't have a sub type, and the h4 filenames are separated by the pipe symbol |
|
|
Baronus
Legendary Hero
|
posted November 09, 2021 06:13 PM |
|
|
Wonderfull! It gives us a lot of new content especially for H4 because H3 has now his own in gigantic scale. Best is to have high quality RMG maps. I want to try make unit conversion table.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 09, 2021 07:57 PM |
|
|
Baronus said: Wonderfull! It gives us a lot of new content especially for H4 because H3 has now his own in gigantic scale. Best is to have high quality RMG maps. I want to try make unit conversion table.
Hi Baronus! I think a good place to start would be to make an h3 map with one of each object in it. Once I get a more robust h3 map parser going I can then create the necessary table, minus the h4 objects, which can then be filled in much easier!
|
|
Bytebandit
Promising
Famous Hero
Soul Merchant
|
posted November 14, 2021 04:35 AM |
|
|
I know one thing I would like to see on the advanced H4 map editor are some x,y and z coordinates on the outside perimeter of the map. This would make manual map conversion much easier than it is now. But I am excited about what's going on here at the present though. Thanks for the effort you're putting into it.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 14, 2021 06:49 AM |
|
|
Bytebandit said: I know one thing I would like to see on the advanced H4 map editor are some x,y and z coordinates on the outside perimeter of the map. This would make manual map conversion much easier than it is now. But I am excited about what's going on here at the present though. Thanks for the effort you're putting into it.
Can you give an example of what you mean? There is a row / column readout, but no pixel readout.
|
|
Bytebandit
Promising
Famous Hero
Soul Merchant
|
posted November 14, 2021 07:46 AM |
|
|
Sure. In the H3 map editor, when you're making a map, Just above the map are horizontal numbers. To the left are vertical numbers. It's set up much like a grid system. To me, the 'x' numbers represent the horizontal. The 'y' numbers are vertical. The numbers increase with the size of the map. 'Z' would represent above or below ground.
There are no numbers laid out like I mentioned for the H4 map editor.
This would be nice to have for manual conversion of H3 maps as well as for reference of cross checking the map.
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 14, 2021 08:16 AM |
|
|
Bytebandit said: Sure. In the H3 map editor, when you're making a map, Just above the map are horizontal numbers. To the left are vertical numbers. It's set up much like a grid system. To me, the 'x' numbers represent the horizontal. The 'y' numbers are vertical. The numbers increase with the size of the map. 'Z' would represent above or below ground.
There are no numbers laid out like I mentioned for the H4 map editor.
This would be nice to have for manual conversion of H3 maps as well as for reference of cross checking the map.
The grid in H4 is row / column instead of x / y, with rows starting from the top right and columns starting from the top left.
If you're using the H4 editor, take a look at the very bottom right, there is a readout for row, column, and level. The advanced editor also has this readout.
Do you mean that you would like to see the H3 x / y grid on an H4 map? I am actually doing a conversion to get an H4 row / column from an H3 x / y.
What I could look at adding to the advanced editor is something to allow you to input a row / column, and get back an x / y on the H3 grid and vice versa.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted November 14, 2021 05:35 PM |
|
Edited by NimoStar at 17:44, 14 Nov 2021.
|
The grid in H4 maps would have to be at least doubled compared to the H3 one.
THis is necessary to fit in the new objects and the area of control mechanic forcreatures.
Compare H3 oasis, 2 tiles vs H4 oasis, 4 tiles. And this is not even a big H4 object.
H3 1x1 flotsams are 2x2 in H4.
H4 level 4 dwellings are 16 (!) [4x4] tiles while H3 ones are just 2x1.
So, even turning 1x1 into 2x2 there will be problems. However, there would be limitations in original map size if we convert 1x1 into 3x3...
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 14, 2021 06:42 PM |
|
|
NimoStar said: The grid in H4 maps would have to be at least doubled compared to the H3 one.
THis is necessary to fit in the new objects and the area of control mechanic forcreatures.
Compare H3 oasis, 2 tiles vs H4 oasis, 4 tiles. And this is not even a big H4 object.
H3 1x1 flotsams are 2x2 in H4.
H4 level 4 dwellings are 16 (!) [4x4] tiles while H3 ones are just 2x1.
So, even turning 1x1 into 2x2 there will be problems. However, there would be limitations in original map size if we convert 1x1 into 3x3...
I don't think it's too big a deal. Some maps might be a little cramped when converted, but the person that did the conversion can move things around as needed.
The sizes also don't look to map exactly to one another. Just looking at it the H4 maps seem to be a little bit bigger, but I don't have any actual numbers to back that up. Could figure out the map area for H4 maps if we wanted to really compare.
So far ByteBandit's Heroes IV Chronicles looks to be fitting pretty well.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted November 15, 2021 06:16 PM |
|
|
But heroes IV chronicles doesn't map 1:1 with the original H3 maps either...
I would go from a base of 1x1 to 2x2 at the very least.
I mean, even compare the area that something like towns takes.
Or magic shrines.
H3 shrines are always 1x1 while H4 ones can be 3x3
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 15, 2021 06:24 PM |
|
|
The maps that ByteBandit has produced so far look great. I really don't think the object footprint differences are a big deal. You just have to move the larger footprint object to a better spot for the passability issues.
H3 -> H4 isn't going to map perfectly. We just need something good enough that can be done programmatically, and then any smoothing or passability issues would need to be taken care of by hand.
Unless I'm not understanding what you're saying?
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted November 15, 2021 09:27 PM |
|
|
1x1 area in h3 to 2x2 area in h4 can be programmed.
Even by "moving" the objects there will be just not enough space to pass otherwise.
This is obvious with a single data point:
H3 SoD+ allows diagonal movement.
H4 doesn't.
So in 1:1 scale, H4 maps will be impassable even if all objects were the same size.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 15, 2021 09:47 PM |
|
|
Right, but that's where the person converting the map comes in. I'm not going to be worrying about passability for a little while, if at all.
It will be a known issue that you'll have to massage any map you convert from H3 to H4 for things like this.
You might be overthinking this This conversion won't be perfect. It's not going to be able to handle everything like keeping the exact passability, and therefore the same zones. That would take some extra thought and problem solving, which could be done, but I have a laundry list of things to get done, so I will more than likely leave that piece to anyone converting the H3 maps.
Think of it as something to make it possible to transfer H3 maps to H4, by taking an enormous amount of work off of the person bringing the maps over.
|
|
Bytebandit
Promising
Famous Hero
Soul Merchant
|
posted November 15, 2021 10:35 PM |
|
|
Getting THE perfect map conversion from H3 to H4 would be asking a lot. The width on an H4 map is longer than on H3. While the height seems smaller. More rectangular than square. I subtract a tree or a rock here and there heighthwise, while adding more decorations lengthwise. It's the only way to do it to get the map as close as possible. Still there are a few things that are moved about that can't make the map 100% like H3, but nothing that could affect the whole gameplay negatively.
Getting something like a 'grouping' of stuff, like sawmills, Ore, Gems, etc, together much like the H4 util does would even be OK. But going into the map and adjusting things around for passability is almost just taken for granted. (When you make a map, you gotta double check for passability anyway.) You can't always trust an automatically made map to be ready to play right away like an RMG does. All the converter should be is a tool for getting what you need on the map, and moving things around as you see fit.
____________
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted November 16, 2021 05:18 AM |
|
Edited by NimoStar at 22:28, 16 Nov 2021.
|
Just look at an H3 forest that can have 5+ pixel trees in the same tile, while H4 forests are one tree per tile. Then compare the average tile width of each, and realize H3 "dense forests" will become 4-6 trees in H4... but well, that is the cosmetic and scale aspect. H4 is MUCH more zoomed in, which in turns means it uses more tiles.
What I'm saying is that there won't be enough space in a 1:1 conversion BY A LOT. It's not about massaging, it's about basic viability. There might be 4x more occupied tiles in the "converted" map, making everything a full, overcrowded, completely impassable (and of course, unplayable) red space if topography isn't expanded as a base function. That is way beyond "Massaging".
I'm not at all against a conversion algorithm, I'm saying it *must* convert 1x1 h3 to 2x2 h4 in order to be useful at all.
It is completely certain this will become plenty clear with time if the project ever gets far enough, so I'm just laying it here now.
____________
|
|
iliveinabox05
Honorable
Famous Hero
|
posted November 17, 2021 06:21 AM |
|
|
We'll just agree to disagree
|
|
|