Zephyr Net


Return to the Fighters Anthology Resource Center

Go to the VNFAWING.com Forums
It is currently Wed Oct 16, 2024 08:28 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Shape (.SH) Files Format
PostPosted: Tue Feb 17, 2004 17:53 pm 
Offline

Joined: Tue Feb 17, 2004 17:15 pm
Posts: 18
I have spent the last couple of days figuring out the format of the Shape files. (FA is a game that I always come back from time to time). So far and with the help of some docs that I found around I can now parse a .SH file by hand. I wrote a little program that does the same, but it requires user input when it encounters certain polygons. If someone has more info and feel like sharing please post. This is what I have so far:

A shape files is a collection of Meshes (Different level of details, alerons in different positions, landing gear, etc...) Each mesh is a collection of structures. You can walk the structure list by knowing their sizes bacause when an structure ends another should be there (This is an approach I use for when I found difficult polygons e.g. I try to figure out what struct comes next by trying different offsets)


// This Struct also signifies the begining of a new Mesh
struct FACoordinatesList
{
BYTE Signature; // 0x82
BYTE Unknown1; // 0x00
WORD NumCoordinates; // How many FACoordinates follow
BYTE Unknown2;
BYTE Unknown3;
};


// Coordinates follow the List Header
struct FACoordinates
{
SHORT X, Y, Z;
};


struct FAPolygon
{
BYTE Signature; // 0xFC
BYTE Flags; // Describes what is present in the polygon
BYTE ColorIndex; // Color Pallete Index
BYTE Unknown1;
WORD Unknown2;
WORD Unknown3;
WORD Unknown4;
WORD Unknown5;
WORD Unknown6;
BYTE NumVertices; // Number of Vertices
};


// POLYGONS: Vertices Indices come at the end of the polygon, also you can get U,Vs if the polygon is to be texture mapped. The indices and the U,Vs can be either 8 bit or 16 bit and thats the problem my little program has right now. 2 polygon that look identical could have different sized indices and/or UVs.

Flags values that I have found:

0x41, 0x61, 0x63: No U,Vs present.
0x44, 0x64: 8 bit UVs present
0xEE, 0xED, 0x6C, 0x4C: 8 or 16 bit UVs



struct FANormal
{
BYTE Signature; // 0xF6
SHORT X, Y, Z;
};

There should be some connection between the Normals and Polygons or the Vertices, but I havent found it yet...


Other structs:

Struct 0x06 size 21
Struct 0x0C size 17
Struct 0x0E size 17
Struct 0x10 size 17
Struct 0x12 size 7
Struct 0x1E size one (Used for padding and I guess for data alignment)
Struct 0x2E size 8
Struct 0x40 size 12
Struct 0x48 size 4 bytes
Struct 0x4D size 4 bytes
Struct 0x50 size 8
Struct 0x6C size 13
Struct 0xBC size 8
Struct 0xD0 size 4 bytes
Struct 0xE0 size 4 bytes
Struct 0xF0 variable length block delimited by 0x1E
Struct 0xFF size 12 or 14


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 17:59 pm 
Offline
User avatar

Joined: Fri Aug 29, 2003 19:11 pm
Posts: 2153
:: mutters to self "Find a happy, shiney corner, find a happy shiney corner." ::

LOL good work man. Who are you though? Never seen you around before.

_________________
Centurian


Top
 Profile  
 
PostPosted: Tue Feb 17, 2004 18:31 pm 
Offline

Joined: Tue Feb 17, 2004 17:15 pm
Posts: 18
member of the FA comunity but I have been playing FA (and USNF, ATF, etc...) for a long time. I also play a lot of old and new games (Racing Simulators, FPS) but somehow once in a while I go back to FA for good 'ole fun even though the graphics are far from what is possible today . And you guessed it I'm a professional programmer so wasting time through binary files doesnt scare me...(I wish EA released FA source code so a 3D accelerated version could be created, that would be fun)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 19:53 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4432
How long have you been a memeber of the community?

VNFAWING is directly involved in creating a D3D graphics engined version of FA, called FA - 2....

Shapes in FA can indeed be modified, however I think you will find that they destabilize the game and cause CTDs...

Major changes that I have been able to accomplish involve making folded wings for stationary F-18s and changing a F-104 into a U-2 by stretching the wings and altering the tail...

I accomplished both, but the new shapes cuased instant destabilization and CTDs...

Even the simple Skijump version of the Nimitz carrier shape and the Pyramid shape altered from teh aptartment building casue CTDs if you fly through them to to close to them...

Also the altered (stretched vertical stabilizer) MiG-21 causes crashes...

What have you been able to accomplish? Please let us know...

CAG out...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 19:54 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4432
Also what program are you using to modify the shape file? What are you editing it with?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2004 23:03 pm 
Offline

Joined: Sat May 24, 2003 18:08 pm
Posts: 44
HOLY SHIT!!!, THIS IS GREAT NEWS. This guy basically just unlocked the key to FA shape modding.

_________________
I was going to make something creative but then I started playing FA.


Top
 Profile  
 
PostPosted: Thu Feb 19, 2004 01:05 am 
Offline
User avatar

Joined: Fri Aug 29, 2003 19:11 pm
Posts: 2153
hotfrog wrote:
And you guessed it I'm a professional programmer so wasting time through binary files doesnt scare me


That's why I left the Computer Science major. Among other reasons. You know my college doesn't teach C++ in their computer science program?

_________________
Centurian


