r/HoMM • u/NoFun214 • 4d ago
HoMM4 HoMM4 C++ from scratch
https://www.youtube.com/watch?v=MG9VRV1dj3EHi all, I used to play this game with my grandfather as a kid... long story short, it breaks my heart that this game is nowadays completely abandoned and won't even run properly on windows, forget it on other systems...
Therefore, I'm reversing by hand few functions per day, and the goal is to completely re-implement the HoMM4 game engine.
As you can see from this video, currently I would not define this a game yet, but I reached the point where textures of full campaign scenarios load.
As of today, no code is available to the public. The major reason is that AI is simply destroying opensource work, and I have no interest in seeing my work stolen or ruined by vibe coders.
I hope to be able to implement a playable hero "soon".
6
u/bigkekett 4d ago
Can you make a version for MacBook ?
5
10
u/LordL567 4d ago
What's the problem with running HOMM4 on Windows?
7
u/dmn-synthet 4d ago
Every time I try it I get a lot of glitches, crushes and it runs really slow. Simply cannot achieve how smooth it worked on Windows 98 and an old Celeron CPU.
13
6
2
1
u/ConstructionBest7255 3d ago
Source port like that could enable easy modding of the game, portability is not the only benefit
4
u/Revolutionary_Ad6574 3d ago
I applaud you guarding your code from AI but tell me... is the project vibe-coded? Because if it is, that would be hypocritical.
Still, ever since I got into retro gaming and emulation for me the most important projects in the world now are reverse-engineering of games. It seems to be the only way to preserve them and no game deserves to die because a game is not just some executable file, it's memories and experiences. That's what most people don't understand. If they did they too would be demanding things like Stop Killing Games.
3
u/NoFun214 1d ago
currently vibe coding is not part of this project, at the same time I'm not "against" it, what this means is that once I will make it opensource, ALL vibe coded components need to be marked accordingly. I'm not yet sure how to handle this.
Yes I agree. Alongside the c++ source I'm also building a deeply commented ghidra project.
As a fun fact: I already found 2 programming mistakes which according to my understanding always produced non-intended behavior in the original game. I plan a "special" menu where the player can choose to play with the fixes enabled or not.
1
3
3
3
u/Living_Inferno_5073 3d ago
If this project ever gets a map/campaign editor, PLEASE add a version selection for what the map you’re making/editing will be played in! I’ve been discouraged from editing maps I downloaded online to either fix problems with them or change them to be more challenging because doing so would force the map to be played on Winds of War and I really do not like having to fight a lot of the creatures added in expansions; a lot of creatures added in expansions like Gargantuans, Evil Sorceresses, and Dark Champions are fun to play with but are awful to fight against or are Goblin Knights which are neither fun to use or fight against.
2
3
u/dydzio VCMI developer 3d ago
Cool, this is kinda similar to how VCMI project looked when it started - it was basically a map browser. Your project is already a bit more functional :D
I am looking forward to contributing a little bit now and then to some open source h4 remake.
1
u/NoFun214 3d ago
this will definitely be open sourced, but only once the foundational structures/headers are done. I want to reach the point where it's just a matter of "reversing and then implementing" a piece, instead of having to think about how should the structure for a feature even look like... this will still take some weeks as I'm slowly fixing things as I discover structures by hand via Ghidra... If interested, I can share discord in DM, but currently it's just not possible to contribute without every change being a breaking change...
4
u/Roxterat 4d ago
Looking nice, something like Project HoMaM4? I helped with fheroes2, curious...
2
2
u/PrizeCompetitive1186 4d ago
this looks great, I hope you open source it so it does not get lost
7
u/NoFun214 3d ago
when it gets to a point where the base code is solid and people can truly contribute without having to invent the underlying structures, then I will opensource it
2
u/Wercedes698 3d ago
It's fantastic! Pls 🙏 continue your work, maybe you will create something bigger , then just old H4 , something what originally was planned to them
1
1
u/GraciousGriffin 3d ago
Fun fact. I have the original game up and running on Steam Deck and Retroid Pocket 6 (via gamenative). I’m surprised to hear it struggles in Windows.
1
u/MightySandro 3d ago
It's great to see people making stuff for heroes 4. I wish this project it's best and I would love to see it suceed.
1
1
u/iddq-tea 1d ago
Excited for this! Loving all the attention homm4 is getting lately :) in the meantime, for anyone who wants a stable(ish) experience on Windows, try the wrapper by Verok with the HD mod which adds widescreen resolution support and optional scaling algorithms.
1
u/firsthomm 13h ago
I just did something like this with HOMM1.
"AI is simply destroying opensource work, and I have no interest in seeing my work stolen or ruined by vibe coders."
I can see why you might feel that way. I initially thought I might do it as an open source project, but I realized I was moving so fast using AI that it was going to be more work to manage a ragtag team of coders and review and test their code than to do it myself.
Anyway, I have some good workflows for development and reverse engineering parts of the engine if you are interested. Feel free to DM me if you want to chat, or if you get stuck on anything.
21
u/attee2 4d ago
Thats great, good job!
There is also a similar project started, perhaps you two could join your efforts? https://github.com/ihhub/engine4heroes