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: Researching how to add new objects
Thread: Researching how to add new objects This thread is 10 pages long: 1 2 3 4 5 6 7 8 9 10 · «PREV / NEXT»
Karmakeld
Karmakeld


Famous Hero
posted October 15, 2017 11:02 AM

I'm getting the sense of 04 being followed by 4 bytes of data (only if you look at my screenshot, it's 04 followed by only 3 times 00)..?
But the 10=16. 20=256 is just greek to me. Will these show if viewed as decimal? Anyway, I admit I simply lack understanding of how to read (the importance of) these last numbers. What I can do, is look into more objects and share patterns, but I doubt I will have much clue as to how they are determined.
The above method worked with several objects, but not with all, but I don't know it has to do with image size, colors or whatever.

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


Adventuring Hero
posted October 17, 2017 12:07 AM

Karmakeld said:
I'm getting the sense of 04 being followed by 4 bytes of data (only if you look at my screenshot, it's 04 followed by only 3 times 00)..?
But the 10=16. 20=256 is just greek to me. Will these show if viewed as decimal? Anyway, I admit I simply lack understanding of how to read (the importance of) these last numbers. What I can do, is look into more objects and share patterns, but I doubt I will have much clue as to how they are determined.
The above method worked with several objects, but not with all, but I don't know it has to do with image size, colors or whatever.


As far as base 16 numbers go, all that means is you take the number, place by place (from right to left), and multiply it by the corresponding power of 16, and add them all up.

For example, take the hex number, 1a

First start with a. In base 10 decimal, a is 10. It's in the first place (so power of 0). Then, 10 * 16^0 = 10

Now the 1 in the second place. 1 is just 1, but it's in the second place, so its value is 1 * 16^1 = 16

So, the full number is 16 + 10 = 26

There are probably some better tutorials / explanations of this you can find on google, but that's pretty much how you do it.

As far as the actual code you're looking for patterns in, you grab only the end part - which seems to be the shadow correct? - for several objects and send them my way and I can do a little analyzing and see what I can come up with.

Just the byte code like you have it in the hex editor. If I can't figure it out from that, I'll ask you to just send me the byte code for the whole objects Pretty much what I had to do when I was reverse engineering the map files, but I won't have any easy way to verify my findings.

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


Famous Hero
posted October 18, 2017 07:57 PM

Give me a few days, and I'll gather up a bunch of object codes for you.
____________

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


Promising
Famous Hero
Modding the Unmoddable
posted December 12, 2017 10:04 AM

shadow is just a shadow frame

frame 001 = normal frame

shadow 001 = shadow frame

You can search them as words in ANSI form within the hex.


Now as for the ending, I have no idea.


I tried to import a new pyramid image with no sucess -_- everytime I try to pu it in object palette, the editor crahes. (as creature_bank)

I have tried pasting header, pasting image, even pasting just the thing within "layer 001" - With no sucess.

Maybe I will try decorative but this is against the purpose and still don't know if it would work...

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


Hired Hero
posted December 12, 2017 01:15 PM
Edited by mirage at 15:36, 12 Dec 2017.

you should send it to the radmutant perhaps

he is the great wizard of image importing and sooner or later he will make it for you. if you can even find him somehow ofc

and a stupid question: can someone tell me where is the exact end of the shadow frame??? or the last shadow frame??? i cannot figure out that on my own...

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


Supreme Hero
posted December 12, 2017 05:13 PM

Its easier to find begin than end :-) Its hard to tell because at the end we have additional data not decrypted yet. So end of shadow is on begon the next but it not means that its end of pixels. Usulaly it sholud be 00000000 because its transparency.

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


Hired Hero
posted December 12, 2017 06:58 PM

ok then where starts the files end haha? the additional data i mean. i know its hard to find but i saw several objects with 'fixed' or with no shadow. how did you guys make those things anyway if you dont know that? you just randomly trying to replace parts of the shadow frame until it works or what?

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


Supreme Hero
posted December 12, 2017 08:53 PM

I dont know nothing about succes with shadow. Only method is to use old shadow...
Its possible because shadow is only 00000011111 . 111 is shadow 0000 nothing. But its big work for nothing. Its still random work. May be succes may be crash...

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


Famous Hero
posted December 12, 2017 10:13 PM
Edited by Karmakeld at 22:19, 12 Dec 2017.

I haven't had time to look into more 'ending' codes and send them to iLiVe for further research yet - I've been focused with other matters.
For a long time I've been wanting to make a proper guide, but we still lack some info and I've lacked time. Also I haven't added an image for 2 months, so I'll have to refresh my memory, but here's what I've noted/do remember.

Similar to Radmutant I find that the 'snake skeleton' object is a good object to test new images for import, although it might not have the desired object type (this is easy to change, although your aim should be to insert your image into the desired object). Most of the times it works, and it's really easy to test, as the image part has been clearly defined by Radmutant here.

