Author Topic: Tool to measure jump in/out distances  (Read 1792 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Tool to measure jump in/out distances
So basically a small script that tracks the point where the ship enters the game and then waits until the defined timepoint before logging its 'stop position'. Then it starts tracing the ships jump out run and records the last position the game lists for the ship. So in the end you get the distance the ship needs for getting from jump to stationary position and also the distance needed for the ship to jump out. The data is saved to a text file named 'Distancetest.txt' which will be ruthlessly overridden every time script is run.

Script
Code: [Select]
#Conditional Hooks

$State: GS_STATE_GAME_PLAY

$On HUD Draw:

[

if arrayInit == nil then
   startPos = {}
   stopPos = {}
   endPos = {}
   names = {}
   arrayInit = 1
   triggerDone = 0
end

if mn.getMissionTime() ~= nil then

   integerShips = #mn.Ships
   mTime = mn.getMissionTime()

   for y = 1,integerShips do
      objectShip = mn.Ships[y]

      stringName = objectShip.Name

      if startPos[stringName] == nil then
         startPos[stringName] = objectShip.Position[3]
      end

      if stopPos[stringName] == nil and mTime >= 74 then
         stopPos[stringName] = objectShip.Position[3]
         names[y] = stringName
      end

      if mTime < 120 then
         endPos[stringName] = objectShip.Position[3]
      end

   end

   if mTime > 120 and fileWritten == nil then
      iofile = cf.openFile("Distancetest.txt", "w")
      iofile:write("Comma separate data output from distance checks\n\n")
      iofile:write("First value is Jump In distance, second Jump Out distance (both assuming 0 speed)\n\n\n")
      numberships = #names
      for g = 1,numberships do
         shipName = names[g]
         jumpIn = stopPos[shipName] - startPos[shipName]
         jumpOut = endPos[shipName] - stopPos[shipName]
         iofile:write(shipName .. ", " .. math.floor(jumpIn) .. ", " .. math.floor(jumpOut) .. "\n")
      end
      iofile:close()
      triggerDone = 1
      fileWritten = 1
   end

   if triggerDone == 1 and mTime < 135 then
      gr.setColor(255,255,0)
      gr.drawString("DONE",300,300)
   end

end

]

#End

Here are also the distances i got using the script for almost every freespace 2 ship and object (with 3.6.10 beta mediavps in use) as comma separate data (name, jump in run, jump out run).

Distances
Code: [Select]
GTF Ulysses, 29, 51
GTF Hercules, 47, 83
GTF Hercules Mark II, 47, 87
GTF Ares, 52, 109
GTF Erinyes, 48, 86
GTF Loki, 40, 68
GTF Pegasus, 51, 90
GTF Perseus, 46, 84
GTF Myrmidon, 46, 71
SF Mara Terran, 48, 111
GTB Artemis, 79, 118
GTB Artemis DH, 91, 133
GTB Medusa, 96, 156
GTB Ursa, 112, 203
GTB Zeus, 41, 110
GTB Boanerges, 93, 157
GTDR Amazon, 93, 186
GTDR Amazon Adv, 305, 675
GTS Hygeia, 38, 111
GTFR Triton, 894, 1211
TC-TRI, 275, 1058
GTFR Poseidon, 111, 271
TC 2, 35, 137
TSC 2, 35, 137
TAC 1, 61, 228
TTC 1, 26, 96
GTC Fenris, 848, 1009
GTM Hippocrates, 1501, 2010
GTC Leviathan, 1079, 1009
GTSC Faustus, 514, 713
GTG Zephyrus, 713, 1106
GTA Charybdis, 543, 827
GTD Orion, 5243, 3074
GTD Hecate, 5748, 3335
GTD Hades, 8301, 5317
GTI Arcadia, 1854, 3313
GTVA Colossus, 7123, 11346
GTCv Deimos, 1394, 2649
GTC Aeolus, 791, 1090
NTF Iceni, 2145, 2757
NTF Boadicea, 2835, 3857
GTT Elysium, 53, 126
GTT Argo, 269, 701
GTNB Pharos, 6, 30
GTI Ganymede, 1408, 2329
Knossos, 4183, 5748
Asteroid, 148, 611
GTSG Watchdog, 9, 32
GTSG Cerberus, 9, 32
GTSG Alastor, 11, 39
GTEP Hermes, 28, 49
TC-Meson Bomb, 391, 1316
GVF Seth, 39, 69
GVF Horus, 52, 90
GVF Thoth, 44, 76
GVF Serapis, 33, 91
GVF Tauret, 45, 79
GVB Sekhmet, 77, 119
GVB Osiris, 119, 199
GVB Bakha, 50, 75
GVF Ptah, 39, 63
GVS Nephthys, 41, 119
GVT Isis, 45, 97
PVFR Maat, 110, 221
GVFr Bes, 112, 212
VAC 5, 54, 207
VAC 4, 25, 93
GVFr Satis, 397, 468
GVG Anuket, 914, 1451
GVC Aten, 716, 1059
GVC Mentu, 886, 1329
GVCv Sobek, 1247, 2437
GVD Typhon, 5562, 3341
GVSG Ankh, 7, 29
GVSG Edjo, 10, 41
GVEP Ra, 45, 83
GVA Setekh, 557, 915
GVD Hatshepsut, 5197, 3656
SF Dragon, 24, 53
SF Basilisk, 59, 110
SF Manticore, 45, 78
SF Aeshma, 59, 116
SF Mara, 48, 112
SF Astaroth, 47, 82
SB Nephilim, 90, 158
SB Taurvi, 70, 103
SB Nahema, 90, 152
SB Seraphim, 175, 302
ST Azrael, 79, 166
SFr Dis, 552, 1204
SAC 3, 292, 1086
SFr Mephisto, 108, 204
SC 5, 14, 58
SFr Asmodeus, 241, 492
SAC 2, 28, 122
SC Lilith, 700, 770
SC Rakshasa, 1174, 1304
SC Cain, 1185, 770
SD Demon, 5779, 3221
SD Ravana, 5759, 5184
SD Lucifer, 6778, 4415
SSG Trident, 7, 32
SSG Belial, 16, 61
SSG Rahu, 589, 1048
SCv Moloch, 1826, 2290
SJ Sathanas, 6963, 9212
SJD Sathanas, 53, 18
GTSG Mjolnir, 101, 527
Shivan Comm Node, 557, 907

Should you want to use stick all ships to use non dynamic goals and place stay still flag on all the fighters and other such little ships. When placing ships make them point forward (judging from default fred start position, ie. along z axis). Make sure the time allowances for the ship jump in (i used 2 seconds) and jump out (i had 75 seconds) are adequate for your purpose. And also make sure the values in the script match the values in the mission file.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Tool to measure jump in/out distances
Excellent. :yes: I've always had to measure those distances by trial and error so this is very useful.

That list you've got probably should go in the wiki too.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Shade

  • 211
Re: Tool to measure jump in/out distances
Nice! That's one potentially major headache removed from FREDding :)
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Tool to measure jump in/out distances
Wow...excellent work, Wanderer! That will be useful when designing cutscenes! :D

Can you please do the same wih ships?
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Tool to measure jump in/out distances
Can you please do the same wih ships?
Eh?
Do not meddle in the affairs of coders for they are soggy and hard to light

  
Re: Tool to measure jump in/out distances
I think he's requesting jumpin/jumpout distances with more ships.
"You need to believe in things that aren't true. How else can they become?" -DEATH, Discworld

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Tool to measure jump in/out distances
There are only fighters and bombers in that list. Having ships would be better(they're fast when jumping in/out, cutscene camera problems mostly involve ships of cruiser size and above).
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito

 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
Re: Tool to measure jump in/out distances
Can you please do the same wih ships?

The GTD Orion is in the list of jump distances.  Scroll down a little, look closely and you'll see this.

Quote
GTD Orion, 5243, 3074
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
Re: Tool to measure jump in/out distances
Azz...

I don't feel ok today.
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito