Steve Jackson Games Forums

Steve Jackson Games Forums (https://forums.sjgames.com/index.php)
-   GURPS (https://forums.sjgames.com/forumdisplay.php?f=13)
-   -   [Space] DIV/0 error in starsystem generation sequence (https://forums.sjgames.com/showthread.php?t=29287)

Agemegos 07-25-2007 08:47 PM

[Space] DIV/0 error in starsystem generation sequence
 
In the the starsystem generation sequence in GURPS Space it is possible for a star system to have an age of 0. Since the unit of measure is billions of years, and the table entries go to one decimal place (with a '5', sometimes, in the second decimal place), this is fair enough. Age = 0 represents systems younger than about 250 million years.

However, in the rules for generating the level of volcanic activity (Step 31, on p.119) you divide surface gravity by age. This can produce a divide-by-zero error.

MIB 1473 07-25-2007 08:58 PM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by Agemegos
G'day

In the the starsystem generation sequence in GURPS Space it is possible for a star system to have an age of 0. Since the unit of measure is billions of years, and the table entries go to one decimal place (with a '5', sometimes, in the second decimal place), this is fair enough. It represents systems younger than about 250 million years.

However, in the rules for generating the level of volcanic activity (Step 31, on p.119) you divide surface gravity by age. This can produce a divide-by-zero error.

Regards,


Brett

Perhaps substituting 0.25 (or 0.125, or a random value between 0 and 0.25) for 0 would solve your problem?

whswhs 07-25-2007 09:24 PM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by Agemegos
In the starsystem generation sequence in GURPS Space it is possible for a star system to have an age of 0. Since the unit of measure is billions of years, and the table entries go to one decimal place (with a '5', sometimes, in the second decimal place), this is fair enough. Age = 0 represents systems younger than about 250 million years.

However, in the rules for generating the level of volcanic activity (Step 31, on p.119) you divide surface gravity by age. This can produce a divide-by-zero error.

Mathematically that's an error, yes. In actual fact, though, those star systems don't have an age of zero; they have an age that rounds down to zero when you divide by 10^8—that is, anything less than 50 million years. The rounding produces problems for the specific case of figuring volcanic activity.

You could assume an arbitrary age of, say, 50 million years (0.05 billion). But I would suggest an even simpler approach. If the modified roll for volcanic activity is 71 or higher, you get extreme vulcanism. Infinity is greater than 71. So just treat it as "increases without limit" and as automatically greater than 71—that is, every world in such a system has extreme vulcanism. Save the dice roll entirely.

Bill Stoddard

David Johnston 07-25-2007 09:28 PM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Is this a problem with a spreadsheet? I don't find it to be a problem in in principle because an age 0 star would presumably not have any planets anyway, just coagulating clouds of dust.

Agemegos 07-25-2007 11:35 PM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by David Johnston
Is this a problem with a spreadsheet?

Not any more. I put in yet another exception trap to handle it. (Exception handling in spreadsheet programming is a lot of fun.)

Agemegos 07-25-2007 11:38 PM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by whswhs
Mathematically that's an error, yes. In actual fact, though, those star systems don't have an age of zero; they have an age that rounds down to zero when you divide by 10^8—that is, anything less than 50 million years. The rounding produces problems for the specific case of figuring volcanic activity.

Just so. There is no fundamental problem that is not easily sidestepped with a bit of understanding and circumspection. It is only when you attempt to apply the rules in a mechanical way that you encounter the problem. As for instance when you are coding the algorithm for a computer to execute.

Quote:

You could assume an arbitrary age of, say, 50 million years (0.05 billion). But I would suggest an even simpler approach. If the modified roll for volcanic activity is 71 or higher, you get extreme vulcanism. Infinity is greater than 71. So just treat it as "increases without limit" and as automatically greater than 71—that is, every world in such a system has extreme vulcanism. Save the dice roll entirely.
Indeed. Programming conventionally that means that before you execute the division statement you test the exception and force a result of at least 71. Programming on a spreadsheet is equivalent, but done slightly differently.

Exception testing before any division is routine for professional programmers. But I didn't think that it was a bad idea not to give the many amateurs who are having a go at this project a 'heads up' about a potential run-time error.

Agemegos 07-25-2007 11:47 PM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by David Johnston
Is this a problem with a spreadsheet? I don't find it to be a problem in in principle because an age 0 star would presumably not have any planets anyway, just coagulating clouds of dust.

As whswhs emphasised, they aren't really age zero. Age has been rounded to the nearest whole multiple of 0.05 billion years. 'Age 0' represents anything up to 25 million years.

Rupert 07-26-2007 05:24 AM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by Agemegos
ot any more. I put in yet another exception trap to handle it. (Exception handling in spreadsheet programming is a lot of fun.)

If your sheets are like mine, they'll end up full of cells that are cluttered with nested IF(.....) statements, none of which make any sense the next morning.

Agemegos 07-26-2007 06:39 AM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by Rupert
If your sheets are like mine, they'll end up full of cells that are cluttered with nested IF(.....) statements, none of which make any sense the next morning.

It goes in waves. Sometimes there are carefully-named columns full of condition flags.

David Johnston 07-26-2007 09:04 AM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by Agemegos
As whswhs emphasised, they aren't really age zero.

Didn't think they were, but I'd still class them as "too young to have planets".

Agemegos 07-26-2007 09:11 AM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by David Johnston
Didn't think they were, but I'd still class them as "too young to have planets".

At 25 million years? The planets might be rather hot, but I think they'd be there.

Flyndaran 07-26-2007 10:12 AM

Re: [Space] DIV/0 error in starsystem generation sequence
 
Quote:

Originally Posted by Agemegos
At 25 million years? The planets might be rather hot, but I think they'd be there.

Sounds more like orbiting goo than planets, but close enough, eh?


All times are GMT -6. The time now is 05:36 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.