You must be logged in to post messages.
Please login or register

Modding Discussions
Moderated by Alexastor, MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.25 replies, Sticky
Age of Empires III Heaven » Forums » Modding Discussions » ES Engine's FD Vertex format
Bottom
Topic Subject:ES Engine's FD Vertex format
kangcliff
Skirmisher
posted 06-13-16 08:44 AM EDT (US)         
I did some reverse-engineering on age3y.exe and converted the special vertex format back to the standard one, while later I could import it into 3ds max with some editing of the grnreader source code.
(Also fixed some structures so that bone data can be read properly)

It's likely the game will convert any gr2 files with the standard vertex format to the special one in memory, and later load them with functions from deformerdlly.dll using SSE optimization, which seems reasonable to use a packet of 4 vertices.

Specification

Sample Code:
https://drive.google.com/open?id=0B05b3EeXHbWMZnNtWmJzNVBaUWs
https://drive.google.com/open?id=0B05b3EeXHbWMV2F1UE14WGxXRG8

Screenshot:

[This message has been edited by kangcliff (edited 06-13-2016 @ 07:36 PM).]

AuthorReplies:
Pawelec_POLAND
Skirmisher
posted 06-13-16 10:34 AM EDT (US)     1 / 25       
Is that only happening to me or we're experiencing a breakthrough in game modding? AoE3 is the 4th of the games I play which suddenly (and by that I mean within the last week) offers new modding possibilities because the .exe was disassembled.

Well done, kangcliff. I've already asked Tilanus about the UnHardcode project (literally, I send him a PM on NE forum a minute ago), but may you tell me what are the chances of un-hardcoding the age up model for all the civs? I believe this would help the modders more than freeing the farming graphics.

I have IDA Pro 6.8 licence for my academic projects, but I'm not patient enough to work with it.
Titan Joker
Skirmisher
posted 06-14-16 06:05 AM EDT (US)     2 / 25       
Wow this is pretty big! Altought can you explain what you've done in a language a non-coding-expert can understand ? I don't really get some parts and I feel I'm missing something important.

It seems you got models from the game into 3ds max directly, without needing to go with the usual processes.
It's likely the game will convert any gr2 files with the standard vertex format to the special one in memory, and later load them with functions from deformerdlly.dll using SSE optimization, which seems reasonable to use a packet of 4 vertices.
This is the part I can't get my head around, I'm too dumb to understand such coding language...

_________________________________________________________

Creator of The XX Century mod, look it up on ModBB and on WotTA subforums!!!

Want to learn how to add playercolor, bumpmaps and much more to your new models? Click here
Mister SCP
Scenario Reviewer
posted 06-14-16 09:59 AM EDT (US)     3 / 25       
really awesome!


ESO2 Name:Sir_ConstantinESO Name:Sir_Pacman
Trigger Freak and Modder for AOE3

SCP Editor Tools---my map pack---Some incomplete stuff
My trigger Pack
WollieWoltaz
Skirmisher
posted 06-14-16 11:09 AM EDT (US)     4 / 25       
Where do I put the downloadable files?
Or are this some kind of 3ds max plug-ins?
kangcliff
Skirmisher
posted 06-15-16 10:03 AM EDT (US)     5 / 25       
Well done, kangcliff. I've already asked Tilanus about the UnHardcode project (literally, I send him a PM on NE forum a minute ago), but may you tell me what are the chances of un-hardcoding the age up model for all the civs? I believe this would help the modders more than freeing the farming graphics.
Daniel and I did some research on that, and I can tell that it's possible to achieve.
This is the part I can't get my head around, I'm too dumb to understand such coding language...
Well, I'll highlight the important part, the game always converts the standard vertex format to the game engine's private format(invisible in gr2_viewer) at runtime.

grnreaderX

- loading invisible meshes (check FD Vertex Library)
- importing bones
- fixed faces
- vertex weighing
- loading animations


Download

Source code and latest version