Last edited by Centurian57_369th on Sun Sep 22, 2024 00:30 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 12:47 pm 
Offline

Joined: Tue Feb 17, 2004 17:15 pm
Posts: 18
Hey Centurian when I studied at the University (in my native country the concept of college doesnt exists, it's either Engineer (5 or more years) or Thecnicians (3 years)) they didnt teach C++ or C for that matter. Everything was Pascal (which by the way it's an excellent language to learn programming). C and C++ I learned my self and I have been working professionally on C++ for 8 years. Programming it is more an art, a methodology, and above else logic, than anything else. Programming languages are just tools, you learn how to use them , but you have to know what your doing.
Anyways so far I havent accomplished anything FA wise. Meaning I havent modified any plane and tested it in FA. I'm just trying to figure out the format of .SH files. I'm confident that I can modify existing polygons to some extent without crashing. Also the creator of AIRBRUSH is far ahead in decoding the .SH format, I wonder why he hasnt shared his knowledge.
One use of decoding the .SH format would be as a starting point for artist in the comunity to port and add details to the low poly (by today standards) models that come with FA. Like I said before it would be great if EA released the source for FA (a la Quake from Id), that way the 3D enigne could be updated to todays quality. but then all my work would be rendered obsolete :-). Realize guys that we have a huge database of planes (3D models and data) ready to be used in a modern simulation. Now creating that simulation is what takes time and effort and thats where EA releasing the source code could be really beneficial (The simulation code is there it's just a matter of adding and changing what we want). I guess they dont do it bacause that would mean less sales on their next Flight Simulation. Another idea is create porting tools to existing open source Flight Simulators.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 12:59 pm 
Offline

Joined: Tue Feb 17, 2004 17:15 pm
Posts: 18
Hotshot are you guys writing a new Flight Simulator? Or hooking into the existing exe? I saw at VNFAWING that some guys dissasembled FA.EXE. If you figure out the entry point to say a function like RenderPolygon and more important the arguments passed in, you can change the actual address to a new function that could call OpengGL, D3D or whatever. It sounds easy when I say it, but believe me thats quite a project. But definitively doable.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 18:07 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4432
FA - 2 Architecture is not based on FA, its an all new package with new models, graphics engine, art, terrains, hard code for fully clickable cockpits, 3D model weapons, etc. It is also sponsored by an officail developer, backing VNFAWING Development Group...

FA -2 is the next stage of FA, just as LB2 was to LB Gold... Those two packages have nothing incommon except layout of the GUI to 'blend' the transition...

The good points of FA (the mission builder, the scaling, etc) will be replicated in 'feel' but vastly improved in FA - 2...

However the 'core' of what FA offers, multiple battlefield engagements in multiple theaters via multiple airforces to replcate the air/ground war will be adhered to...

CAG out...

PS - You never said what program you were using to look at the shape file codes...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 11:58 am 
Offline

Joined: Tue Feb 17, 2004 17:15 pm
Posts: 18
So, what you're saying is that you guys are creating a new Flight Simulator from the ground up...Like a modernized FA, new source code, new data but using FA as a model.
Is this gonna be a commercial project or an open source? For such a big project I recommend it to be open source or at least make sure that porwerful, easy to use, editors for content generation are released to the comunity. If you guys dont do this I dont see how you guys are gonna be able to generate so much content in a realisic amount of time. Releasing editors helps with the longevity of the game like the Toolkit did for FA. Another thing is that you might want to research licensing issues. I know that at least car/racing simulations need to license the cars, if they're real cars, used in the game and it's not cheap. I dont know if it's the same for military aircraft. Thats where the editors and the comunity come into play. You guys deliver the game/simulation with minimun amount of data and all the content is generated by the comunity free of charge. One thing is for sure I dont think you guys can even use the name FA if it's gonna be a commercial game. If the project were to be open source I would be more than happy to contribute...

PS: I use a regular hex heditor called XVI32 and Word for formatting and trying to make sense of all the hex codes and pattern search. The windows calculator for converting big numbers from hex to decimal is great.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2004 19:13 pm 
Offline

Joined: Fri Feb 07, 2003 19:00 pm
Posts: 763
Quote:
Another thing is that you might want to research licensing issues. I know that at least car/racing simulations need to license the cars, if they're real cars, used in the game and it's not cheap. I dont know if it's the same for military aircraft.


This might be the case with the Lockheed F-104 Starfighter. One of the patches to Strike Fighters added a (TM) after the Starfighter name in all the menus.

Zephyr


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2004 05:38 am 
Offline

Joined: Wed Sep 03, 2003 20:47 pm
Posts: 12
Hi Hotfrog,

That's some really interesting stuff regarding the shape files.

Please send me an e-mail when you get a chance. I'd like to talk to you about some stuff I've learned studying FA myself.
My email is: thunderboltgeorge@fastmail.fm

Thanks

Full Burner


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2004 15:03 pm 
Offline
User avatar

Joined: Wed Apr 02, 2003 16:44 pm
Posts: 809
Location: Any cheap strip joint close by
cool freakin' beanz hotfrog, this is to killer. Thanks for shareing this with us.
And to Zephyr too ... for this board, that from time to time really scores pay-dirt.
.

_________________
Image

"cool beanz"
D. "FETCH" Jordan


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 22, 2004 03:09 am 
Offline

Joined: Sat May 24, 2003 18:08 pm
Posts: 44
You said the creator of airbrush was well ahead. Care to elaborate?

_________________
I was going to make something creative but then I started playing FA.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group