Closed mapron closed 1 year ago
Hey Vladimir, kudos for your work on FreeHeroes! Want to join forces with HeroWO?
As I could infer from the code, these differences in .h3m
format exist in HotA:
HOTA1+
: in H3M
(map header), extra 2-3 ints after $format
before $isPlayable
: m_ver1
(the v#
below, defaults to 3), m_ver2
(16-bit), m_ver3
(only if v3, defaults to 12)HOTA1+
: in ObjectDetails_Town
, extra bool between $impossibleSpells
and $events
: m_spellResearch
- any idea what is it for?HOTA3
v3: in ObjectDetails_Monster
, 5 extra ints after $canGrow
and 2 zero bytes: m_agressionExact
†, m_joinOnlyForMoney
(bool), m_joinPercent
, m_upgradedStack
†, m_splitStack
† - any idea what they are for?HOTA3
v3: new "object details" type for creature banks with an int and array: m_upgraded
† (8-bit), m_artifacts
- any idea what they are for? m_artifacts
starts with an uint32_t
count? are -1
values allowed, if so what they stand for? HOTA3
v3: in ObjectDetails_SeerHut
, extra int before reading quest data: count of quests - FH's code bails out if not exactly 1, do you know how 0 and >1 values work?HOTA3
v3: in ObjectDetails_Event
, extra 8-bit int after 4 zero bytes: m_humanActivate
- I suppose it complements $applyToComputer
, preventing human players from triggering the event? why is it uint8_t
rather than bool
?HOTA1+
: in H3M
(map header), extra int before $startingHeroes
that must be exactly 178 in HOTA3
v1-v2, else 179, and $startingHeroes
is 22 bytes longHOTA1+
: in H3M
(map header), extra int after reading rumors before reading custom $heroes
that must be the sameHOTA1+
: in H3M
(map header), extra int before $unavailableArtifacts
that must be exactly 163 in HOTA3
v1-v2, else 165, and $unavailableArtifacts
is 20 bytes longHOTA1+
: in H3M
(map header), 3-4 extra ints after 31 zero bytes before reading $unavailableArtifacts
: m_allowSpecialWeeks
, unknown (16, 16-bit), unknown (0), m_roundLimit
† (only in v3) - any idea what they are for?HOTA1
, HOTA2
, HOTA3
: objects with $detail
of ObjectDetails_Monster
must have MapObject->$x
decremented by 1-1
(0xFF
, etc.) considered "not set"Additionally, m_creatureBanksCustomization
(HOTA3
v3) is unused in FH's code.
Map format byte: HOTA1 0x1E, HOTA2 0x1F, HOTA3 0x20, WOG 0x33, VCMI 0xF0
.
Can you confirm this?
Also, notice HotA has at least 5 different map formats for now.
I see 3 enum members with 3 variations on m_ver1
, of which v1/v2 seem to have an identical format. Is that what you meant?
If you need further info for hota support (hota sprite format for example) I also can provide you some insights.
Definitely, insights (see above) are most welcome! I strive to make h3m2json
not only the most comprehensive parser and compiler but also a one-stop place for human-readable format documentation in the form of h3m-The-Corpus.txt
.
m_spellResearch - is 'enable spell research in Mage Guild'. look it in map editor.
Want to join forces with HeroWO?
If I wanted to join other porject, I'd continue work on VCMI, not create my own project 3 years ago. so, no thx. If you want me to write code for you, I mean.
m_agressionExact†, m_joinOnlyForMoney (bool), m_joinPercent, m_upgradedStack†, m_splitStack
just look flags in HotA map editor for create stack on the map.
m_upgraded† (8-bit), m_artifacts - any idea what they are for?
look bank editing dialog in hota maped.
If I wanted to join other porject, I'd continue work on VCMI, not create my own project 3 years ago. so, no thx.
Well, I suggested this because your own stated goals explain why you will not contribute to VCMI. HeroWO pursues the same goals (online experience, completely open source, decentralized server, better code quality, etc.).
m_spellResearch - is 'enable spell research in Mage Guild'. look it in map editor.
I see this checkbox but I don't know what it does in-game. Can you explain it briefly?
HOTA3
v3: new "object details" type for creature banks with an int and array:m_upgraded
† (8-bit),m_artifacts
- any idea what they are for?m_artifacts
starts with anuint32_t
count? are-1
values allowed, if so what they stand for?look bank editing dialog in hota maped.
That dialog only has two options: fixed bank level (rather than randomly selected as in SoD) and random/upgraded/non-upgraded switch. There's nothing like m_artifacts
.
Can you explain it briefly?
well, it enables and disables spell research in the mage guild. Are you familiar with HD mod? do you play it? you can change spells
That dialog only has two options: fixed bank level
open same dialog for Dragon Utopia. It changes (hides/shows) controls. You can select every artifact for the bank.
m_humanActivate - I suppose it complements $applyToComputer, preventing human players from triggering the event? why is it uint8_t rather than bool?
well, did not used that much other for format testing, not sure. Not play with events atm. why uint8_t instead of bool - probably did not think inside it, could be bool, yeah.
m_creatureBanksCustomization is an oversight , I renamed it to m_creatureBankSize and forget to remove, thanks for pointing out. :)
SeerHut:
do you know how 0 and >1 values work?
sorry, that part for >1
I did not reversed yet. It has pretty strange blob format... and what is worse, it changes when I save it again with current map editor (so it is inconsistent between patches, so I need to branch by format descriptor flag)
map [HotA] Gold Rush
AFAIR use this, not sure if I found that anywhere else. So that's my TODO.
For the rest, yeah, you did a good grasp of it.
HeroWO pursues the same goals (online experience, completely open source, decentralized server, better code quality, etc.).
well, we can have a voice talk over discord if you so desire, but you hardly can convince me to contribute code for ya.
well, we can have a voice talk over discord if you so desire, but you hardly can convince me to contribute code for ya.
Not sure why you keep pointing out that it's writing code "for" somebody. It's open source and I don't earn anything from it; if you don't want to contribute then fine, I certainly won't go as far as "convince" anybody to do so.
Anyway, thanks for the tips. I have combined all your messages into one for clarity.
HOTA1
/HOTA2
formats can have m_ver1
of 3? In your code you have several conditionals that trigger for HOTA1
and then do a check for m_ver1 == 3
- does this implicitly check for HOTA3
? if (m_features->m_mapHotaUnknown1) {
uint16_t unknown1; // == 16;
uint32_t unknown2; // == 0;
stream >> m_hotaVer.m_allowSpecialWeeks >> unknown1 >> unknown2;
assert(unknown1 == 16);
assert(unknown2 == 0);
if (m_hotaVer.m_ver1 == 3)
stream >> m_hotaVer.m_roundLimit;
}
HOTA#
as well as those two meaning that WoG, for example, has 10 factions: if (format >= MapFormat::HOTA1)
m_factions = 10;
It's open source and I don't earn anything from it;
don't be picky. I'm not interested in abstract opensource code exist in the world. I am interested in particular domain, project goals, structure, technology used etc etc (why should I even explain why I rule my own project?). I don't want explain in details especially because I don't want you feel bad for your choices (with deep dignity and respect).
Do you know if HOTA1/HOTA2 formats can have m_ver1 of 3?
well, I do not have enough old hota maps to answer, so - no, I don't know.
Are WoG/VCMI formats really an extension to HotA? no, WoG is an SoD extension and it has pretty much the same SoD format; all WoG (and Era) objects utilize Pyramid object. Map binary is the same.
VCMI is ... not an extension. Entirely new format. It has just same header as SoD and that's it. you'd better check VCMI source code (I have 0 support for both wog and VCMI) about >= HOTA1 is probably a lazy oversight.
HotA support implemented. h3m2json.php
is now able to parse all official HotA 1.6.1 maps. Thank you for your assistance.
Yay.
BTW hi, another rival HOMM3 project (FreeHeroes, VCMI, HeroWO)! (just kidding about rival)
you can check freeheroes binary format spec in:
https://github.com/mapron/FreeHeroes/blob/master/src/Core/MapUtil/H3MObjects.cpp#L16 (and also search where those conditions are used).
Also, notice HotA has at least 5 different map formats for now. If you need further info for hota support (hota sprite format for example) I also can provide you some insights.