Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: Researching how to make new spells + town buildings
Thread: Researching how to make new spells + town buildings
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted October 20, 2018 08:19 PM
Edited by NimoStar at 20:21, 20 Oct 2018.

Researching how to make new spell anims + town buildings

NOTE: THIS ONLY SPEAKS ABOUT THE GRAPHICAL ASPECT OF MAKING ANIMATIONS, NOT THE CODE ASPECT OF MAKING NEW COMPLETELY FUNCTIONAL SPELLS AND BUILDINGS.
THOUGH WE CAN CHANGE SOME SPELL FUNCTIONALITY IN THE SPELLS TABLE AND BUILDING COSTS IN THEIR TABLE FILES

SInce I don't remember we have a thread for this...

Note that this only speaks of town buildings, not adventure objects. Thare is karmakeld thread for that.

I will lay down some basics:

- Spells and town buildings are the same type of file/animation

- They are interchangeable in ingame use
(You can use spells for building anims, and buildings for spell anims)

- They can be divided into a "static" frame and an "animation" portion
- ...Or they can be fully animated too

- Building files may be only the *animation*, with thew base frame being provided in the Town layers file.

- However all spell anims overwrite the base frame in town file when used as buildings.

Extra:
- Buiildings that come with the game have different lighting based on which town they represent. This is specially notable with Order buildings, which are noticeably lighter than the ones from other towns.

***

Things to document/research:

- What makes a building be only "animation" instead of overwriting the still frame from the town file? Is it a missing base frame, or something else?

- Can .ora be simply imported with namerutan's tool and used as spells/buildings? Or is there any obstacle?

After the town buildings and spell animations are "solved", we can very easily make our own custom towns with unique looks, and eventually our own custom magics.
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted November 03, 2018 10:21 PM
Edited by Karmakeld at 22:25, 03 Nov 2018.

NimoStar said:

Things to document/research:

1) What makes a building be only "animation" instead of overwriting the still frame from the town file? Is it a missing base frame, or something else?

2) Can .ora be simply imported with namerutan's tool and used as spells/buildings? Or is there any obstacle?

After the town buildings and spell animations are "solved", we can very easily make our own custom towns with unique looks, and eventually our own custom magics.


1) If you look at the Chaos Grail structure, it's animation consist of a frame named animation_position, then frames 000-015. The animation is only the Eye moving, thus it doesn't overwrite the static frame from Town's Layout file.
So quite simply, it's cause the specific animation only contains the 'animation' and NOT the building in the animation.


Other animations contain a frame named base within the animation.


2) The answer is yet. I just exported the Chaos Blacksmith and Adventure spell Mire as ora files. Replaced the base of the Blacksmith with the Luckstone and changed the color of the Mire to red. Imported the ora files with Namerutans tool, saved as h4d files. Placed them in the Data folder and voila. It works..
In generel there shouldn't be any obstacles, this was fairly easy for me. Only thing to be aware of is that the ResHelper doesn't export blank images, so you can occasionally miss a frame or two. That was the case with Mire btw. Missing frame 001 and frame 012, but when importing I got a failure message.



____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted November 09, 2018 12:00 PM
Edited by NimoStar at 12:01, 09 Nov 2018.

Quote:
So quite simply, it's cause the specific animation only contains the 'animation' and NOT the building in the animation.


That can't be true because the game doesn't know if the building is there or not since it doesn't have image recogniticion, it needs to be based on frame names...

Because some buildings from the town files are replaced and others just "complimented" with the animation.

I thought originally that it needs to be a frame named "base" for the town-appearing buildings to be replaced, because "replacing" buildings have it while "complimenting" anims don't.






But then I found out that spells replace buildings instead of complimenting them too, so it wasn't that, since they don't have a "base" frame.



So it was something else. Then I found it:





Besides an "animation_position" frame, complimenting anims have an empty first frame with 0x0 size.

Eye of Chaos also has it:


Now we would need to know how to reproduce that in the .ora
...

Plus I found an unused hourglass animation:



(It runs but doesn't flip)

*****
TL;DR:

Animations that don't replace buildings but compliment them have an empty 0x0 first numbered frame. We need to know how to do that in a .ora to make out own.

They also may have a separate "base" named frame that appears along and below all anims, much like adventure objects.
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted November 09, 2018 12:03 PM
Edited by NimoStar at 12:03, 09 Nov 2018.

2) Very nice, its good to know at least we can change them.

But that is even more worrying as regarding 0x0 frames since you are saying namerutan's tool doesn't even recognize them at least when exporting. If so using it to make buildings with 0x0 frames may be impossible; or maybe its impossible by definition that an .ora file contains such frames.
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted November 09, 2018 09:50 PM

I do recall Namerutan mentioning something about 0x0 frames and not having come up with a way yet to handle these things.

I think it wouldn't be terribly difficult though. The H4 Resource Editor would just need to allow you to add one of these when importing a .ora file, or some other way to specify that it should be there, what it should be named, etc.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted November 09, 2018 10:33 PM
Edited by Karmakeld at 23:40, 09 Nov 2018.

Have you tried using the infos specied on the 0x0 frame?
As far I can see by just lookkng at your image (will have to test this when I have the time), but it's listed as a 0x0 sized frame with 0x0 position.. just a guess but if all other sizes and positions are read, perhaps these are true enough.
What I mean is, have you tried making a layer  sized 0x0? I do find it easier to just try it, rather than to just speculate

There's lots of unused images and animations. Just Look through the files..

As for the 'base' of buildings, keep in mind some of the town structures are also located in a some Layout at the bottom (can't recall the path). That might be the 2nd image/base you seek.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted November 10, 2018 12:52 AM
Edited by NimoStar at 20:28, 11 Nov 2018.

Quote:
have you tried making a layer  sized 0x0? I do find it easier to just try it, rather than to just speculate


I can't "try" if I don't know how to "try". Layers in gimp are images, I suppose you can make a layer with nothing on it, but 1- Is this really equivalent to 0x0 pixels or just an empty image the size of the frame, 2-How do you know the "Position" of this layer 3- will it be imported?

And no, speculating is easier, this is an objective fact :V

Quote:
There's lots of unused images and animations. Just Look through the files..


I woudn't say lots, and I have found others before, I just didn't recall this particular one.

Quote:
As for the 'base' of buildings, keep in mind some of the town structures are also located in a some Layout at the bottom (can't recall the path). That might be the 2nd image/base you seek.


You mean inside the Town file? I know about those, that's what I was talking about as for replace/not replace. They are not replaced if the first numbered image is 0x0.

If you mean some other thing please say.

Also we need to know how the animation offset is saved in the "animation position" frame, since it doesn't seem to have positional data either.

____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted November 18, 2018 12:07 AM

NimoStar said:
Quote:
have you tried making a layer  sized 0x0? I do find it easier to just try it, rather than to just speculate


I can't "try" if I don't know how to "try". Layers in gimp are images, I suppose you can make a layer with nothing on it, but 1- Is this really equivalent to 0x0 pixels or just an empty image the size of the frame, 2-How do you know the "Position" of this layer 3- will it be imported?

And no, speculating is easier, this is an objective fact :V


As I don't know either, I decided to find out, rather than to keep life in this silly word quarrel .

I've exported the animation.town.chaos.nightmare (as it has bigger size than the eye). It lacks the frame 000 as that is empty.
I've doublicated another layer, deleted the image and renamed it to frame 000. I can't reduce the size to 0x0, it automatically changes to 1x1.
Then I replaced the Nightmare heart with the Rainbow animation. Imported the animation, saved it as h4d file and placed it in the Data folder. Tested it, and it works.

1) Apparently not. As you stated below, the layout image is replaced, so it doesn't have a 'base_frame'. I don't know if other programs might be able to make a 0x0 layer, but Gimp can't.
2) By looking at it's position noted in the ResourceHelper.
3) Yes it will be imported.


NimoStar said:

