H4ResourceEditor

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.

Moderator: Moderators

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Apr 19 2018, 15:40

A small additional update: I have successfully created and displayed an animated gif with the sawmill object. Now I need to actually pair up the shadow frames with the non shadow frames so that they are one single frame each, rather than just animating each frame in order from the object file, which was just part of the test to actually create an animated gif :D

Steven Aus
Assassin
Assassin
Posts: 292
Joined: 08 Feb 2006
Location: Australia

Re: H4ResourceEditor

Postby Steven Aus » Apr 22 2018, 4:43

:tsup: :applause: :yes: :up: :hug: :tsup: Great Stuff on Your Hero's Journey of Love, Passion and Indominatable Spirits!

Lethalogica
Leprechaun
Leprechaun
Posts: 3
Joined: 30 Apr 2018

Re: H4ResourceEditor

Postby Lethalogica » May 2 2018, 5:00

Really excited for this, with the right mods tools and modders heroes iv can be the best of the series, really happy I'm not the only one who is still interested

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 2 2018, 16:54

Glad to hear it and welcome Lethalogica! Trying to get to the point where we can create our own objects using this tool. I think we have enough information about the format of adventure objects to make it doable. I need to do a couple more things, such as display flag location for flaggable objects and make it adjustable, then I can work on taking an image and breaking it up into the adventure object format.

I have a couple things to do still to finish up with displaying adventure objects, such as converting image pixels to pixels where the image is displayed (when the image is resized) so that I can line up the passability, entrance info, and flag location.

Just need some time to work on it!

Here's a resized gif of the sawmill:

Image

I still haven't done any work with pixel blending and using the apha data, but I'll get to that eventually.

Also, there are some little artifacts floating around, but they are actually contained in the object image data. Alpha and blending may take care of those.
Last edited by iLiVeInAbOx05 on May 2 2018, 16:56, edited 1 time in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 17 2018, 17:56

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.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 19 2018, 21:16

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).

Image

Here is the result in the editor.

Image

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

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 21 2018, 18:56

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.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » May 26 2018, 18:58

Added a toolbar on the adventure panel with buttons to switch between editing the passability and interactive data.

Time to start working on converting an image into H4 format!

User avatar
Pol
Admin
Admin
Posts: 8190
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: H4ResourceEditor

Postby Pol » May 27 2018, 20:47

Das is great!
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Jun 19 2018, 4:56

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:

Image

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

Image

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

Image

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!

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Jun 20 2018, 22:09

By the way, please send me a private message if you're interested in helping me test this tool. You'll need a gmail account or one associated with gmail since I use google drive to host / share my files!

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Jun 23 2018, 18:34

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.

Image

User avatar
Pol
Admin
Admin
Posts: 8190
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: H4ResourceEditor

Postby Pol » Jun 23 2018, 22:09

Starcraft?
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Jun 24 2018, 2:16

Haha yes, I used a forge image I found with google. Starcraft is the game I've played more than any other, so I decided I would use an image from it to help test the resource editor.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Jun 28 2018, 22:00

Currently I'm working on some resizing options since the H4 Editor sometimes gets upset if the image has pixels which are drawn to far outside of the footprint width.

Here are some resizing options which I plan to make available with the H4 Resource Editor:

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.
Last edited by iLiVeInAbOx05 on Jun 29 2018, 18:09, edited 1 time in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 540
Joined: 21 Jul 2014

Re: H4ResourceEditor

Postby iLiVeInAbOx05 » Jul 4 2018, 16:35

I have created the form for entering resizing options. Currently working are: No resizing, resize the frame to the grid's width, and custom entering of the width and height in pixels.

Now I just need to work on the slightly more difficult case of cropping out transparent pixels on the left and right of the image, and then resizing the remaining image to the width of the grid.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 16 guests