SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [WIP] Almagest. Strict Import for SH5. (https://www.subsim.com/radioroom/showthread.php?t=248714)

Jeff-Groves 03-05-21 02:51 PM

Almagest. Strict Import for SH5.
 
One of the biggest problems when importing with TDW's program is the loose import.
File size grows in an astronomical way!

1st thing you'll ask is "Why that Name?" Look it up!
:har:

2nd thing you'll ask is "How do you know it will work?"
:hmmm:

There are many posts in the past where I TRIED to explain this all. Those are hard to find and it's time to teach a new crowd.

This is going to be a stand alone program ANYONE can use! No math. No 010 editor. Just run it and your files will be adjusted to a well known standard.
Well know by me any way!

Neal and Jimbuna helped solve my connection issues so this is my way of giving back to ALL my friends here at SubSim.
:salute:

Jeff-Groves 03-05-21 02:59 PM

Why THAT name?

In the second century, Claudius Ptolemy, an Alexandrian astronomer and mathematician, wrote Mathematike Syntaxis (in Greek) or The Mathematical Compilation, a treatise on the apparent motions of the stars and planets. This work soon became known as The Greatest Compilation and it established the model of a geocentric universe, a scientific schema that would be followed for the next thousand years. When Ptolemy’s Greek work was adopted in the Islamic world, its title in Arabic was shortened to The Greatest, which when transliterated into Latin became Almagest.
:har:

People come up with some of the craziest names so this is my name for the program!

Jeff-Groves 03-05-21 03:06 PM

Let us talk about details.
1st thing one needs to have is a complete understanding of the obj format.
It's a text file yes but do you REALLY understand how it works?
Then you need to have a complete understanding of how those files are adjusted and stored in a GR2 file.

Pretty sure very few reading this do know. You see what is exported and probably don't even look at the files in a text editor.
Even if you do it's Greek.
(Another salute to the Name! :haha:)

Jeff-Groves 03-05-21 03:15 PM

I'm not going to explain the object file format. You can look that up for a basic understanding.

What I AM going to explain is HOW a GR2 file uses the format to store the information and how it does that!
Knowing that information tells me HOW to write a Converter!

Some of the information can also be used to Ghost S3D!

gap 03-05-21 04:09 PM

Of all the mad scientists and inventors, you are by far the one with the craziest names. :har:

Following this thread.

Long life to the almighty Almagest :up:

P.S: if someone wants to know more on the wavefront (obj) format, I can provide the basics :salute:

Jeff-Groves 03-05-21 04:39 PM

Let's reveal the Magic
 
RAD Games GR2 format for storing the 3D object files is basically an obj file.
The mystical part is how they did it. (To most people)
Why do they export with so many faces and verts and such?

That is where a FULL understanding of the obj file format comes in SO important!

RAD took full advantage of the format in a way that just confuses most!
I'll call it a shuffling of the deck type approach.
We take 2 decks with different faces, discard what we don't need, then shuffle the rest but in an organized way with a template of where each card is.

Each card is recorded in the Faces section of the obj format with a number.
Each number in the Faces section is a line number.
So if we want vert 75? It will be in that catalog as 75.

Jeff-Groves 03-05-21 04:44 PM

Knowing all this? How did RAD do it in GR2?
Easy! They read the files, drop what they don't need, add what is needed, make sure file placement numbers are equal, then adjust the faces section to call the proper lines!

Being obj files are text files? Pretty easy to shuffle the deck in our favor!

Jeff-Groves 03-05-21 05:14 PM

Time for Alchemy
 
A seemingly magical process of transformation, creation, or combination.

In all my years watching GR2 editors and such? The best I have seen is TDW's version. I rate it the best as it does not use the granny2.dll.

He did miss the one critical thinking about imports.
Now even S3D missed the mark so not the first time!

It is easier to work around S3D's faults but maybe I'll include that during programming.
:hmmm:

Now I am concerned about the transformation\combination in this Alchemy.
I'll need to read 2 separate files, program to find the differences, then adjust everything to create 2 new files that meet the requirements.

Being doing that 2 files at a time would be slow?
Gonna need to make it a mass Alchemy type program.
So put all the files in a folder, click a button, and stand back!

Jeff-Groves 03-05-21 05:27 PM

I will take files from people to experiment on.
I'll need both the normal file and any AO files.

Better to test what you have then play with something that may not match
what you are working in.

kapuhy 03-07-21 07:10 AM

Quote:

Originally Posted by Jeff-Groves (Post 2734238)
I will take files from people to experiment on.
I'll need both the normal file and any AO files.

Better to test what you have then play with something that may not match
what you are working in.

First of all, thanks for making the effort to create Almagest :up: It will be invaluable for anyone planning to create new content for SH5.

Now, if I read you correctly re:files, you'd like examples of files we've been importing using TDW's tool in order to experiment on them? In that case, here's a sample:

Plane model

That's a plane I've been working on recently, upon importing it using TDW's program and following settings:
- Loose import
- Vertex data, uv1 data, normal data, calculate tangent and binormals: yes
- uv2 data, force subset ordering, update materials - no

Resulting GR2 file of that 8K vertices model is 1683 KB, while - for comparison - stock Avro Anson (7,1 K vertices) is 657 KB. I packed into linked file both .obj files before importing and the .gr2 file after import.

gap 03-07-21 09:08 AM

@ Jeff

a quick question: if I got you correctly the core of your idea, when using your program we will need to check that the model we want to import in game has a number of of vertices and faces equal or lesser than the stock GR2 template chosen for the import. Is that correct?

If that was true, it would be a big incentive to keep our models as simple as possible...

Jeff-Groves 03-07-21 10:05 AM

Strict import doesn't matter about size of the imported file.
Strict means all verts and such match on their numbers.
So if you have 100 verts you need to have 100 text coords and 100 normals (If included)
Both the diffuse obj and AO obj MUST match those numbers!

AND the faces must match! That is the tricky part.
:03:

I'll need to test the different versions of TDW's program as I'm not sure how he's defining Strict at this time.

Jeff-Groves 03-07-21 11:29 AM

@gap, I hope you down load both mine and kapuhy's files to examine!




@kapuhy,

Using nothing but 010 editor to change your rudder,
I imported your rudder to the Avro GR2 file.
There is NO file size change to the GR2 file!
:D

Look at the rudder size in your edited GR2 compared to mine!
I also opened my GR2 with Goblin.

Testing TDW's program I did remember a few things I forgot!
So this is going to be easier then I recalled!

I'll upload the test GR2 so you can see it for yourself.
:up:


https://www.mediafire.com/file/vypnt...test1.GR2/file

Jeff-Groves 03-07-21 11:41 AM

Quote:

Originally Posted by gap (Post 2734604)
@ Jeff

a quick question: if I got you correctly the core of your idea, when using your program we will need to check that the model we want to import in game has a number of of vertices and faces equal or lesser than the stock GR2 template chosen for the import. Is that correct?

If that was true, it would be a big incentive to keep our models as simple as possible...

So far I'd say stay smaller then the target GR2.
As I stated above? I'd forgotten a few things about Ghosting TDW's program.
It's all coming back now!
:har:

Jeff-Groves 03-07-21 12:29 PM

So 3D object import as Strict works.
I still need to work on the texture part but it's looking good so far!

What I'll do now is to export the rudder and check the textures UV's in 3DS max.
That should give me the information I need to adjust things.


All times are GMT -5. The time now is 04:23 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.