Heroes 4 Map Generator / Utility

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.

Moderator: Moderators

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 7 2016, 5:53

Time for some screen shots for the above update! They start with two maps already loaded, my Heroes Chronicles campaign, and a test map (Small empty). I switch to the second map of the campaign, and go to the "Scripts" tab (I should probably change that to "Events").

To copy scripts, highlight the scripts you wish to copy, then right click the table, and select "Copy". Right now, if there are no highlighted rows, all events are saved for copying. I'll probably add another menu item "Copy all rows".

Image

Now, switch to the map of your choice. The only other map I loaded was one of my test maps.

Image

Now, I copied triggerable events, so I can only paste triggerable events, so right click on the triggerable events table, and select paste.

Image

Now, all the events I copied have been copied to the map Small empty.

Image

Don't forget to save or your changes won't be applied. Right now I only have save as, and no button for easy saving, but we'll get there eventually :)

Image

Lastly, open the map in the editor and have a look for yourself ;)

Image

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 7 2016, 13:14

Works go on. We can use this generator to create Unity campaign :-)

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 7 2016, 16:35

Sure can :) I'm hoping to get to the terrain part for easy high-level map design, which we cannot do in the actual editor. My plan is to be able to paint terrain like you can in the editor, but from the all the way zoomed out level. That way, you can actually do the terrain for the entire map quite easily, rather than have to move the window around and paint the terrain little by little, only to find out you wanted certain areas bigger or smaller.

Removing events also works now :D

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 7 2016, 19:17

I have an idea. Heroes II to Heroes IV map converter. It is 6 the same factions and I think that it is simple convert. But it is only idea. You have a lot of work with HIV.

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 7 2016, 19:45

I had actually thought about adding something like that, some sort of map converter between heroes games, but that is certainly a lot further in the future :)

As far as what's next, do you guys think I should work on being able to add events to adventure objects, or should I aim for painting terrain first? I have to document a few more things after events, and then I'll be at landscape / adventure objects in the .h4c file. It's likely that once I get to where I'm able to read in landscape / adventure objects that I'll be able to paste events pretty easily.

Terrain codes are after the adventure / landscape objects, and are relatively simple to understand. I just don't know how terrain boundary codes are represented yet.

Thoughts on where I should focus next?

I'd also like some ideas on how to display the various adventure objects which have events attached to them. Maybe a table with all adventure objects that could potentially have events available? A table similar to those above, but with the name of the adventure object, maybe the type, and other pertinent information? Then, maybe you can right click and edit or something to see the events?

I was also thinking about trying to put events on landscape objects, but I'd also have to dig into the file where the information is stored on them and add an "visit point," so that will probably have to wait until later :D

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 7 2016, 20:51

I think that first is terrain paiting and then objects at the end monsters.
Tables are the simplest solution I think. Its easy to edit rows and columns.

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

Re: Heroes 4 Map Generator / Utility

Postby Karmakeld » Mar 7 2016, 22:47

I second the terrain being next focus area. As Baronus stated earlier, that feature is currently more useful than object events. But surely following adventure object events, comes events on heroes and monsters. I'll have to give the display a few thoughts. It'd be nice to hear others opinions..
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: 565
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 8 2016, 16:00

Alrighty, I'll just continue documenting until I get to terrain. There seems to be some stuff right after the last event that I'm currently not quite sure of. For most of my maps, it's just 00 00 00, except for one, which has 00 00 01, and then some other codes, then "artifact" and then a few more codes. I thought it might be because I had placed some artifacts on that particular map, but removing a couple of them didn't seem to have any effect on the file, at least at the point I was looking at.

Once I get through that, I should be able to get through the next part fairly easily :)

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 9 2016, 9:48

Step by step and will be succes :-)
In options I think sholud be:
1. Genrrate WoW map.
2. Generate Eq3.51 map.
3. Generate Eq3.55 map.

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 9 2016, 15:15

:)

I figured out that directly after the events is the info for custom oracle settings. Every oracle is represented in the file, whether or not it has any custom settings.

If 01, the oracle has custom settings, followed by a short indicating how many oracles are needed to complete the puzzle. The next int (or it could be a short followed by 00 00) indicates the number of rewards this oracle reveals. The next short indicates the length of the name of the award type, followed by the name of the award type (artifact or material). Next, is a short for the artifact or material code (keep in mind, artifacts also contain parchments 7c and scrolls a6, followed by their code), followed by an int for the number of the item present. Each oracle info block is terminated with 00 00.

If 00, read in 4 bytes (ff ff 00 00), and start processing the next oracle on the 5th byte.

There are a few bytes after the custom oracle block that I don't have a handle on yet, then it's skills, spells, and heroes. I documented the custom skills format and skill codes last night, and will post them when I get to them in order. AI Properties have also been documented, but I currently don't recall where they are in the order of the above. I'll also get its format posted when I get to it in order :)

