Anyone else still need a SUR generator?
-
But as missiles don’t cause a crash…
-
Looks like it’s hardpoints causing the problems (at least in Quarks’ mod). I’ve attached a new plugin to see if your log matches mine. It only logs what should be causing the crash, but since I didn’t determine why, potential causes are logged, too. Here’s what a crash should look like:
12:37:16.937: idx = -3, end = 0x33E6B5C object 1 = 2001 equipment\models\weapons\li_heavy_ion_blaster.cmp object 2 = 0067 CRC 1 = 0x12688F2D CRC 2 = 0x00000000 12:37:16.937: idx = -2, end = 0x33E6B5C object 1 = crash! object 2 = 0067 CRC 1 = 0x12688F2D CRC 2 = 0x00000000 ```Idx is the collision item (relative to end). The idx before the crash should be one less than the crash, with end being the same for both (turns out the object occurs twice; sometimes it is destroyed in the first, which causes the crash in the second). 2001 is the type for CEquipmentObj (0067 is CBeam); this is all you'll see, since it's all that's logged. I wasn't able to determine the hardpoint name, but the next best thing is the archetype it uses. Shooting the weapons off a player ship doesn't crash, so I guess it's just an NPC thing. How to solve it is still unknown. All I can think to try is adding the hardpoints to the sur, but I don't know if you can do that. I'll have to get moving on the exporter…
-
Anyone tried 2 remove the weapon’s SUR?
-
Adoxa - Thanks, I’ll try it out asap.
F!R - well that would defeat the objective, which in my opinion is to create surs as close to vanilla surs as possible, not remove existing functionality. For me it’s a double-challenge, to emulate the originals and that they should also work flawlessly over a long test period.
I did make a sur for the no_gunship_turret.cmp (because LS’s Error Checker called it out) and that caused constant, immediate crashes when ships using it were in combat in the system. It could be that my sur was bad, of course, but I’ve not investigated that, I just removed the sur.
-
An update from my part: I have finished the geometry conversion and tree generation. The generated meshes seem to work most of the time (over 1000 groups, one works with over 3000), but in some cases if you fly long enough the collision does not work correctly anymore until you leave the root bounds. I think for the start this is not a problem, maybe there is still an error in the tree generation (I was not able to duplicate the sorting yet, it is more a similar one). If anyone is interested I can convert a mesh for testing. Everything will be attached to root. I can append a hpid section for hpmount if wished.
-
No there are no limitation other than you should not use a too high polygon count. On some models FL just froze when I used too much (although this could be related to errors in the file generation process). I will run a polygon reducer anyway if I see there are too much of them, so just give me a mesh that works in FL.
Every group will be automatically separated from convex and not convex geometry and all not connected convex geometry will also be separated in new groups.
I would say it’s easiest for me if you give me the .cmp file, then I can test myself more easily and see whether there might be still errors. If the .mat is not too big you can include it aswell.
The best would be that I can post it here in the forum together with the generated .sur so that more people can check for errors.
If everything works I can start including more features, like multipart meshes (hi Skotty :P) etc. Maybe I release a public version for further testing before that, we will see.
-
Well that’s ok. Construct the geometry and save it as .obj. I can convert it and send it to you if you want to test it alone (it’s better than no one testing :D). Mind that everything will be attached to root for now.
-
Skotty was kind enough to help me testing for bugs and I was able to find and solve a few. Collision really looks promising now. I have attached the generated .sur for the DevilRay ship which caused problems for some. It is not multipart! Geometry is converted 1:1, I only used a poly reducer on it. See it as a stress test, ideally you would use the convex hulls for the single parts but that’s the next step…
-
I’m all for a new way of getting surs to work. As we already have Lancers sur utility, i’ve found with regular use that for me at least it works as i want it to with certain types of models.
With the ELITE ship pack i’ve just done (still waiting for approval btw), it was great due to the shapes of the ships involved and produced some really form fitting surs.
On more odd shaped modles like the Starlancer ships, it’s a different story, specially on the larger ones. This ship is called a Mammoth freighter and looks like this with LS’s sur builder on a single group model
Works but it’s ugly. Yes, i know i should break it up but with over a 100 models to do sur files for, i’m looking for an easier solution than carving all the models up and in some cases, by the time i’ve done that it will be the year 3278.
Now using the same ship and the sur exporter 1.1, i’ve got this,
Exactly what i’m looking for although i could lose the shield bubble as i don’t really want that, but the rest of the sur is as it should be.
One small problem, it doesn’t bloody work, which is a shame as this would be an ideal solution. Now i hate surs with a passion, don’t understand them at all and never will, but i’d like to know why the sur exporter version is faulty. Looks fine, i can generate surs for all the models that look like that, form fitting and so on, but all are faulty. Has someone not looked at maybe fixing this exporter?
If not then maybe they should. If this new idea i see being discussed works, then i’m all for it, anything to achieve a working version of the sur above would be nice
-
When Bejaymac was active he found that some surs crashed because they had “internal spikes” and concavities. Surs can be imported into MilkShape with the plugin.
Since we have no way to edit sur files graphically, it is not possible to modify the .sur itself.
So he had to remove and remake bits of his models until the exporter generated truly convex sur parts in the entire sur.
If you use the Convex Tool on the model parts first, this problem should not happen.
As I have found, my surs (generated manually, with Sur Splicer, with Sur Builder, with sur exporter v1.1) all work for many minutes, leading most modellers to think they are completely good.
But all cause crashes eventually, it seems it is due to weapon hit calculations or on destroying a sur part on hits, but it is not constant, many NPC ships with the same sur can be destroyed until one fails. I haven’t had time to isolate which weapons cause the crashes most reliably.
This is supported by Bejaymac’s statements that there MUST be both collision and hit detection sur parts in the sur, and also weapon surs in the sur for it to work correctly. Look at a plain FL ship sur and you will see there are duplicate components in it for the wings, weapons, and also wing+weapon surs. These are the Type 5 sur parts.
My background is in finding intermittent problems on mainframe computers, so I am used to setting up and aggravating environments to bring out these intermittent faults as often as possible so they can be traced.
So I have also used only spheres to cover a model, and also only boxes - all fail eventually. Only original ship surs are completely sound, I have proven this by running test games overnight using only vanilla surs. When NPCs are equipped with custom surs then they fail eventually, some have taken over 30 minutes in my test environment. Solars on the other hand do not seem to have the same problem, as I am using a huge battleship with a manually-spliced sur on it as a base station during my testing. The base ship continually destroys hostile NPCs equipped with the test ships and surs.
Sur Exporter v1.1 can also generate weapon (HpWeapon and HpTurret and HpTorpedo) surs automatically, but does not make the additional hit detection boxes that are in the original surs.
But we (I) don’t know how to create them correctly. I can make the shapes correctly and place them at the origin, but the naming defeats me.
Adoxa and others say it is an offset. So how do we calculate it and put it in?
-
Great explanation ST, just wish i knew what you said and i mean that in the nicest possible way.
This subject just eludes me for whatever reason, Why i like LS’s utility which is great up to a point. When it comes to more complicated models like the one i posted above, the sur exporter should work but it doesn’t. I mean a sur generated at the push of a button as is already the case with the exporter is without doubt the way to go. Not only that the exporter recognises holes, like docking bays and so on.
We just need a working version of ANY sur creating utility that does similar to what we’re all after, a working SUR file, and i don’t just mean a working shrinkwrap utility
-
i believe, Schmackbolzen is bringing us just what we are crying for - a tool that converts a geometry we do ourselves to a sur file. that would mean no more problems with concavity or hit or collision detection or anything else but just a surface mesh we did saved in the freelancer sur format. guess all our problems so far are that we in fact did just not yet understand the sur file format entirely. once this happens there will instantly be a converter - a translation program.
-
It would be very helpful if one of you could test whether the generated DevilRay.sur I attached still crashes the server. The same will have to be done with convex geometry and later with multipart meshes. So far the .sur format I write seems to be correct.
@Gisteron: Exactly. The .sur will be what your geometry is, with some additional checks to make sure the format will not be wrong. I.e. Geometry will be changed if it is not convex. If everything goes well you can test the converter yourself this week (no multipart and everything attached to root).
-
That’s a restriction of the physics engine. The geometry you input will be converted accordingly with some options, you will see. The best .sur files you probably will get if you reconstruct the original geometry with convex groups. Skotty and I tested this and we were able to get .sur files like in vanilla and they work perfectly till now (even one with over 2000 polygons and over 100 convex parts). If you don’t the geometry will be processed so that it still works, but it wont be as optimal.