Page 1 of 2

New way Editor!

Posted: Sun May 15, 2011 11:08 am
by Ikaros
Hi all. I'm writing version2 of my editor, based upon new knowledges.

The code will be much more clear, so I'll can share sources with those are interested.

The .bin files will be read as a tree structure, so modifing a .bin will be easier and more error proof.
The functions that create, save as .bin, modify, etc. this tree will be in a package by itself, so they could be used as a base to other editors. If some of you want them, just contact me.

I'm planning to add (beyond the old interface) also a DC|ED-style inteface, to modify directly every value in files, with a correct handling of byte-counts and definitions. Here some screens:
[img width=351 height=600]http://malgolan.altervista.org/forumIma ... 2tree1.jpg[/img][img width=394 height=600]http://malgolan.altervista.org/forumIma ... 2tree2.jpg[/img]

Because of the recursive nature of .bin files (ID, length-of-block, data-block, where data-block again contains a list of ID-len-data, until leafs are reached) the .bin reader can skip whole unknown blocks of data, storing them as raw bytes, and then writing them identically when the tree is saved. In this way, not all the IDs must be known. Just the ones we want to modify.
Here is a list of IDs I've considered by now:
[img width=469 height=600]http://malgolan.altervista.org/forumImages/treeIDs.jpg[/img]
If you know the meaning of some IDs I've marked with "Unknown" just tell me. And if you want me to handle other IDs, idem.
Bye.

Re: New way Editor!

Posted: Sun May 15, 2011 11:34 am
by hdmaster
Yeah, amazing work!

I've sent you a message with a link to the scene2.bin documentation by the Mafia Modding Crew. It contains all the knowledge of the makers of DC||ED about the .bin files. Very useful stuff for you ;)

Also here's a list with all IDs (+ description) which appear in the 0x1140 block. The IDs apply to the .4ds files too, so not all are used inside the bin files. Because I've taken them from the disassembled HD2.exe, they are 100% correct ;)

1 Visual
2 Light
3 Camera
4 Sound
5 Sector
6 Dummy
7 Target
8 User
9 Model
10 Joint
11 Volume
12 Occluder
13 Scene
14 Area
15 Shadow
16 Landscape

Re: New way Editor!

Posted: Mon May 30, 2011 10:22 am
by Ikaros
Works adavance. Some more screenshots..

This is the main interface. In the big area in center will be displayed the map. On the right there are some icons (temporary images!) to activate several layers (respawns, actors, zones, number of flags, etc.)
[img width=797 height=600]http://malgolan.altervista.org/forumIma ... 2main1.jpg[/img]

Also the DC|ED style editor has been improved. Here some screens of it.
[img width=797 height=600]http://malgolan.altervista.org/forumIma ... 2tree3.jpg[/img]
[img width=797 height=600]http://malgolan.altervista.org/forumIma ... 2tree4.jpg[/img]

And finally, for those who care, here is the design for interface:
http://malgolan.altervista.org/forumImages/H&D2 RevEngEd 2.pps

If you have suggestions, just tell me!

Re: New way Editor!

Posted: Tue May 31, 2011 1:53 am
by Jason
Looking great thup01

great news.

Posted: Tue May 31, 2011 11:52 am
by finnlayer
i hope you have plenty of paracetamol and black coffee, because their is so much to learn and do, i can imagine the headaches, one gets figuring all this hd2,

I have been trying the past week for map making, i am very pleased with your work and see the effort you have done for everyone, i can not wait to try it out, your editor.

will this editor also have plugin support  for other appz ??

one need to jack that petition for hd2, editor is born.

Re: New way Editor!

Posted: Wed Jun 01, 2011 2:31 pm
by Ikaros
New feature implemented.

When loading an "actors.bin" file, now the editor checks for some byte counts integrity.
In fact, to manually modify files (using an hex editor) can introduce errors that H&D2 apparently can handle.
For istance, adding a "definition block" at end of file usually works, despite two byte counts should be changed according to the new byte length.

Here are some screens (the italian "s?" for "yes" will be fixed soon):
Image

Image

Also, graphic for layer icons has been improved, thanks to "Sonny":
Image

