Page 56 of 118
Re: Scripters cove
Posted: Tue Dec 04, 2012 9:00 am
by Wildeblood
Rese249er wrote:Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Re: Scripters cove
Posted: Tue Dec 04, 2012 9:14 am
by Rese249er
Odd. Could you point one out?
Re: Scripters cove
Posted: Tue Dec 04, 2012 9:32 am
by spara
Wildeblood wrote:spara wrote:Is this what you are looking for: f(x)=x*100^((x-4000)/36000), where 4000 <= x <= 40000 ?
I think it is. Thank you.
Didn't work the way you wanted?
Re: Scripters cove
Posted: Tue Dec 04, 2012 10:35 am
by Commander McLane
Wildeblood wrote:An arithmetic question. I need a procedure that will take a number between 0 and 36000 (actually 4000 to 40000, but I think I can manage adding and subtracting 4000) and output a number between 0 and 3996000 (4000000-4000), such that there's no distortion at the bottom of the range, but a 100x exaggeration at the top of the range. So 4000 -> 4000, but 40000 -> 4000000, or 0 -> 0, but 36000 -> 3996000. I think this is called a geometric progression, but being the victim of a state school education, my mathematical ability is limited to basic addition and subtraction.
So you want to make the range of 0 ... 36000 into the range of 0 ... 3996000? The only thing you need to know is the factor between these two ranges, which means the factor between 36000 and 3996000.
Thus: 3996000 / 36000 = 111.
Thus all you need to do is to multiply you original number by 111, and there you are.
And of course you need to subtract 4000 before the operation, and add them again after the operation. Which gives us:
Code: Select all
var newNumber = originalNumber - 4000;
newNumber *= 111;
newNumber += 4000;
in JS, where originalNumber is of course the number between 4000 ... 40000 that is fed into the equation.
Or, the same thing in one line, which we get by substituting the steps from back to front:
Code: Select all
var newNumber = ((originalNumber - 4000) * 111) + 4000
which is a pretty straightforward translation from the English language: take your original number, subtract 4000, multiply by 111, and add 4000.
The values aren't distorted in any way. Only the steps of 1 between whole numbers are transformed into steps of 111. So instead of 4000, 4001, 4002 ... 40000 you get 4000, 4111, 4222 ... 4000000. If you feed real numbers into it, you'll of course get anything in-between as well.
Re: Scripters cove
Posted: Tue Dec 04, 2012 11:23 am
by spara
Ah. I assumed it was exponential growth that was wanted not linear. Sorry for the hassle.
Re: Scripters cove
Posted: Tue Dec 04, 2012 12:28 pm
by Wildeblood
spara wrote:Ah. I assumed it was exponential growth that was wanted not linear.
Yes.
This is what I am currently using:
Code: Select all
if (x > 40000) x = null;
if (x && x > 4000) x = (x * (x - 4000)/360 + 4000).toFixed(0);
The 360 divisor comes from previously having 36000 followed by a 100 multiplier.
Re: Scripters cove
Posted: Tue Dec 04, 2012 12:35 pm
by Wildeblood
Rese249er wrote:Odd. Could you point one out?
Point what out - a HUD with two or ten scanners? No, take my word for it. You didn't answer the relevant question, did you try with 1.76.1 or with a trunk build?
Re: Scripters cove
Posted: Tue Dec 04, 2012 12:38 pm
by Rese249er
It's a trunk build, r5555.
Re: Scripters cove
Posted: Tue Dec 04, 2012 1:54 pm
by Wildeblood
Wildeblood wrote:Rese249er wrote:Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Well, there ya go. In 1.76 you can define ten scanners on the HUD centred on the same point, but all slightly different sizes, and it gives the appearance of each scanner contact being drawn as a line, instead of a dot, like an old-school radar display. But that trick no longer works in trunk, because it only draws one scanner. That's progress, I guess.
Re: Scripters cove
Posted: Tue Dec 04, 2012 10:54 pm
by Commander McLane
Wildeblood wrote:spara wrote:Ah. I assumed it was exponential growth that was wanted not linear.
Yes.
This is what I am currently using:
Code: Select all
if (x > 40000) x = null;
if (x && x > 4000) x = (x * (x - 4000)/360 + 4000).toFixed(0);
The 360 divisor comes from previously having 36000 followed by a 100 multiplier.
Ah. I thought you wanted an equal distribution.
The only problem with your formula is that it produces results > 4000000 for x > 39981. That's easy to fix by adjusting the divisor. Change it to 360.36036, and you're there.
Re: Scripters cove
Posted: Thu Dec 06, 2012 6:04 pm
by cim
Wildeblood wrote:Rese249er wrote:Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Fixed in r5562.
Re: Scripters cove
Posted: Thu Dec 06, 2012 6:24 pm
by Wildeblood
cim wrote:Wildeblood wrote:Rese249er wrote:Through experimenting with a hud.plist for the next version of HoloNumHUD, I discovered that only one scanner will be drawn at a time.
I've made several HUDs with several scanners. If there is such a restriction, it is new in trunk, not in 1.76.1.
Fixed in r5562.
Well, there ya go. You know, I always thought it was a bit odd that you could include several scanners. It didn't surprise me at all when it was changed (and I knew it had been because I'd read the comment in HeadUpDisplay.m previously). Now it's back. Sometimes I wonder if you guys really have a clear idea of how you intend/anticipate people will use these features. Sometimes I think you're just making it up as you go along.
Re: Scripters cove
Posted: Thu Dec 06, 2012 6:28 pm
by Smivs
Wildeblood wrote:Sometimes I wonder if you guys really have a clear idea of how you intend/anticipate people will use these features.
Hehe, who knows what a bunch of nutters like us will do when given a new
toy feature!
Wildeblood wrote:Sometimes I think you're just making it up as you go along.
I think that's called 'Being innovative'
Re: Scripters cove
Posted: Thu Dec 06, 2012 6:37 pm
by Wildeblood
Smivs wrote:Wildeblood wrote:Sometimes I wonder if you guys really have a clear idea of how you intend/anticipate people will use these features.
Hehe, who knows what a bunch of nutters like us will do when given a new
toy feature!
Except in this case it's not new. (And I've already said how I've used it.)
Smivs wrote:Wildeblood wrote:Sometimes I think you're just making it up as you go along.
I think that's called 'Being innovative'
Are you sure it's not being 'indecisive'? Now a multi-shift galactic hyperdrive,
that would be unambiguously innovative.
Re: Scripters cove
Posted: Thu Dec 06, 2012 7:29 pm
by Smivs
Wildeblood wrote:Now a multi-shift galactic hyperdrive,
that would be unambiguously innovative.
Sounds good...I'd get one!