~ Forums of Enroth ~
Would you like to react to this message? Create an account in a few clicks or log in to continue.

~ Forums of Enroth ~

The Enroth diehard fan community
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Songs of Silence (HoMM like game)
Advanced hex-editing techniques Icon_minitimeby Blake01 2024-03-27, 16:52

» Heroes Orchestra's 5th Birthday concerts with Paul Romero
Advanced hex-editing techniques Icon_minitimeby rrravyn 2024-03-23, 22:45

» WARNING - The dreaded moment is here: Heroes 6 servers shutting down
Advanced hex-editing techniques Icon_minitimeby Sir Albe 2024-03-22, 07:15

» fheroes2 General Announcements
Advanced hex-editing techniques Icon_minitimeby sirDranik 2024-03-17, 23:35

» Photo Gallery
Advanced hex-editing techniques Icon_minitimeby Sir Albe 2024-03-07, 06:57

» Polskie powitanie
Advanced hex-editing techniques Icon_minitimeby rrravyn 2024-03-05, 04:02

» Heroes II localisation: how to make no-CD patch.
Advanced hex-editing techniques Icon_minitimeby kiku 2024-02-19, 02:43

Poll
Global announcements should be:
Everlasting, 1 for each project.
Advanced hex-editing techniques Redbar110%Advanced hex-editing techniques Redbar12
 0% [ 0 ]
Temporary, when there is something new to announce.
Advanced hex-editing techniques Redbar11100%Advanced hex-editing techniques Redbar12
 100% [ 6 ]
Holalala... No idea where the Ultimate artifact is.
Advanced hex-editing techniques Redbar110%Advanced hex-editing techniques Redbar12
 0% [ 0 ]
Total Votes : 6
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
Introduce yourself
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Forum Admins Feed
The Floody Land
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.1 Beta

 

 Advanced hex-editing techniques

Go down 
+5
Steven Aus
Sir Albe
Orzie
GodRage
ComputerPhreak
9 posters
Go to page : 1, 2, 3  Next
AuthorMessage
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 14:59

Hi,

I do not know if this is the correct place to post or in the general HoMM2 forum, but it regards mapmaking so I am putting it here.  The below examples are all running on the original, unmodified Heroes 2: Gold Edition executable.

I have been able to create some otherwise "impossible" map locations via hex-editing map structures.  Take a look at a couple of the examples:

An animated smoke puff:
Advanced hex-editing techniques Homm2_10

The context menu (right-click) labels it as "Unknown":
Advanced hex-editing techniques Homm2_11

When visited, it acts like a hut of the magi:
Advanced hex-editing techniques Homm2_12

Here is a floating castle:
Advanced hex-editing techniques Homm2_13

(Ignore the flags, they are due to me messing up one of the values in the map structure).  It can only be visited via boat.
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 15:05

A hero in a boat visiting the floating castle:
Advanced hex-editing techniques Homm2_14


I am still learning about the map structures and what they do, but it seems as if it is theoretically possible to make almost any structure act like any other structure, even to make "composite structures" out of slices of different structures, but I have yet to do this. When I have figured it out I will post the info here.

I don't know if people still make maps for the unmodified HoMM2, but if they do, these techniques could enable some cool "new" content and concepts, if used cleverly.
Back to top Go down
GodRage
Webmaster
Webmaster
GodRage


Messages : 1042
Quality Points : 228
Registration Date : 2009-09-21
Location : France

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 15:19

Hahaha I love the floating castle! Very Happy
Did you make a playable map with such tricks? Smile I would like to try one. Razz

Yes I think it's the right place for this topic. Smile

________________________
~Lands of Enroth~
Back to top Go down
http://homm2.free.fr
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 15:56

GodRage wrote:
Hahaha I love the floating castle! Very Happy
Did you make a playable map with such tricks? Smile I would like to try one. Razz

Yes I think it's the right place for this topic. Smile

The only maps I have made thusfar are just test maps, but eventually I would like to make one using as many of these tricks as I can to create a full map.
Back to top Go down
Orzie
Master Modder
Master Modder
Orzie


Messages : 2163
Quality Points : 843
Registration Date : 2014-12-12
Age : 32
Location : Turkey

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 17:15

Very interesting. It seems that you will be also able to create such tricks as invisible Mercury Mines (just like in Black Forest) and empty wagon mines, just like we had in Charlie Watkins' Ghost Planet. I am very curious what else you can come up with.

Did you check the stability of the map varied by such means? Is the Atlantis city functional and doesn't the game crash upon each turn?

---

