Anyone else still need a SUR generator?
-
I found another way, just have to test it further
1. Create the sur using the SUR Creator
2. Import the sur into MS
3. Import the model on top of that with the hardpoints (Delete the unnecessary one’s like HpPilot, HpCocpit, and Lights).
4. Delete the model leaving the sur and the hardpoints (If you have a multipart you need to find the part name for each part of the sur xxxxxx_lod1) and export it using shield bubble + disable mesh directx reduction
This has work well so far on smaller models (No console errors with both single part and multipart surs). I’ve also used this on my bigger ships with full success too (Full success meaning that it didn’t crash on takeoff and took damage without any shots going through the hull). Now it is time for stress testing and see if anything comes up in the GetCollisions and GetRoot. I’m writing from work so I hope I remembered everything.
-
Sur Creator? Never heard of it.
I’m guessing you mean LS’s Sur Builder?
Yep, that works as long as Sur Builder didn’t miss any parts, but unfortunately it often does.
I just do this:-
1. import the .cmp into MilkShape,
2. fix or regroup any groups I don’t like the look of,
3. use the Convex Tool to make sure all shapes can be generated easily,
4. fix and remake any bad shapes that are created,
5. delete the original model groups,
6. save the model as (ShipName)Surs.ms3d just in case it’s needed again, then
7. export the sur with the needed hardpoints using Sur Exporter v1.1 (it ignores any hardpoints it does not recognise in any case).As long as there are 18 or less parts, this way and your way are
both fine.Special-named hardpoints
If you have special named hardpoints, like HpCannon01, name them with standard names first otherwise they will not be exported, but don’t conflict with existing hardpoints. e.g. use:-HpWeapon101 etc. for guns,
HpTurret101 for small fighter turrets,
HpTurret_L1_101 etc for biggest battleship turrets,
HpTurret_L2_101 etc for the next size down,
HpTurret_L3_101 for the next size down again, and
HpTurret_L4_101 for the smallest of the big turrets,
HpShield101 etc for special-named shields and equipment hardpoints.Do this with all your special named weapon & equipment hardpoints.
These names produce different sur shapes, import the sur and check them out to see if it’s what you want.
Then after you export the sur, you need to open it in a hex editor, look for the hpid section, find the CRC’s of these (HpWeapon101 = E2912E17 - It must be reversed, so look for 172E91E2 in your hex editor) and replace them with yours - HpCannon01 = E77A39D1 so reversed = D1397AE7.
Remember:
When you export a whole model you MUST NOT add “_lod1” to the end of the sur part names because the exporter does this. You ONLY need to add “lod_1” to the name when you export single groups to stitch together with Sur Splicer, because the Sur Exporter does not add it - as there is only 1 group it will be named “root”. -
Sadly I have just confirmed that Sur Splicer ignores hardpoints and does not keep them.
Every sur part in the sur file has an hpid section, but the count field is 0.
So it seems that we can’t export non-wrapped surs with hardpoints.
Someone earler said that Sur Exporter knows about holes?
No it doesn’t, it covers all holes with the shrinkwrap.
-
Yes can of worms is right.
Gibbon - as you say your sur is not good too.
The one I made gets the shrinkwrap but I can fly through almost all parts of it with no collision detection. And then Freelancer.exe hung. So it’s unusable.
I spent the whole day today trying to export hardpoints with Sur Splicer and with Sur Exporter v1.1 on a big ship, my Brakiri Avioki with gaps everywhere - no go, it hung Freelaner.exe every time. The original sur which I made with Sur Splicer with no hardpoints a couple of years ago is fine, I can fly through almost all the gaps (not the rear body, I didn’t want to make that into 4 parts) and I collide with and can shoot and hit all body parts.
Just no danged way to add hardpoints.
-
As long as your hex editor can insert bytes, adding hpid is not all that difficult. Use surdump -ob to generate the offsets (only those names with two spaces are needed). Working backwards to preserve those offsets, go straight to EOF. Insert “hpid”, the number of hardpoints and the CRC of each. Go to offset+4 of the last group and add one to that byte. Go back to offset, insert “hpid”… Once done, run it through SurDump again to test it out.
-
@ST
I do actually have a working version of that sur, complete with holes that Bejaymac modified for me, although it’s based on that sur i uploaded.
What i was trying to show with that sur is that the sur exporter does recognise holes in models and doesn’t automatically shrinkwrap as you suggest.
-
Gibbon wrote:
That was me ST, about holes, so how do you explain this sur then? This has holes, look at the docking bays. Made using 1.1. No shrink wrapping in sight. It’s a uesless sur but that’s not the point here.Hi pal.
No, Sur Exporter does not know about (i.e. cannot make surs around) holes. I re-affirm this.
I just had a good look at your Galactica sur file. It’s a very nice sur by the way, could have been made by me - almost :D.
The docking bays on your Galactica are made in the same way I make mine - one piece for the floor, another piece for each wall, and on my models one piece for the ceiling. The Galactica model has 3 parts for each docking bay: the floor, and two sloping sidewalls which meet at the top.
I have several working surs with docking bays - my TCS Vesuvius, TCS Midway (2), Kilrathi Dreadnought, and Tigers Claw are made in this way. All sur parts are exported one at a time and then spliced with Sur Splicer. they all work very well. The only problem is making them within the 18 total group count, Sur Splicer removes this limit but the cmp exporter still has it. The manual way to splice cmp files solves this too.
Your Galactica sur has a Shield Bubble, not a shrink-wrap.
And I have just noticed that the outer bay wall sur parts are not convex, the inside walls are flexed inwards into the sur part, so that is one reason for the sur not working.
The other problem is that the shield bubble will not let a ship fly into it, so ships cannot dock on this model.
A shrink-wrap is just a skin-tight convex shape around all the component shapes, and covers all holes - it has to, it is a convex shroud around the whole model. The strange thing is you can fly into a hole through the shrink-wrap, since it seems that it is not meant to detect collisions, but you can also fly through most parts of the model too then, like floor, walls and ceiling, despite them having sur parts.
If you remember a long time ago Mirkha and CzW helped us on how to use the Boolean tool in 3DS Max to make a hole in a solid object and then make it into a sur? Well I did that with a solid sphere and “Bool’d” a “monolith” to cut a docking hangar in it. I exported that as a sur, with a Shrink Wrap - which on that model was another sphere close to the surface of the original, since the sphere is already convex, and it covered the bay entrance. It was so easy… and it worked!(?) But only slightly, because I could fly into it, and there was an initial collision with the ceiling - but not with the walls nor with the floor. And after the first collision, I could also fly through the ceiling until I exited from the model and re-entered it again, then this behaviour repeated.
So that was a shame, so near yet so far.
Believe me if I had found a way to make useable one-piece surs with holes I’d be using it. This is my 4th year of sur-apprenticeship!
-
adoxa wrote:
…Use surdump -ob to generate the offsets (only those names with two spaces are needed).What do you mean by 2 spaces exactly please?
adoxa wrote:
…
Working backwards to preserve those offsets, go straight to EOF. Insert “hpid”, the number of hardpoints and the CRC of each.Go to offset+4 of the last group and add one to that byte.
Go back to offset, insert “hpid”…
Once done, run it through SurDump again to test it out.
My sur files have 2 entries for each mesh:
00008 Root (0x12688F2D)
0006C Root (0x12688F2D)0197C Mesh_E08DE812 (0xE08DE812)
019E0 Mesh_E08DE812 (0xE08DE812)02900 Mesh_020DAFD8 (0x020DAFD8 )
02964 Mesh_020DAFD8 (0x020DAFD8 )04784 Mesh_F91C3704 (0xF91C3704)
047E8 Mesh_F91C3704 (0xF91C3704)05EE8 Mesh_F5D687E5 (0xF5D687E5)
05F4C Mesh_F5D687E5 (0xF5D687E5)0956C Mesh_10F7AD36 (0x10F7AD36)
095D0 Mesh_10F7AD36 (0x10F7AD36)0C5C0 Mesh_F8A79E07 (0xF8A79E07)
0C624 Mesh_F8A79E07 (0xF8A79E07)0DB44 Mesh_E3AF5337 (0xE3AF5337)
0DBA8 Mesh_E3AF5337 (0xE3AF5337)0F098 Mesh_0827E417 (0x0827E417)
0F0FC Mesh_0827E417 (0x0827E417)0FC2C Mesh_132F2927 (0x132F2927)
0FC90 Mesh_132F2927 (0x132F2927)107F0 Mesh_0F984C74 (0x0F984C74)
10854 Mesh_0F984C74 (0x0F984C74)13934 Mesh_FF42A8CE (0xFF42A8CE)
13998 Mesh_FF42A8CE (0xFF42A8CE)16B68 Mesh_FB852522 (0xFB852522)
16BCC Mesh_FB852522 (0xFB852522)So I take it you mean the first entry of the last block (16B68 ) and the value at (16B68+4 = 16B6C ) = 04
So add 1 to this = 05 to indicate there are 5 blocks to follow?
And add my hpids block at the EOF.
So there is no file length anywhere? In this case why not expand an existing hpid block in the file by inserting additional hpids and updating the count? LS warned against doing this because it would mean losing info from the end of the file, so I’m uncertain?
-
I only meant hex editing the file. Using his converter you should be fine.
-
LS - that is what we are doing, hex-editing the file and adding bytes, it’s not a converter. So what is the correct thing to do? :-?
-
@ ST
You obviously missed the bit where i said i have a working version of that sur that Bejay corrected. With that i can fly through the landing bays and it is most certainly dockable.
I’ve included it here so you can compare.
All i was doing by showing the previous sur was to demonstrate that the exporter can make a decent body hugging sur, it just needs fixing so it can work properly, by that i mean the exporter as one possible solution to our woes.
-
No, I got you, but I wanted to clarify that Sur Exporter doesn’t understand “holes”, by which we usually mean holes in a single sur part.
As I said we can come close to it but floors and sides collision detection in the hole didn’t work.
Sure we can make “holes” by “boxing them in” with several sur parts, as long as we can get within the sur part / cmp group count limitations.
But what we need is a magic tool.
Thanks for your working sur, I’ll check it out too.
LS, adoxa - can you answer my previous post on inserting the hpids please?
-
If you are simply plugging values directly into the sur without moving the following section, then you are over-writing important data and creating a bad sur. You can get away with that if it’s a single part sur by extending the size of the file but in a multi-part, forget it, the data following the HPID section has to be moved. Surs use pointers to step thru them and putting extra HPs in there screws it up. I was assuming that you were using his XML converter…
-
Only surf tags use offsets, so inserting hpid sections is as “easy” as I said.
In the brief dump, objects have two spaces between the offset and the name, with the meshes being indented another two spaces (that’s why you should use code blocks…). Since we’re only changing objects, not meshes, lines with “two spaces” are all that is relevant. If the count is 4 it should already have the hpid section (there are only four tags - !fxd, exts, surf & hpid), so yes, just update the existing hpid section.
-
If you remember a long time ago Mirkha and CzW helped us on how to use the Boolean tool in 3DS Max to make a hole in a solid object and then make it into a sur? Well I did that with a solid sphere and “Bool’d” a “monolith” to cut a docking hangar in it. I exported that as a sur, with a Shrink Wrap - which on that model was another sphere close to the surface of the original, since the sphere is already convex, and it covered the bay entrance. It was so easy… and it worked!(?) But only slightly, because I could fly into it, and there was an initial collision with the ceiling - but not with the walls nor with the floor. And after the first collision, I could also fly through the ceiling until I exited from the model and re-entered it again, then this behaviour repeated.
in fact with the boolean tool, the sur works for the laser and not for the hull, if i reminber well
so, and if the galactica is the one i’ve made, yes for a hole you have to cover each face separately.
but it doesn’t matter because we are not limited in number of parts in the sur -
Gibbon wrote:
@ STYou obviously missed the bit where i said i have a working version of that sur that Bejay corrected. With that i can fly through the landing bays and it is most certainly dockable.
I’ve included it here so you can compare.
All i was doing by showing the previous sur was to demonstrate that the exporter can make a decent body hugging sur, it just needs fixing so it can work properly, by that i mean the exporter as one possible solution to our woes.
Gibbon:
Your new galactica sur has no HpMount (the shield bubble) so it can be docked on. And the bent dock sidewalls are now straight and convex.
Very good.
LS: Yes I understand about not overwriting any of the data in the sur file. By using insert the file size is extended so I can see that might also cause problems since offsets to the following sections would be wrong and I would not know where to find and change them.
Adoxa: So if there are sections following the hpid location, we cannot insert additional hardpoints even if surf sections are not present? But if the hpid section is at the end, then we can extend it by adding our hardpoint crc’s?
I’ve still not quite got in my head what I can and cannot do (we engineers need precise instructions or else our logic circuits malfunction)!, so I will have to do it and report back.
Now - we need to be sure that all the lessons learned here are incorporated into the next sur tool!
My measure of the success of that tool will be to generate a sur for a vanilla ship, and it should be identical to the original sur including hardpoint sur parts, and all bounding boxes including those for the (weapon+wing) surs. Nothing less will be acceptable! Because only then will we know we have a tool that produces fully compatible surs.
And on top of this, remember that it must have:-
1. an option for shield bubbles for small fighters (HpMount plus an identical bounding box),
2. an option for a tight bounding box like the ones used for vanilla freighters and warships (plus the internal bounding boxes), and
3. an option for no bounding boxes at all, only bare sur parts, so that we can generate surs for the huge ships and bases etc. without needing Sur Splicer.I know that this is a tall order - but I have complete faith in the abilities of you guys who are slaving over the next sur tool.
Of course you won’t please everyone but this will go a long way.
Come to me for encouragement any time, this tool will complete our arsenal!
Thanks guys.