Screenshots

[This message has been edited by kangcliff (edited 06-15-2016 @ 11:50 AM).]

Titan Joker
Skirmisher
posted 06-16-16 04:14 PM EDT (US)     6 / 25       
Oh this seems very usefull, so I tried it with the links you gave on this thread.

I put the files in a new folder, and dropped a gr2 file, I think it was the fluyt file, and it read just fine, it created a fluyt.ms.

But when it came to open the fluyt.ms on 3ds max I got this error:



Any idea what I'm doing wrong?

_________________________________________________________

Creator of The XX Century mod, look it up on ModBB and on WotTA subforums!!!

Want to learn how to add playercolor, bumpmaps and much more to your new models? Click here

[This message has been edited by Titan Joker (edited 06-16-2016 @ 04:18 PM).]

kangcliff
Skirmisher
posted 06-16-16 07:40 PM EDT (US)     7 / 25       
Oh this seems very usefull, so I tried it with the links you gave on this thread.

I put the files in a new folder, and dropped a gr2 file, I think it was the fluyt file, and it read just fine, it created a fluyt.ms.

But when it came to open the fluyt.ms on 3ds max I got this error:

Any idea what I'm doing wrong?
Sorry for the inconvenience, this was a coding mistake as the error message suggested, too many arguments during structure creation.

Interestingly, this wasn't seen as a mistake in later versions of 3ds Max.

You can simply remove the last '#()' in the highlighted line of 'fluyt.ms' and your 'grnreaderX.ms', or re-download 'grnreaderX.ms' from the links and run the program again.

[This message has been edited by kangcliff (edited 06-16-2016 @ 07:51 PM).]

Titan Joker
Skirmisher
posted 06-17-16 07:10 AM EDT (US)     8 / 25       
Oh thank you, now it works just fine. It seems it imports even with skin modifier, wich means we can see how objects are skinned, thus allowing us to skin our own models, this is a great breakthrought!

Noob question, why can't I select the objects individually? In the schematic view I have this, but when I try to select one of the sub-objects, like the Fluyt mesh, it selects the entire hierarchy as an whole. Also when I try to go around this and select the objects in the selection floater I get only the bone_master thus I cannot select any of the sub-objects.

EDIT: Nevermind, I found out what it was, the objects were grouped, thus I couldn't select them, my bad, thanks, it's a very usefull tool!

_________________________________________________________

Creator of The XX Century mod, look it up on ModBB and on WotTA subforums!!!

Want to learn how to add playercolor, bumpmaps and much more to your new models? Click here

[This message has been edited by Titan Joker (edited 06-17-2016 @ 08:14 AM).]

Pawelec_POLAND
Skirmisher
posted 06-18-16 10:49 AM EDT (US)     9 / 25       
Finally something worth activating my student's licence for 3ds Max.

I don't know whether that's useful or not for anyone, but there are few .cpy files left untouched by the devs: Horse Artillery, generic Horse in animation_library/cavalry and Iroquois Warchief. They could be useful for reverse engineering.

kangcliff, have you tried exporting the animations and using them in-game? I hope reverse engineering of the models is possible.

[This message has been edited by Pawelec_POLAND (edited 06-18-2016 @ 11:37 AM).]

kangcliff
Skirmisher
posted 06-20-16 04:36 AM EDT (US)     10 / 25       
Changes in 1.3
- introduced plugin mode for directly loading GR2 files from 3ds Max UI
- if no files are dropped to the program, a file dialog will be opened (multiple selection allowed)

Plugin mode

Set up
1. Copy grnreaderX.ms to <3dsMaxRoot>\scripts\startup to activate the mode
2. Open 3ds Max and go to Utilites>MAXScript and select 'grnreaderX' from the drop down list
3. Click the button 'Setup' to locate 'grnreaderX.exe'

Comments
- click the button 'Setup' whenever you change the location of 'grnreaderX.exe'
- checking 'Start from slider' will import animation from the current time of 'Time Slider'