Do any of you knows if an actor.bin file can have different blocks AFTER the end of the definitions block? If so, could you make me an example among the vanilla missions?

Re: New way Editor!

Posted: Tue Jun 21, 2011 6:37 pm
by hdmaster
Here a few things that might be of interest:

The 3 float values in a 0x0032 block represent the color (RGB) of the ground plane in a scene (the one you see when you fall through the map)
I saw in one of your logs that you read the content of 0x24AE blocks as raw data, but these also have son datablocks (0x0100 up to 0x0900).
I've changed the value of a 0x00B6 block from 32 to zero on Normandy3_mp and the barbed wire around the first spawnpoints had no alpha anymore. The value in that block seems always to be 32 or 64

Re: New way Editor!

Posted: Wed Jun 22, 2011 7:23 am
by Ikaros
Thank you! :)
Help is always appreciated!

I'll fix 0x0032 (just a label rename is needed).

I read as raw data all those blocks that are not worthing to modify (or I did not understand).
For example, the 0x24AE of ladder definitions is always the same (I suppose) and there is no need to change or understand its values. It's presence in the correct place it's enough.

Instead, the 0x24AE of zone definitions will be explored more, because it's needed to change flags owner and order.

If you have need for accessing some 0x24E block data, tell me which ones, and I'll add them to the editor.

And thank you again!

Re: New way Editor!

Posted: Thu Jun 23, 2011 6:37 pm
by finnlayer
Ikaros,,

you have much understanding of the files of hd2,

can you put a bik into walls and have them playing like they do on billboards, it be nice to see video playing on maps, n2_b, any were were their a wall.

Some old war movie cuts, and may be voice in the bik playing, or not ! so ikaros, is their any way to change a .bmp to a bik or place the module of voda,  in side a wall to play a bik,  ??? No one has even made this possible to play bik in a wall, i think you could achieve this and have  built in your editor bik playing in walls, i like to know how you do this playing bik in other places on a map.  :roll:

Re: New way Editor!

Posted: Fri Jun 24, 2011 1:40 pm
by Ikaros
I've never tried such a thing  :eek:
Maybe hdmaster knows more than me.
If you can give me an example (a mission where this is achieved)
I could try to reverse engineer
and replicate it....

Re: New way Editor!

Posted: Fri Jul 01, 2011 7:51 am
by Ikaros
Hi!
I've added "delete" and "duplicate" functionalities to my DC-ED-like editor.
If someone would you like to do some beta testing, please contact me!

Re: New way Editor!

Posted: Fri Jul 01, 2011 11:27 am
by Ikaros
When a definition is missing its specification (a specification with the same label),
it's pointed out with a red exclamation mark:
Image

Do you think it's sufficient? Would you like also a pop-up on loading the file, or would it be too invasive?
Or, maybe, a completely different icon, more clearly visible? (for example, a big red disc...)

Which other marks would you suggest?
Model specifications which miss a relative definition? What else?

Bye.

Re: New way Editor!

Posted: Tue Jul 05, 2011 12:02 pm
by Mator
finnlayer wrote: can you put a bik into walls and have them playing like they do on billboards, it be nice to see video playing on maps, n2_b, any were were their a wall.
It's possible  ;)
But only with changes in game or with plugin for 3ds max.
Max can use movie like texture in format .avi or .mpeg.We may add new  movie format to hd2(hd2 engine can't play avi format any way).Not only .bik.[hard way]
Or get bik plugin for 3ds max.This will allow .bik [import/export](not .avi and .mpeg only).[easier way]
nods01
Hey Ikaros will you publish an editor or tease us?  :lol:

Re: New way Editor!

Posted: Tue Jul 05, 2011 1:02 pm
by miamidos
must give him time he makes a very good job  thup01 bravo ikaros good joob

Re: New way Editor!

Posted: Fri Jul 15, 2011 6:59 pm
by MCh2207Cz
I think that HD2 must be able to read BIK files internally, the cutscenes are in BIK files.

Also I think it is possible to make animated surface in a map. Look at rivers or sea surfaces.
The question is if they use the BIK files from "gamemovie" folder or BMP textures (saved as frames) from "maps" folder.