Heroes 4 Advanced Options Map Editor

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.
User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Unread postby Karmakeld » 20 Mar 2016, 10:29

Well if you want a few people to test it and possibly also add a H4 skin as Baronues suggested, you'd should give a shout out, before the announcement is made. I would recommand a test of user-friendliness, before releasing it :) New ideas could spawn by people testing it..
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 20 Mar 2016, 19:08

Yep, I definitely want some others to give it a test before we make an announcement :) And as you said, it will surely lead to some good feedback. Before I send it to others though, I'll want to test deploying it on my girlfriend's laptop first. Need to get all the setup stuff out of the way, which I haven't started working on yet :)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 21 Mar 2016, 14:02

I believe I got all the terrain properly read in last night. I'll still need to do some additional testing and debug checking to verify, but I'm pretty sure we're good to go there :)

Since the only thing after the terrain codes is the elevation, I also thinks that means I've finished with parsing .h4c files :D

I'll need to revisit the cursor readout, since the way I did it is off unless the panel is an exact square (as far as pixels are concerned). Then I can get some overlay classes in place so that we can display the terrain on the map. After that, we can start painting terrain :) I'm excited to try painting "void" terrain ;) Hopefully the game and editor don't get upset with me!

Edit: Getting the cursor readout right means I figured out a correct algorithm for converting pixels on the panel to grid squares in the .h4c map. Once I have that down we'll be well on our way to having something to release for others to test :D

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes 4 Map Generator / Utility

Unread postby Baronus » 21 Mar 2016, 18:48

Only good news:-)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 24 Mar 2016, 15:04

The grid overlay is coming along nicely. I've set it up so that it will determine if the rows / columns are too small, and not draw the grid for each row / column in that case. I still need to actually label each row / column, and then I think the grid will be good to go.

I'm also using the grid overlay to convert between pixels and rows / columns. I've gotten row conversions properly setup and the readout is now working as expected :) Once I get the column readout plugged in, which should be pretty simple since I have it working for rows, I'll be able to start work on displaying the terrain data from a map :D

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes 4 Map Generator / Utility

Unread postby Baronus » 24 Mar 2016, 18:46

All good! Works go on! :-)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 25 Mar 2016, 05:37

I got some colors on the display ;) Here are a couple screen shots of the first three maps of my campaign in the H4 Map Generator. I know the colors are not as nice as the actual editor, but they don't have to be in order to be useful :D

Image

Image

Image

There are still some kinks to work out with the overlay mechanism, but then it's time to start painting our own terrain :D

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes 4 Map Generator / Utility

Unread postby Baronus » 25 Mar 2016, 14:37

Good look. It means you go forward :-)

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Unread postby Karmakeld » 25 Mar 2016, 22:57

Uh, pretty colors ;)
Dispite the 'paint' look, I'm impressed with the progress and the fact that it actually reads your maps quite detailed, is just great news.
I'm eager to try how painting with it will work out.
Also will there be some color explanation, regarding objects like trees and mountains? I guess you'll try to match terrain colors with those of the mini map to some degree. I see that most are already familiar colors, but the pink one, didn't ring a bell.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 25 Mar 2016, 23:20

The actual coloring of the pixels takes a couple seconds, so I'll need to do some optimizations and possibly revisit the actual algorithm, but at least we have colors now :)

Right now I'm converting each pixel to the row / column, getting the terrain code for that row / column, and then coloring the pixel, so it's definitely very detailed ;) but that's also probably why it's a little slow, haha.

I don't yet have a plan for showing objects. I could do something simple, like put different color dots (would require a legend), which I could do relatively easily, but I haven't thought any further than that.

As far as the terrain colors, I selected them with an online color chooser without actually comparing them to what they look like on the mini-map / in the editor, so I actually plan to go back and pick colors that are closer, but yes, I'll probably put a legend somewhere :)

The pink one was what I decided on for "field of life" terrain. Maybe need more of a tan pink ;)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 28 Mar 2016, 05:38

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 :D

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)

Image

And what it looks like in the editor:

Image

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 :D

Oh right, and as you can see, I got the grid up and running.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Unread postby Karmakeld » 28 Mar 2016, 07:47

I seem to be able to paint any type of terrain on any elevation, which is pretty cool
That's pretty awsome. And so is the fact that you can just paint the void terrrain on the map, despite objects being placed :-D
Now if you could add the cliff effect as well = :applause:
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 28 Mar 2016, 14:55

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 :D

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Unread postby Karmakeld » 28 Mar 2016, 18:21

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 :-D 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

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 28 Mar 2016, 18:50

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 :)

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Re: Heroes 4 Map Generator / Utility

Unread postby Karmakeld » 29 Mar 2016, 21:55

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 :(
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 30 Mar 2016, 00:17

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 :D

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 :)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 30 Mar 2016, 02:20

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 :)

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Unread postby iLiVeInAbOx05 » 30 Mar 2016, 03:27

Above ground, grid on:

Image

Below ground, grid on (by pressing the underground button as in the actual editor):

Image

Below ground, grid off (by pressing the grid button as in the actual editor):

Image

User avatar
Baronus
Assassin
Assassin
Posts: 288
Joined: 06 Jun 2015

Re: Heroes 4 Map Generator / Utility

Unread postby Baronus » 30 Mar 2016, 08:41

Undergrounds has another look so special brush is needed... But I like underoceans of water ofcourse.
Oceans of lava too :-)


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 19 guests