Heroes 4 Advanced Options Map Editor
Re: Heroes 4 Map Generator / Utility
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?
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?
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
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?
Do you mean make it so the AI sees your army as half the size it actually is?
Re: Heroes 4 Map Generator / Utility
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
Everytime you throw dirt, you loose a little ground
Re: Heroes 4 Map Generator / Utility
Yes I think about halfing army look for AI. Only look. It shuold help to make AI more offensive.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
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
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.
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
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.
Re: Heroes 4 Map Generator / Utility
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?
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
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
If you switch to the Events tab, there will be 3 more tabs (with the default tab shown being "Map" events). The map events are what are shown in the screen shots on page 4 (in the actual editor, campaign -> map properties -> events). If you select the "Adventure" sub tab, that will show you a table of adventure objects which (can) contain events, such as heroes, armies, and quest huts.
Is that what you were asking?
Is that what you were asking?
Re: Heroes 4 Map Generator / Utility
Yes. Exactly what I was asking.
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
Today's update:
It would appear that I've made it all the way to the adventure / landscaping objects
So, I'll start here from the additional player information after the oracles:
The custom oracle info is followed by additional player info. The first byte indicates the player color, and is followed by a byte indicating whether the player has a maximum level or not (00 no, 01 yes). If 01, then the next short is the maximum level. Next a byte indicating the importance to the AI (00 normal, 01 high, 02 vital). There is an entry for each player in the map (we know how many players there are from the header info).
After the additional player info is the custom artifact information. It starts with a byte indicating if there is any custom artifact info (00 no, 01 yes). If 01, it is followed by the int 00 00 f8 00. After that are 31 bytes of information about which artifacts are available for the map. (I'll get the codes for each artifact at some point)
Next, is a byte indicating if there are custom heroes settings (00 no, 01 yes). If 01, then 313 bytes follow with 00 or 01 for each hero. 00 if the hero is disabled, 01 if they are enabled. (I'll get the codes for the heroes at some point)
After is the skills block, starting with a short indicating if there are custom skills or not (00 no, 01 yes). If yes, it is followed by 5 bytes of data where each byte contains a binary addition indicating which skills are available.
Hex values of the skills
1st byte
Tactics - 01
Combat - 02
Scouting - 04
Nobility - 08
Life Magic - 10
Order Magic - 20
Death Magic - 40
Chaos Magic - 80
2nd byte
Nature Magic - 01
Offense - 02
Defense - 04
Leadership - 08
Combat - 10
Archery - 20
Magic Resistance - 40
Pathfinding - 80
3rd byte
Seamanship - 01
Stealth - 02
Estates - 04
Mining - 08
Diplomacy - 10
Healing - 20
Spirituality - 40
Resurrection - 80
4th byte
Enchantment - 01
Wizardry - 02
Charm - 04
Occultism - 08
Demonology - 10
Necromancy - 20
Conjuration - 40
Pyromancy - 80
5th byte
Sorcery - 01
Herbalism - 02
Meditation - 04
Summoning - 08
After that come the spells. 00 means there are no custom choices made, 01 means the custom selection check box is checked. If 01, it is followed by the short bc 00, then 34 bytes of data where each byte contains a binary addition indicating which spells are available. (I'll get the codes for each spell at some point)
Next come the artifact carryover properties. These start with the int 00 00 f8 00, followed by 31 bytes of data, where each byte contains a binary addition indicating which artifacts are carried in from previous scenarios. After that is the int 00 00 f8 00, followed by 31 bytes of data, where each byte contains a binary addition indicating which artifacts are to be carried out of this scenario. (I'll get the codes for each artifact at some point)
The AI properties come next, and are preceded with 00, followed by a short indicating the number of artifacts to follow. After is a short for the artifact code, followed by a byte for the priority (01 high, 02 vital). After the artifacts comes parchments, which are preceded by a 00 00, followed by a short indicating the number of parchments to follow. Then a short for the parchment code, followed by a byte indicating the priority. Next are the scrolls, which are preceded by a 00 00, then a short indicating the number of scrolls to follow. Next, a short for the scroll code and a byte for the priority.
And finally, as I said, are the adventure / landscape objects, in the order they were placed on the map (above and below ground are mixed together).
It would appear that I've made it all the way to the adventure / landscaping objects
So, I'll start here from the additional player information after the oracles:
The custom oracle info is followed by additional player info. The first byte indicates the player color, and is followed by a byte indicating whether the player has a maximum level or not (00 no, 01 yes). If 01, then the next short is the maximum level. Next a byte indicating the importance to the AI (00 normal, 01 high, 02 vital). There is an entry for each player in the map (we know how many players there are from the header info).
After the additional player info is the custom artifact information. It starts with a byte indicating if there is any custom artifact info (00 no, 01 yes). If 01, it is followed by the int 00 00 f8 00. After that are 31 bytes of information about which artifacts are available for the map. (I'll get the codes for each artifact at some point)
Next, is a byte indicating if there are custom heroes settings (00 no, 01 yes). If 01, then 313 bytes follow with 00 or 01 for each hero. 00 if the hero is disabled, 01 if they are enabled. (I'll get the codes for the heroes at some point)
After is the skills block, starting with a short indicating if there are custom skills or not (00 no, 01 yes). If yes, it is followed by 5 bytes of data where each byte contains a binary addition indicating which skills are available.
Hex values of the skills
1st byte
Tactics - 01
Combat - 02
Scouting - 04
Nobility - 08
Life Magic - 10
Order Magic - 20
Death Magic - 40
Chaos Magic - 80
2nd byte
Nature Magic - 01
Offense - 02
Defense - 04
Leadership - 08
Combat - 10
Archery - 20
Magic Resistance - 40
Pathfinding - 80
3rd byte
Seamanship - 01
Stealth - 02
Estates - 04
Mining - 08
Diplomacy - 10
Healing - 20
Spirituality - 40
Resurrection - 80
4th byte
Enchantment - 01
Wizardry - 02
Charm - 04
Occultism - 08
Demonology - 10
Necromancy - 20
Conjuration - 40
Pyromancy - 80
5th byte
Sorcery - 01
Herbalism - 02
Meditation - 04
Summoning - 08
After that come the spells. 00 means there are no custom choices made, 01 means the custom selection check box is checked. If 01, it is followed by the short bc 00, then 34 bytes of data where each byte contains a binary addition indicating which spells are available. (I'll get the codes for each spell at some point)
Next come the artifact carryover properties. These start with the int 00 00 f8 00, followed by 31 bytes of data, where each byte contains a binary addition indicating which artifacts are carried in from previous scenarios. After that is the int 00 00 f8 00, followed by 31 bytes of data, where each byte contains a binary addition indicating which artifacts are to be carried out of this scenario. (I'll get the codes for each artifact at some point)
The AI properties come next, and are preceded with 00, followed by a short indicating the number of artifacts to follow. After is a short for the artifact code, followed by a byte for the priority (01 high, 02 vital). After the artifacts comes parchments, which are preceded by a 00 00, followed by a short indicating the number of parchments to follow. Then a short for the parchment code, followed by a byte indicating the priority. Next are the scrolls, which are preceded by a 00 00, then a short indicating the number of scrolls to follow. Next, a short for the scroll code and a byte for the priority.
And finally, as I said, are the adventure / landscape objects, in the order they were placed on the map (above and below ground are mixed together).
Re: Heroes 4 Map Generator / Utility
Can't you use the code info about skills, spells, creatures etc. available in the modding treads?
I would assume that would be faster than having to track all of it yourself, at least if you can see matches along the way.
I would assume that would be faster than having to track all of it yourself, at least if you can see matches along the way.
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
For the codes in something like the combat script, then I can probably use the ones, if there is a complete listing, in the modding threads, but the codes I mention above are the codes that map check boxes to artifacts and spells. Each byte has up to 8 items associated with it (as shown above with the skill codes).
It won't take too long to figure out, it will just be a little tedious
Unselect all check boxes -> select one at a time and look at the file -> write down the hex value and byte location (1st byte, 2nd byte, etc.).
There's also a pattern with the codes that I could use. They're usually in the order that they appear in the editor
It won't take too long to figure out, it will just be a little tedious
Unselect all check boxes -> select one at a time and look at the file -> write down the hex value and byte location (1st byte, 2nd byte, etc.).
There's also a pattern with the codes that I could use. They're usually in the order that they appear in the editor
Re: Heroes 4 Map Generator / Utility
Map hex values will be usefull to decodeing exe file for modding game. So note all you find.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Getting the codes will be easy, just time consuming. I have to put a stack of creature types in a combat script and then just write the code.
Currently I'm looking at reading in a castle / town. Lots of fields on those, but some of them are similar to things I already know how to read in so I can probably re-use. So far I see 3 types of map objects: towns, armies, and decorative. Quest huts will probably be a 4th type, and gates may be a 5th. So many objects.. I'll probably be on them for a little while.
Currently I'm looking at reading in a castle / town. Lots of fields on those, but some of them are similar to things I already know how to read in so I can probably re-use. So far I see 3 types of map objects: towns, armies, and decorative. Quest huts will probably be a 4th type, and gates may be a 5th. So many objects.. I'll probably be on them for a little while.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
I can parse and write towns and random towns. Next I'll work on reading / writing armies, then quest huts, then decorations, and then mines and treasures. Dang, there are a LOT of object types >.<
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Rather than post all the "how to read"s I've been posting, I'll simply post about what I can read / write to file, and end the post with the following link.
It is a google drive document that I update with how to read a .h4c file step by step.
I'm about to test reading in armies with creatures and heroes, so we'll see how that goes I've successfully read in an army without a hero, so the only new thing to test is reading an army with a hero in it.
The triggered combat scripts, garrisons, and army objects all represent the army slots in the same format, so I'm excited to (at some point) try adding a hero to a triggered combat script to see if that works (or crashes the game)
It is a google drive document that I update with how to read a .h4c file step by step.
I'm about to test reading in armies with creatures and heroes, so we'll see how that goes I've successfully read in an army without a hero, so the only new thing to test is reading an army with a hero in it.
The triggered combat scripts, garrisons, and army objects all represent the army slots in the same format, so I'm excited to (at some point) try adding a hero to a triggered combat script to see if that works (or crashes the game)
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Successfully tested reading / writing maps with armies that have heroes and creatures. Think I'm done for the night
Re: Heroes 4 Map Generator / Utility
Good news! Hard work!
Thanks for guide. Its material to modders. If you finished I suggest making download link i CH. Another people can read it, not to decoing once againg. Its important to archivize all infos.
Thanks for guide. Its material to modders. If you finished I suggest making download link i CH. Another people can read it, not to decoing once againg. Its important to archivize all infos.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Went through and collected all the creature hex codes:
01 - Air Elemental
02 - Angel
03 - Ballista
04 - Bandit
05 - Behemoth
1a - Berserker
06 - Black Dragon
07 - Bone Dragon
47 - Catapult
08 - Centaur
09 - Cerberus
0a - Champion
0b - Crossbowman
0c - Crusader
0d - Cyclops
46 - Dark Champion
0f - Devil
10 - Dragon Golem
11 - Dwarf
12 - Earth Elemental
13 - Efreet
14 - Elf
05 - Evil Eye
44 - Evil Sorceress
15 - Faerie Dragon
16 - Fire Elemental
48 - Frenzied Gnasher
45 - Gargantuan
17 - Gargoyle
18 - Genie
19 - Ghost
43 - Goblin Knight
1b - Gold Golem
1c - Griffin
1d - Halfling
1e - Harpy
1f - Hydra
20 - Ice Demon
21 - Imp
22 - Leprechaun
23 - Mage
24 - Mantis
25 - Medusa
49 - Megadragon
26 - Mermaid
27 - Minotaur
28 - Monk
29 - Mummy
2a - Naga
2b - Nightmare
2c - Nomad
2d - Ogre Magi
2e - Orc
2f - Peasant
30 - Phoenix
31 - Pikeman
32 - Pirate
33 - Satyr
34 - Sea Monster
35 - Skeleton
37 - Sprite
36 - Squire
38 - Thunderbird
39 - Titan
3a - Troglodyte
3b - Troll
3c - Unicorn
3d - Vampire
e - Venom Spawn
42 - Waspwort
3e - Water Elemental
3f - White Tiger
40 - Wolf
41 - Zombie
01 - Air Elemental
02 - Angel
03 - Ballista
04 - Bandit
05 - Behemoth
1a - Berserker
06 - Black Dragon
07 - Bone Dragon
47 - Catapult
08 - Centaur
09 - Cerberus
0a - Champion
0b - Crossbowman
0c - Crusader
0d - Cyclops
46 - Dark Champion
0f - Devil
10 - Dragon Golem
11 - Dwarf
12 - Earth Elemental
13 - Efreet
14 - Elf
05 - Evil Eye
44 - Evil Sorceress
15 - Faerie Dragon
16 - Fire Elemental
48 - Frenzied Gnasher
45 - Gargantuan
17 - Gargoyle
18 - Genie
19 - Ghost
43 - Goblin Knight
1b - Gold Golem
1c - Griffin
1d - Halfling
1e - Harpy
1f - Hydra
20 - Ice Demon
21 - Imp
22 - Leprechaun
23 - Mage
24 - Mantis
25 - Medusa
49 - Megadragon
26 - Mermaid
27 - Minotaur
28 - Monk
29 - Mummy
2a - Naga
2b - Nightmare
2c - Nomad
2d - Ogre Magi
2e - Orc
2f - Peasant
30 - Phoenix
31 - Pikeman
32 - Pirate
33 - Satyr
34 - Sea Monster
35 - Skeleton
37 - Sprite
36 - Squire
38 - Thunderbird
39 - Titan
3a - Troglodyte
3b - Troll
3c - Unicorn
3d - Vampire
e - Venom Spawn
42 - Waspwort
3e - Water Elemental
3f - White Tiger
40 - Wolf
41 - Zombie
Re: Heroes 4 Map Generator / Utility
Alphabetical list plus addons. See there:
http://heroescommunity.com/viewthread.php3?TID=37350
http://heroescommunity.com/viewthread.php3?TID=37350
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
The list there is in hex (number) order where the one here is in alphabetical, but it's nice to see that the numbers seem to match up
Looking at parsing quest huts now!
Looking at parsing quest huts now!
Who is online
Users browsing this forum: Google [Bot] and 1 guest