[OPTing] XWA OPT Editor

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

Re: [OPTing] a new opting tool is under construction

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Sun May 25, 2014 2:18 pm

Hi Jeremey, not having much look with this, got various error messages concerning materials, got past all those and the program gets stuck in the please wait loading cycle. It does update the info at the bottome with the correct number and bpp of textures, plus size,but i've let it run for an hour with no change. Any chance a can sent you the model for a look as would like to know the proper settings for importing. This ones a converted galaxies model so there may be problems withe the original model or conversion process, but again be good to get these nailed down for future reference

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun May 25, 2014 3:06 pm

If the informations at the bottom of the window are updated and no error box appears, it means that importing the obj succeded. Then the 3d model is updated and the busy indicator disappears. The whole process should not take more than a couple of minutes. You can have a look at the process manager to see whether the process is still running.

The various error messages you get probably mean that my program doesn't import the obj file crorrectly, or that the obj file is not correctly formated.

For debugging purpose, it would be simpler if you can send me the obj file.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Sun May 25, 2014 3:34 pm

I'll do that then, like i said it does seem to import the obj correctly, but the model never appears in the windows and the please wait appears indefinitely, most likely the conversion process is to blame, it is a large model though, 50k faces and 12 maps, mostlt 1024* and 512*. I'll zip it up and upload and send you the link by pm

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon May 26, 2014 12:07 am

There was a couple of bugs in my obj importing code (misunderstanding about the obj specs).
This is now corrected.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Mon May 26, 2014 1:34 am

No probs, my own understanding is limited too so most of the errors were my fault.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon May 26, 2014 8:14 pm

Hello,
I have done a couple of tests, and it seems that what limits the vertices count per mesh is not directly related to opt rendering, but it is related to the rendering of the hit marks effects.
When there are more than 512 different vertices in a mesh, the game may crash.
When there are too many triangles in a face group, the display may be corrupted, but not seems to make the game crash.

Rasalas
Cadet 2nd Class
Posts: 50
Joined: Fri Jan 17, 2014 8:09 pm

Post by Rasalas » Mon May 26, 2014 10:38 pm

JeremyaFr wrote:When there are too many triangles in a face group, the display may be corrupted, but not seems to make the game crash.
Is that the explanation for the infamous "triangulation to infinity"-effect?

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Tue May 27, 2014 7:18 am

So were're limited to 512 vertices per mesh? Thats a bit low, but workable as long as the unlimited mesh still applies. By triangles in a face group do you mean in a single mesh? if the limits 512 vetrices it should not be much of a problem i think?

I'll cut up the obj i sent you into more realistic meshes instead of one big one when i have some free time, also convert a few more with maya or max instead of the limited tools i was using as they caused more than a few problems

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue May 27, 2014 1:20 pm

The vertices count per mesh is limited to 512.
The meshes count per opt is limited to 50.
Therefore an opt file can contain up to 25600 vertices.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Tue May 27, 2014 2:20 pm

Ah i missed the 50 mesh limit. so no 100k poly ISD or Mon Cals in game then.

User avatar
Atx
Lieutenant Commander
Posts: 1217
Joined: Mon Feb 11, 2002 12:01 am

Post by Atx » Tue May 27, 2014 3:58 pm

I think there's an issue with using Tri faces over Quads. You can maximize more of that limit using Quad faces if I recall?
But both tri faces have to be coplanar for the quad to work. I successfully converted Saxman's airspeeder and that thing was a monster with all sorts of back-facing faces and the works. I fixed up most of it and was able to get it all in there... so you never know til you start breaking it down and seeing what you can get away with or remodel parts in a lower poly?
The Navbuoy is closed...long live the XWAU!!!

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed May 28, 2014 12:10 am

Just wondering,
Has anyone ever tried to increase the size of the scene buffers?
Would it have an effect?

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Wed May 28, 2014 2:46 am

ATX, quads are just 2 tris, the issues the number of vertices anyways which are the corners, you might think 2 tri has 6 corners and a quad has 4 but the vertices are welded and the numbers the same. It depends greatly on the model but for example the corvette i sent to Jeremy had 49578 vertices and 50611 tri faces, conveting tris to quads here would make no difference here, it only would if vertices werent welded in the first place, say for example you used a format like dxf which is a 32 year old format and completely unsuitable for 3d models anyways.

Jeremy I think you're at the forefront here, or if anyone has tried it i doubt they're still around. 512 is a nice round number though, maybe thats editable somewhere? 50's not, i saw you tested 50 meshes of 3200 tri's, each or in total?, and how many vertices?

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Wed May 28, 2014 10:28 am

Hi Jeremy, i looked at a few opts and some of the xwau meshs have more than 512 vertices in a mesh
Capture.JPG
also the rear wing/tailfin on this model has 660

The preybird opt also has over 512 in the main wings and engine meshes

The ISD has 943 in its main hull, which i think would get hit a lot and if any crashes would have been reported by now, and also has over 512 in a considerable number more meshes.


I think the model i sent you should be disregarded as it came through 3 programs to get to its current state and isnt properly constructed, at least not in the way an opt would normally be
You do not have the required permissions to view the files attached to this post.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Wed May 28, 2014 10:33 am

