Anyone else still need a SUR generator?
-
Schmackbolzen:
I tested your sur, it is as good as mine, runs fine initially but fails after up to 5-12 minutes of continuous destruction of NPCs using it. I tested it 3 times.The symptoms are the same as my surs, so don’t worry, it is as good as we can get with any of our current sur generation tools and methods, so it’s looking very good already.
As you create your sur exporter/generator please remember that the vanilla surs have hardpoint sur parts, and the exporter v1.1 can also generate at least some of them (HpWeapon, HpTurret and HpTorpedo), I’ve not tested to see if it generates a sur part for every hardpoint type that has a sur part in the vanilla surs.
adoxa:
I uploaded my test results here:- http://downloads.rrjds.com/STLatestCrashes.zipThe first 3 crash logs are with Schmackbolzen’s sur for the DevilRay and the last 3 are with my own last sur.
The symptoms are that the last weapon hit just before the crash is sometimes to the NPC’s thruster (ku_thruster.3db) and the other times to the NPC’s CM dropper (li_cm_dropper01.cmp).
These have their own surs but do not have one for their hardpoint in either of these ship sur files, whereas the vanilla surs do, and those do not fail in my test environment.
Almost all other hits before the crash (with a couple of exceptions, see the GetCollisions files carefully) are to the shield specified in shield_link in the shiparch.ini file (li_elite_shield.3db), as I had expected.
But there are no hull hits mentioned in GetCollisions at all once the shield is down, which I expected to see. Anyway I’m not qualified to determine if this is correct or not! lol
Hopefully now we will learn why the crashes are happening.
Many thanks guys.
-
That crash report confirms my results, so it does look like it’s the hardpoints. The packet log shows a particular type of damage object at the same time (both u_dword and u_byte are 2; normally if u_byte is 2, u_dword is 5; if u_dword is 2, u_byte is 0). I’ve attached the Builder sur, updated to include the proper hpid sections (untested, other than running through SurDump). If that still doesn’t work, adding in the hardpoint surfaces themselves will have to wait till one of us writes the code (unless you’re able to splice them in?).
-
Startrader: Thanks for testing! I concurr with adoxa that it’s most probably the hardpoints.
@adoxa: I could just set them in the middle for the start (would be just a box), wouldn’t be a trouble. You would have to enter the names manually, though…
Btw. I have finished implementing the convex hull algorithm, so I think I can indeed release a first beta version this week.
-
That’s great, and explains why it takes so long to fail, it’s just whenever there is a hit on those hardpoints. And since they are behind they are protected by the hull.
It’s funny that NPC weapon hardpoint hits aren’t causing any crashes though, the NPC weapons must be getting hit much more often than the CM dropper and thruster I would think. Any idea why hits on these may not be causing crashes?
For generating Hp surs - it’s very easy for the modeller to put in the hardpoints in MilkShape before exporting, in fact they are already in the model usually and the modeller just needs to leave them in before exporting, whereas “normally” we would take them out. They are just triangles centred on the hardpoint connection point (HpConnect).
Why would we have to enter the names manually? The vanilla surs have their hashcodes.
And for the exporter / sur builder, just detecting the hardpoint name, as the sur hardpoint shapes are only 2 standard shapes I think, so just selecting one of two fixed-size shapes depending on the hardpoint name and placing them on the hardpoint face centre and orienting them to its plane should do? I don’t know the coding problems of course.
I will check and get back to you with the precise shapes, but if I remember correctly the HpWeaponxx and HpTurretxx and HpTorpedoxx are all the same stretched 8-vertex tapered rectanguloid, the HpEnginexx and HpCMxx and HpMinexx are a 10-vertex tapered pentagonal shape.
I’ll confirm that asap.
Thanks chaps.
-
adoxa, Schmackbolzen:
Here attached is a .zip with all of the Hardpoint sur shapes that I could find in vanilla Freelancer, in .ms3d (Milkshape) format.There are quite a few. Some are the same shape as others, but I took them all so that you can decide the “what” & “how”.
I have included the Hp triangle with each of them so that you can see where the sur sits in relation to its Hardpoint. Some of them have their bottoms on the same plane as the hardpoint, others are above, e.g. HpTurret.
I have separated them into individual files and also one file with all of them in for comparison.
Many thanks for taking the time.
-
I have some very interesting news, thanks to my dogmatic approach to troubleshooting…
First the bad news:
Guys: All the custom SUR files you made are bad, you just haven’t triggered what will cause them to crash yet.
And if you are getting rare crashes in your mod that you can’t find, this may well be the same cause.
Now the good news:
From my crashes we found that the countermeasure dropper or thruster were always the last objects hit at the time of the crashes.I added the Hp’s and exported the sur with sur parts for HpCM01, HpThruster01 and HpThruster02. These are already built into SUR Exporter v1.1 and there are others too, I haven’t checked to see if it knows about all the hardpoints in the zip file I made in my previous post.
Guess what?
Both surs made with SUR Exporter v1.1 worked right away.
And… No more crashes, my test environment ran overnight for 6+ hours!
Yay! Progress at last.
adoxa - I looked in the GetCollisions.txt file and found there are now no entries at all for the shield_link (I exported with a shield bubble):
23:53:35.351: idx = -5, end = 0xA31638
object 1 = 2001 SHIPS\liberty\li_elite\li_elite_shield.3db
object 2 = 0067
CRC 1 = 0x00000000
CRC 2 = 0x00000000And now, the only entries in GetCollisions.txt are the still-unprotected items in my model and loadout:
1. The gun hardpoints (HpTurretxx) on my battleship base which have no sur parts:
12:51:41.665: idx = -3, end = 0x2E8D29C
object 1 = 2001 equipment\models\turret\li_turret04b.cmp
object 2 = 0067
CRC 1 = 0x12688F2D
CRC 2 = 0x000000002. The 2 types of special equipment that I have in my mod, mounted on new nonstandard-named hardpoints and these have no sur parts:
12:48:03.562: idx = -2, end = 0x2E8D268
object 1 = 2001 equipment\models\st\br_conversion_shield.3db
object 2 = 0067
CRC 1 = 0x00000000
CRC 2 = 0x00000000and
14:15:18.068: idx = -2, end = 0x2E8D268
object 1 = 2001 equipment\models\st\rh_radiation_shield.3db
object 2 = 0067
CRC 1 = 0x00000000
CRC 2 = 0x00000000These are not causing crashes, but the fact that they are unprotected and are listed in GetCollisions tells me they should not be (unprotected and listed).
So I think we now have confirmation that these missing sur parts are the cause of the crashes.
I will check (sometime) which ones of all the standard weapon and equipment hardpoints the SUR Exporter v1.1 can insert into a sur file.
These will need to be inserted properly by any sur generator / sur builder / sur exporter plugin, otherwise we will still be generating bad surs.
adoxa - What is GetCollisions listing exactly, I thought it was all collisions, good and bad, but evidently it is not listing good ones?
Is anyone progressing a new exporter/generator/builder?
-
It lists all 2001 collisions that occur twice in succession. I thought they were all good, but I guess it makes sense that they’re actually bad.
Since you added the actual surfaces, does that mean the simple hpid version I made didn’t work?
I’m working on FLMM v2, then I will do the exporter.
-
I hadn’t tested it, I forgot all about it - sorry, good you reminded me.
I’m testing it at the moment and will let you know, it’s looking positive, over an hour already.
You said: “I’ve attached the Builder sur, updated to include the proper hpid sections”.
What do you mean exactly, this is not clear? Does hpid mean Hardpoint, as in Hpxxx? And do you mean you put in only the hardpoint names? With no meshes how will FL detect a hit?
If this works, how can we put in the hardpoint names into a sur made with Sur Builder? (I’m reluctant to use this method because it’s another get-round).
-
adoxa: It ran clean overnight, so it works.
GetCollisions.txt now contains only the turret entries (turrets are used on the base ship). There are no entries for my special hardpoints, and this is unexpected.
This poses more questions:
What did you add to the sur exactly?
And how?
-
He just added them to the HpID list at the end of every sur file. Simple but effective solution. There is no actual geometry involved for them but FL can find the hardpoint in the collision data and use it (even though it will never collide). I guess its because they never anticipated that there wouldn’t be any hardpoint data it the .sur files.
Btw.: I have encountered a stupid showstopper bug in the convex hull algorithms (I actually am porting the 3. variant right now, since every solution I found on the net has some flaw in special cases). The rest is working perfectly. As soon as I was able to implement a perfectly working one I think I can release my generator.
-
Can someone spell this out in plain english please for those of us that only understand that we push a button and the generator creates an sur.
Is the conclusion that the sur generator is flawed because it doesn’t create a list of hardpoints and will therefore cause a crash whether we’ve yet to experience one or not?
-
Yes Timmy.
That is to say Sur Builder and the manual SurSplicer way, which don’t put in any hardpoint surs.
The two missing hardpoint surs that caused the crashes that I experienced are the countermeasure dropper HpCMxx and thruster HpThrusterxx - neither one has a sur part in the sur file.
They take some time to fail, because of the rarety of a hit on those hardpoints.
More info:
Using adoxa’s GetCollisions dll, when the ship sur has no shield bubble, it is logging lots of hits on the shield specified in shield_link (e.g. shield_link = l_elite_shield01, HpMount, HpShield01), and on the turrets I use on my battleship base station (HpTurretxx) as well as the HpCMxx and HpThrusterxx and my special hardpoints.When there is a shield bubble, there are no hits logged for the shield_link shield sur, so the log is much smaller.
So it looks like we need to provide sur parts for any components logged by GetCollisions - that’s not so hard except for my special-name hardpoints.
That leads me to a side-issue: I used HpTurretxx for my large ships, and the sur parts for that are small because it is the standard turret used on fighters etc, whereas battleship weapons are much larger and use larger surs, for example HpTurret_L1_xx, HpTurret_L2_xx, HpTurret_L3_xx, and HpTurret_L4_xx for Liberty ships - these are large weapon surs.
The good news is that SUR Exporter v1.1 can put these weapon surs in and can usually make good surs - see my next post.
-
These are the hardpoint surs that SUR Exporter v1.1 can insert:
Hardpoint Surs:
HpMount
HpCMxx
HpMinexx
HpShieldxx
HpThrusterxx
HpTorpedoxx
HpWeaponxx
HpTurretxxwhere xx = 01 to 99, or 01 to 09 and 010 to 999 (I haven’t tried 001 to 999)
Remember the max number of weapons firing simultaneously is 32 in standard FL, or it will crash.HpTurret Surs:
HpTurret_n1_xx = 17.76m dia x 8.88m high
HpTurret_n2_xx = 15.86m dia x 7.93m high
HpTurret_n3_xx = 8.13m dia x 4.06m high
HpTurret_n4_xx = 7.49m dia x 3.75m high
HpTurret_n5_xx = 0.64w x 0.64h x 1.60len
HpTurret_Prison = HpTurret_Liner = HpTurret = 0.64w x 0.64h x 1.60lenWhere n = B, D, K, L, O, R, S, U
B = Bretonia
D = Dyson
K = Kusari
L = Liberty
O = Order
R = Rheinland
S = Station
U = Utilitye.g. HpTurret_L1_01, HpTurret_B2_01, HpTurret_K3_01, HpTurret_R4_01, HpTurret_O1_010, HpTurret_U3_011, HpTurret_S1_012, HpTurret_D1_013
HpTurret_U2 and HpTurret_U4 are generated but are not used in FL.
Unrecognised HpTurret_n5+ numbers are made as HpTurret (0.64w x 0.64h x 1.60len).
All other Hps are ignored.
HpTurret_O2_01 is not recognised by adoxa’s SUR Importer (CRC = 0x10183a47) so HpTurret_O2_xx will not be recognised either.
-
Sur files consist of a number of objects (matching the Object Name in the Cmpnd) with each object containing a number of sections. One of those sections is called hpid (presumably hardpoint identifiers). The Builder creates the section, but leaves it empty. I used SurDump to find the offset of each object, UTF Editor to view the hardpoints, CRCTool to calculate the CRC and a hex editor to add it all in; then SurDump again to verify it. Now it’s known that’s the problem, Lancer should add it to the Builder, although I guess a stand-alone program (or an update to FLMT) might be needed anyway, for existing surs.
-
Right, half understand what you guys are on about now. To this end i’ve created my first multipart model. Comes in three sections, main body, and two wings. It’s the ELITE Pirate Gunboat btw
This is what i did to get it working. Exported in MS as 3 groups, all individually named, ended up with one cmp file but with the three sections included. Resized the model in FLModelTool, then used LS’s surbuilder v3 to make the multipart sur. After a bit of fiddling got it so that it made the three sections.
I’ve included it here with it’s seperate turret model, all hardpointed, scripted and ready to go. Can someone have a look to see if it crashes please as i’m out all day today. I made a single group version of this model and that works fine, but after talking to LS this morning, thought i’d try the multipart version.
Feedback welcome
Can be downloaded here: http://www.mediafire.com/?01195sma51m75ca
-
StarTrader wrote:
adoxa: It ran clean overnight, so it works.GetCollisions.txt now contains only the turret entries (turrets are used on the base ship). There are no entries for my special hardpoints, and this is unexpected.
Now I understand where the hpids are in the sur file, and found the answer to this: - adoxa had added in all of my hardpoints including the special ones.
So this is conclusive: -
If your sur file does not contain hardpoints then your sur is incomplete and will cause an FLServer crash eventually, if it is hit in the right place! So look out you modders who are running game servers!The good thing is that SUR Exporter v1.1 adds all vanilla-named Hardpoints (see the list above and keep it somewhere), just put them into MilkShape at the end of all the groups from your cmp file before you export your sur. But if you have more than 18 parts the Exporter cannot do this.
And the other good news is that even special named hardpoints can be added, so for you other guys who want to make ships with HpCannonxx HpBlasterxx you should also be able to add your own hpids as adoxa describes above by hex-editing the hpid section - remember if you increase the entry count, if you extend the file length the sur file may be destroyed, I haven’t tested this.
Here is mine:-
68706964 = hpid
09000000 = 9 (count of entries)
DEB90FF0 = HpMount (FLModel Tool doesn’t recognise it)
437E9611 = HpWeapon03
91C20AEC = HpShield01
E08B8E1D = My specialHp01
5ADA8706 = My specialHp02
CCEA800F = My specialHp03
D0FCFA12 = HpThruster01
6AADF309 = HpThruster02
B02324EF = HpCM01
9CD399F8 = Next mesh name. Don’t overwrite this!
03000000 = Mesh type
21667864 = !fxdIf you are clever you might be able to use SUR Exporter v1.1 to add extra hardpoints as standard names (remember to choose one with the sur shape you want) and then find and rename them in the sur file hpid section.
And for the battleship turrets I need to rename the hardpoints to use the HpTurret_n1_xx format in the cmp files, shiparch.ini, and loadouts_special.ini and/or solar\loadouts.ini as applicable so that the sur shape is the right size for my turrets.
At least now I understand a bit more about the sur files and about HpTurret hardpoint naming.
So - we now need an exporter or sur builder or sur generator that does all of this and tells us what part of a model cannot be generated and why!
-
Gibbon wrote:
… To this end i’ve created my first multipart model.Really? Thought you were an old hand at this, Gibbon?
Gibbon wrote:
Resized the model in FLModelTool,I don’t do this unless I see the disappearing problem, only on large objects.
I see straight away that your sur does not have any hardpoints in it and no hpid section, so you have the problem we just isolated.
Use SUR Exporter v1.1 with your hardpoints and it should be fine. As it’s a small ship you can use a shield bubble. I’ll check that for you if you uploaded it.
-
Thanks for looking at this ST. Just to clarify a few points from my end.
1. I’ve been converting models for years, but i’ve been lazy and making them all single group models and using vanilla surs until the sur builder came along.
2. I resize the model in FLMT because when i export them from MS they are normally a bit small for my taste. I now use Lancers sur builder on the resized model, not actually resizing the sur itself with FLMT
3. Which brings me to this point. All the single group models i’ve converted so far don’t have the hardpoints in the surs as all i’ve done is used the sur builder on them. I don’t get crashes. So the next question is, is this specific to multi part surs only where i need to add the hardpoints to the sur itself?
As to the shield bubble, the model is rheinland gunboat size so do i need a shield bubble?
-
1. Oh, OK, I thought you were “au fait” with making break-off parts and stuff.
2. When you export, the exporter scale sits at 1/92 - I model all mine using 1 MS unit to 1 metre, and set the exporter scale to 1 and all is well.
But remember that the cmp exporter has a bug and will not set the new scale unless you Save Settings or Load Settings first!
If you import the pilot model you will see that 1 to 1 is good.
3. You’ve perhaps not tested them in the same way I guess. Sushi also tested my sur but with NPCs vs NPCs and it didn’t fail for him.
I have a battleship station blasting NPCs using the test ships and surs, it can crash within 5 minutes, but usually takes a while but not more than 1 hour to crash. Then using adoxa’s GetCollisions dll we found it was hits on the hardpoints, as we mentioned above.
The problem is it crashes FLServer, not the client. So for a mod server it is an annoying problem. Good thing is we have now identified the cause, and since we deviated from standard FL it is better to go back to standards instead of inventing get-rounds that might cause other problems.
Anyway, if we fix them then there will be no chances of random unidentifiable crashes caused by this problem.
For your model - the vanilla gunboats and bigger ships don’t have shield bubbles (tnis is seen as HpMount, or crc=f00fb9de in the sur file), they are “shrink-wrapped” with just a bounding box. The SUR Exporter v1.1 does this, but Sur Builder does not.
NOTE: Gunships, cruisers, battleships, transports, lifters and trains do not have the shield_link entry in shiparch.ini - so this will not cause the logged hits in GetCollisions that would be logged if there were a shield_link entry.
If you don’t need break-off bits and your models are small with no gaps then single-part cmps and surs are fine, e.g. for your Elite models.
But if you get a good multi-part sur utility that inserts your hardpoints and does everything close to standard surs, wouldn’t you be happier than farting about fixing half-finished utilities?
And there are modders (not me at the moment) who want break-off parts too. And of course the large ships and station models need multiple parts, more than the 18 limit of our current utilities.
That still leaves the wing+weapon sur parts (type 5) which are in standard FL sur files. They must have a purpose so should be included in our surs for full compatibility/compliance.
Sur Builder would be great if it could be updated to do all this since LS already put so much into it.
But now we know more about what is needed, (actually Bejaymac told us all this many, many times years ago but we didn’t understand or didn’t want to do it his way), the other guys here will crack it hopefully. I’m hanging around here to make sure they get harassed into doing it!