Links are same to the second post.
Titan Joker
Skirmisher
posted 06-22-16 07:19 AM EDT (US)     11 / 25       
Great update kangcliff! This will surely make people playing around with gr2 models easier in the feature.

Regardings what Pawelec said I got curious and I checked: there are severall .cpy files for animations in art1.bar, art4.bar and even in art5.bar, do you think it would be possible to reverse engineer this files, along with other gr2 animations in order to make new animations possible? Or is it still too far stretched for such thing to be possible?

Anyway, great works as always Cliff!

_________________________________________________________

Creator of The XX Century mod, look it up on ModBB and on WotTA subforums!!!

Want to learn how to add playercolor, bumpmaps and much more to your new models? Click here
Mister SCP
Scenario Reviewer
posted 06-23-16 07:24 AM EDT (US)     12 / 25       
amazing as always. You are always surprising me


ESO2 Name:Sir_ConstantinESO Name:Sir_Pacman
Trigger Freak and Modder for AOE3

SCP Editor Tools---my map pack---Some incomplete stuff
My trigger Pack
kangcliff
Skirmisher
posted 06-24-16 11:27 PM EDT (US)     13 / 25       
Finally something worth activating my student's licence for 3ds Max.

I don't know whether that's useful or not for anyone, but there are few .cpy files left untouched by the devs: Horse Artillery, generic Horse in animation_library/cavalry and Iroquois Warchief. They could be useful for reverse engineering.

kangcliff, have you tried exporting the animations and using them in-game? I hope reverse engineering of the models is possible.
Regardings what Pawelec said I got curious and I checked: there are severall .cpy files for animations in art1.bar, art4.bar and even in art5.bar, do you think it would be possible to reverse engineer this files, along with other gr2 animations in order to make new animations possible? Or is it still too far stretched for such thing to be possible?
Saving animations is possible via the NWN2 plug-in, but since the animation format is updated, AoE3 cannot read it. New animations will only be viable if GR2 files are created in older formats (2.5 and lower).

Regarding the .cpy files, which are setting files used for Biped Objects in 3ds Max, can only be useful for understanding how the skeleton is created and animated.

[This message has been edited by kangcliff (edited 06-26-2016 @ 00:35 AM).]

WollieWoltaz
Skirmisher
posted 08-23-16 02:17 PM EDT (US)     14 / 25       
Hee great script, thanks for this but it's only working with buildings?. I currently use 3ds max 2015 and you said that this script works with 3ds max 7 or later. So that can't be the problem then. but everythime i put a gr2 file (animation file) in 3ds max 2015 i get this error!
http://prnt.sc/c7hwc5

then I press oke and then this appears:
http://prnt.sc/c7hwr1

I press oke again and nothing get's imported. So I don't get a mesh model in my viewport neither the animations of that particular unit.
So what can I do to fix this?

Kind regards,

~WollieWoltaz,
Mister SCP
Scenario Reviewer
posted 08-23-16 10:56 PM EDT (US)     15 / 25       
I guess you imported a file wich only contains an animation.
There should be a Howdah in the "models" folder which you can maybe import? (Duno if it works with 2015)


ESO2 Name:Sir_ConstantinESO Name:Sir_Pacman
Trigger Freak and Modder for AOE3

SCP Editor Tools---my map pack---Some incomplete stuff
My trigger Pack
WollieWoltaz
Skirmisher
posted 08-24-16 12:54 PM EDT (US)     16 / 25       
Yes you're right I did indeed. Now I first import a static gr2 file from the Howdah unit and later I import the animations and that worked but I still get this particular error:
http://prnt.sc/c7hwc5

But it does merge the animation with the model but there are some issues with the weights or the bone heights/widths when imported. Not sure though what the excact problem is.
Here is a picture of what i mean:
http://nl.tinypic.com/r/2w6b2bo/9

Can this be fixed?