should add though none of those meshs have welded vertices, i've yet to see a mesh with over 512 tris

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed May 28, 2014 1:16 pm

Here is some explanations regarding vertices and triangles count.
HeavyLifter.JPG
Triangles and vertices count next to distance are calculated as follow:
Triangles count (339): a face with a Tri counts for 1 and a face with a Quad counts for 2.
Vertices count (1017): a face with a Tri counts for 3 and a face with a Quad counts for 4.

The 512 vertices limit applies to the mesh geometry.
For the Heavy Lifter, the max vertices count is 508.
You do not have the required permissions to view the files attached to this post.
Last edited by JeremyaFr on Thu May 29, 2014 1:05 pm, edited 1 time in total.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Wed May 28, 2014 2:34 pm

I understand, the one i was looking at was total number of vertices based on all tris.

Can you explain what's meant by face group?

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed May 28, 2014 2:51 pm

A face is a triangle or a quad.
Faces that share a same texture are grouped in a face group.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed May 28, 2014 3:23 pm

Gank wrote:i saw you tested 50 meshes of 3200 tri's, each or in total?, and how many vertices?
Each mesh had 3200 triangles and 6400 vertices (1683 different vertices).
The model looks good in-game.
But when it is hit, the game crashes.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Wed May 28, 2014 4:10 pm

any idea on what the limit is on faces in a group before corruption? with larger textures that might be a problem

if i remember correctly when theres a hit on something theres a lighting effect and a decal applied to the mesh? if theres no lighting problems before the hit the decal could be causing the problem? maybe edit/remove it? sorry if i'm wrong on this, cant play the game no with no joystick

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed May 28, 2014 4:24 pm

No need to worry about the limits in face groups.
If there is too many faces, triangles, vertices, or edges (I don't really know) in a face group, it can be automatically split into several face groups.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Thu May 29, 2014 2:28 am

ok, thats good to know

so the limits 512 per mesh, max 50 meshes. Hopefully you'll find a way around these in the future?

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Sat May 31, 2014 7:20 am

Question about your new oting tool, using OPTech as reference

All faces imported in OPTech have 4 vertex.
Importing a quad and tri faces dxf model into OPTech, there is a process we have to follow to create a good Tri faces opt model:
- We complete the texturing work and control it with the Error Check (no errors)
- Even though the model appears to be Tri faces we clicked on QuadtoTri and checked for errors again. You should now see a list of the errors like this

* MESH 3, LOD 1, Face 2 normal does not correspond to orientation of face.
* MESH 3, LOD 1, Face 4 normal does not correspond to orientation of face.
* MESH 3, LOD 1, Face 6 normal does not correspond to orientation of face.
* ...

That is because, all faces imported in OPTech have 4 vertex. Tri faces have 4 vertex, 2 with the same coordinates. The QuadtoTri function creates 2 faces from what appears as Tri face. The first is a good Tri vertex, the second is abnormal. The list of the Error Check function shows the abnormale faces. This faces have to be delated manually. That's a very boring work!

Does your opting tool have the same problem? If yes, you should add a simple function to delate these abnormal faces :D

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jun 01, 2014 12:28 am

For now, XwaOptEditor can't import dxf files (this feature will be added). It can only import obj files.

Here is how an obj is imported:

Let v be a vertex index.
Let vt be a texture coordinates index.
Let vn be a vertex normal index.

A face vertex can be v, v/vt, v//vn, or v/vt/vn
A face can be defined with 3 or 4 triplets (a triangle or a quadrangle).

Each face refers to vertices (also tex coords and normals) using 4 integer indices (a, b, c, d).
If d is negative, then the face is a triangle, otherwise it is a quadrangle.

The face normal is calculed from the 3 first vertices.
When the vn are missing, they are set to the face normal.
When the vt are missing, (0,0), (1,0), (1,1) (0,1) are assigned.

For materials (textures), the following statements can be used: Kd, d, map_Kd, map_d.
Kd to define a diffuse color.
d to define a dissolve factor (transparency).
map_Kd to define a color map.
map_d to define an alpha map.

When map_Kd is missing, Kd is used. If both map_Kd and Kd are missing, White is set.
If map_d is missing, d is used. If both map_d and d are missing, the material is opaque.

____________________________________________________________________________________________________

Here is a preview of what I am working on regarding texturing:
AwingTex.JPG
The vertices are represented with red disks on the texture. The edges are drawn with black lines. When one moves a vertex, the uv coords of the vertex are updated. By moving vertices, one have complete control of how a texture is mapped on a face.
You do not have the required permissions to view the files attached to this post.

Gank
XWAU Member
Posts: 577
Joined: Sun Mar 31, 2002 11:01 pm
Contact:

Post by Gank » Sun Jun 01, 2014 6:02 am

Thanks Jeremy, thats helpful, can you explain a bit as well about how the obj needs to be exported with regards to opt meshes when you have some time, as i'm having mixed results there.

Iirc Rhino 2, which was the tool of choice for modelling around here 10 years ago, doesnt have native obj export so a third tool would be needed, and the ones I've tried have some very different settings, so as much clarity on it as poss would be helpful

Post Reply