• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community Discovery Development Discovery Developers Forum Freelancer Modding Tutorials
« Previous 1 2 3 4 5
Making hitboxes using SUR Splicing

Server Time (24h)

Players Online

Active Events - Scoreboard
Core Dominance - 7 / 10,000
Humanity's Defiance - 72 / 10,000
Nomad Ascendancy - 37 / 10,000
Order Mastery - 10 / 10,000

Latest activity

Making hitboxes using SUR Splicing
Offline frozen
05-17-2010, 02:18 PM,
#2
Member
Posts: 1,948
Threads: 76
Joined: Jul 2007

1. Close MilkShape and restart it, and open your sur model. This will save you heartache that I went through when MilkShape's buffers or pointers or whatever don't get reset properly. You will see another one of these bugs later in any case.

2. CAREFULLY DELETE ALL of the SHIP main groups, SHIP group sub-components, and ALL of the hardpoints, and the hardpoint placement group if you made one. LEAVE ONLY the SUR groups.

SAVE as a NEW name, e.g. ExcaliburNewSursOnly.ms3d

3. This step needs VERY GREAT CARE! DO NOT SAVE at any step!

a. In MilkShape, leave the topmost sur group (your Excalibur_Hull_lod1), and CAREFULLY delete all other sur groups. You can do it a little faster by ensuring Select is by Face, selecting the group you want to keep, press Ctrl+I, and then Delete.

If you make a mistake use Ctrl-Z to undo it. DO NOT SAVE!

b. Copy the main group's xxxx_lod1 name from the Rename window (select it all, press Ctrl-C).

c. Start the SUR Exporter plugin (File... Export... go find it).

d. Click Load CMP Settings (.ces) and retrieve the settings you saved earlier when you exported the ship cmp file. If you didn't, don't worry, the next steps will fix it for you anyway...

e. Ensure Orientation = Back to Front, Scale Down Value = 1, Collision Mesh = Shrink Wrapped, Disable DirectX Mesh Reduction is checked, Number of Groups = 1

f. Click Browse... and paste (Ctrl-V) the main group name (Excalibur_Hull_lod1) into the filename window, and click Save

g. In Ship Mass, put in a value that is about half of the total ship's mass. This is for the root sphere that is near the centre of the ship and will help stability.

If you decided to not use a sphere, give this mass to the sur group you chose as your root sur (the top one in your list).

h. Click OK.

If all went well, you have exported the first sur group successfully.

If not, then you need to do this part again - sorry, but yes, you do.

i) If all did go well so far, repeat this step for the next sur group. This needs care! I usually leave MilkShape open and use Ctrl-Z repeatedly to undo the group deletions, then delete the other groups and sub-groups that I don't want. Here is where the thoughtful sub-group naming is important.

ii) Do the same for the remaining sur main groups and their sub-components. In step 3g, set a mass appropriate to the piece you are covering, and ensure the total of all masses is close to the total mass of your ship. Balance the mass of left and right parts to be the same, i.e. mass of the left wing should be the same as the mass of the right wing etc.

BUT - Don't do this when you are sleepy!

If you get a message saying "Failed to start 3D Device" or similar, DO NOT SAVE! Close and restart MilkShape. This is the bug I referred to earlier. Don't worry, now just re-open your saved SURs ms3d file again.

All done? Well done again.

Splicing Them Together

4. Now we need to use Sur-Splicer to stitch the multiple surs into one...

a. Go to the folder where you placed a copy of sur-splicer, and make a new file with Notepad named splice-it.bat and enter this into it...

sur_splice.exe SurInput.ini
pause

Save it.

b. Make another new file with Notepad named SurInput.ini and enter these following lines into it, adapting the names to your own sur files - this example is for my Enterprise D - Remember to change the group names to match your ship sur groups names, and don't enter my comments in {brackets}...

