Zephyr Net


Return to the Fighters Anthology Resource Center

Go to the VNFAWING.com Forums
It is currently Sun Apr 28, 2024 09:32 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Aug 30, 2023 14:42 pm 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
Shape (*.SH) files: 'The Explanation of how it works and How I Do It'

Part I. - FA Shape Explanation v0.11 - 2023/08

This is only a partial explanation of the information contained in the shape file.

It's actually a sort of my 'slightly disparate artificially glued together' collection of various independent informations, explanations, notes and instructions about shape files.

FA Shape Explanation.zip - FULL
https://mega.nz/file/REFB3JKY#Leyc6eQ7Hf9yzr0eOVwBq3qd2hW_8d1g4qGN5z6gHYM

F22.SH - Explanation.zip - ONLY
https://mega.nz/file/RU0ACDZC#TMz8eBqgg3VQf3gWE3AgwvSvgj-6uY-fgG7J44wIAik

Many (even important) parts of the code and mechanics inside shape files are still undeciphered.
I'll try to explain at least the ones we know so far and if we discover something new, I'll gradually add to the manual as time and my personal situation allows.

In the upcoming second part of the tutorial, I will explain how I edit shape files.

If you are interested in this topic and would like to know more, feel free to post your questions here.

Peter


Last edited by plurry on Tue Oct 10, 2023 08:08 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Aug 30, 2023 14:59 pm 
Offline
User avatar

Joined: Fri Aug 29, 2003 19:11 pm
Posts: 2148
Not a question, just a massive show of appreciation for the work you've been doing on this and sharing in the Discord with us! I cannot wait to see the full product.

_________________
Centurian


Top
 Profile  
 
PostPosted: Wed Aug 30, 2023 15:28 pm 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
Centurian57_369th wrote:
Not a question, just a massive show of appreciation for the work you've been doing on this and sharing in the Discord with us! I cannot wait to see the full product.

Thank you.
This is the easiest part. Explaining the procedures will be much more complicated. We have a long way to go.

I wonder if this will attract new people or put them off. :wink:


Top
 Profile  
 
PostPosted: Wed Aug 30, 2023 16:47 pm 
Offline
User avatar

Joined: Sun May 23, 2004 18:24 pm
Posts: 597
Location: Indiana
Hey Plurry,

Nice guide. It helps when people document their knowledge for others to learn from.

I do have a recommendation to consider for FA installation guide. To avoid the 'Time
Stamp' issue, I suggest adding an instruction to set the computer clock year to 1998
prior to installation, and return it to present year after installation of FA + patch; as
mentioned near top of my guide.
http://myplace.frontier.com/~usnraptor/usnraptor%20playset%20v3_9.txt

Now for a question. How would someone go about changing the color of an object at
a distance, using a Hex editor. I use a hex editor often, so that's not the issue. I'm
looking for where in the code would one need to change the value to get the color.

Example: The F-4B/J shape is gray in its distant shape. How would one change that
basic gray color to green or brown?

Lastly, thanks for acknowledging the work of CAG, Cent, Hawke, others, and myself.

Thanks.


Top
 Profile  
 
PostPosted: Wed Sep 20, 2023 03:11 am 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4402
Changing the color of each polygons is not as simple as you would think in the hex editor. The shape color editor is the best solution for that… if you must use the hex editor you have to not only change the color code for the polygon (for each and every one in each lod level of the shape) but you also have to change thar color in the shading segment of the polygon because the game shade's off the original color code and even if you recolor all layers of the polygons if you don't recolor the shading then as soon as you turn on shading in the game you will revert back to shades of the original color as shading over writes the basic color code when turned on…. Also having different colors next to each other can cause bleeding over when shading is on unless that aection of the shape already has a different color in its original form…

_________________
Hotshot
"FAF Shape Meister"
FAF/FA-2 Design team
TSH Member/Developer
VNFAWING.com Forum Administrator

VNFAWING Forums
VNFAWING Website

FA Futures/FA-2 is Still Being Worked On and Will Be Released...


Top
 Profile  
 
PostPosted: Sat Sep 23, 2023 13:56 pm 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
I am so sorry for not responding sooner, but I have been very busy with work the last few weeks.

First of all… Hello CAG and welcome back!
CAG Hotshot wrote:
but you also have to change thar color in the shading segment of the polygon because the game shade's off the original color code and even if you recolor all layers of the polygons if you don't recolor the shading then as soon as you turn on shading in the game you will revert back to shades of the original color as shading over writes the basic color code when turned on….
I assume that by 'the shading segment of the polygon' you mean 'Vertexes Normals for Gouraud shading effect', which in the SH file starts with the F6 header.

