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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: H4ResourceEditor
Thread: H4ResourceEditor This thread is 7 pages long: 1 2 3 4 5 6 7 · «PREV / NEXT»
Karmakeld
Karmakeld


Famous Hero
posted June 29, 2018 08:54 AM

I think the 3 options would be great.
Not sure if 'objects' makes more sense than data? But I think you're spot on about the 1st -image description being the intire image with transparent areas an all..

Or you go 1) entire image 2) image data only..?

Please send me a link to updated version

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


Known Hero
posted June 29, 2018 05:25 PM
Edited by iliveinabox05 at 19:40, 29 Jun 2018.

Karmakeld said:
I think the 3 options would be great.
Not sure if 'objects' makes more sense than data? But I think you're spot on about the 1st -image description being the intire image with transparent areas an all..

Or you go 1) entire image 2) image data only..?

Please send me a link to updated version


I can also add tool tips so hovering your mouse over each option gives more information. That or I could even add an icon with the "i" information symbol like a help feature to explain each option

I'll get you a copy of what I'm currently working with once I get home from work. What it basically does is checks for the existence of a "base_frame" and uses the width and height of that if found, otherwise it just uses the width and height of the entire object's frame for the width and height to resize the image being imported.

Edit. What it should probably be for now is to check if the image's width is bigger than the base_frame width or the total object frame with, and only resize if that's the case. I will make that small update before I send it off to you later.

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


Famous Hero
posted June 30, 2018 11:18 AM

iliveinabox05 said:
Karmakeld said:
I think the 3 options would be great.
Not sure if 'objects' makes more sense than data? But I think you're spot on about the 1st -image description being the intire image with transparent areas an all..

Or you go 1) entire image 2) image data only..?

Please send me a link to updated version


I can also add tool tips so hovering your mouse over each option gives more information. That or I could even add an icon with the "i" information symbol like a help feature to explain each option



I thought of that too, but thought I didn't wanna causebyou the extra work

iliveinabox05 said:

I'll get you a copy of what I'm currently working with once I get home from work. What it basically does is checks for the existence of a "base_frame" and uses the width and height of that if found, otherwise it just uses the width and height of the entire object's frame for the width and height to resize the image being imported.

Edit. What it should probably be for now is to check if the image's width is bigger than the base_frame width or the total object frame with, and only resize if that's the case. I will make that small update before I send it off to you later.


I recall there are a few of the game objects that doesn't have a base_frame but starts off with frame 001 - guess this could also be the case with new animations. So perhaps you should also set up a  conditional action that in case a base_frame isn't present it should check if the image's width is bigger than frame 001's?

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


Known Hero
posted June 30, 2018 08:12 PM
Edited by iliveinabox05 at 04:22, 18 Jul 2018.

Karmakeld said:
I recall there are a few of the game objects that doesn't have a base_frame but starts off with frame 001 - guess this could also be the case with new animations. So perhaps you should also set up a  conditional action that in case a base_frame isn't present it should check if the image's width is bigger than frame 001's?


That is certainly an option, as long as that is the only image in the object, but it won't matter anyway once I add in resizing options

Edit. Finally got a new form created and I can finally move onto pulling out the settings entered by the user, and then to actually inserting the image.

I do still need to do a little input verification for things like making sure a file was selected, but mostly simple stuff.

Edit2. I have the cases for resizing the frame to the grid width and custom dimensions working. Oh, and the case for not resizing at all

Now the slightly more difficult case of cropping out transparent pixels to the left and right of the image data.

Edit3. The cropping out of transparent pixels to the left, right, top, and bottom of an image was actually pretty easy, and I got that done a little bit ago, but I had some issues importing an image in this manner.

And when I say trouble, I mean trouble getting the H4 Editor to allow me to add the object to the palette for use.

What I need to do now is go back to the sawmill that I have been using and try it there. I just haven't had much time recently.

Edit4. It seems I also need to do a little startup stuff for my program since - obviously - some things are platform dependent, like how much heap space is allocated for the program when it is started up.