Extract the adv_object.Skeletons.Snake.obj (or use Gnoll Hut as it has no shadows) file and open it with hex editor. Mark it from this point: (snake skeleton)00000040(position) - (ff ff ff ff 02 00) fd (00 01 00). To this point: 00000695(position) - (02 58 ff ff ff) 03 (02 00 01) Both fd and 03 needs to be replaced as well!!
Replace it with your frame and save the file with another name. And it's done. If you did it correctly, you have a 'new' object, that you can change whatever type you want.


This image shows the begining of an image. This is easily recognized from object to object/image to image. 02 means that the file contains 2 images (Frame 001 and Shadow 001). '00 01 01 00' is the where the actual image starts. As mentioned you can either replace the image part or insert entrance info and missing end bytes. Either method have been proven to work.

To locate the end of single layered images (non animated), search for 'shadow' in hex editor. Go back 12-13 bytes and you should see 'ff' code. This is the last byte of the image.

If you want to replace the shadow as well, take a look at my post here.
The way I determine it, is to compare images - simply we don't have any easier method yet.
Extract e.g. the original Pyramid object as h4d (I've extracted objects as obj files which lacked the object type info, like creature_dwelling, so you will want these info to be present).
Then export the Pyramid image (as ora file) with Namerutan's tool, import it and save it as h4d file. When you compare the two in hex editor, you should be lacking the header/entrance info as well as a number of bytes at the end (in your new file).
As mentioned, we still need to look into these 'end bytes' to figure out a pattern, but you should be able to simply insert the missing start and end to your new image and it should work.

So far I've had no succes/experience with animated objects, only radmutant has. So I can't guide you on that yet.

As for Radmutant, I know he's been busy as of lately. Besides that, I've already booked his services for quite a time So you best pick a number and get behind the queue...
____________

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


Hired Hero
posted December 13, 2017 03:33 PM

Karmakeld said:

If you want to replace the shadow as well, take a look at my post here.
The way I determine it, is to compare images - simply we don't have any easier method yet.


just as i thought... thats sad news cause im not sure it can help me with the new images i wanna importing.

Karmakeld said:

As for Radmutant, I know he's been busy as of lately. Besides that, I've already booked his services for quite a time So you best pick a number and get behind the queue...


and another bad news. when did you meet or talk him last time if i can ask it? i didnt see him online much more than a month ago...

Baronus said:
I dont know nothing about succes with shadow. Only method is to use old shadow...


but they did it. i mean radmutant and/or karmakeld did it somehow. they are working on mirrored objects and i saw some of the results already. they surely can do it.

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


Supreme Hero
posted December 13, 2017 04:45 PM

They added new picture with new shadow ant it work? Congratulations. I didnt know. This tool dont work in my 32bit win so I know it only from screens.

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


Famous Hero
posted December 14, 2017 11:08 PM

mirage said:
Karmakeld said:

If you want to replace the shadow as well, take a look at my post here.
The way I determine it, is to compare images - simply we don't have any easier method yet.


just as i thought... thats sad news cause im not sure it can help me with the new images i wanna importing.


That's not true. What you need to do is take any object, a tree, a mine, a dwelling etc. Follow my guide from above. Then you simply use the additional info and either insert you image or the additional info around your image. That's the same method I used for e.g the 'blue trees' - these are new images. You already had success with your halloween objects. You just lack the shadow part.

If your new images doesn't have matching shadows you can use the gnoll hut, as Baronus suggested a while ago. It doesn't have a shadow layer.

Karmakeld said:

As for Radmutant, I know he's been busy as of lately. Besides that, I've already booked his services for quite a time So you best pick a number and get behind the queue...


mirage said:

and another bad news. when did you meet or talk him last time if i can ask it? i didnt see him online much more than a month ago...


Hmmm. I got an e-mail from him a couple of weeks ago. Don't remember the date, but as mentioned, he did state he'd be busy for a couple of weeks, so have patience. He told me he would continue our work, so I'm counting on it.

Baronus said:
I dont know nothing about succes with shadow. Only method is to use old shadow...


but they did it. i mean radmutant and/or karmakeld did it somehow. they are working on mirrored objects and i saw some of the results already. they surely can do it.


Indeed I did. I even posted about the succes in this tread. I'm guessing Radmutant had success using the same method for animated objects, coz I've been sending him mirrored objects with changed shadows, and he's returned them to me as working objects. The success rate is +90%. I think he only had 2 objects which behaved oddly and 1 where, for unknown reason, part of the animation became transparant.

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


Supreme Hero
posted December 15, 2017 09:13 AM
Edited by Baronus at 09:14, 15 Dec 2017.

Baronus

Ok 90% success, sometimes dont work. Picture to shadow is not a big problem. Problem is additional value at the end of picture, we dont know what it means. Only to make it faster I suggest no shadow in defs. Personally I dont need in games dark stains :-) Better is fullcolor! And you can add dark stain in main picture too. Its the same and faster.

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


Promising
Famous Hero
Modding the Unmoddable
posted December 15, 2017 09:21 PM

Possibly it's not exactly the same because any other objects override shadow but not main picture.