CAG Hotshot wrote:
Changing the color of each polygons is not as simple as you would think in the hex editor.
We are now so far ahead that a HEX editor is not needed to change the color of polygons (and many other shape properties).
There are currently two ways to do this:
1) in a plain text editor (notepad)
2) or by using 'Visual Studio Code'
In both cases, Terrence's OpenFA tools help us.

The only problem still remains 3D visualisation, which is currently still only possible using AutoCAD.

usnraptor wrote:
Now for a question. How would someone go about changing the color of an object at a distance, using a Hex editor. I use a hex editor often, so that's not the issue. I'm looking for where in the code would one need to change the value to get the color.
Again, if I have enough free time, I'll post the instructions here, which already exist in a work in progress form at the moment.

However, I stopped everything for the moment because, based on Terrence's experiment with his famous 'Double Moose coupling' https://www.youtube.com/watch?v=x3h5iFSY8-0,
I made another new discovery and great progress in shape editing.


Top
 Profile  
 
PostPosted: Sun Oct 01, 2023 18:53 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4402
I watched the openFA video… What was the point? To add additional polygons to the shape? That 2D shape is so limited its not really a good example… Depending on your answer I have other questions … You do know I have built new shapes for all the weapons with skins and improved default aircraft shapes plus built all new ones, even adding detailed skins, redoing landing gear and building new shadow shapes as well as tanks with rotating turrets and detailed skins, rotating radars and rotating missile launchers and AAA turrets with highly detailed skins on them as well…

Like the F-16XL, the U-2, the F/A-18E and F, the MiG-19, the UH-1 Huey Helicopter, the P3C, and many others over many years… You are correct on what I mean by shading. I only figured that out a few years ago for the MiG-19…

As for the other question I only know how to express it in hex editing terms…

Distance color is easy… you just change the color code in all levels of the shape so it displays the proper colors at the proper distances… each level of the shape is usually designated by hex code 1e82. That is for the close distance shape, the flaps, the air brakes, the medium distance (less detail, no skin files), and the far shade (usually a 2D super low detail shape also with no skin file, just raw polygons)…

_________________
Hotshot
"FAF Shape Meister"
FAF/FA-2 Design team
TSH Member/Developer
VNFAWING.com Forum Administrator

VNFAWING Forums
VNFAWING Website

FA Futures/FA-2 is Still Being Worked On and Will Be Released...


Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 07:29 am 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
CAG Hotshot wrote:
I watched the openFA video… What was the point? To add additional polygons to the shape? That 2D shape is so limited its not really a good example…
I'm of the opposite opinion, I found this video very funny and it totally served its purpose. Terrence has fulfilled one of my big wishes with this discovery and has moved the whole thing forward a lot.

When exploring individual code properties, you need to start with simpler objects. Terrence discovered a place where you need to adjust the offset after extending the shape with brand new polygons.
He was only able to put it at the very beginning of the SH file, otherwise the game crashed.

Based on this tutorial, I figured out other embedded offsets and proved that new polygons can be inserted (add or remove virtually any bit values) at any location in the shape file. But then a large number of contained offsets have to be changed.


Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 07:44 am 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
CAG Hotshot wrote:
Depending on your answer I have other questions … You do know I have built new shapes for all the weapons with skins and improved default aircraft shapes plus built all new ones, even adding detailed skins, redoing landing gear and building new shadow shapes as well as tanks with rotating turrets and detailed skins, rotating radars and rotating missile launchers and AAA turrets with highly detailed skins on them as well…
Like the F-16XL, the U-2, the F/A-18E and F, the MiG-19, the UH-1 Huey Helicopter, the P3C, and many others over many years… You are correct on what I mean by shading. I only figured that out a few years ago for the MiG-19…
I know all this very well. It's just that none of what you write here has ever been released publicly.
All your modified ground vehicles (including Challenger and Abrams), aircraft like MiG-31, F-16XL, EF2000, Su-22, F-14, F/A-18C, F/A-18E/F, U-2, many A-A & A-G weapons etc... I know only from pictures.

The only aircraft you publicly released after FAF Korea 2003 were the P3C Orion, MiG-19, AN-2 and UH-1H, and that wasn't until 2021.

I have closely studied the code of all four of these machines. The first three aircraft (P3C, MiG-19, AN-2) are very well and precisely modified, and a lot of really good work has been done on their skins, but unfortunately they don't contain any of the revolutionary features you showed in your pictures published from 2004 to the present.