NewEntDSpliced.sur {This is the name of your new sur file when it's done}
EntD_cons_fix.dat (This is not needed by us but sur-splicer needs it to be named.}
550 {Make this the radius of your own ship in metres}
18600 18600 18600 {This is the X, Y & Z inertia but use your ship's mass 3 times}
EntD_Hull_lod1.sur root {This is our ROOT sphere}
EntD_HullNacelle_lod1.sur EntD_HullNacelle_lod1
EntD_Pylon_lod1.sur EntD_Pylon_lod1
EntD_Saucer_lod1.sur EntD_Saucer_lod1
EntD_Wing_lod1.sur EntD_Wing_lod1
EntD_LEng_lod1.sur EntD_LEng_lod1
EntD_LEngPyl_lod1.sur EntD_LEngPyl_lod1
EntD_LPylRoot_lod1.sur EntD_LPylRoot_lod1
EntD_REng_lod1.sur EntD_REng_lod1
EntD_REngPyl_lod1.sur EntD_REngPyl_lod1
EntD_RPylRoot_lod1.sur EntD_RPylRoot_lod1

Note the two entries on each line are identical except that the second entry does not have the .sur suffix, and that they are separated by one or more spaces, or a tab. Extra spaces do not show in this forum.

Save SurInput.ini

c. Copy all of your sur files into this same folder.

d. Run splice-it.bat by double-clicking on it.

Check the run messages for any errors.

If all is well, close the DOS window.

If it does not seem to be OK then go back and check the names you used in SurInput.ini

e. Copy the NewEntDSpliced.sur or whatever you named your sur file into your ship model work folder and rename it to match your ship's .cmp file.

All done.

f. Check your model and Sur file using HardCMP, press S to see your sur file.

If HardCMP crashes on trying to open your ship model, it's most likely to be that your SUR file is bad - rename or delete it from the folder temporarily to check. If it is the cause - well, you just have to go back and do it again more carefully. Been there!

Don't worry unnecessarily if the sur file parts are not all showing in bright white in HardCMP, this doesn't matter in my experience. But make sure that no bits are missing altogether, this will be a problem.

Shoot it up!

Go check it out in the game. You will need to copy these files:-
yournewship.mat
yournewship.cmp
yournewship.sur

into the DATA\SHIPS\yourshipname folder.

You will also need a cockpit.ini file there for the camera views, and you will also need to make a full and correct entry in shiparch.ini and also in goods.ini and in market_ships.ini to be able to buy it, and you will need to start two game characters, one with the new ship and one for another ship to crash into it and shoot it up! WBTSOTT!

But you can also make it a stationary solar to test it - see my tutorial on that.

But if you do it this way, remember you are not testing the sur fully because you will not be able to destroy the ship, and so you will not detect any sur problems which occur when the model breaks apart. You need to have another player or NPC use the ship and then destroy it to test for these problems.

I also found that with this test method, I could shoot it up and crash into it and bounce off, but concave sur parts were not detected! So the game only froze when I gave the ship to NPCs and flew around them.

Problem Symptoms

To isolate if any of these following problems are to do with your sur file, use a resized vanilla sur temporarily by renaming your own sur file or removing it from the ship folder, and renaming the resized one to suit your ship cmp file, and run again to see if you get the same problem. Use FL Model Tool to resize a vanilla sur to fit your ship.

Error messages in C:\fl-server-errors.log that the new sur file contains bad or unrecognised information? Yeh, it's bad!

You cannot target the ship that is using a new sur? Hmmph! It was not my new sur file. My new .MAT file was bad!

HardCMP crashes when you are trying to open the ship model? Probably your new sur is bad.

FL Server hangs or crashes when you fly a ship with your new sur, Frelancer appears to continue after a short hang but no connection to FL Server (connectivity icon flashes red)? Yep, sur file is bad!

Freelancer crashes to desktop when trying to open your character when it uses your new sur, or when a ship in the area where your character is trying to spawn is using the new sur? Yep, your new sur is bad. Mine had a very slightly concave part of a tail group (it was extremely hard to see where it was concave in MilkShape!) and froze when I was near it!

Freelancer freezes when you are trying to launch in a ship using the new sur, flying a ship using the new sur, or near a ship using the new sur, or you destroy a ship using the new sur, or you have just destroyed a ship using or carrying a weapon that is using a new sur. Yep... you guessed it, your new sur is bad.

All three of the last symptoms happened to me when I found my sur groups had concavities. Mainly it was the FL Server crash, Freelancer would lose connection with it but still let me do stuff that didn't need FL Server response, like just fly around.

Tip: DON'T make new ship sur AND new weapon surs and fit them on the same ship or its weapons at the same time! I did it!

Your shots don't hit some areas of the ship even though you know there is a sur group covering it, and you can see that in HardCMP? Did you weld all vertexes in MilkShape? Did you ensure that EVERY sur group is closed all round (i.e. faces on ALL surfaces) including ones that meet up with other groups or are overlapping with other groups? Is that sur group REALLY convex all over?

It's very late and I'm in a rush, hope I haven't made any blunders - let me know and I'll fix them next time I get here.

[Image: 5d1144bd1.png]
  Reply  


Messages In This Thread
Making hitboxes using SUR Splicing - by frozen - 05-17-2010, 02:14 PM
Making hitboxes using SUR Splicing - by frozen - 05-17-2010, 02:18 PM

  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2026 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode