|
Thread: Research: Adding and Modifying creatures | |
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 02, 2017 06:30 PM |
|
|
Research: Adding and Modifying creatures
Adding creatures will be a great breaktrough for the game in general.
This is theoretical as it hasn't been done yet.
(the adding creatures. The modifying is easy as my Lich mod shows.)
We know creature abilities are hardcoded.
Which creature has what abilities is defined in the .exe, and as such ability number for creatures is static, and there is no code for this over 4. Abilities are edited by hex editing, switching one for the other, using their hexadecimal (byte).
Equilibris added some extra abilities for already existing creatures (but still not over four) like Orcs and Earth Elementals;
In 3.51 they did this by hex editing with jumps, using otherwise unused parts of heroes 4 code, and filling them with such creature code.
After the abilities list, there is another hex code listed by the creature: This is their "reference number".
Reference numbers are used by the game internal code to know which creature is which for gameplay purposes.
The creature "keyword" name is mostly used for retrieving aesthetic assets: The creature's graphics and sounds, which much use this keyword to work (that is why "devils" are "Devils" ingame, but their files list them as "archdevils")
________
To add a new creature, the next ingredients have to be met:
- Adding the hex code with abilities and unique creature number. Next creature would be numbered 74 and be the 75th (the last one from official Heroes is numbered 73 - actually the 74th because they start at 00)
In hex, the "73" looks as "49" (megadragon), so our next creature will be 4A.
This part is tricky because space in the .exe is already limited and it cannot be expanded, except with the .dll by expert programmers. But using empty space, this should be possible. Creature data seems to be read in a linear manner by the game code, sequentially from first to last. There is also a "00" byte dividing creature codes, which may or may not be usable to compress the section.
- Adding the keyword to the .exe
This seems easy enough. Unlike the Hex codes for abilities and creature number, this is a simple list which is done in plain text.
Those "00" are definitely unused spaces, and they even vary between the creatures. It's not unreasonable to think more can be introduced.
- Putting creature in table.
You have to make a new line in the creature table and fill all data.
This includes using the keyword you introduced at the .exe
- Use that keyboard to name all the creature's resources. THis includes:
* Adventure map sprite
* Combat sprite
* Sounds for actions (walk, attack, spellcast, etc.)
- Creature dwellings use the number (NOT the keyword) to identify which creature they actually recruit. This is true for both map dwellings and castle dwellings.
UNSOLVED QUESTIONS:
- How does the keywork get related with the number?
That is to say: How does the game know that creature "25" links with the keyword "Medusa"? It does not fit the pattern in the screenshot.
This, to me, is still a mystery, which seems important to solve.
- Even if you include all these things, will the game supoort it, or is there something else we are not seeing?
____________
|
|
Baronus
Legendary Hero
|
posted April 20, 2017 08:26 AM |
|
Edited by Baronus at 08:27, 20 Apr 2017.
|
1. In txt tables game has number eg 25 in txt tables. And for creature 25 game read 25 data line.
2. In exe file is area for creature 25, with 25 id number, with abilities. Game read this and ad abilities to statiscis, name and defs, sounds from txt.
I think thats all.
...
To add creature you must:
1. Add line 4A in txt tables.
2. Add area in exe with 4A id and abilities.
If you want new look.
3. Add new defs.
4. Add new sounds.
5. Add new move sequence.
Thats all I think.
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 28, 2017 10:06 PM |
|
|
Are you sure there is such number in text tables?
Text tables have empty lines,
and also introduction lines,
which do not correspond to the number of the creature.
(line 00 is not air elemental, for example... and also creatures not in order)
So, where is this creature number in the .txt ?
____________
|
|
Baronus
Legendary Hero
|
posted April 28, 2017 10:30 PM |
|
Edited by Baronus at 22:32, 28 Apr 2017.
|
Only one way is that game read it from creature name in txt tables. The same name as def and sound. Adding name to number must be codded in exe file...
|
|
NimoStar
Responsible
Legendary Hero
Modding the Unmoddable
|
posted April 29, 2017 01:37 PM |
|
|
Sounds reasonable, yes, that must be what happens...
____________
|
|
Baronus
Legendary Hero
|
posted April 29, 2017 06:49 PM |
|
|
First column name is KEYWORD! It says all. Its keyword to exe file. Names are ,,numbers".
|
|
ReinePedauque
Adventuring Hero
faerie
|
posted August 22, 2019 11:11 AM |
|
|
why so discontent with Mullich Productions? )
|
|
|
|