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»
kkfkkkfk
kkfkkkfk


Adventuring Hero
Nothing is impossible
posted May 11, 2018 08:49 AM

Hello, about the last work,H4 Map Generator.
Is it not finished yet?
If it can generate random maps, it would be a great ability.

Do you consider making language text for it?
Although I can show it in Chinese, it is not complete.



Wish your work better

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


Known Hero
posted May 11, 2018 05:51 PM
Edited by iliveinabox05 at 17:52, 11 May 2018.

Hi there! The H4 Advanced Options Editor can create new maps, but it cannot yet generate random maps that are playable.

It is able to place objects on the map and modify terrain, but I haven't worked on the random part yet.

In short, the H4 Advanced Options Map Editor is in a working state, but not all of its features have been implemented.

Edit. I haven't done the language thing for it, but it's something I can look into

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


Adventuring Hero
Nothing is impossible
posted May 11, 2018 05:57 PM

Expect it to become more perfect.
It's better to have an option to work in Chinese language
And the font is recommended to use Tahoma
Arial cannot display Chinese words.

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


Famous Hero
posted May 16, 2018 08:35 PM

iliveinabox05 said:
Thanks Radmutant!

Michael, when you say the Default object, do you mean it is literally named "default"? Radmutant gave me what I needed with the sizings, but it might still be useful for other things.


Yup, it's really called default. You can even extract it in the editor, under the name of Default. For ora, it's located somewhere under Adventure Objects. Haven't been near my pc for a while, so I can't give you a more precise location than this.

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


Known Hero
posted May 17, 2018 06:13 PM

Karmakeld said:
Yup, it's really called default. You can even extract it in the editor, under the name of Default. For ora, it's located somewhere under Adventure Objects. Haven't been near my pc for a while, so I can't give you a more precise location than this.


Gotcha. Haven't tried looking at it in Namerutan's editor, but I see you emailed it to me

Still working on lining everything up over the image, but I have been making some progress.

I think I need to actually start with the image at its exact size and get everything lined up, rather than just starting with a scaled image and trying to properly scale all of the values to their correct locations.

So far, the flag location is just a tiny bit off. The starting point for the passability and entrance data seems to be really close, but I need to restudy how I'm drawing it so that it lines up with that particular point.

Getting close though. I don't really need these things done to make the passability starting point editable, so I'll probably work on adding number spinners for that.

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


Known Hero
posted May 19, 2018 07:40 PM
Edited by iliveinabox05 at 20:04, 21 May 2018.

I got the passability and entrance info lined up with the image. Turns out I had the scaling correct, I just forgot about my code centering the passability and entrance info on the image. Once I removed that, things were in the right place.

Also, I've added number spinners to enable editing of the location of the footprint info. Actually it's the x and y offsets to draw the image onto the footprint, which is why the numbers are negative. A y value of 0 lines the top of the image with the top point of the footprint info. There are some restrictions with the x value, however, which possibly has to do with the width of the image versus the width of the footprint. Haven't done too much testing here yet.