Edit5. So far I'm not having any luck getting the H4 Editor to allow me to import an object with a new image using the new resizing options. I'm going to fall back to keeping the current width and height of an adventure object when importing a new image to see how that works.

If anyone has some insight into the issues with changing the dimensions of an adventure object's image, please post them

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


Known Hero
posted July 18, 2018 12:31 PM

iliveinabox05 said:
Edit5. So far I'm not having any luck getting the H4 Editor to allow me to import an object with a new image using the new resizing options. I'm going to fall back to keeping the current width and height of an adventure object when importing a new image to see how that works.

If anyone has some insight into the issues with changing the dimensions of an adventure object's image, please post them


Just to be clear: do you mean importing an image into an existing object?

Because in that case: - you shouldn't change the size of the whole
                       image, resize only the visible parts of it

                     - you should not change the width of the
                       layer itself. Only it's height can be
                       changed (almost) freely

                     - do not crop the layer

because all of these things will most likely causing crash.

If you mean importing a totally new image (i.e. creating a totally new object) or you know this already, please don't mind this post

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


Known Hero
posted July 18, 2018 06:32 PM

I only know what I've been able to find in these forums (and some of which I've forgotten ) so please post everything you know, haha.

I started updating my code last night to always keep the same frame dimensions when importing into an existing object, but there is still a bit more work to do concerning the resizing options we discussed.

I've updated the options a little:
1) Fit image to object's frame
2) Fit data to object's frame (crop out transparent pixels on the left / right / top / bottom)
3) Fit image to grid (while leaving the frame the same size)
4) Fit data to grid (while leaving the frame the same size)
5) Custom (while leaving the frame the same size) If the custom dimensions are bigger than the frame, adjust them to the size of the frame.

I think those are what I have currently for the resizing options.

What do you know about creating a totally new object as far as restrictions on importing an image?

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


Famous Hero
posted July 21, 2018 10:31 AM

iliveinabox05 said:

What do you know about creating a totally new object as far as restrictions on importing an image?


I don't know if the term Totally new objects is really accurate, but I've made a bunch of adventure objects where I first export the image to h4 format then add the header and footprint - method in discussed in the researching tread. So it's basically no different than replacing the image code and restrictions seems to be the same for most objects. Images has to fit inside the original frame size to work.
Radmutant noted some exceptions like the Snake Skeleton.
But to my knowledge no one has yet added a completely new header or footprint code to a new image. We know how header works but as far as I recall I'm not sure if we ever got to conclude how the footprint code is 'calculated'. I should've send you some of the similarities found in various codes but there are still some blank fields to be filled out.

In short I believe all current methods are basically importing new image into existing object, one way or the other.

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


Known Hero
posted July 21, 2018 01:05 PM

Karmakeld said:
Radmutant noted some exceptions like the Snake Skeleton.


...and I think it's because those objects



lack these bytes



at the end of the file. It is possible to create 'totally new objects' if they are such 'background objects' like the Snake Skeleton because they only need a simple header that can be written even by hand and also the footprint coordinates' data at the end. Nothing more. As far as I know there are no real restrictions in these files.

But I don't know what the additional bytes at the end of the file doing or how to manually write them . The size of this code is seemingly based on the footprint's size, but it is possible to change the footprint size but keep the end code and it won't causing crash or any other problems (well, except maybe this is the reason of those custom objects 'which always appear on top of others')

Also I still don't know what exactly is this part of the header:





So I don't know how to make totally new objects but I know what prevents me from doing that I think

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


Famous Hero
posted July 22, 2018 11:23 AM

radmutant69 said:

But I don't know what the additional bytes at the end of the file doing or how to manually write them . The size of this code is seemingly based on the footprint's size, but it is possible to change the footprint size but keep the end code and it won't causing crash or any other problems (well, except maybe this is the reason of those custom objects 'which always appear on top of others')

So I don't know how to make totally new objects but I know what prevents me from doing that I think