Quote:
As for the 'base' of buildings, keep in mind some of the town structures are also located in a some Layout at the bottom (can't recall the path). That might be the 2nd image/base you seek.


You mean inside the Town file? I know about those, that's what I was talking about as for replace/not replace. They are not replaced if the first numbered image is 0x0.

If you mean some other thing please say.

Also we need to know how the animation offset is saved in the "animation position" frame, since it doesn't seem to have positional data either.



Those are what I meant, yes.

As for the animation's postion data, I believe this might answer your question. If you look at the Grail's position in the layers.town.chaos.layout file, it's positioned at 40, 192.
The Grail animation frame 001 (the Eye), is positioned at 39, 24.
The animations position is based on the position of the layer in the layout. 40+39 and 192+24. Pos. 79, 216 matches the eye (I tried placing the animation over the layout to see if it fit).

Let me know if you want images posted...
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted November 19, 2018 03:09 PM


Quote:
Those are what I meant, yes.

As for the animation's postion data, I believe this might answer your question. If you look at the Grail's position in the layers.town.chaos.layout file, it's positioned at 40, 192.
The Grail animation frame 001 (the Eye), is positioned at 39, 24.
The animations position is based on the position of the layer in the layout. 40+39 and 192+24. Pos. 79, 216 matches the eye (I tried placing the animation over the layout to see if it fit).

Let me know if you want images posted...


That's what I would have guessed. I don't think images are necessary as I can imagine how it works.

Quote:
I've exported the animation.town.chaos.nightmare (as it has bigger size than the eye). It lacks the frame 000 as that is empty.
I've doublicated another layer, deleted the image and renamed it to frame 000. I can't reduce the size to 0x0, it automatically changes to 1x1.
Then I replaced the Nightmare heart with the Rainbow animation. Imported the animation, saved it as h4d file and placed it in the Data folder. Tested it, and it works.

1) Apparently not. As you stated below, the layout image is replaced, so it doesn't have a 'base_frame'. I don't know if other programs might be able to make a 0x0 layer, but Gimp can't.
2) By looking at it's position noted in the ResourceHelper.
3) Yes it will be imported.



Thanks, so importing it everything works as normal even with 1x1 empty layer? (I mean, in that way the rainbow doesn't "replace" the layout "nightmare forest" image but rather compliment it?)

____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted November 19, 2018 08:30 PM

NimoStar said:


Karmakeld said:

1) Apparently not. As you stated below, the layout image is replaced, so it doesn't have a 'base_frame'. I don't know if other programs might be able to make a 0x0 layer, but Gimp can't.
2) By looking at it's position noted in the ResourceHelper.
3) Yes it will be imported.



Thanks, so importing it everything works as normal even with 1x1 empty layer? (I mean, in that way the rainbow doesn't "replace" the layout "nightmare forest" image but rather compliment it?)



No, the rainbow completely replaces the nightmare forest, it doesn't compliment it as it should, so somehow this 0x0 frame is needed. I don't know if there's any image/layer settings that could work.
In this test I made the frame 000 a 1x1 empty layers, but my eye doesn't catch a blink in the animation, so I'm a bit curious as to how it will appear if several of the frames are empty 1x1 images.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted November 23, 2018 10:07 PM

So my original intuition that this would be an issue was correct...

Perhaps by hex editing the data where it sould store that frame's size, 1x1 can be modified to 0x0 on the finished file.

More extra work to be done every time, but would probably be worth it.

Also, another good reason to use compilations of PNGs and not .oras in future programs :V
____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted November 25, 2018 10:39 AM

Hex editing is worth the try, just haven't had time.
Can PNG's be 0x0?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
NimoStar
NimoStar


Responsible
Legendary Hero
Modding the Unmoddable
posted December 08, 2018 04:16 AM


Hex editing may work but that just adds extra manual steps to an already very "steppy" process...

***

Apparently, yes:

https://stackoverflow.com/questions/7909212/how-to-create-empty-0x0-image

Quote:
even if 0x0 is allowed by the specs of some image formats. A 67-byte PNG is detailed at http://garethrees.org/2007/11/14/pngcrush/ perhaps the smallest possible. A transparent one can be done in 67 bytes also.

____________
Never changing = never improving

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted December 08, 2018 12:47 PM

Well even though that article seems to provide a solution I don't see that method being any less complicated or faster. Many technical steps imo.

I'm curious as to how iLiVe's ResourceEditor exports the 0x0 layered images (or if it also doesn't). Will havw to check.


____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0672 seconds