I think that's it before the landscaping / adventure objects :D

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

Re: Heroes 4 Map Generator / Utility

Postby Karmakeld » Mar 9 2016, 16:38

In the copy/paste post earlier, you wrote you copied triggerable so you can only paste triggerable events, will it be possible to copy/transfer say a timed event from one map and paste it as a triggerable event in another? I guess the timed values would be an issue, but it would be useful. The same goes for e.g. placed events that you would like to use as a triggered event on an army/hero.

Baronus, there might even be a need for std. or tgs. version's as well.
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: 565
Joined: 21 Jul 2014

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 9 2016, 17:26

Hmm, I guess that would be relatively simple, since I've used inheritance for my Timed/Triggerable/Continuous/Placed event classes. Each of the event classes has a main base class of H4Event, which is what contains all of the scripting information and variables for the event name and name length, while the child classes contain more specific information.

So, it would be a simple thing to copy, say, the name and scripts of the event, and then possibly use default values for everything else. All of the events, except for continuous, also have an effects portion, so I'd need to take that into account when copying between continuous events and the others, but it should definitely be possible to implement.

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 10 2016, 19:52

Standard and GS are poor of resources. Someone want play without eg. 7 added creatures?
...
Maybe it will be possible adding some interesting scrips? Eg. for AI buy army and attack...
Im not a programist I can only give an idea.

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 10 2016, 20:15

We'll definitely be able to add some scripts for the AI and AI heroes. We can't force them to buy creatures, but we can give them money, additional creatures to recruit (or directly give heroes creatures), and add a fake attack / defense boost to heroes, as well as give their heroes strong units during their turn to make them more aggressive :)

I'm also planning to add a feature to save / load events. That way you won't have to always search for the map with the different events you want to copy to a map, you can simply load the events you saved directly into your map :D

Currently I'm putting the finishing touches on reading in the custom oracle info. I've read it all in properly, now I'm getting it patched back together and put into a new file.

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 10 2016, 22:10

AI strengh calculation using unit experience data. If it is small attacked. But it must be very small army.
Maybe script divide experience for 2?
Example:
You have army with 10.000 exp.
For AI it is 5.000 exp.
So AI attacked.
It is possible?

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 10 2016, 22:25

I'm not sure what you mean.

Do you mean make it so the AI sees your army as half the size it actually is?

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

Re: Heroes 4 Map Generator / Utility

Postby Karmakeld » Mar 11 2016, 6:45

Might I suggest that we post/look at ideas for AI enhancements in the proper treads? I believe I posted links to two treads earlier. I like the idea of setting up a script library for ways to help improve the AI, that both map makers and players can easily add to any map, without having to go through several maps to find the scripts, or having to set them up themselves. But I think the proper place to discuss such scripts is in a tread made for the purpose :)
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

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

Re: Heroes 4 Map Generator / Utility

Postby Baronus » Mar 11 2016, 10:50

Yes I think about halfing army look for AI. Only look. It shuold help to make AI more offensive.

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

Re: Heroes 4 Map Generator / Utility

Postby iLiVeInAbOx05 » Mar 11 2016, 16:11

Finished with reading / writing the custom oracle information.

Immediately following the custom oracle info, is some additional player info: a byte for the player number (in color order), followed by a byte indicating if there is a level cap (00 no, 01 yes). If there is one, then the next byte is the level cap. Then there is a byte that seems to always be 00 (at least I haven't found an example yet where it's not), followed by a byte indicating the AI importance (00 normal, 01 high, 02 vital).

After the player info is a byte that means "has something," but I haven't figured out what yet. If it's 01, then it is followed by 00 00, but I haven't seen any of the bytes after 01 be anything other than 00 00. Still gotta figure out what that is.

After that, is a byte indicating whether or not there are custom hero settings. If 01, then it seems to always be followed by 38, and then a bunch of bytes with 00 or 01, indicating if the hero for that particular byte is enabled or disabled for the map.


With respect to be able to save / load events, I'm thinking about something like "Event Groups," where you can save / load multiple events. I may have sub tabs under the Events tab: 1) Map, 2) Adventure, and 3) Groups.

Trying to keep the number of tabs low so that navigation / usability remains simple, but sometimes you need more :D


Baronus, I think that would require modding, but we can still trick AI heroes into thinking like that by giving them a large amount of high-level creatures during their turn, and taking them away on encounter / the player's turn.

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

Re: Heroes 4 Map Generator / Utility

Postby Karmakeld » Mar 11 2016, 20:32

Keep in mind what others have written regarding AI aggressiveness, it's not always a matter of the AI not being being aggressive enough, but also a matter of ensuring they don't enter battles with high risk of many casualties, meaning they'll be reduced once they face the player.

Regarding events, is map - map properties event and adventure, events on objects and armies?
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 8 guests