I've compared several objects and indeed if you compare a bunch of 2x2 sized objects they seems to share footprints the same lenght. Also goes with 2x3, 3x3, 4x4 etc. The bigger the object, the longer the footprint.
And as I wrote above many of the codes are similar but a few are variables.
Now tbh it might be that I've only looked at adventure objects and not decoratives - so I'm not sure how their patterns looks like.
But if we want to be able to create objects entirely from scratch I think we should try to figure out what the end code means and how the variable codes are calculated - if possible..

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


Known Hero
posted July 23, 2018 06:28 PM

I realized after I clicked "post" that of course we don't really know about creating objects completely from scratch, haha. I'm sure the restrictions on the image height and width are SOMEWHERE in the data, we just don't yet know what all of the fields represent.

Well, as far as the info at the end of the files, does the version of the resource editor that I sent y'all show those values? I just don't remember if I had added that before I sent it to you or not.

As far as the small block of info Radmutant mentioned that is still unknown, the first of the highlighted bytes (in the third and fourth images) is for the extra info at the end of the file. A value of "0" indicates that the extra info is present, while a value of "1" indicates the info is not there.

Namerutan has the next block of data labeled as something to do with the elevation, which may or may not be correct.

I haven't had a lot of time lately, but I'm hoping pretty soon I'll be able to get some work done on the editor since I'll be taking a vacation (which will involve lots of sleep )

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


Known Hero
posted July 23, 2018 09:41 PM
Edited by radmutant69 at 21:52, 23 Jul 2018.

iliveinabox05 said:
...the image height and width are SOMEWHERE in the data, we just don't yet know what all of the fields represent...

[...]

As far as the small block of info Radmutant mentioned that is still unknown, the first of the highlighted bytes (in the third and fourth images) is for the extra info at the end of the file. A value of "0" indicates that the extra info is present, while a value of "1" indicates the info is not there.


...and the image height and width should be in the extra info at the end. I think so because when you change that 00 byte in the header to 01 in a normal object, the game will just ignore the extra info if that is present, and then you can import any size of images into that object without causing crash.

I just can't figure out how to read this extra info stuff.

Edit: also I cannot check it now but yes, the resource editor probably shows those values, because I saw there some values I couldn't interpret when I opened objects with it

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


Famous Hero
posted July 23, 2018 10:04 PM

radmutant69 said:

...and the image height and width should be in the extra info at the end. I think so because when you change that 00 byte in the header to 01 in a normal object, the game will just ignore the extra info if that is present, and then you can import any size of images into that object without causing crash.


Isn't those 00 and 01 related to wheter the object will appear infront or behind objects or is that in another part?
Just thinking that being able to change that via the Resource Editor come in handy..

As for the rest, I'm really not of much use at the moment as it been ages since I've last had time to sit by my pc... :/

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


Known Hero
posted July 23, 2018 10:14 PM

Karmakeld said:
Isn't those 00 and 01 related to wheter the object will appear infront or behind objects or is that in another part?
Just thinking that being able to change that via the Resource Editor come in handy..


Yep, also this is that 00 02/01 01 stuff that makes the object appear in front/back as I mentioned several times before.

And yeah, it would be good to make the editor being able to change it

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


Known Hero
posted July 24, 2018 05:37 PM

radmutant69 said:
...and the image height and width should be in the extra info at the end. I think so because when you change that 00 byte in the header to 01 in a normal object, the game will just ignore the extra info if that is present, and then you can import any size of images into that object without causing crash.


This is great info right here! You probably said it before and I just wasn't understanding, but I have it now I can easily make that extra info field editable, and then it should be much easier to import images!

The only issue is that the Resource Editor won't keep the extra info at the end of the file once you save the object, so you will have to make sure not to save over the original one if you want to keep that info (though it probably wouldn't be difficult to make an update to keep it if we wanted to).


radmutant69 said:
I just can't figure out how to read this extra info stuff.

Edit: also I cannot check it now but yes, the resource editor probably shows those values, because I saw there some values I couldn't interpret when I opened objects with it


Okay good, but yeah, it still doesn't make sense what the values represent. I've looked at them as a single digit (2 byte number) as well as two single byte numbers and I can't see any sort of pattern. Next step would be to show the value of each bit (16 values) to see if there is any meaning we can glean.

