Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: InsaneBaron on February 11, 2014, 12:26:59 pm

Title: Out of bounds distance
Post by: InsaneBaron on February 11, 2014, 12:26:59 pm
How far out, in meters, does the player have to go to get "out of bounds" and self-destruct?
Title: Re: Out of bounds distance
Post by: Lorric on February 11, 2014, 01:04:19 pm
Does Freespace 2 even have such a thing?

You could try finding out though. Take a fast ship, target something, go to full speed away from it and put time compression on 64X. Eat some food or something while you watch.
Title: Re: Out of bounds distance
Post by: The E on February 11, 2014, 01:38:19 pm
Well, physics calculations etc will start to break at around 32 km out from mission start.
Title: Re: Out of bounds distance
Post by: Lorric on February 11, 2014, 01:59:22 pm
Well, physics calculations etc will start to break at around 32 km out from mission start.
That's not 32,000 in the ship distance in the bottom corner, is it? Because that's not much at all.
Title: Re: Out of bounds distance
Post by: Kobrar44 on February 11, 2014, 02:03:26 pm
This (http://www.hard-light.net/forums/index.php?topic=71965.0;) is a must-read on the topic. Retail distance was quite realistic and there even are messages from command about leaving the combat zone. After certain point the ship was self-destructed. Those got massively increased at some point.
Title: Re: Out of bounds distance
Post by: InsaneBaron on February 11, 2014, 02:12:28 pm
Interesting. I was curious how far away something had to be to make it inaccessible (I think the Knossos in Into the Lion's Den is far enough out.
Title: Re: Out of bounds distance
Post by: The E on February 11, 2014, 02:15:23 pm
A-Ha! Found the limits!

There are three defines that govern this:

Code: [Select]
#define PLAYER_MAX_DIST_WARNING 700000 // distance in KM at which player gets warning to return to battle
#define PLAYER_DISTANCE_MAX_WARNINGS 3 // maximum number of warnings player can receive before mission ends
#define PLAYER_MAX_DIST_END 750000 // distance from starting loc at which we end mission

Basically, if you move 700000 units from the world origin, you'll get warned. Move out beyond 750k units, and you'll get killed. Very, very messily. What happens is that a bomb will go off hitting the player ship with 10 times its current hull value as damage, making sure that nothing remains (Incidentally, this is also why cheating yourself invulnerable will allow you to get past this, as the damage will not be applied to your ship).
Title: Re: Out of bounds distance
Post by: Lorric on February 11, 2014, 02:15:55 pm
This (http://www.hard-light.net/forums/index.php?topic=71965.0;) is a must-read on the topic. Retail distance was quite realistic and there even are messages from command about leaving the combat zone. After certain point the ship was self-destructed. Those got massively increased at some point.
Wow. That is quite something indeed.
Title: Re: Out of bounds distance
Post by: Lorric on February 11, 2014, 02:18:16 pm
A-Ha! Found the limits!

There are three defines that govern this:

Code: [Select]
#define PLAYER_MAX_DIST_WARNING 700000 // distance in KM at which player gets warning to return to battle
#define PLAYER_DISTANCE_MAX_WARNINGS 3 // maximum number of warnings player can receive before mission ends
#define PLAYER_MAX_DIST_END 750000 // distance from starting loc at which we end mission

Basically, if you move 700000 units from the world origin, you'll get warned. Move out beyond 750k units, and you'll get killed. Very, very messily. What happens is that a bomb will go off hitting the player ship with 10 times its current hull value as damage, making sure that nothing remains (Incidentally, this is also why cheating yourself invulnerable will allow you to get past this, as the damage will not be applied to your ship).
Interesting. :)

I think Colony Wars on PS1, if you ignore the warnings, when you hit the boundary, instead of your brutal destruction, control of your ship is taken away from you, and you are forcibly turned around and flown back into the combat area for a good few seconds before you get control back. :D
Title: Re: Out of bounds distance
Post by: InsaneBaron on February 11, 2014, 02:28:15 pm
Fascinating...

So I need to make a 700,000 meter line of Sathani...

Just kidding :P

That also explains why I never got a "Turn Around Pilot" message. Who on earth has enough time to get Seven Hundred Kilometers from the start point? (sans editing your Ulysses speed)
Title: Re: Out of bounds distance
Post by: Lorric on February 11, 2014, 02:38:40 pm
Fascinating...

So I need to make a 700,000 meter line of Sathani...

Just kidding :P

That also explains why I never got a "Turn Around Pilot" message. Who on earth has enough time to get Seven Hundred Kilometers from the start point? (sans editing your Ulysses speed)
I guess it wouldn't take long at 64X compression. I might just have to try it, and see what command has to say to me. I presume they self destruct your ship as a traitor.
Title: Re: Out of bounds distance
Post by: zookeeper on February 11, 2014, 04:13:11 pm
A-Ha! Found the limits!

There are three defines that govern this:

Code: [Select]
#define PLAYER_MAX_DIST_WARNING 700000 // distance in KM at which player gets warning to return to battle
#define PLAYER_DISTANCE_MAX_WARNINGS 3 // maximum number of warnings player can receive before mission ends
#define PLAYER_MAX_DIST_END 750000 // distance from starting loc at which we end mission

Basically, if you move 700000 units from the world origin, you'll get warned. Move out beyond 750k units, and you'll get killed. Very, very messily. What happens is that a bomb will go off hitting the player ship with 10 times its current hull value as damage, making sure that nothing remains (Incidentally, this is also why cheating yourself invulnerable will allow you to get past this, as the damage will not be applied to your ship).

I wonder if that really serves any meaningful purpose? After all, you won't reach those kind of limits unless you specifically set out in search of the boundary, and getting blown to bits at an arbitrary point is rather less interesting than watching floating-point math go bonkers.
Title: Re: Out of bounds distance
Post by: The E on February 12, 2014, 01:30:06 am
Not as far as I am aware. I mean, numerical stability is definitely a concern here, the game will be unplayable if you move too far out, but I think the main reasons for doing this were tradition and keeping the players concentrated on the mission area.
Title: Re: Out of bounds distance
Post by: zookeeper on February 12, 2014, 02:45:33 am
I just don't see how it really achieves that. If you're 700000km away, you've obviously already decided to forego trying to play the mission properly in favor of toying with the game's limits. The radius of the mission area is pretty much always going to be about 10000x smaller, after all.

Of course, a possible explanation would be that the limit used to be much much smaller and at some point it wasn't really wanted anymore and it got bumped to a ludicrous value instead of being removed entirely.

...or is it 700km instead of 700000km? The code comment said km, E said units.
Title: Re: Out of bounds distance
Post by: The E on February 12, 2014, 02:56:04 am
It is units (aka meters). The game checks the distance between the player's position and the world origin, and compares it against that value.
Title: Re: Out of bounds distance
Post by: karajorma on February 12, 2014, 04:40:24 am
Remember that the limits were multiplied tenfold by the SCP. In a retail mission it wouldn't be that hard to get yourself 70km from origin.
Title: Re: Out of bounds distance
Post by: Mongoose on February 12, 2014, 11:47:22 pm
Now's the part where we ask the coders to implement a relative coordinate system in order to do away with floating-point inaccuracy, and then time how long it takes until they hunt us down and kill us. :D
Title: Re: Out of bounds distance
Post by: Lorric on February 13, 2014, 12:01:33 am
I wonder if this has any impact on Wing Commander Saga? You travel huge distances from the start point in that game.
Title: Re: Out of bounds distance
Post by: niffiwan on February 13, 2014, 12:55:01 am
Now's the part where we ask the coders to implement a relative coordinate system in order to do away with floating-point inaccuracy, and then time how long it takes until they hunt us down and kill us. :D

Or just replace the floating point coordinate system with an integer one...  :P
Title: Re: Out of bounds distance
Post by: Luis Dias on February 13, 2014, 07:04:57 am
Double-precision floating-point.

Because why not.
Title: Re: Out of bounds distance
Post by: The E on February 13, 2014, 07:09:45 am
Simple reason: Because slow.
Title: Re: Out of bounds distance
Post by: Luis Dias on February 13, 2014, 07:10:43 am
(I know - deferred lighting builds would oh so be so cooler! :D)
Title: Re: Out of bounds distance
Post by: Kobrar44 on February 13, 2014, 12:00:48 pm
I wonder if this has any impact on Wing Commander Saga? You travel huge distances from the start point in that game.

Ships jump around in WCS at times, sometimes really noticeably. They got away with it for the most part however.
Title: Re: Out of bounds distance
Post by: Fury on February 14, 2014, 11:56:06 am
Simple reason: Because slow.
Is this really true on modern computers though?
http://stackoverflow.com/questions/1074474/should-i-use-double-or-float
http://stackoverflow.com/questions/417568/float-vs-double-performance