|
Thread: ERA II - Source code - Help and discussion | This thread is pages long: 1 2 3 4 5 6 7 8 9 10 11 · «PREV / NEXT» |
|
gamemaster
Adventuring Hero
|
posted June 01, 2020 10:39 PM |
|
|
Yes. Some kind of mod for testing will be good for bug hunting.
Edit:
Two minor things:
Erm.pas(5303): Variable 'SavedTriggerLocalObjects' might not have been initialized
Erm.pas(5297): Variable 'PrevTriggerCmdIndPtr' might not have been initialized
This two warnings are from compiler. Maybe we can nil those variables at the beginning be safe and satisfy compiler.
|
|
Bersy
Honorable
Supreme Hero
|
posted June 02, 2020 01:12 AM |
|
|
|
Bersy
Honorable
Supreme Hero
|
posted June 04, 2020 12:00 AM |
|
|
|
gamemaster
Adventuring Hero
|
posted June 28, 2020 01:52 PM |
|
|
I am now on discord too
I can see that GameExt.RegisterHandler is deprecated.
What is alternative that can be used for external plugin (Yona)?
Should RegisterHandler be avoided in future projects?
|
|
Bersy
Honorable
Supreme Hero
|
posted June 28, 2020 10:34 PM |
|
|
It's ok to use it for plugins. See Extern.pas:
procedure RegisterHandler (Handler: TEventHandler; EventName: pchar); stdcall;
begin
EventMan.GetInstance.On(EventName, Handler);
end;
Singleton object instance is used as Event Dispatcher behind the scene now. It's just note for ERA code writers to use EventMan.GetInstance.On.
____________
Heroes 3 Era and everything for it. Releases folder for releases.
|
|
gamemaster
Adventuring Hero
|
posted July 10, 2020 03:59 PM |
|
|
Bersy
If i want to see era log console i need to set "Debug.LogDestination" in heroes3.ini to something other then "file"?
Also, to see yona console i must have enabled era log console in first place or yona can do it without era log?
I menage to get yona only with era log enabled. I am just curios to know is that right way.
Another question about "Aimed shot" of marksmen. How it work? When marksmen can use it? How to activate it.
For now i don't know how it work and i am not sure is that "porting" problem or i missuses that skill
|
|
Bersy
Honorable
Supreme Hero
|
posted July 10, 2020 07:46 PM |
|
|
Hi, gamemaster!
Try Debug.LogDestination=Console
In fact, everything, other than "File" works as console.
if GetOptValue('Debug.LogDestination', 'File') = 'File' then begin
InstallLogger(EraLog.TFileLogger.Create(GameExt.DEBUG_DIR + '' + LOG_FILE_NAME));
end else begin
InstallLogger(EraLog.TConsoleLogger.Create('Era Log'));
end;
Latest Yona: https://dropmefiles.com/LVRoa
Yona console can be turned on separately via:
ModsYonaYonasettings.ini
[]
; Main
Debug = 1
Aimed shot mode is switched on/off via ESC (at least with old HD mod cursor must change). You select hex to aim at and press LMB. Next turn attack at this hex will be 200% more effective.
____________
Heroes 3 Era and everything for it. Releases folder for releases.
|
|
gamemaster
Adventuring Hero
|
posted July 10, 2020 08:32 PM |
|
|
Thanks!
Quote: Yona console can be turned on separately via:
Mods/Yona/Yonasettings.ini
[]
; Main
Debug = 1
I tried that before, and with provided yona. And always same result. Yona console don't work without era console.
Don't know is that related to win10 or something.
"GetConsoleWindow" always return 0 in yona if era console is not started before. If it is started before yona overtake that console.
I tried with "ported" and original dll's.
Can you confirm that your configuration work same way.
Era console can be turned on. Yona will overtake it, but yona alone wont work.
Anyway, it is not of big importance. I was just curios.
Quote: Aimed shot mode is switched on/off via ESC (at least with old HD mod cursor must change). You select hex to aim at and press LMB. Next turn attack at this hex will be 200% more effective.
I will never figure that out
PS: Don't forget to pack new source and missing pas files with yona distribution
|
|
Bersy
Honorable
Supreme Hero
|
posted July 10, 2020 11:21 PM |
|
|
|
gamemaster
Adventuring Hero
|
posted August 23, 2020 10:56 PM |
|
|
Hi Bersy
Is there any way to get variables from patcher_x86 trough PatchApi.pas?
Something like this from c version of patcher
_P->VarValue<_dword_>("HD.Version.Dword");
|
|
Bersy
Honorable
Supreme Hero
|
posted August 25, 2020 02:15 PM |
|
|
|
gamemaster
Adventuring Hero
|
posted August 25, 2020 06:58 PM |
|
|
Bersy said: I think we should find c++ patcher sdk first to change PatchApi.pas.
xexe i was hoping that you will not answer that
For now i had 4.3.1 hpp file. There i found missing functionality in PatchApi.pas.
Actually it is not of most importance. I will try to use patcher_x86.hpp version 4.3.1 i had, until found 4.5.4 (latest) that is dll version provided with era.
Any idea who may have latest version? Perhaps baratorch?
Who made initial port of PatchApi.pas?
|
|
Bersy
Honorable
Supreme Hero
|
posted August 26, 2020 12:33 PM |
|
|
|
myocytebd
Hired Hero
|
posted September 30, 2020 09:02 AM |
|
|
Excuse me, but where is the source code of ERA?
|
|
gamemaster
Adventuring Hero
|
posted September 30, 2020 05:27 PM |
|
|
here is official version for delphi 2007
https://github.com/ethernidee/era
|
|
myocytebd
Hired Hero
|
posted October 01, 2020 12:52 PM |
|
|
I downloaded current community edition, there are a lot of errors in b2/Strlib.pas due to string neq char comparison. Is it incompatible with later Delphi IDE? (After replacing string with AnsiString, build stops with internal error ...)
Another question is, where is vfs available?
It was unfortunate that the project uses Delphi, which is dead(or dying) for long.
(As I was googling around today, I found almost nothing for Delphi;
while FPC/GPC had reasonable results).
|
|
gamemaster
Adventuring Hero
|
posted October 01, 2020 06:41 PM |
|
|
Hi,
Original source is for old delphi version D2009. It will not compile in new version mostly because old delphi use ansistring and new use unicode. That make all kind of string hell.
You can find b2 and vfs at Bersy git-hub. Same place you find era source. It is not in same package with era but separate.
If i remember correct you will need to set patches in era project to b2 and vfs, or place them to correct locations.
Anyway, it is lot of trouble if you just want to see it compile.
You can examine source without compiling if some part of code interest you.
Is there any reason why you look for code or just curiosity?
If you want to make plugins you can use some C++ alternatives
https://github.com/RoseKavalier/H3Plugins
Regarding delphi...
Don't worry, delphi dyeing 30 years and will need another 30 to die . I personally use delphi for all my home projects. It is simple fast and much easier then C. It is handy.
|
|
myocytebd
Hired Hero
|
posted October 01, 2020 09:26 PM |
|
|
Thanks for the help
gamemaster said: Hi,
Original source is for old delphi version D2009. It will not compile in new version mostly because old delphi use ansistring and new use unicode. That make all kind of string hell.
Yes, I'm sort of shocked how Delphi guys reckless breaks API and ABI by unicode string. I tried to change them and soon give up on trickier usecases I cannot decide.
It seems that FPC has a Delphi compatible mode, and I will give it a shot.
gamemaster said:
You can find b2 and vfs at Bersy git-hub. Same place you find era source.
I was blind and failed to find vfs.
gamemaster said:
Anyway, it is lot of trouble if you just want to see it compile.
You can examine source without compiling if some part of code interest you.
Is there any reason why you look for code or just curiosity?
For code, addresses, curiosity and consideration to replace ERM language. Last time I debugged HOMM3 long ago when ERA was not yet.
I thought that it is much easier to find code and data address from hooks. Since there are many mem patches by ERA and plugins, IDA static analysis does not work well and asm debugging is not very comfortable on newer Windows (CE/olly2 are not that good).
In addition, I thought that ERA is a clean rewrite and it would be easy to bind to alt languages.
But then I found that ERA further hook onto WoG binary and replaces parts of it. So it is double cryptic to me
gamemaster said:
If you want to make plugins you can use some C++ alternatives
https://github.com/RoseKavalier/H3Plugins
Thanks, I will take a look.
|
|
gamemaster
Adventuring Hero
|
posted October 02, 2020 12:16 AM |
|
|
myocytebd said:
I thought that it is much easier to find code and data address from hooks. Since there are many mem patches by ERA and plugins, IDA static analysis does not work well and asm debugging is not very comfortable on newer Windows (CE/olly2 are not that good).
In addition, I thought that ERA is a clean rewrite and it would be easy to bind to alt languages.
But then I found that ERA further hook onto WoG binary and replaces parts of it. So it is double cryptic to me
It will not be easy to follow all that patches. Some are patch to heroes3, some are patches to other patches, some are relocated memories so actual address is not important. There are all kind of voodoo magic in era. On top of that there are lot mods that overpatch era. And in combination with HD mode you will lost track who patch what .
If it was easy to replace erm Bersy would do that long time ago .
If you need only addresses that are patched there is list in "x86 patches.txt" in heroes3/Debug/Era folder and it contains most patches applied.
Also you can examine era code for HookCode and WriteDataPatch functions that do patch job. Actually any 8 digit hexadecimal is 99% chance involved in some kind of patching .
Do you have experience with delphi code? What is your experience in coding/reversing in general?
|
|
myocytebd
Hired Hero
|
posted October 02, 2020 09:35 AM |
|
|
gamemaster said: If it was easy to replace erm Bersy would do that long time ago .
Except for (bug) compatiblity, it would be easy if wog ERM was implemented as clean as in era
gamemaster said: Do you have experience with delphi code?
Zero with delphi or pascal.
But I knew that pascal is not that different from C.
gamemaster said: What is your experience in coding/reversing in general?
Good at native and assembly. Moderate at graphics, VM/compiler and reversing.
I mostly coded on Linux and thus are not quite familiar with building/source-based-debugging on win32.
BTW what do you think of VCMI?
At a glance, it seems that VCMI reserves placeholder for ERM.
I tried latest Lazarus but FPC crashed at linking
I thought it is due to -L.obj in zlib, so I tried to convert them. But FPC still crashes with converted .o or even if I commented those -L.obj.
|
|
|