Please feel yourself comfortable here. We also have the Introduce Yourself thread if you are not against this kind of stuff Smile

---

I also would recommend to check Project Ironfist, a massive HoMM2 modification which made a lot of things possible, including map scripting.


________________________
Advanced hex-editing techniques L18zg1M
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 17:43

Orzie wrote:
Very interesting. It seems that you will be also able to create such tricks as invisible Mercury Mines (just like in Black Forest) and empty wagon mines, just like we had in Charlie Watkins' Ghost Planet. I am very curious what else you can come up with.

Did you check the stability of the map varied by such means? Is the Atlantis city functional and doesn't the game crash upon each turn?

---

Please feel yourself comfortable here. We also have the Introduce Yourself thread if you are not against this kind of stuff Smile

---

I also would recommend to check Project Ironfist, a massive HoMM2 modification which made a lot of things possible, including map scripting.


Yes I was inspired by Charlie Watkin's maps, Ghost Planet specifically, but also some tricks he used in Metalluna and Illuminati.

Speaking of which, if you (or anyone else) has played the Retribution map by Timothy Duncan, have you noticed a 'phantom' hero, of the yellow faction I believe, that is not visible during normal play, but is shown during enemy movement, and is able to capture castles in some cases? I didn't know if it was intentional or just an odd one-off bug.

I will have to perform some more testing to see about the stability of such editing; 'Atlantis' is accessible, and you can recruit troops and move them in and out of the garrison, however I did notice a crash when attempting to upgrade the fort to a castle (obviously this can be disabled, though). I don't know if it was because of a mistake I made elsewhere, or if that is going to be the case with any 'floating' castles/towns.
Back to top Go down
Orzie
Master Modder
Master Modder
Orzie


Messages : 2163
Quality Points : 843
Registration Date : 2014-12-12
Age : 32
Location : Turkey

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-02, 17:49

I remember something of this kind, yes. Very impressive. Even the Metalluna map was a nice gem in terms of map hacking.
It was very peculiar to find your heroes moving on their own while you push End Turn.