In the image below, I have modified the y value of the footprint (I haven't made it so changes on the panel will show in the image immediately, yet).



Here is  the result in the editor.



We're getting close to importing our own images There are a few more things I need to understand first.

Edit: Also the flag x and y offsets are actually offsets from the upper tip of the footprint, not the center of the image as I originally thought.

I've also fixed a few bugs in my code for displaying non-animated images that I broke while working on the animated ones.

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


Famous Hero
posted May 26, 2018 10:09 AM

Nice to see you're progressing.
Oh keep track of the research tread mate, we already concluded where the flag position starts. seems you forgot
I'm super busy with real life work like digging up our garden, as we're having superv May weather, but any time you'll be in need of the type list, let me know

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


Known Hero
posted May 26, 2018 05:47 PM
Edited by iliveinabox05 at 19:08, 29 May 2018.

Oh I read it all, there's just a lot of info in there and sometimes I skim, haha

Currently I'm making icons for turning on / off editing of passabilty and entrance info buttons on the toolbar. The buttons are there and working, just need the visual icons.

After that I think I can move onto start coding my algorithm for taking an image and putting it in H4 format.

Edit. Got the icons created and in place. Time to start working on converting an image to the H4 format!

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


Honorable
Legendary Hero
Erwin Data Modeler
posted May 26, 2018 11:53 PM

I am sorry to go a bit off topic but for sure check this out mates, it looks there is a George Almond portfolio about with some rare stuff of H4 and whatelse cheers lol
____________

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


Known Hero
posted May 29, 2018 07:06 PM
Edited by iliveinabox05 at 20:25, 18 Jun 2018.

Definitely cool stuff Mr. Verriker! I think Marzhin posted it somewhere on CH.

Currently trying to read in a png with transparency and figure out why the color value is always opaque.

Anddddddd I just figured out that I was using the wrong Color constructor. Such a silly mistake.

Anywho, I'll keep working on my code to take an image and put it into H4 format.

Edit. I'm through pulling out the used pixels and converting the color to an index using a nearest color method on the color palette.

For the color palette I'm using code I found that does quantizing for colors, so it can reduce the amount of colors to a set maximum and return the color palette. Haven't tested to see how well this works, but we'll get there soon.

Currently I need to get the alpha data pulled out of the image and stored, and then create the acceleration mask data based on that.

Edit edit: I have finished initial coding of converting a Java's BufferedImage class into the H4 format of an image. So far my editor will read and view it, but I still have some work to do with getting the editor to actually let me import it onto the palette so it can be placed on the map.

I have a couple tests I can do when I get home that should give me some ideas as to what the problem is.

Also, if anyone would like to help test the H4 Resource Editor (if you aren't already), please send me a pm. I use google drive to share so you will need to have a gmail account or an email that is associated with a gmail account in order for me to be able to share it.

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


Known Hero
posted June 19, 2018 06:44 AM

So it seems that the problem was just that I needed to center the width of the image on the footprint (and make the image width small enough to mostly fit on the width of the footprint.

So, to replace an image, open up the adventure object of your choice. I have been playing with the sawmill, so I used that. Select File->import:



Select the image, currently I am just working with png files.



Save the object and then place it into the data folder. Add to the palette to use in the map and drop it on.



The weirdness near the bottom middle of the object is probably me just not doing something quite right when creating the acceleration mask.

There also seems to be something I need to update in order to be able to actually select the object to move it around, etc. With my Starcraft 2 forge, there are only a couple pixels that will allow me to actually select the object. Maybe the offset information at the end of the file?

Anyway, still moving forward!

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


Known Hero
posted June 19, 2018 12:06 PM

Oh this is great!!! Finally I see the light at the end of the tunnel...


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


Known Hero
posted June 21, 2018 12:38 AM

Michael, might be time to get that list of major / minor types sorted out

I just need to figure out what is causing those pixels to be transparent when they should be a mix of transparent and opaque and then I will be moving onto changing footprint sizes as well as object types (basically creating your own objects from scratch).

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


Known Hero
posted June 23, 2018 08:32 PM

Got it!

The problem turned out to be - yet again - the fact that Java only uses signed values whereas pretty much everything in H4 is unsigned. I just needed to use bigger containers until the point where I need to actually save the data in H4 format.


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


Famous Hero
posted June 25, 2018 06:27 PM

iliveinabox05 said:
Michael, might be time to get that list of major / minor types sorted out

I just need to figure out what is causing those pixels to be transparent when they should be a mix of transparent and opaque and then I will be moving onto changing footprint sizes as well as object types (basically creating your own objects from scratch).


Got it will start asap. And awsome work mate *applause*, I know there's still a ton of features to add from the wishlist, but you're getting the base done so the rest should hopefully be fast work. Will have to get the latest version..

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


Known Hero
posted June 25, 2018 07:21 PM
Edited by iliveinabox05 at 19:22, 25 Jun 2018.

Karmakeld said:
Got it will start asap. And awsome work mate *applause*, I know there's still a ton of features to add from the wishlist, but you're getting the base done so the rest should hopefully be fast work. Will have to get the latest version..


Thanks man!

I do actually need some thoughts and feedback on how the importing should work as far as resizing images since the width seems to be causing issues at times (the shadow seems to be able to fall outside). Should the H4 Resource Editor just resize an image to fit on the footprint? It should probably have an option to not resize as well. It knows the width and height of images being imported, so it can keep the aspect ratio.

The starcraft 2 forge image shown in this thread was resized, and it still looks good, at least to my eyes.

Also when resizing, I'm thinking the resource editor may also need to take into account the width and height of pixels that are actually drawn (not transparent), since transparent areas don't seem to be tripping the crash caused by having the image outside of the footprint. This could also make it so the resource editor can help with at least starting to get the image centered on the footprint, and then the user can tweak if needed.

Edit. The thoughts and feedback part is open to anyone who would like to share.

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


Known Hero
posted June 26, 2018 12:29 PM

Well I think that automatic resizing would be a good feature for any building-like objects as we usually have to resize them anyway to fit on the footprint.

But it must be optional because automatic resizing to the footprint's size will probably ruin any object with a wider top than its base (like trees usually) or objects that we simply don't want to resize (like the dancing fred79 object in the other thread.)

The starcraft thing looks good for me too

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


Known Hero
posted June 26, 2018 06:48 PM

radmutant69 said:
Well I think that automatic resizing would be a good feature for any building-like objects as we usually have to resize them anyway to fit on the footprint.

But it must be optional because automatic resizing to the footprint's size will probably ruin any object with a wider top than its base (like trees usually) or objects that we simply don't want to resize (like the dancing fred79 object in the other thread.)

The starcraft thing looks good for me too


Optional for sure

When selecting File->Import, should I display a dialogue prompting for a yes / no response on resizing, or should I have a form with a checkbox for resize so we can add other options to the form? Probably the form.

I also fixed a bug in creating the acceleration mask so that partial transparency is now handled.

I still can't quite figure out what the problem is with applying the alpha data to the image when displaying it in my viewer. The alpha values are never completely opaque for the parts of the images that should definitely be opaque, so I'm sure I just need to figure out what I'm doing wrong when unpacking them.

At least it doesn't really hurt anything, just annoying to not see it in the resource editor.

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


Famous Hero
posted June 27, 2018 11:49 AM

iliveinabox05 said:
radmutant69 said:
Well I think that automatic resizing would be a good feature for any building-like objects as we usually have to resize them anyway to fit on the footprint.

But it must be optional because automatic resizing to the footprint's size will probably ruin any object with a wider top than its base (like trees usually) or objects that we simply don't want to resize (like the dancing fred79 object in the other thread.)


Optional for sure

When selecting File->Import, should I display a dialogue prompting for a yes / no response on resizing, or should I have a form with a checkbox for resize so we can add other options to the form? Probably the form.



I 2nd what Radmutant wrote. If you could auto resize the image to fit wheter it should be 2x2 or 5x5 that would be a neat feature.
You know Im always a supporter of as many options as possible, simply coz it gives more free hands, manual settings for special customization would be very handy. I guess you could allow resizing to match a number of tiles, pixels or percentage. Once my pc is back up running it'll be easier to give better feedback having tried the latest features.

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


Known Hero
posted June 27, 2018 08:11 PM
Edited by iliveinabox05 at 03:48, 29 Jun 2018.

Karmakeld said:
I 2nd what Radmutant wrote. If you could auto resize the image to fit wheter it should be 2x2 or 5x5 that would be a neat feature.
You know Im always a supporter of as many options as possible, simply coz it gives more free hands, manual settings for special customization would be very handy. I guess you could allow resizing to match a number of tiles, pixels or percentage. Once my pc is back up running it'll be easier to give better feedback having tried the latest features.



I can only resize the width of an image to the width of the footprint. I can't think of a way that I could match the height of an object's image to the height of a footprint unfortunately, since the height of the image isn't necessarily the visual height of the object. The resizing is really just to help with the issue of an object causing a crash when part of the object falls too far outside of the footprint width.

But still, we'll try to add as many options as we can

Edit. Once I do a little more work on adding resizing options for importing images, I'll update things so that the footprint size is editable.

Edit2. Also, I have some work to do still with the resizing options before there will be a next version, but If you want what I currently have, let me know and I can package it up and send update the link.

Edit3. A few options for resizing:

1) Resize frame to grid. This means resize the entire image, not taking into account transparent pixels which could pad to the left or right of the non-transparent pixels, to the width of the grid.

2) Resize data to grid. This means find the width of the actual pixels that are non-transparent, and resize that width to the width of the grid. If you can think of a better name for this other than "data," please let me know

3) Enter a width and height in pixels.

Also, any other ideas for resizing options are welcome.

 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.1967 seconds