The MiG-19 looks very good and has a lot of 3D shape adjustments, but the face normal vectors and centroids have not been adequately adjusted.

On the other hand, the UH-1H is a very nice model. You worked very hard on it and made extensive changes in the code.

My question:
You also edited 'normal vectors of face' several times on UH-1H. I have partially deciphered these values, but I still don't understand part of the code - it's the yellow highlighted bits. Would you be able to explain what these values mean?


Image


Last edited by plurry on Tue Oct 10, 2023 17:23 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 07:48 am 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
CAG Hotshot wrote:
Distance color is easy… you just change the color code in all levels of the shape so it displays the proper colors at the proper distances…
Yes changing the bit value of the face color and vertex normal is easy.
The fundamental problem is how to know which face or vertex I want to re-color. For that you need some 3D visualization of the shape. I can only do such a meaningful import (including information about individual vertices and faces) in AutoCAD so far – and this is not an ideal solution.


Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 07:52 am 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
CAG Hotshot wrote:
each level of the shape is usually designated by hex code 1e82. That is for the close distance shape, the flaps, the air brakes, the medium distance (less detail, no skin files), and the far shade (usually a 2D super low detail shape also with no skin file, just raw polygons)…
Unfortunately this is not entirely true, every new subshape (embedded partial shape) starts with the HEX code header 'FF FF 00 00'. Header '82 00' starts the vertex list for that subshape.

F22.SH - Shape Explanation v0.11 final.zip
https://mega.nz/file/RU0ACDZC#TMz8eBqgg3VQf3gWE3AgwvSvgj-6uY-fgG7J44wIAik


Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 22:26 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4402
plurry wrote:
CAG Hotshot wrote:
Distance color is easy… you just change the color code in all levels of the shape so it displays the proper colors at the proper distances…
Yes changing the bit value of the face color and vertex normal is easy.
The fundamental problem is how to know which face or vertex I want to re-color. For that you need some 3D visualization of the shape. I can only do such a meaningful import (including information about individual vertices and faces) in AutoCAD so far – and this is not an ideal solution.


Why do you need to do it at all when you can already recolor the vast majority of existing shapes in the old color editor? I don't get the need for duplication of effort? Are you wanting to combine color editing with shape editing in one tool? That was the original goal of the old color editor…

_________________
Hotshot
"FAF Shape Meister"
FAF/FA-2 Design team
TSH Member/Developer
VNFAWING.com Forum Administrator

VNFAWING Forums
VNFAWING Website

FA Futures/FA-2 is Still Being Worked On and Will Be Released...


Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 22:33 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4402
plurry wrote:
CAG Hotshot wrote:
each level of the shape is usually designated by hex code 1e82. That is for the close distance shape, the flaps, the air brakes, the medium distance (less detail, no skin files), and the far shade (usually a 2D super low detail shape also with no skin file, just raw polygons)…
Unfortunately this is not entirely true, every new subshape (embedded partial shape) starts with the HEX code header 'FF FF 00 00'. Header '82 00' starts the vertex list for that subshape.

F22.SH - Shape Explanation v0.11 final.zip
https://mega.nz/file/RU0ACDZC#TMz8eBqgg3VQf3gWE3AgwvSvgj-6uY-fgG7J44wIAik



Its not true? That is how every level of the shape is designated, along with additional F6 coding. I have edited all the levels of the shapes I have edited, plus the landing gear, flaps, and air brake shapes and locations.

What would be very very helpful is to be able to change the medium distance shape into a duplicate of the close shape so that more detail could be seen at distance, hut I never got around to experimenting with that… I thought it might crash the game with its demand on additional memory when a large number of objects are present, because of the limitations of the old game’s DOS roots…. but if it could be solved it would improve immersion by having objects appear at farther visual distances and not be so under detailed. I always found the way objects appeared in the game to be very unrealistic even at -100 magnification…

_________________
Hotshot
"FAF Shape Meister"
FAF/FA-2 Design team
TSH Member/Developer
VNFAWING.com Forum Administrator

VNFAWING Forums
VNFAWING Website

FA Futures/FA-2 is Still Being Worked On and Will Be Released...


Top
 Profile  
 
PostPosted: Tue Oct 10, 2023 22:46 pm 
Offline
User avatar