Regards,
WollieWoltaz
Skirmisher
posted 09-18-16 07:26 AM EDT (US)     17 / 25       
What can I do about this? Or prevent it from happening...
Hopefully someone can answer this.
WollieWoltaz
Skirmisher
posted 01-02-17 09:19 AM EDT (US)     18 / 25       
Sorry for the double posts but i'd really like to know how I can resolve this?

~W.w
Mister SCP
Scenario Reviewer
posted 01-13-17 11:06 AM EDT (US)     19 / 25       
I tried it out today - you did a really really really good job


ESO2 Name:Sir_ConstantinESO Name:Sir_Pacman
Trigger Freak and Modder for AOE3

SCP Editor Tools---my map pack---Some incomplete stuff
My trigger Pack
WollieWoltaz
Skirmisher
posted 01-14-17 07:59 AM EDT (US)     20 / 25       
@Mister SCP

Did you get this problem to when you imported an animation? As I showed before in the second picture I uploaded couple months ago...
Mister SCP
Scenario Reviewer
posted 01-14-17 09:56 AM EDT (US)     21 / 25       
I had them with the british explorer until i realized I must import the model first into 3ds max and then drag and drop the animation

https://www.dropbox.com/s/fwg0pkly72dq7sh/Screenshot 2017-01-14 16.52.07.png?dl=0

the only problem with artillery is the export because the engine I'm using doesnt support these 3ds max groups and so I should export them one by one

https://www.dropbox.com/s/9bg3rprn216ek4v/Screenshot 2017-01-14 16.54.24.png?dl=0
as you see the gunner get the full skeleton of the scene, same with the horse and the cannon etc

BUT and this is the most important thing - it works
https://www.dropbox.com/s/ya8bbdq0hhr48lt/screenshot_2017-01-13-20-28-04.tif?dl=0


ESO2 Name:Sir_ConstantinESO Name:Sir_Pacman
Trigger Freak and Modder for AOE3

SCP Editor Tools---my map pack---Some incomplete stuff
My trigger Pack

[This message has been edited by Mister SCP (edited 01-14-2017 @ 10:01 AM).]

Callistonian
Skirmisher
posted 11-24-17 04:50 PM EDT (US)     22 / 25       
@Mister SCP - Hi, I know this is an old thread, but could you please clarify what you mean by "drag and drop the animation"? I have tried dragging the animation gr2's onto the Max viewport to no effect. When I import animation gr2s onto a mesh using the normal method, sometimes it works fine. Other times, this happens: https://www.dropbox.com/s/msuylj9a8zscuwo/aoe3 import problem.jpg?dl=0

Obviously, this causes the animations to not work. I have noticed that this only happens for a certain percentage of meshes/animations in the game files. If you have a solution for this, please let us know - Wollie and I have not found one.
kangcliff
Skirmisher
posted 12-31-17 06:47 AM EDT (US)     23 / 25       
@Callistonian

The problems occurs either the wrong animations are applied to the model, or miscalculations of bones which I was able to fix it at a later point. Perhaps you can leave a Skype or Discord contact to talk more in details.
Elpea
Hal
(id: lp_usa)
posted 01-02-18 09:34 PM EDT (US)     24 / 25       
Not Callistonian but if you have time for some questions.. Luciano#1747 on Discord.

XLightningStormL
Skirmisher
(id: TheBronyKing11)
posted 01-21-18 03:45 AM EDT (US)     25 / 25       
I am having a similar issue as well @Kangcliff

Specifically the rhea.gr2, and rhea_walka.gr2 models when imported (the correct way as you mentioned mind you) the neck acts...well spastic (the rest of the model works fines, but the neck does this: https://i.imgur.com/ND4SPcJ.png)

Thanks in Advance (For Discord, here: XLightningStormL#7461)

Lead Designer and Producer of Age of Mythology's biggest mod compilation: http://aom.heavengames.com/downloads/showfile.php?fileid=11038
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames