Editing
Hex Editing - Guide
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Game Mechanics = == Starting Resources == Table with the starting resources starts at 0x278170. Each 4 bytes are the next resource (Wood, Mercury, Ore, Sulfur, Crystal, Gems, Gold). Each 28 bytes is the next difficulty - Easy, Normal, Expert, etc. At 0x2781FC the AI resources start and follow the same order of resources and difficulties. The whole table thus takes 280 bytes. == Secondary skills == In the basic game, how secondary skills work is only determined by the .exe file (i.e. heroes3.exe). In HotA, the skills are both in the h3hota.exe and in HotA.dll files. The former is typically used in single player games, and the latter for multiplayer. When starting a multiplayer game the game loads the HotA DLL, and overrides parts of the hota EXE. This section is intended to guide how to modify how secondary skills in multiplayer HotA. === Estates === The daily gold awarded by estates in HotA multiplayer (as of 1.7.3) is in HotA.dll, offset 19A100 there is the byte sequence: <code>63 00 '''FA 00 00 00''' C7 05 20 EA 63 00 '''F4 01 00 00'''</code> <code>C7 05 24 EA 63 00 '''E8 03 00 00''' D9 15 8C EA 63 00</code> The highlighted values are the amounts in hexadecimal (FA == 250, F401 == 500 and C803 == 1000). Also note that the message you get when you right click on Estates skill is separate from the actual money given. It will still say 250 per day, since the text help is in different files, but you will get what you edited (check under kingdom income for example). === Mysticism === The percentage of maximum mana regenerated with Mysticism is located at 0x001EC46C in HotA.dll (version 1.7.3). It is stored as four IEEE 32-bit floating point numbers, in little endian format.<br> <code>00 00 00 00 CD CC CC 3D CD CC 4C 3E 9A 99 99 3E</code><br> where the first four bytes corresponds to the percentage gained without Mysticism, the next four bytes for basic level followed by advanced and expert. <code>00 00 00 00 == 0.0</code> (0%)<br> <code>CD CC CC 3D == 0.1</code> (10%)<br> <code>CD CC 4C 3E == 0.2</code> (20%)<br> <code>9A 99 99 3E == 0.3</code> (30%)<br> The fixed number of points are located also in HotA.dll, offsets hota.dll, basic: 0x19a15E (05), advanced: 0x19a16a (0A), expert: 0x19a174 (0F).<br> (Shoutout to [[User:Csaros|Csaros]] for finding some of these offsets). Like with Estates, the right click help will still state 10%, 20% or 30% etc, but the actual mana regeneration depends on the numbers encoded in the DLL. === Pathfinding === Pathfinding is spread out over several parts of the code. The part that allows for spending less than 100 MP per terrain is mostly in HotA.dll: {| class="wikitable" |+ Caption text |- ! File offset !! opcodes !! instruction !! comment |- |0x019a22b|| c7 40 04 5f 00 00 00 || mov DWORD PTR [eax+0x4],0x5f|| ; 95 - dirt |- |0x019a232|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a237|| c7 40 08 5a 00 00 00 || mov DWORD PTR [eax+0x8],0x5a|| ; 90 |- |0x019a23e|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a243|| c7 40 0c 55 00 00 00 || mov DWORD PTR [eax+0xc],0x55|| ; 85 |- |0x019a24a|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a24f|| c7 40 14 7d 00 00 00 || mov DWORD PTR [eax+0x14],0x7d|| ; 125 - sand |- |0x019a256|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a25b|| c7 40 18 64 00 00 00 || mov DWORD PTR [eax+0x18],0x64|| ; 100 |- |0x019a262|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a267|| c7 40 1c 55 00 00 00 || mov DWORD PTR [eax+0x1c],0x55|| ; 85 |- |0x019a26e|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a273|| c7 40 24 5f 00 00 00 || mov DWORD PTR [eax+0x24],0x5f|| ; 95 - grass |- |0x019a27a|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a27f|| c7 40 28 5a 00 00 00 || mov DWORD PTR [eax+0x28],0x5a|| ; 90 |- |0x019a286|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a28b|| c7 40 2c 55 00 00 00 || mov DWORD PTR [eax+0x2c],0x55|| ; 85 |- |0x019a292|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a297|| c7 40 34 7d 00 00 00 || mov DWORD PTR [eax+0x34],0x7d|| ; 125 - snow |- |0x019a29e|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2a3|| c7 40 38 64 00 00 00 || mov DWORD PTR [eax+0x38],0x64|| ; 100 |- |0x019a2aa|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2af|| c7 40 3c 55 00 00 00 || mov DWORD PTR [eax+0x3c],0x55|| ; 85 |- |0x019a2b6|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2bb|| c7 40 44 96 00 00 00 || mov DWORD PTR [eax+0x44],0x96|| ; 150 - swamp |- |0x019a2c2|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2c7|| c7 40 48 7d 00 00 00 || mov DWORD PTR [eax+0x48],0x7d|| ; 125 |- |0x019a2ce|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2d3|| c7 40 4c 64 00 00 00 || mov DWORD PTR [eax+0x4c],0x64|| ; 100 |- |0x019a2da|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2df|| c7 40 54 64 00 00 00 || mov DWORD PTR [eax+0x54],0x64|| ; 100 - rough |- |0x019a2e6|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2eb|| c7 40 58 5a 00 00 00 || mov DWORD PTR [eax+0x58],0x5a|| ; 90 |- |0x019a2f2|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a2f7|| 68 f1 55 30 4f || push 0x4f3055f1|| |- |0x019a2fc|| c7 40 5c 55 00 00 00 || mov DWORD PTR [eax+0x5c],0x55|| ; 85 |- |0x019a303|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a308|| c7 40 64 5f 00 00 00 || mov DWORD PTR [eax+0x64],0x5f|| ; 95 - subterranean |- |0x019a30f|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a314|| c7 40 68 5a 00 00 00 || mov DWORD PTR [eax+0x68],0x5a|| ; 90 |- |0x019a31b|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a320|| c7 40 6c 55 00 00 00 || mov DWORD PTR [eax+0x6c],0x55|| ; 85 |- |0x019a327|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a32c|| c7 40 74 5f 00 00 00 || mov DWORD PTR [eax+0x74],0x5f|| ; 95 - lava |- |0x019a333|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a338|| c7 40 78 5a 00 00 00 || mov DWORD PTR [eax+0x78],0x5a|| ; 90 |- |0x019a33f|| a1 90 36 20 10 || mov eax,ds:0x10203690|| |- |0x019a344|| c7 40 7c 55 00 00 00 || mov DWORD PTR [eax+0x7c],0x55|| ; 85 |- |} To change the pathfinding minimum movement, one has to modify the values for each terrain, for each level of the skill. The new terrains introduced by HotA, wasteland and highlands, are not affected by this. Their movement costs are stored as plain ASCII text in HotA.dat. == Starting Bonuses == === Gold Bonus === The starting gold bonus chooses a random value between the value written at 0x0C0002 and the value at 0x0BFFFD, and then multiplies it by 100. To change the multiplication, simply edit 0x0C000B (multiplying by 25) and 0x0C0016 (moving the value by 2 bits, so multiplying it by 4). === Resource Bonuses === The starting resource bonuses use DWORD pointers to find their appropriate code to run: * Wood and Ore - AF FF 4B 00 * Crystals - D6 FF 4B 00 * Gems - E1 FF 4B 00 * Mercury - EC FF 4B 00 * Sulfur - F4 FF 4B 00 These DWORD pointers are located at the following addresses: * Castle - 0x0C01B4 * Rampart - 0x0C01B8 * Tower - 0x0C01BC * Inferno - 0x0C01C0 * Necropolis - 0x0C01C4 * Dungeon - 0x0C01C8 * Stronghold - 0x0C01CC * Fortress - 0x0C01D0 * Conflux - 0x0C01D4 Note, that you need to edit ScnrStar.def to reflect any altered resources. The amount for each rare resource is most likely determined by the function at 0xc009e: {{unk}} : minimum: c745f0 33333333 ''(mov [ebp-0x10], 0x33333333)'' c745f0 3333EB3F ''(mov [ebp-0x1c], 0x3feb3333)'' : break between the two: eb 0e ''(jmp 0x0e)'' : maximum: c745f0 66666666 ''(mov [ebp-0x10], 0x66666666)'' c745f0 6666E63F ''(mov [ebp-0x10], 0x3FE66666)'' The amount of wood and ore are most likely specified at 0xbffaf: BA 0a000000 ''(mov edx, 0x0a)'' B9 05000000 ''(mov ecx, 0x05)'' == Movement point reminder == The movement point reminder is located at 0x9c91. It checks if movement points are 0 (using a 2-byte ''test eax, eax'') and then proceeds to different code if movement points are (or not) zero. If one wants to change it to a higher number (to avoid reminding of movement for heroes that can't actually move anymore), the following code can be used: :0x9c91: {{---}}{{---}}a1 c8876900 ''mov eax, [0x6987c8]'' e9 849d0d00 (jump to some arbitrary free space) 90909090 : free space: {{-}}3d XY000000 ''cmp eax, XY'' - compare movement points with value XY. :::: {{---}}7F 0A ''jg 0x0a'' - jump 10 bytes if the value is greater. :::: {{---}}A1 C4 5d 6A 00 - displaced code :::: {{---}}e9 6f62f2ff - jump to 0x9c9f (or 49C9F) :::: {{---}}e9 a462f2ff - jump to 0x9cd9 (or 49CD9). == Hex value tables == See [[Reference IDs]]. = External links = # [http://heroescommunity.com/viewthread.php3?TID=18817 heroescommunity.com - Editing heroes in memory] - Includes a large number of various Reference IDs # [http://heroescommunity.com/viewthread.php3?TID=42152&pagenumber=1 heroescommunity.com - How to edit Hota?] - Thread with majority of useful information, scrambled across 112 forum pages. # [http://btb2.free.fr/mods/h3/hacking.txt BTB2's hacking guide] - primarily detailing creation of his own mod, but including tips, explanations and some of the Reference IDs # [https://handbookhmm.ru/forum/viewtopic.php?f=56&t=968 void_17's database] - this database describes most or all of the functions in the base game of heroes 3. #* [https://drive.google.com/file/d/1MY28K8cVbAeBzAbBBBf5ZeK-0aLMfz_d/view void_17's database] (link 2). [[Category:Guides]]
Summary:
Please note that all contributions to Heroes 3 wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Purge
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information