Acid Hydras anyone? #4524
Replies: 7 comments 20 replies
-
Just discovered that the PNG loader has R and B channels mixed up. Here's a fix: f7a9610 With our hydra that's barely noticeable because it's mostly green and gray colors. ;) |
Beta Was this translation helpful? Give feedback.
-
Hello @a1exsh, For your information, the video in the first post is not viewable. I think that recoloring already existing sprites is okay for personal use. |
Beta Was this translation helpful? Give feedback.
-
@LeHerosInconnu can you try with the following one (used a different video codec): Acid_Hydra_lavc.mp4 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
If you are looking for new content, take a look at the HoMM3 mod "The Succession Wars": https://heroes2.forumactif.com/f24-development-board |
Beta Was this translation helpful? Give feedback.
-
+1 to this idea, im into some optional modding to this game, thanks for ur ideas alex. |
Beta Was this translation helpful? Give feedback.
-
Just as a means of backup, attaching the script I've used for the Hydras. ;) #!/usr/bin/env python3
import os
import subprocess
subprocess.run(
["gimp", "-i", "-c"] +
sum(
[
[
'-b',
f"""
(let* ((img (car (file-png-load RUN-NONINTERACTIVE "{f}" "")))
(drw (car (gimp-image-get-active-drawable img))))
(gimp-drawable-hue-saturation drw HUE-RANGE-YELLOW 180 -100.0 0 0.0)
(gimp-drawable-hue-saturation drw HUE-RANGE-RED 180 0 0 0.0)
(file-png-save-defaults RUN-NONINTERACTIVE img drw "../../icn/HYDRA3.ICN/{f}" "")
(gimp-image-delete img))
"""
]
for f in sorted(os.listdir())
if f.endswith(".png")
],
[]
) +
["-b", "(gimp-quit 0)"]
) |
Beta Was this translation helpful? Give feedback.
-
Hi!
As I mentioned earlier, I was exploring what it takes to add new monsters to the game (per my son's request) and here's a sneak peek of an upgraded Hydra unit, Acid Hydra :)
Acid_Hydra.mp4
The changes to the code I've made to get this working can be found on this branch: master...a1exsh:hydra2
When it comes to the images, we've simply extracted the PNG files using
icn2img
fromHYDRA.ICN
and changed the color hue using Gimp's filters (which turned out to be scriptable as well). This method is particularly promising, IMO, as it allows to add new upgraded units programmatically, without the need to distribute copyrighted resources from the original game: the same algorithm as Gimp uses can be implemented in the code if needed.The images are then loaded from a directory under
~/.local/share/fheroes2/icn/
, if they exist, otherwise standard game resources are queried. I didn't dare adding an XML parser, soicn2img
was also changed to output a simple text file with the sprite offsets, and the PNGs are saved with real transparency instead of the gray background.That's all, folks! ;)
PS: I do not intend to open a PR with these changes — I will keep them in that private branch. Would love to hear about plans for extensibility, though: what others have explored so far, what is feasible to extend with a scripting language instead of hard-code, etc.
Beta Was this translation helpful? Give feedback.
All reactions