Hi since a few years i have tried to develop alone a Heroes3 remake
(but no code published)
trying to have somethink like kingBounty remake
I have not all skill to have a clean interface
i use delphi + delphix for graphic
however most heroes3.0 map can be loaded
(reverse enginering of heroes3.1 format at 99% completed)
a simple AI discover the map, collect item, get mine,
battle nearest enemy (autobattle only),
recuit new hero if 1st hero killed
heroes can move on the map , use road
and interact with most of object
minimap, fog of war
battle can occurs in interactive mode, but only one magic spell type, AI handle the battle also
can built inside town (following the tree of allowed building)
=> quite awfull to map Building_Id from h3m format to building_id in town screen
can recruit in town …
i am still working on mapping spell effect in battle
reorganizing and cleaning code
I have found inspiration in kingbounty remake for handling object into arrays
mObjs : array of all map object with min attribute type,subtypes,position,reference,player owner
mObj: one map object mObj.v , give a reference of additonal parrameter for the object
here index in array mScholar that store all Scholar parameter
code of loading Scholar object from h3m map filte into my programm
procedure ReadOB81_schoolar;
{TMapScholar = record // SC 81
t: Byte; //type PK / SS / SP
pk: integer; //primary skill
ss: integer; //secondary skill
sp: integer; //spell}
begin
with mScholar[nScholars] do
begin
t:=ReadByte;
if t=255 then
begin
t:=random(3);
case t of
0: pk:=random(4);
1: ss:=random(MAX_SSKL);
2: sp:=random(MAX_SPEL);
end;
ReadPad(7);
end
else
begin
case t of
0: pk:=readbyte;
1: ss:=readbyte;
2: sp:=readbyte;
end;
ReadPad(6);
end;
end;
mObj.v:=nScholars;
inc(nScholars);
end;
code to load generic object
with mObj do
begin
pos.x:=ReadIntByte;
pos.y:=ReadIntByte;
pos.l:=ReadIntByte;
Defptr:=ReadInt; ReadPad(7);
DefName:=DefTxt[DefPtr];
SnMain.AddDef(Defname);
Def:=iDefFind(DefName);
DefInfo:=iDef[Def];
t:=DefInfo.t;
u:=DefInfo.u;
id:=ObjId;
v:=0;
mLog.Insert(format(‘Adding mDef=%s main=%d sub=%d des=%s’, [DefInfo.Name,DefInfo.t,DefInfo.u,TxtObject[DefInfo.t]]));
case DefInfo.t of
…
81: ReadOB81_Schoolar;