If I recall correctly, hex editing in all cases was performed by Charlie Watkins (Timothy Duncan's maps were in fact a result of a fruitful collaboration with some other community members). Too bad Timothy himself is now overly busy with moderating the chit-chat section of Heroes Community to pay any attention to the HoMM2-HoMM3 developments going on. He is like a legend to me.

Concerning the crash, I suspect it's related to the fort.

________________________
Advanced hex-editing techniques L18zg1M
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-03, 06:43

I am also working on upscaling the original art assets using pixel-art scaling algorithms such as XBRz.

Original resolution:
Advanced hex-editing techniques Out10

Normal 4x upscaling (nearest neighboor):
Advanced hex-editing techniques Out4xn10

Using XBRz 4x:
Advanced hex-editing techniques Out4x10
Advanced hex-editing techniques Out4x11

This is still very early stage, I will post another thread about this with more details once I make some more progress.
Back to top Go down
Sir Albe
Mage
Mage
Sir Albe


Messages : 852
Quality Points : 452
Registration Date : 2015-07-16
Age : 28
Location : Aalborg, Denmark

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-03, 08:21

That looks amazing!

Orzie wrote:
Very interesting. It seems that you will be also able to create such tricks as invisible Mercury Mines (just like in Black Forest) and empty wagon mines, just like we had in Charlie Watkins' Ghost Planet. I am very curious what else you can come up with.

Invisible mines? How and where exactly? I never played Black Forest before, but I can't see anything special in the editor.
Back to top Go down
GodRage
Webmaster
Webmaster
GodRage


Messages : 1042
Quality Points : 228
Registration Date : 2009-09-21
Location : France

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-03, 09:27

ComputerPhreak wrote:

Advanced hex-editing techniques Out4x11
OMG, that's awesome! Very Happy

________________________
~Lands of Enroth~
Back to top Go down
http://homm2.free.fr
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-03, 10:10

Sir Albe wrote:
That looks amazing!

Orzie wrote:
Very interesting. It seems that you will be also able to create such tricks as invisible Mercury Mines (just like in Black Forest) and empty wagon mines, just like we had in Charlie Watkins' Ghost Planet. I am very curious what else you can come up with.

Invisible mines? How and where exactly? I never played Black Forest before, but I can't see anything special in the editor.

You cannot see them in the editor, only in the game. I've seen them in several maps, 'Ghost Planet', 'Illuminati', 'Abode of Evil', and one of the Agent of Heaven campaign maps that I can't recall the name of.

According to my understanding, it occurs as a result of a bug in the map editor, where using the 'erase' tool in a certain way erases the visible tiles of the object, I guess the alchemist's lab, but leaves some sort of interactable object remaining, which the game sees as a 'mercury mine'. I haven't been able to replicate the bug using the editor, though.
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-03, 12:19

Here is one more example. The differences aren't too dramatic with this scene but I think have the potential to be with more complex objects.
Advanced hex-editing techniques Exampl10

Advanced hex-editing techniques Exampl11
Back to top Go down
Orzie
Master Modder
Master Modder
Orzie


Messages : 2163
Quality Points : 843
Registration Date : 2014-12-12
Age : 32
Location : Turkey

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-03, 20:49

What I actually find funny is that you will be able to place a sign with a custom text, and then replace its sprite with a somewhat new object so that it will be possible to make very atmospheric maps allowing to put custom text upon visiting "houses", etc.

Is the functionality of an object saved right after you replace its sprite with another one?

________________________
Advanced hex-editing techniques L18zg1M
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-04, 07:48

Orzie wrote:
What I actually find funny is that you will be able to place a sign with a custom text, and then replace its sprite with a somewhat new object so that it will be possible to make very atmospheric maps allowing to put custom text upon visiting "houses", etc.


That is a great idea, actually.  And it (mostly) works:


Only problem is the tooltip says 'Sign', I don't know if that can be changed or not.  Either way it isn't a huge deal.

Orzie wrote:

Is the functionality of an object saved right after you replace its sprite with another one?

I'm not quite sure what you are asking.
I will try to explain how it works to the best of my understanding.  You may already know this but for everyone else's sake I'll try to give some details.  Each map "cell" (every square of the map) has an associated struct (this is from the IronFist source):
Code:

struct mapCell
 {
 __int16 groundIndex;
 [b]char bitfield_1_hasObject_1_isRoad_6_objTileset;
 __int8 objectIndex;[/b]
 unsigned __int16 field_4_1_1_isShadow_1_13_extraInfo;
 char field__1_hasOverlay_1_hasLateOverlay_6_overlayTileset;
 char overlayIndex;
 char displayFlags;
 [b]char objType;[/b]
 __int16 extraIdx;
 int objLink;
 int ovrLink;
 };

Each cell has the object type ('char objType' above) which signifies which type of object it is.  It also has a tileset (the top two bolded fields) which specifies which sprite to draw.  I assume it is done this way since some objects have multiple styles (e.g. the well has at least two different sprites, one with green grass under it and another with yellow-ish grass under it), but are still the same type of object.

By changing the sprite/tileset, objects that look one way and act a different way are possible.
Back to top Go down
Steven Aus
Elf
Elf
Steven Aus


Messages : 108
Quality Points : 38
Registration Date : 2015-07-21
Age : 43

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-04, 19:34

If it is possible to create custom objects with new names and the functionality of a sign, it might be possible to make a custom sign object with a custom right-click name.
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani


Messages : 288
Quality Points : 47
Registration Date : 2014-12-27

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-06, 08:12

Hello ComputerPhreak!

Nice work! I'm pretty interested in what you're doing, and would like to reach out to chat more about possibly working together. I can also explain more of how map cells and map editor objects work (you've got the basics, but the full version is actually somewhat complicated).

Anyway, here's something that should be immediately helpful:

Run the map editor in "Debug mode" by going to the command line and running "EDITOR2W.exe /NWC" . Now, when you use the "?" tool, instead of just being able to edit things like signs and castles, you will be able to edit any object and set all of these fields manually.
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-06, 08:58

Darmani wrote:
Hello ComputerPhreak!

Nice work! I'm pretty interested in what you're doing, and would like to reach out to chat more about possibly working together. I can also explain more of how map cells and map editor objects work (you've got the basics, but the full version is actually somewhat complicated).

Anyway, here's something that should be immediately helpful:

Run the map editor in "Debug mode" by going to the command line and running "EDITOR2W.exe /NWC" . Now, when you use the "?" tool, instead of just being able to edit things like signs and castles, you will be able to edit any object and set all of these fields manually.

Sure, I'd like to talk and learn more about how things work. I am in #homm2 on irc.freenode.net, I should be available to talk later today.

I tried running the editor with /NWC but it did not do anything for me, I am running the editor version 2.1, included with HoMM2: Gold Edition.
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-06, 10:36

ComputerPhreak wrote:
Darmani wrote:
Run the map editor in "Debug mode" by going to the command line and running "EDITOR2W.exe /NWC" . Now, when you use the "?" tool, instead of just being able to edit things like signs and castles, you will be able to edit any object and set all of these fields manually.

Sure, I'd like to talk and learn more about how things work.  I am in #homm2 on irc.freenode.net, I should be available to talk later today.

I tried running the editor with /NWC but it did not do anything for me, I am running the editor version 2.1, included with HoMM2: Gold Edition.

I just want to update you and everyone and note that I searched through the strings of my EDITOR2W.exe and did not find "NWC", but I did find "/PUR", and after trying it as an argument it has the effect that you described. I have no idea what it stands for, though.
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-06, 12:13

Some very odd behavior...
Back to top Go down
GodRage
Webmaster
Webmaster
GodRage


Messages : 1042
Quality Points : 228
Registration Date : 2009-09-21
Location : France

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-08, 05:52

ComputerPhreak wrote:
Original resolution:
Advanced hex-editing techniques Out10

4x:
Advanced hex-editing techniques Out4x11
I am very interested in your work! Smile
I would like to used time to time some of your images made in this 4x way on my website ( Lands of Enroth )


I don't know if I can ask you that... but can you make a x2 (and a x4?) of:

Advanced hex-editing techniques 03

________________________
~Lands of Enroth~
Back to top Go down
http://homm2.free.fr
GodRage
Webmaster
Webmaster
GodRage


Messages : 1042
Quality Points : 228
Registration Date : 2009-09-21
Location : France

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-08, 05:53

ComputerPhreak wrote:
Original resolution:
Advanced hex-editing techniques Out10

4x:
Advanced hex-editing techniques Out4x11
I am very interested in your work! Smile
I would like to used time to time some of your images made in this 4x way on my website ( Lands of Enroth )Advanced hex-editing techniques 164599763


Advanced hex-editing techniques 1675887764 I don't know if I can ask you that... but can you make a x1.5 (and maybe x2 x4?) of:

Advanced hex-editing techniques 03
?
I would be so amazingly happy Advanced hex-editing techniques 589285140  <3  ... &lt;3

________________________
~Lands of Enroth~


Last edited by GodRage on 2016-03-08, 06:34; edited 1 time in total
Back to top Go down
http://homm2.free.fr
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-08, 06:28

Well to be clear I didn't write the algorithm, or the tool to resize these images.  I'm using the code from here: https://code.google.com/p/2dimagefilter/
and the scaler I used for the previous examples was 'XBRz 4x'.

These algorithms are all designed for pixel-art, and work because said art isn't really photo-realistic.  So for the intro screen, it won't produce a very good result:
Advanced hex-editing techniques Intro_10


Click for full-res: https://i.servimg.com/u/f84/19/43/11/56/intro_10.jpg

I'm not sure what algorithm would be best for scaling this particular image. You might have to resort to doing things by hand.
Back to top Go down
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-08, 06:32

Map objects turn out much better:
Advanced hex-editing techniques Founta10
Advanced hex-editing techniques Out4x12
Advanced hex-editing techniques Sign4x10
Advanced hex-editing techniques Well4x10
Back to top Go down
GodRage
Webmaster
Webmaster
GodRage


Messages : 1042
Quality Points : 228
Registration Date : 2009-09-21
Location : France

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-08, 06:40

Thank you very much ComputerPhreak, I will try myself to see if it can works for my project. Advanced hex-editing techniques 589285140

Do you authorize me to use (on my website) the images you made by this way? (when I would use them, I'll thank you in the community page)

________________________
~Lands of Enroth~
Back to top Go down
http://homm2.free.fr
ComputerPhreak
Pikeman
Pikeman
ComputerPhreak


Messages : 30
Quality Points : 23
Registration Date : 2016-03-02

Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime2016-03-08, 06:47

GodRage wrote:
Thank you very much ComputerPhreak, I will try myself to see if it can works for my project.  Advanced hex-editing techniques 589285140

Do you authorize me to use (on my website) the images you made by this way? (when I would use them, I'll thank you in the community page)

You don't have to thank me or ask for my authorization, I don't own the images as they are I guess copyrighted to Ubisoft or whomever controls New World Computing's assets.

Just to clarify, I don't mind if you use them, but I can't promise anything about the legality of using them, since (from my understanding, at least) they are derived from copyrighted assets.
Back to top Go down
Sponsored content





Advanced hex-editing techniques Empty
PostSubject: Re: Advanced hex-editing techniques   Advanced hex-editing techniques Icon_minitime

Back to top Go down
 
Advanced hex-editing techniques
Back to top 
Page 1 of 3Go to page : 1, 2, 3  Next
 Similar topics
-
» Adding and Editing Sounds

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Mapmaking Guild :: Classic maps: SW & PoL-
Jump to: