Heroes 4 Advanced Options Map Editor
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
After about two days of fighting with and debugging threading optimizations to make loading times and terrain painting times a bit better, I was finally able to find and fix the problem keeping me from moving forward
Now, each map is parsed on its own thread. Painting terrain for multiple maps works the same way, each image is drawn on its own thread.
Oh, and before that, I went back to actually parse the campaign header, which I wasn't really doing before. I was just searching for the campaign name and description, but I have since gone through all of the options (hopefully) and documented them. One of the things I found out, which also helped me with some optimizations, was the fact that the end of the campaign header (if a campaign and not single scenario) had a short for the number of maps in the campaign, followed by an integer for each campaign which represented the gzipped size of the map in bytes. If I hadn't found that, I wouldn't be able to actually modify the map, since invalid size values will cause the editor (and probably the game) to crash.
Now that that's out of the way, I've also started working on painting terrain, and I have some screen shots. See the void terrain below (ignore that ugly mouse arrow on the button next to the terrain button, just started working on the toolbar)
And what it looks like in the editor:
I haven't set things up quite yet to be able to select the terrain type to paint, just hard-coded the type and passed that to the painting method, but that won't take too long. I'm thinking that if the terrain icon is pressed, I'll switch over to the drawing tab, similar to how the campaign editor brings up the terrain options. I'll probably give a few more options, such as brush shape, where the editor only has the square brushes of four sizes.
I seem to be able to paint any type of terrain on any elevation, which is pretty cool
Oh right, and as you can see, I got the grid up and running.
Now, each map is parsed on its own thread. Painting terrain for multiple maps works the same way, each image is drawn on its own thread.
Oh, and before that, I went back to actually parse the campaign header, which I wasn't really doing before. I was just searching for the campaign name and description, but I have since gone through all of the options (hopefully) and documented them. One of the things I found out, which also helped me with some optimizations, was the fact that the end of the campaign header (if a campaign and not single scenario) had a short for the number of maps in the campaign, followed by an integer for each campaign which represented the gzipped size of the map in bytes. If I hadn't found that, I wouldn't be able to actually modify the map, since invalid size values will cause the editor (and probably the game) to crash.
Now that that's out of the way, I've also started working on painting terrain, and I have some screen shots. See the void terrain below (ignore that ugly mouse arrow on the button next to the terrain button, just started working on the toolbar)
And what it looks like in the editor:
I haven't set things up quite yet to be able to select the terrain type to paint, just hard-coded the type and passed that to the painting method, but that won't take too long. I'm thinking that if the terrain icon is pressed, I'll switch over to the drawing tab, similar to how the campaign editor brings up the terrain options. I'll probably give a few more options, such as brush shape, where the editor only has the square brushes of four sizes.
I seem to be able to paint any type of terrain on any elevation, which is pretty cool
Oh right, and as you can see, I got the grid up and running.
Re: Heroes 4 Map Generator / Utility
That's pretty awsome. And so is the fact that you can just paint the void terrrain on the map, despite objects being placedI seem to be able to paint any type of terrain on any elevation, which is pretty cool
Now if you could add the cliff effect as well =
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Haha yep, also without the cave / stone walls
Before I move on to the elevation, I'd like to figure out the terrain boundary codes. I think I should be able to isolate the different boundaries so that I can view them one at a time in the hex editor.
I wish I could apply the boundaries to the void terrain, but I'm afraid we're stuck with its blockiness We'll just have to use some other dark terrain around it to hide it
Before I move on to the elevation, I'd like to figure out the terrain boundary codes. I think I should be able to isolate the different boundaries so that I can view them one at a time in the hex editor.
I wish I could apply the boundaries to the void terrain, but I'm afraid we're stuck with its blockiness We'll just have to use some other dark terrain around it to hide it
Re: Heroes 4 Map Generator / Utility
Indeed the blocks aren't the prettiest (funny how I didn't take notice of the fact that it' black without cave), but I can already find a use for this feature in one of my planned maps You just helped me to an easier solution than I had originally been trying out.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
I figured you might find void terrain useful It will also be useful for my map taking place on the Plane of Death and for the Unity Isle of Death map
Right now it's not quite useful yet, since you can only see the map at the top level. Once I get zooming working, it will be significantly more useful.
One thing to note, you should have all of your objects in place already and elevation done before painting void terrain. Otherwise, as you know, you have to do things the hard way with objects, and elevation doesn't work. As I write this, I realize I also need a way to remove void terrain. Making a note for myself now
Right now it's not quite useful yet, since you can only see the map at the top level. Once I get zooming working, it will be significantly more useful.
One thing to note, you should have all of your objects in place already and elevation done before painting void terrain. Otherwise, as you know, you have to do things the hard way with objects, and elevation doesn't work. As I write this, I realize I also need a way to remove void terrain. Making a note for myself now
Re: Heroes 4 Map Generator / Utility
How about showing underground? Just realized I didn't recall this being mentioned in any previous post. I asume you can read and switch between Levels?
Regarding elevation I'm curious if that'll be the same rule as the void terrain? You mentioned being able to paint all terrain types on elevated ground, unlike in the editor. Certain larger objects have a tendency to lower elevation, so it would be great if your program could somehow look past that. Of course placing a mountain will need leveled tiles on the occupying space, but I find it frustrating that even minor objects also drags the entire elevated area down
Regarding elevation I'm curious if that'll be the same rule as the void terrain? You mentioned being able to paint all terrain types on elevated ground, unlike in the editor. Certain larger objects have a tendency to lower elevation, so it would be great if your program could somehow look past that. Of course placing a mountain will need leveled tiles on the occupying space, but I find it frustrating that even minor objects also drags the entire elevated area down
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
I've read in the underground terrain and the terrain image for it should be drawn, I just didn't have a mechanism yet for switching between levels (button). I've been copying the icons from the editor, including the underground button icon, I just need to get it plugged in and tested
I was also wondering what would happen to objects if we changed the elevations under them, but I haven't gotten to that point yet
I was also wondering what would happen to objects if we changed the elevations under them, but I haven't gotten to that point yet
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Finished implementing the ability to switch between above and below levels.
I also added the ability to toggle the grid on and off.
I'll post a couple screen caps in a little bit
I also added the ability to toggle the grid on and off.
I'll post a couple screen caps in a little bit
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Above ground, grid on:
Below ground, grid on (by pressing the underground button as in the actual editor):
Below ground, grid off (by pressing the grid button as in the actual editor):
Below ground, grid on (by pressing the underground button as in the actual editor):
Below ground, grid off (by pressing the grid button as in the actual editor):
Re: Heroes 4 Map Generator / Utility
Undergrounds has another look so special brush is needed... But I like underoceans of water ofcourse.
Oceans of lava too :-)
Oceans of lava too :-)
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Hi Baronus
What do you mean by a "special brush" for underground? Do you mean different colors for the terrain types?
What do you mean by a "special brush" for underground? Do you mean different colors for the terrain types?
Re: Heroes 4 Map Generator / Utility
There is soecial underground terrain:
http://www.gameexpres.cz/products/ostat ... gic4/2.jpg
Mooshroms, rocks. Special brush is needed... But lava water should bee too.
http://www.gameexpres.cz/products/ostat ... gic4/2.jpg
Mooshroms, rocks. Special brush is needed... But lava water should bee too.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Ohh, so you mean like the H4 editor brushes, but make a brush specifically for underground terrain and objects? When I get a bit further with the H4MG (Heroes 4 Map Generator), I can start looking at H4 editor brushes to figure out the format so that we can use and create brushes in the H4 editor and H4MG.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Update: I have implemented painting different terrain types, as well as changing the brush size. I still have a little work to do with getting the brush size exact, since I'm currently using the diagonal of the grid square, rather than the side, when calculating the pixel length. I also need to rotate the drawn square (if a square is the shape being used) so that it matches the grid direction.
Painting with a large brush on an XL map:
Painting with a ludicrous brush on an XL map:
The resulting minimap in the H4 editor:
I think next I'm going to update the painting methods to handle shapes (just square and circle for now). Then I think I'll get on figuring out the boundary codes so that painting terrain can look "right."
After that, I think I'll work on showing adventure objects that contain events.
Painting with a large brush on an XL map:
Painting with a ludicrous brush on an XL map:
The resulting minimap in the H4 editor:
I think next I'm going to update the painting methods to handle shapes (just square and circle for now). Then I think I'll get on figuring out the boundary codes so that painting terrain can look "right."
After that, I think I'll work on showing adventure objects that contain events.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Finished updating the paint methods so that they will accept shapes. I can now paint circles and squares. I've also implemented the ability to remove void terrain, fixed several small bugs, and made some other updates to emulate the way things work in the actual editor.
I briefly started looking at terrain boundary codes, but their meanings are still beyond me. I'll just have to keep looking at them until I can figure them out >.<!
I briefly started looking at terrain boundary codes, but their meanings are still beyond me. I'll just have to keep looking at them until I can figure them out >.<!
Re: Heroes 4 Map Generator / Utility
Good results!
What about copy selected area? And paste in another map? Friendly selector will be usefull...
What about copy selected area? And paste in another map? Friendly selector will be usefull...
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
A selection tool with various options is definitely on my list of things to implement
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Update: I'm now able to show all of the adventure objects which have events. So far I have also emulated the "Army Properties" options you get when selecting an army in the editor. I still need to figure out what kind of information should actually be displayed in the tables, so feedback is appreciated. Clearly "Army" isn't exactly useful when you have many on the map, and it took me some time to find the one I was looking for. Maybe under the "Name" column (the column name can change) I should list the name of the first creature stack or hero (whichever comes first)? Under "Type" I can probably shorten it to just the important part of the object's name.
The screen shot below shows that you will be able to right click and edit any particular object (currently only works for Army objects).
Still missing a few fields on the emulated Army Properties panel, but I'll get them filled in eventually The number after "Male" corresponds to the Hero's class, which I haven't documented quite yet.
And you can check out the events for army objects (can't copy or anything yet).
I decided I didn't want to keep breaking my head against terrain boundary codes (at least for now) so I moved on to getting this done I'll work on the "Hero Properties" panel next, and then look at enabling changes to the armies and heroes
At some point I'll work on displaying the actual scripts (emulating the editor unless someone else has a better idea of how to show them).
The screen shot below shows that you will be able to right click and edit any particular object (currently only works for Army objects).
Still missing a few fields on the emulated Army Properties panel, but I'll get them filled in eventually The number after "Male" corresponds to the Hero's class, which I haven't documented quite yet.
And you can check out the events for army objects (can't copy or anything yet).
I decided I didn't want to keep breaking my head against terrain boundary codes (at least for now) so I moved on to getting this done I'll work on the "Hero Properties" panel next, and then look at enabling changes to the armies and heroes
At some point I'll work on displaying the actual scripts (emulating the editor unless someone else has a better idea of how to show them).
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Speaking of the terrain boundary codes, if anyone is interested in helping me figure those out, please let me know. If you create an empty map, I can point you to where the terrain codes start and show you in the documentation what each of the bytes means.
I've started seeing some small patterns in the boundary codes, but nothing conclusive yet.
I've started seeing some small patterns in the boundary codes, but nothing conclusive yet.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Created a bare bones hero editing panel with just the events tab set up. So, from the Army properties panel, you can edit a hero in the army as you would in the actual editor like so:
Then the Hero Properties frame shows up (after I took the screen shots, I realized I forgot to add the "Ok" and "Cancel" buttons) and I navigate to the events tab (the other tabs are currently empty).
Now I can switch between event types as I can in the editor, and switch to triggerable events.
I realize you can do this stuff in the editor, but next I'm going to add the ability to copy and paste events between objects (starting with armies and heroes). Once that is done, that means I will have a way coded to add scripts to armies and heroes (besides reading them in from the map file), which will allow us to easily add the AI enhancing scripts. I guess that means I'll need to work on the ability to save and load events as well
Then the Hero Properties frame shows up (after I took the screen shots, I realized I forgot to add the "Ok" and "Cancel" buttons) and I navigate to the events tab (the other tabs are currently empty).
Now I can switch between event types as I can in the editor, and switch to triggerable events.
I realize you can do this stuff in the editor, but next I'm going to add the ability to copy and paste events between objects (starting with armies and heroes). Once that is done, that means I will have a way coded to add scripts to armies and heroes (besides reading them in from the map file), which will allow us to easily add the AI enhancing scripts. I guess that means I'll need to work on the ability to save and load events as well
Who is online
Users browsing this forum: No registered users and 3 guests