Increase variable torus speed factor

An area for discussing new ideas and additions to Oolite.

Moderators: another_commander, winston

Post Reply
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Increase variable torus speed factor

Post by Milo »

At line 3227 of PlayerEntity.m is a "factor" variable that determines how quickly Torus speed adjusts up and down (within the range of min 32x to max 1024x) as a function of distance to the nearest entity. I suggest removing the constant 4 from the divisor of that factor. This cuts ramp-up/ramp-down time by 4x (i.e., you will ramp up 4x faster and ramp down 4x faster), without changing the minimum or maximum speed. There is a discontinuity at just past 4x scanner range where the Torus speed doubles from 32x to 64x, but it doesn’t feel abrupt to me.

In my testing, this tweak significantly (by 4x) reduces time spent traveling across long distances, without skipping any encounters along the way because your speed still drops smoothly down to the minimum as you approach anything.

If someone really likes spending 20 minutes idly flying through space, they can always turn off Torus, so I don't see any down-side here. Note that when flying on the witchpoint to station route, there will be frequent mass locks and those will be by far the majority of your time spent on the route, so this simply means you could spend 4x less time between mass locks (although they would have to be spaced at least 4 scanner ranges apart, as that is the minimum distance before Torus speed starts to ramp up). If you avoid the route, you'll get to the station 4x sooner, so this will improve the credits/time ratio for milk runs for players who avoid the route. I think that's fine, because that kind of game-play soon grows boring anyway (and if not, at least the player is having fun, right?). On the other hand, this tweak makes sun skimming 4x less time-consuming, so maybe players will do that more.

Here is an excerpt of the revised code from line 3216 to 3243, including revised comments to reflect the change. Previously maximum speed was reached when the nearest entity was ~10^8 m distant, after around ~10 minutes flying away from everything. Now the maximum can be reached after ~2.5 minutes flying away from everything (when the nearest entity is 26214.4 km away). But in practice you rarely fly that far away from everything, so the more game-play relevant consequence is that when you fly towards a distant entity, you can arrive up to 4x sooner.

Code: Select all

#if OO_VARIABLE_TORUS_SPEED
	if (EXPECT_NOT(needHyperspeedNearest))
	{
		// this case should only occur in an otherwise empty
		// interstellar space - unlikely but possible
		hyperspeedFactor = MIN_HYPERSPEED_FACTOR;
	}
	else
	{
		// once nearest object is >4x scanner range
		// start increasing torus speed
		double factor = hsnDistance/SCANNER_MAX_RANGE; // changed from hsnDistance/(4*SCANNER_MAX_RANGE) in 1.89
		if (factor < 1.0)
		{
			hyperspeedFactor = MIN_HYPERSPEED_FACTOR;
		}
		else
		{
			hyperspeedFactor = MIN_HYPERSPEED_FACTOR * sqrt(factor);
			if (hyperspeedFactor > MAX_HYPERSPEED_FACTOR)
			{
				// caps out at 26214.4 km from nearest object (changed from ~10^8 m in 1.89)
				// which takes ~2.5 minutes of flying if nothing is encountered along the way (changed from ~10 minutes in 1.89)
				hyperspeedFactor = MAX_HYPERSPEED_FACTOR;
			}
		}
	}
#endif
Last edited by Milo on Sat Jul 11, 2020 4:46 pm, edited 4 times in total.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: Increase variable torus speed factor

Post by dybal »

I would like that.

I run Additional Planets, Station for Additional Planets, and Planet Fall and always visit every planet and moon in the system, so I spend quite some time travelling between planets.
Post Reply