Anyways... I will keep trying my pyramid.

People say "i did it" but don't post detailed information of how.

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


Known Hero
posted December 16, 2017 04:47 PM
Edited by radmutant69 at 17:24, 16 Dec 2017.

Well well I think all the necessary informations about how to make new objects were posted on the forum. The only problem is () Baronus (or someone else?) made so many threads we simply can't find the stuff we posted here and there anymore... (ehm no offense I'm just joking ok??? )

So let's help on it: here is Radmutant's Amazing How To Make A New Pyramid guide:

1. In the first step we need the image of an original object (in this case a Pyramid of course.) We can export it from h4r files with the ResHelper.



2. Now we have to erase the original image and paste our new one into that layer:



3. Also we can change or even erase the shadow of the original pyramid (in this case i only changed it because it will be much easier when we do the hex editing.)



4. Now we export this newly created image as a .ora file...



5. ...and import it with the ResHelper tool and save it as .h4d.



Now we will need this  h4d file and also the original Pyramid object because we need its header and some bytes from the file's end.

6. Open the original object in a hex editor and copy its header...



7. ...and paste it into the h4d file like this:



8. Now we have to compare the two files' end and find out what we need to copy from the original object:





9. Copy it and paste it too into the h4d file like this:



10. Now save it as .obj or .h4d file (it depends on you want to pack it into h4r or just put it into the Data folder):



And it's done. Now we can either pack this new file or put it into Data folder as h4d. After that we just add it to one of the Campaign Editor's object palettes and we can use it just like any other objects:


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


Known Hero
posted December 16, 2017 04:56 PM
Edited by radmutant69 at 17:22, 16 Dec 2017.

Some notes:

I hope now it's detailed enough to make people understand how it works with simple static (single framed) objects. In case of animated objects it is... well not really harder but requires much more hex editing because the frames in the original objects in a lot of cases aren't in that order as in the imported h4d files, and there might be some other problems too. For example with palettes and whatnot

Ah, and about the shadows: I cannot tell you much more about this than Karmakeld posted already somewhere. There is still no simple way to find out where is the end of the shadow frame and where starts that 'additional data' exactly.
You have to compare it with original file's end and decide somehow which part will you copy and you have to hope it will working just like mirage mentioned.

And I think probably there are still some more remaining white spots in this small 'guide'. Feel free to ask what you don't understand or what I didn't explain clearly enough.

Also here is the created object. Not really good but working at least...

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


Supreme Hero
posted December 16, 2017 06:54 PM

Great. Next question. One object has 1x1 size another 10x10. Where is area of this?

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


Known Hero
posted December 16, 2017 07:48 PM
Edited by radmutant69 at 21:41, 16 Dec 2017.

Here



Somewhat more detailed answer:



The 03 00 03 stuff means its size is 3x3 tiles.

If you modify the FF01 area you (probably) can make various holes and gaps in the red 'passability thing' ( I mean this: to this for example )

And the 04 is the entrance itself on the red passability stuff. If you change it, you can modify the shape of the entrance or make it disappearing.
All the lot of 00s here are to representing 'physically' the tiles of the red stuff. If you change them you can add more entrances of various shapes to the building like this:

But these things work mostly randomly because I don't know which exact value needed for the various holes and entrances...

Also if you want to change the size of the building you must copy and paste the whole entrance/passability data from another object (or carefully counting how many 00 required for a certain size and add/remove them manually if you really want to do that )

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


Famous Hero
posted December 16, 2017 10:05 PM
Edited by Karmakeld at 20:01, 18 Dec 2017.

@Baronus, it's not really as simple as that. Each objects consist of 2 layers, the object image and it's shadow. If you only replace the object image, you will still have the original shadow. Even if you would delete the shadow, you would still have to know where the shadow image end, and the 'end code' starts and delete the shadow part in the hex editor as well as change frame numbers, else the object most likely wont work.

(Edit)
Also Nimo is right about shadows overriding each other. That won't happen if the shadow is in the image. It could be of importance for some mapmaker that like to combine objects. So I can't really recommend leaving out the shadow or place it in the image IF it can be avoided. Really it's not that time consuming to work with shadows.
(Edit).

You can however erase the shadow in Gimp. Just delete the image but keep the layer. Then it will just be transparent.
It's possible you could use the gnoll hut object instead, but this would only be most useful for new images without matching shadow.
But you have to remember it might stick out having objects with and without shadows next to eachother.

As for the entrance values I think I can find some time to look into this. It would be very useful to have a list of what each entrance code looks like.

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


Supreme Hero
posted December 16, 2017 11:04 PM
Edited by Baronus at 23:07, 16 Dec 2017.

Baronus

Ive changed these values in gnoll hut! Dont work! So not so easy!
I know that shadow is a problem.
Shadow is definied line by line. I can tell how calculate it with precision but its lost time. You realy want calculate all image size only for shadow? It needs manualy searching and weight calculation. A lot of work for each frame. Better if find somethig for fast shadow deleting.

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

Page compiled in 0.0751 seconds