[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

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

Post by JeremyaFr » Sun Jun 01, 2014 3:11 pm

In an obj file, meshes are defined using the o or the g statement. The importing code does not make any difference between them. The exporting code write an o statement for each mesh.

For those who use Rhino for modeling, it will not be needed to convert the 3dm file to obj. I will use the Rhino3dmIO Toolkit (which uses the openNURBS Toolkit) to write an importer.
It would be great if I could have some basic 3dm models to test the import process.

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

Post by JeremyaFr » Sun Jun 01, 2014 7:29 pm

An update:
partially added:
  • importing 3dm files

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

Post by Gank » Mon Jun 02, 2014 12:06 am

untextured 3dm files ok? can send in rhino 2-5 formats, can also send opts converted with opt23ds and saved as 3dm to test uv mapped models

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

Post by JeremyaFr » Mon Jun 02, 2014 12:36 pm

yes

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

Post by JeremyaFr » Tue Jun 03, 2014 7:21 pm

An update:
added:
  • import / export 3dm files

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

Post by JeremyaFr » Wed Jun 11, 2014 6:47 pm

An update:
added:
  • scale opt
ScaleFactor.PNG
You can scale an opt by setting a different scale factor for axis X, Y, Z, or the same scale factor for the 3 axis. A scale factor is an interger or a float value.
An opt can be scale by a multiplier, a diviser, or by enterring a meter size.
You can also invert an axis by enterring a negative value.
You do not have the required permissions to view the files attached to this post.

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

Post by JeremyaFr » Fri Jun 13, 2014 7:56 pm

An update:
added:
  • check opt playability
  • split / merge lods
removed:
  • bpp warning message box if all textures have not the same bpp (replaced with playability check)

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

Post by Gank » Sat Jun 14, 2014 9:17 am

50 meshs is the limit not 200 :kopfwand:

I got a model in game with 160 meshes, displays fine but lasers go through it, is this because of the mesh count?

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

Post by Gank » Sat Jun 14, 2014 7:26 pm

I redid the model and the lasers arent passing through it anymore, it now has 133 meshes, shoots stuff, gets shot, flys around and doesnt crash, I've had 6 of them and a couple dozen fighters shooting it out and there doesnt seem to mbe any problems

the joystick emulator i'm using doesnt give me any controls, but i've recorded a few missions and ran them through in the film room and everything appears to be working. How exactly did you get to the 50 mesh limit, what happens when you pass it?

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

Post by Gank » Sun Jun 15, 2014 1:31 pm

Well after a few hours of squinting at the screen and moving meshes around something s definitely up with meshes over 50. All are displayed correctly in the ship viewer, but in flight there appears to be some random wierdness going on, sometimes meshes are moved, despite being ok in the viewer, sometimes they dont appear at all, but its not consistent, delete the meshes, import some others, than import the same ones and they display correctly, despite there being more meshes and they're higher on the list.

I dont know if theres any other problems with them, but again i've run extensive tests via the simulator and film room and they look playable.

Heres the mesh if anyone wants to shoot the sht out of it and see what happens, currently only 67 meshes in the opt, the other half are all small details and its near impossible to see if they're displayed correctly without flying into the ship. I cant get a joystick unless i order online and shipping to Cambodias expensive, so if anyone knows any working joysick emulators would be of a great help.

http://nagnatadesign.com/CORVETTE2.opt

Its the star wars galaxies model not my own work

Also jeremy a feature request, some visual aids for rotation, the pivot point can be calculated from the hitbox dimensions but not terribly accurately, and the rotations a bit confusing


edit, heres the full version with 140 meshes: it appears to be working but all the extra meshes are detail and are hard to see unless you're flying right up close, can definitely some of them being displayed there though
http://nagnatadesign.com/CORVETTE2-fulldetail.opt

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

Post by JeremyaFr » Sun Jun 15, 2014 3:02 pm

The meshes count limit is 50.
When the game engine loads opt models, it stores the informations related to the meshes into global arrays. The length of an array for an opt is 50 per info. So when the game loads an opt that contains more than 50 meshes, the meshes infos situated after are overwritten.
In most cases, it does not make the game crash. But depending on which values are overwritten and which ones are written, the effects are dissappeared meshes, not hittable objects, triangles drawing at wrong place, rotating meshes not working, etc...
So it is safe to have less or equal to 50 meshes. The effects of having more than 50 meshes are not fully predictable. At first, the model can look ok, but with further inspection, something could be wrong.

Feature request:
  • visual aid for rotation (Pivot, Look, Up, Right)
It will be added.

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

Post by Gank » Sun Jun 15, 2014 4:01 pm

Thank you for th detailed expanation, like i said in the pm, i just got sent a joystick emulator and those are pretty much exactly what i found on closer inspection. It does seem to be consistent across missions though. Lasers going through stuff i could live with, 50 meshes is enough for main body and any functioning parts, detail doesnt need to be shootable. The unpredictabilitys more of a problem, like i said in pm the vanishing is more frequent the higher the mesh number.

The corvette can be worked down to 50 meshes i think, theres a few wasteful ones due to rhino only allowing one texture per object, and some of them are well below limits. Even without the detailing its still a pretty good model. Theres some issues though, theres some vertices that wont weld, and the lightings messy, it has been converted 3 times from its original though.

So the big question is can the size of that array be increased?

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

Post by JeremyaFr » Sun Jun 15, 2014 6:01 pm

Gank wrote:So the big question is can the size of that array be increased?
No.
Gank wrote:The corvette can be worked down to 50 meshes i think, theres a few wasteful ones due to rhino only allowing one texture per object, and some of them are well below limits.
When importing a Rhino file, each rhino mesh become an opt face group. The rhino meshes that belongs to the the same layer are grouped in a single opt mesh.

arka
Recruit
Posts: 7
Joined: Mon Jun 02, 2014 10:18 pm

Post by arka » Mon Jun 16, 2014 4:49 pm

Are there any plans to add the lightning transparency effects to the textures in opt editor?

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

Post by JeremyaFr » Mon Jun 16, 2014 4:59 pm

arka wrote:Are there any plans to add the lightning transparency effects to the textures in opt editor?
What do you mean by "lightning transparency effects"?

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

Post by Gank » Mon Jun 16, 2014 5:16 pm

think he means emission and transparency maps?

same about the limit, could live with over meshes being unhittable, but the unpredictabilitys a problem.

I havent tried the 3dm exporter yet, the obj is quicker to use and at this point i'm more interested in hitting limits than getting i looking perfect

Triangulation is a bit vexing as well, definitely a high face count causes it but i've also got it with smaller meshs, tend to happen more with smaller more complex meshes that intersect with other meshes. The grevious opt suggests vertices play some part as well they were identical in face count but nt in vertices and one triangulated while the other didnt.

Thqanks for taking note of the feature requests, i have another small one, the ability to rotate the entire model, the obj format flips z and y axis' and some exporters compensate for it, some dont. Obj would probably be preferred format as Rhinos uv mapping capabilities are limited and confusing, and non existant in earlier versions i think.

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

Post by Atx » Tue Jun 17, 2014 6:00 pm

This reminds me of this old thread.
viewtopic.php?f=9&t=5217

I remember having models rejected in the Opt editor and switching them from Tris to Quads got it go through. I understand that a quad is 2 Tris but I believe instead of 2 faces - with a quad you now have just one face and also a single vector for shading as well. Now, I wasn't sure if the quad saved on 4 verticies as opposed to 2 tris doing 6...you touched on the Gank. (thanks)

The face/vertex limit has always stymied me.

I want to take a closer look at the rotation code (especially thankful for JeremyFr's insights) but I'm currently working on something else and don't really have the time right now. :(

Still curious to see some new and improved models coming out - all the best on your Opts Gank :)
The Navbuoy is closed...long live the XWAU!!!

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

Post by JeremyaFr » Tue Jun 17, 2014 11:42 pm

An update:
added:
  • cut/copy/paste hardpoint between meshes
  • cut/copy/paste engine glow between meshes
  • change axes

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

Post by JeremyaFr » Tue Jun 17, 2014 11:47 pm

arka wrote:Are there any plans to add the lightning transparency effects to the textures in opt editor?
Transparency is handled using the alpha channel of the textures.

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

Post by Gank » Wed Jun 18, 2014 3:43 am

Thanks for the updates jeremy, the copy/paste are useful if we're upgrading an original opt, or drop one in the wrong place by mistake. Another request as well, not major but when we export an obj its all a single mesh, would be nice to have it grouped into meshes. Opt23ds used to export face groups rather than meshes, but it doesnt work with 32bit textures, just exports them as completely black textures. Also the specular color on materials would be better set to rgb 0,0,0 as it matches closer what we see in game

Btw, i deleted all the meshes over 50 that we'rent appearing ingame, left me with 102 meshes, and when i exported the obj it had almost 25,000 vertices. Might be coincidence, but thats pretty close to the number of vertices per obj you posted earlier

ATX, if you think about it logically, the triangulation problem is with vertices not face, one vertex is getting misplaced off into god know where and the triangulation is the game trying to display the face in relation to the other 2 vertices. And the way it only happens when you look directly at a model suggests to me its something to do with vertex normals, though jeremy knows far more than this about me, maybe hes a better idea.

A quad is just 2 tris with their vertices and mesh edges welded together, so it will decrease the vertices count. If you look at a primitive cylinder created in rhino its the same, the vertices are welded and mesh edges are welded together and you have a much lower vertex count. Practically every mesh in the first corvette i posted has over 200 faces, only 8 have less and i've since combined 4 of those with no triangulation. I'll post the grevious fighter later on so you can have a look at it ingame, it has 2 identical meshes, i welded the vertices on one but forgot the other and the unwelded one triangulates but the other does not.

The problem before was people were using export settings for dxf which removed all vertex welding, except for quads, so they had much higher vertices counts. Optech did some welding and smoothing, mostly based on UV mapping i think, which is why people were able to get higher face counts sometimes. General Trageton and Master Qui Gon hit the nail on the head in the post you linked to, you're far better off doing UV mapping and applying welding and smoothing in a program where you have better control over it, than optech where you had very little. Unfortunately even Rhino 5 has problems in this area, and while it does have uv mapping abilities, they're limited and confusing.

So yeah basically triangulations because of vertices not faces, and i think its a bit more complicated than having a simple limit. Definitely i've had it on meshes with a relatively small amount of vertices, while others with twice as many display properly. I think its related to the complexity of the mesh, and also the welding.

I'll keep with the corvette, I can definitely get it ingame and fully functional below the 50 mesh limit. However there's issues with the model, some mesh edges wont weld and rhino tends to mess up uv mapping when you weld objects that are already textured. The lighting on its messy though thats just from me being lazy and welding whole objects instead of applying proper shading groups. Its a nice model though, the details are included on the texture so theres no problems leaving them off, and def an improvement over even the xwau one.

The model i have is from a backup dvd over 4 years old, was converted from msh via Tre exporer and 3D object converter, plenty or room for something to get messed up there. certainly the cockpit meshes converted at the same time are completely screwed up. So i'm going to get a gcopy of galaxies and 3dsmax before i do any more work getting it ingame, now that i know it can be done. Sadly the ISD from galaxies is 150k polygons, so zero chance of putting that in.

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

Post by Atx » Wed Jun 18, 2014 1:26 pm

ATX, if you think about it logically, the triangulation problem is with vertices not face, one vertex is getting misplaced off into god know where
I totally agree.
So yeah basically triangulations because of vertices not faces, and i think its a bit more complicated than having a simple limit.
With that point - not so much. Since Jeremy sort of answered it earlier.
When the game engine loads opt models, it stores the informations related to the meshes into global arrays. So when the game loads an opt that contains more... the meshes infos situated after are overwritten.
In most cases, it does not make the game crash. But depending on which values are overwritten....the effects are... triangles drawing at wrong place..., etc...
So, suffering overwrites can force the vertex off into no man's land.
Definitely i've had it on meshes with a relatively small amount of vertices, while others with twice as many display properly. I think its related to the complexity of the mesh, and also the welding.
Ahhh, now that's a great point!
To me I starting to think this issue might have more than just one single cause (overwritten info being one of them in some cases).

So why is the vertex information for certain models getting corrupted ingame?

I swear to god I read about this somewhere (on the net or in a book) and I think it had to do with models with interior (concave) angles...I'm getting old and senile. It's been so long - to be honest I'm not too sure. I do know that certain forms can give a basic 3D engine hell trying to render (shade, hidden face removal and cull, etc..)

Still, I'm confident you guys will zero in on it...I'm eager to see you model its been awhile but I always loved your transport - it had a nice style to it - nice n' crisp! :)
The Navbuoy is closed...long live the XWAU!!!

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

Post by Gank » Wed Jun 18, 2014 3:46 pm

concave angles will cause problems in a quad, but really they're kind of essential to modelling so they wont cause problems. The problem there is smoothing, if you have a bunch of faces which are supposed to be a single flat plane, but the vertexes get shifted around, you'll get some horrible shading. this happened to me with most of the models i did before, as rhino had a problem with shifting vertexes when you saved as 3dm. It was so bad Darksaber had to completely remake the trn and afrig models to get them ingame iirc. Rhino 5's a bit better, but some operations like mesh boolean or trim will still shift points off planar, and its a major headache to fix if you dont notice it.

So while its a problem, i doubt very much it causes triangulation. I honestly dont think theres going to be a solution for that, its pretty hard to tell what vertex is causing the problem. I do think if people moved away from Rhino, which isnt a mesh editing program, and optech, it would happen a lot less. JM used 3dsmax, and you can see in the post you linked too he was getting much higher facecounts before triangulation.

Thanks for the thumbs up on the transport, they were actually easy enough to do, the trick is to use photographs of metal as your base, makes it far more realistic than anything you can do from scratch. I did the same with the assault frigate but the size of the model makes it much more blurry and less defined. the freespace version had much higher texture maps and looked a lot better but sadly i dont have it anymore. that said i'm pretty useless at detail and find it easier to make a high poly model, render it and use it as a texture

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

Post by Gank » Wed Jun 18, 2014 4:22 pm

just as teaser, heres one of my old ships i started to update, got a bit of fixing up to do and a lot of work yet but the face and vertices count aretnt too bad. Going to be a bitch to map though so expect to see something smaller first. The trn is on the cards as well, been looking at the at at and other works and a concepts starting to form, the assault frigate is a bit daunting though.

ActionVIalt (View in 3D)
https://p3d.in/qKPeP

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

Post by Atx » Wed Jun 18, 2014 10:08 pm

Sweet! :)
The Navbuoy is closed...long live the XWAU!!!

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

Post by Gank » Thu Jun 19, 2014 3:14 am

just dont expect it anytime soon, got to see what can be done with the limits first, then practice my uv mapping and texturing first. If you look though you can see some of the shading errors I was talking about, on the front hull mesh as well as a few other places. Lots of stuff needs fixing with it actually.
Capture.JPG
not really visible there but if you look in the viewer they're more noticable, would be more so ingame
You do not have the required permissions to view the files attached to this post.

Post Reply