Joined: Tue Mar 11, 2003 18:54 pm
Posts: 4402
plurry wrote:
CAG Hotshot wrote:
Depending on your answer I have other questions … You do know I have built new shapes for all the weapons with skins and improved default aircraft shapes plus built all new ones, even adding detailed skins, redoing landing gear and building new shadow shapes as well as tanks with rotating turrets and detailed skins, rotating radars and rotating missile launchers and AAA turrets with highly detailed skins on them as well…
Like the F-16XL, the U-2, the F/A-18E and F, the MiG-19, the UH-1 Huey Helicopter, the P3C, and many others over many years… You are correct on what I mean by shading. I only figured that out a few years ago for the MiG-19…
I know all this very well. It's just that none of what you write here has ever been released publicly.
All your modified ground vehicles (including Challenger and Abrams), aircraft like MiG-31, F-16XL, EF2000, Su-22, F-14, F/A-18C, F/A-18E/F, U-2, many A-A & A-G weapons etc... I know only from pictures.

The only aircraft you publicly released after FAF Korea 2003 were the P3C Orion, MiG-19, AN-2 and UH-1H, and that wasn't until 2021.

I have closely studied the code of all four of these machines. The first three aircraft (P3C, MiG-19, AN-2) are very well and precisely modified, and a lot of really good work has been done on their skins, but unfortunately they don't contain any of the revolutionary features you showed in your pictures published from 2004 to the present.

The MiG-19 looks very good and has a lot of 3D shape adjustments, but the face normal vectors and centroids have not been adequately adjusted.

On the other hand, the UH-1H is a very nice model. You worked very hard on it and made extensive changes in the code.

My question:
You also edited 'normal vectors of face' several times on UH-1H. I have partially deciphered these values, but I still don't understand part of the code - it's the yellow highlighted bits. Would you be able to explain what these values mean?


Image


The P-3C and the MiG-19 were the last shapes I worked on as they were specifically requested… I had stopped work on FAF because the game is so old almost no one flies it anymore and I would have to replace nearly every item and mission the default game to get it to run with stability and it simply was to much work for this old limited sim. Oddly enough the UH-1 was one of my earliest shapes as well as the AN-2… and the Huey was improved later due to again a request for the shape…

As for explaining the code I cant just look at a small piece and say anything about it without the context of where it is on the shape file… Almost all the data is stored in my head and I have to have something to start with like which polygon it is and where it is in the shape to be able to get you the information you are requesting…

_________________
Hotshot
"FAF Shape Meister"
FAF/FA-2 Design team
TSH Member/Developer
VNFAWING.com Forum Administrator

VNFAWING Forums
VNFAWING Website

FA Futures/FA-2 is Still Being Worked On and Will Be Released...


Top
 Profile  
 
PostPosted: Sat Oct 14, 2023 08:13 am 
Offline
User avatar

Joined: Sat Mar 12, 2011 07:27 am
Posts: 34
Location: Ostrava, Czech Republic
CAG Hotshot wrote:
Why do you need to do it at all when you can already recolor the vast majority of existing shapes in the old color editor? I don't get the need for duplication of effort? Are you wanting to combine color editing with shape editing in one tool? That was the original goal of the old color editor…
The old Airbrush is a great tool that Dave 'Sick Puppy' Nunez created with the help of Brent Iverson himself - see his own article from 2010:
https://davenunez.wordpress.com/2010/04/17/airbrush-for-fighters-anthology-a-blast-from-the-past/
Yes, it was originally intended to be used for shape editing, but unfortunately it was never finished.

This spring I contacted Dave Nunez asking for some information about Airbrush and importing the SH file code, or providing the source code for Airbrush. Dave said that he no longer has the source code and unfortunately, after almost 25 years, he no longer remembers the details and no interested in resolving this matter.

Personally, I haven't used Airbrush in both versions for a long time for several reasons:
1) To use it in modern systems you need DOSBox (If I use Airbrush, I use it only in Win98SE)
2) Its user interface is not very user friendly
4) It is very unreliable. If the shape can be opened, it too often causes saving errors.
5) A lot of high quality and modern shapes cannot be opened in Airbrush 0.8 Beta at all. Only the older Airbrush 0.1 Alpha can, but that is almost unusable due to its simplicity.

I use an Excel spreadsheet to edit the color, along with AutoCAD visualization. The cumbersomeness is probably worse than Airbrush, but it has 100% reliability in saving.

CAG Hotshot wrote:
Are you wanting to combine color editing with shape editing in one tool?
Creating a new combined tool would be great, but here we are at the level of total Sci-Fi. For an almost forgotten game that's 30 years old, no one will do it today.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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