I'll look into making it so we can switch between viewing each of the data at the end of the file as either a single 2 byte number, two 1 byte numbers, or all 16 bit values (1 or 0).


radmutant69 said:
Yep, also this is that 00 02/01 01 stuff that makes the object appear in front/back as I mentioned several times before.

And yeah, it would be good to make the editor being able to change it


Also easy to make editable, there's just a little logic I need to add since the format is slightly different depending on the first field.

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


Famous Hero
posted July 25, 2018 10:17 AM

Feedback

I got to briefly test the latest version and I got a bit of feedback.

The passability/entrance display and editing works like a charm
I tried to fix a misplaced image (The Labyrint) but I already informed iLive that there are still some limitations to how far the image can be moved. It's worth mentioning I could edit BOTH height and width though, even if just a few pixels. Will check the exact limit later.
In relation to both scaling and possibility of creating objects from scratch I suggest adding a grid display buttom, like in the map editor. This would be useful to determine how much one would like to scale a new object.

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


Known Hero
posted July 25, 2018 06:16 PM

Karmakeld said:
I tried to fix a misplaced image (The Labyrint) but I already informed iLive that there are still some limitations to how far the image can be moved. It's worth mentioning I could edit BOTH height and width though, even if just a few pixels. Will check the exact limit later.


Yeah, we'll have to figure out that info at the end of the file, but as Radmutant said, that's likely the culprit. We'll be able to test this out by setting the field to indicate there is no info at the end of the file.

Karmakeld said:
In relation to both scaling and possibility of creating objects from scratch I suggest adding a grid display buttom, like in the map editor. This would be useful to determine how much one would like to scale a new object.


Can you elaborate on this? Do you mean before actually trying to import an image, or just show a grid in general? Basically, extend the grid out from the footprint that is already shown?

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


Famous Hero
posted July 25, 2018 06:35 PM

iliveinabox05 said:


Karmakeld said:
In relation to both scaling and possibility of creating objects from scratch I suggest adding a grid display buttom, like in the map editor. This would be useful to determine how much one would like to scale a new object.


Can you elaborate on this? Do you mean before actually trying to import an image, or just show a grid in general? Basically, extend the grid out from the footprint that is already shown?


A grid in general. Either extend a 'blank' grid around the footprint or just a toggle on/off YxY grid with no passibility info like in the editor. I guess either 5x5 or 6x6 would be sufficient for most.
I'll make an example, say I export one of the combat objects or an image of a dead creature ,and want to turn it into an adventure object. I'd need to scale it. I want it to be a 1x1 objects but with just a single visible grid, I might not get the right size at first. This becomes more clear when placed in the editor -it could be 2 or 3 tiles high without knowing exactly.
Indeed this would be for new/imported images.

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


Known Hero
posted July 25, 2018 10:27 PM

Got it, just a button to toggle the grid on or off at any point. For new adventure objects I'll just use a default grid size that will change once an image is imported.

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


Known Hero
posted July 31, 2018 12:44 AM
Edited by iliveinabox05 at 00:59, 31 Jul 2018.

Well, well, well. Radmutant was correct. Simply updating the field to indicate there is no additional info at the end of the file has yielded the desired results. In the image below I have unset that field on the mirrored labyrinth and adjusted the footprint to where it should be.



Then I open the editor (which already had this object in my test map) and voila!



I also just retested importing an image into an object that I couldn't get to work before (cliff nest). I just turned off the end of file offsets and it was good to go!

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

Tavern Dweller
posted July 31, 2018 10:41 AM

Hi everyone.
Iím an author of many mods for Heroes V.
Now I am preparing unofficial project for H4.
I have a few questions:
1. Is there possibility to add new extra music songs? Without replacing existing?
2. Is there possibility to add new load screens into game? Without replacing..

Thanks!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 7 pages long: 1 2 3 4 5 6 7 · «PREV / NEXT»
Post New Poll †† Post New Topic †† Post New Reply

Page compiled in 0.0945 seconds