startingCredits

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

the startingCredits piece of code befuddles me.
for example I might have 100d100+10 and it might have -20000 credits
another time I might have 10d100+1000 and it might have 10000 credits.
:?:
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

It is an odd one. I gave it a try to put in larger dice amounts too, and found it equally baffling. Seems to be a limit imposed in there some way.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

those values shouldn't hit any limits
100d100+10 is 110-10010 credits
10d100+1000 is 1010-2000 credits
no where near near the limits or even what the values he gave us.

it sounds like a different issue.
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

I just ran into the same problem. Currently the dice have limits:

x d y + z

x goes from 0 to 255
y goes from 0 to 255
z goes from -32768 to 32767

In the next version I've fixed it so that all values are 32-bit integers (limit around +/- 2 billion)

[In my case, I was trying to generate a number from 30-330. Unfortunately, that gets converted to:

1d301+29

which clearly exceeds the limits.]
User avatar
Sheltem
Militia Lieutenant
Militia Lieutenant
Posts: 153
Joined: Tue Sep 04, 2007 1:44 pm

I also experienced an overflow effect by getting to much damage from a certain source. The damaged was greater than 32767 so shields and armor got a bonus (but the shield was reloaded to normal)

just4info
regards
Sheltem

What do you think about the endless stream of spawns ?

What about modding wandering spawns which dont attack the player directly ?
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

How would the highest currently available be coded?
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

255d255+32767
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

That is supposedly invalid.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I just ran into the same problem. Currently the dice have limits:

x d y + z

x goes from 0 to 255
y goes from 0 to 255
z goes from -32768 to 32767
Perhaps the starting credits aren't working as defined?

Or.... perhaps....
HaHa! Sapphire-class yatch ship class: invalid starting credits
LoL!!

ok...

Code: Select all

			startingCredits=	"254d254+32766"
HaHa! Sapphire-class yatch ship class: invalid starting credits


:shock:

Code: Select all

		startingCredits=	"250d250+32000"
In Game Actual starting credits=> 32000 credits.

Code: Select all

			startingCredits=	"200d200+30000"
In Game Actual starting credits=> 30000 credits.
:?: Ignores the dice? Bug or interesting fact?

Code: Select all

			startingCredits=	"255d255"
In Game Actual starting credits=>
HaHa! Sapphire-class yatch ship class: invalid starting credits
AH, yes.. which makes me wonder-

Code: Select all

			startingCredits=	"0d0+0"
In Game =>
HaHa! Sapphire-class yatch ship class: invalid starting credits
Ok, maybe any something other than:
x d y + z

x goes from 0 to 255
y goes from 0 to 255
z goes from -32768 to 32767
I mean, right? George, what I read is that 0d0+0 is valid, and can obviously generate 0.*


Thankfully 1d1+1 equaled 2 nine out of nine times!

ok, so what's up with this upper range behavior? Care to demonstrate the steps in the program? You could even write it out as a haiku or graphically demonstrate it with blobjects, if you like.

Because I know for a fact that 200 rolls of a 200 sided dice plus thirty thousand will never equal thirty thousand. So, something else is being done than x = 0 to 255, y = 0 to 255, z = a bunch of numbers.

At least, as far as startingCredits are concerned. :P

Code: Select all

			startingCredits=	"100d100+32767"
In Game => 37463

Whoa! We Have A Winner!

Code: Select all

			startingCredits=	"254d254"
IN Game credits 0 ten of ten times.

Code: Select all

			startingCredits=	"253d254"
In Game 0 credits ten of ten times.

Code: Select all

			startingCredits=	"1d255"
HaHa! Sapphire-class yatch ship class: invalid starting credits

Code: Select all

			startingCredits=	"250d250"
In Game 0 credits ten of ten times.

Code: Select all

			startingCredits=	"1d250+1"
WHAT?! [ 6, 6, 2, 2, 8, 8, 5, 2, 4, 4] =credits per test for 10 tests.

So, hmm.. how many tests must I make to reach the center of the tootsie roll?

*0 dice with zero sides plus zero equals zero, yes? And, you know, be realistic, ZERO starting credits is a perfectly reasonable place to start out an adventure! Even minus (far beyond your limits there) in the schools I have RPed in. But certainly zero if nothing else. I mean, picture it- the young spawn from an industrial family, left only with their personal yatch after squandering their inheritance and then at the end deciding to follow the oddly persistant call to go forth and seek the galatic core, why not a final spastic adventure to make or break the young untested neo-terran scion from a technocratic expansionistic corporate clan. Credits? not anymore, this poor young spawnling has nothing left but their wits and a laser cannon to suffice.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

OK...I'm definitely wrong. The numbers are signed, not unsigned, so how about this:

x goes from 0 to 127
y goes from 0 to 127
z goes from -32768 to 32767

In your last test (1d250+1) the 250 is interpreted as -6 (because in 8-bit numbers, 0xFA is -6).

The code calls the random function to pick a random number between 1 and negative 6. The random function is not expecting a negative number and returns a random number from 1 to 8. (Because the code inside the random function computes a range between the two numbers and turns it into an absolute value).

Then we add the +1 bonus to that and we get a random number from 2 to 9 (which is what you are seeing).

Again, this will be better in the next version.

[Edit: Also, if the number of dice goes negative, then the code doesn't roll anything (other than the bonus). That's why 200d200+30000 is always 30000.

p.s.: I don't know why 0d0+0 didn't work. It seems to work fine for me.

p.p.s: Thanks for testing this out.]
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Thanks for explaining some of the goings-ons. :D
Post Reply