New Content - Implemented Spacegate access badge

I'm running into a problem with (at least) some choices in the Spacegate. For instance, at "Space Cave," because I have a geological sample kit equipped, I see an option in the relay browser to "Drill out a core sample [Geology Kit]." I have preference choiceAdventure1236 == 2, which accords with the adventure number and choice number in the page's HTML. But that option's not marked in the relay browser, and if I click the "auto" button, that choice is not executed.

The same thing is true of choice 2 at adventure "Cool Space Rocks," also a core sample option. Am I doing something wrong?
 

VladYvhuce

Member
Sure. But a particular planet with spants or murderbots will be either all combat or all non-combat - and that is procedurally generated from the coordinates; if you find spant soldiers or drones, you will never see Here there be no Spants, or vice versa.

How many of which combat or non-combat a planet has is affected by the RNG. That's a whole different axis of spading.

Personally, I'd like to be able to say "I want hostile exotic plants, hostile exotic animals, peaceful aliens selling X for Y, and Space Pirate Ruin #3", for example.

hostile exotic plants
hostile exotic animals
peaceful aliens
alien ruins

- are all, probably, bit fields.

Space Pirate Choice #3, the trade good and its price are probably modulos of the configuration bits and therefore might not necessarily be possible, given other specified things.

And the hazards are likely not to be bitfields per se. Instead, a particular difficulty will have:

(5 take 1) = 5 environmental hazards
(5 take 2) = 10 possible pairs of environmental hazards
(5 take 3) = 10 possible triples of environmental hazards

depending on planet difficulty, and

0 elemental hazards
(5 take 1) = 5 elemental hazards
(5 take 2) = 10 possible pairs of elemental hazards
(5 take 3) = 10 possible triples of elemental hazards

which are likely modulos of configuration bits. Which is to say, which set of 2 elemental hazards - cold + hot, cold + sleaze, etc. - is determined by a (mod 10) somewhere.

But who knows what, exactly, Jick did. I am confident we will be able to reverse engineer it, eventually.
I think I'm in over my head trying to understand what "bit field" or "modulos" are, but I hope it can be reverse-engineered without too much brain-melting.
 

heeheehee

Developer
Staff member
modulo is the remainder when you divide by N. You can reproduce in ASH via the convenient % operator (e.g. 11 % 3 = 2, since 11 divided by 3 is 3 with remainder 2).

bitfield corresponds to the actual bits in a number's binary representation. It's probably not relevant here, as Veracity mentioned.

Relevance of either of these is speculation for reverse-engineering how TPTB generates world features. I wonder if including a Mersenne Twister implementation (Apache has one publicly available) and simulating what KoL does (after figuring out what that is) would be worthwhile.
 

xKiv

Active member
I wonder if including a Mersenne Twister implementation (Apache has one publicly available) and simulating what KoL does (after figuring out what that is) would be worthwhile.

I suspect what kol does is something along the llines of, 'seed(some_function_of(planet_code)), for each feature_index { feature[feature_index]=rand(feature_max[feature_index]); }', so ... what algorithm is used depends on which version of php is used (remember the time our winged yetis were replaced by differently named winged yetis?).
 

VladYvhuce

Member
modulo is the remainder when you divide by N. You can reproduce in ASH via the convenient % operator (e.g. 11 % 3 = 2, since 11 divided by 3 is 3 with remainder 2).

bitfield corresponds to the actual bits in a number's binary representation. It's probably not relevant here, as Veracity mentioned.

Relevance of either of these is speculation for reverse-engineering how TPTB generates world features. I wonder if including a implementation (Apache has one publicly available) and simulating what KoL does (after figuring out what that is) would be worthwhile.
I think I actually understood most of that. Thanks for dumbing it down for me. Dare I ask what a "Mersenne Twister" is?
 

heeheehee

Developer
Staff member
xKiv: from what we've seen of the code through the Twitch streams, there's a healthy amount of mt_srand(seed) and mt_rand(min, max) throughout their code; I'd be surprised if TPTB have fundamentally changed their approach. I seem to remember that the issue was that they were using the old version of PHP with a buggy implementation, then updated it, hence the yeti name change.

Vlad: Mersenne Twister is an algorithm that implements a PRNG (pseudorandom number generator) -- it's a way of generating numbers that look random while not needing a source of "true randomness" (typically some hardware component that gathers random bits from tiny fluctuations in sensors of temperature, voltage, etc).
 
I'm running into a problem with (at least) some choices in the Spacegate. For instance, at "Space Cave," because I have a geological sample kit equipped, I see an option in the relay browser to "Drill out a core sample [Geology Kit]." I have preference choiceAdventure1236 == 2, which accords with the adventure number and choice number in the page's HTML. But that option's not marked in the relay browser, and if I click the "auto" button, that choice is not executed.

The same thing is true of choice 2 at adventure "Cool Space Rocks," also a core sample option. Am I doing something wrong?

It's working fine for me. If what you posted there is what you actually used to set it, then you set it to '= 2' instead of '2'.

Sorry - I phrased that badly. My preferences were, indeed, set using "set choiceAdventure#### = 2", with only one equals sign, and I could verify they were set correctly, with no apparent typos, with "prefref choiceAdventure####".

Running that same "set" command today fixed the issue. No idea why, especially since re-running it the other day didn't work. Maybe there was an errant space or something saved, that was being stripped in the output of "prefref." I'd also been messing around with my input language the other day, so maybe that had something to do with it. At any rate, thanks for the help, and problem solved.
 

VladYvhuce

Member
Vlad: Mersenne Twister is an algorithm that implements a PRNG (pseudorandom number generator) -- it's a way of generating numbers that look random while not needing a source of "true randomness" (typically some hardware component that gathers random bits from tiny fluctuations in sensors of temperature, voltage, etc).
Ah. That makes more sense than the Wikipedia articles. That kind of math is above my skill level. Especially that one part that looked more like an electrical diagram than a math formula... Still, I think I was able to pick up a little bit of the basic concept. Now I know a few words that I didn't before, and that's progress.

But, I think I'll stick with offering the roll of test subject, if anyone needs someone else to go places and report back with findings. Or if you folks need someone who's not afraid to "waste" adventures in the name of progress. I'm not in a path, ronin, or hardcore at the moment. And IRL, I'm just house-sitting in exchange for internet use. So, I've got lots of free time on my hands this week. If nothing else, I can offer an extra 20 adventures' worth of Spacegate info per day. Just let me know what you want done and how and if it's something I can do, I'm on it. I play KOL mostly just for fun. And if I can actually be useful in the process, that's awesome.
 

Veracity

Developer
Staff member
My post about bit fields was basically about information theory: 7 letters from A-Z has a certain number of bits. Which is to say, the quantity of "information" you can store in it. The number of bits is the log2 of the number of values. Thus, 0-7 (or 1-8, or 156-163) requires log2(8) = 3 bits.

If you have a variety of different values you want to be able to encode, each of which requires a certain number of bits, then you can compare the sum of required bits to the available bits and see if they fit.

Now, that assumes that all of the values are independent: if I have 8 of value A and 10 of value B and 123 of value C, then if you can generate all combinations with equal likelihood, then you need log2( 8 * 10 * 123) bits to hold the "information" for those three values. You can come up schemes to extract those three fields from a smaller number of bits, but only if they "share" some bits, which means that not all combinations of the three variables can be encoded.

I suspect that some of the variables for Spacegate really are independent but some of them overlap. For example, the type of animals and their hostility has 7 values (none, simple, hostile simple, complex, hostile complex, anomalous, hostile anomalous), taking slightly less than 3 bits (although for simplicity, I might encode it with (none, simple, complex, anomalous) - 2 bits and (peaceful, hostile) - 1 bit). I expect that any of those combinations can appear with any comparable combination of plants. I.e., they don't overlap.

But do they store the image # of plants, animals, aliens in separate fields? Or is there a single field which is mod'ed by the number of images for the particular type? Or is there some other way that info is overlapped with other data? Who knows?

I think the best way you can contribute to the spading is to publish your discoveries, either on the G-D thread, or in the spading spreadsheet, and let those who are interested in crunching the data go and crunch it.

It will take lots of data to decide which values really are independent - every combination is possible and is equally likely - and which overlap with which.

As I said, I was theorizing, rather than, really, spading.
 

Geistbar

New member
I'm told, and tested myself, that Mafia seems to have the name of the "Space Baby children's book" as "Space Baby childrens' book" which is causing it to not appear under recent items in the item manager.
 

Veracity

Developer
Staff member
Code:
[25275] Through the Spacegate
Encounter: Time Enough at Last
Took choice 1252/1: Grab a book
choice.php?pwd&whichchoice=1252&option=1
You acquire an item: Space Baby childrens' book
This is from my session log of April 17.

You are telling me that KoL changed the name of the item more recently than that? Looking at the item description, I see that it is so.

Thanks for telling us about the KoL change!
 

Yendor

Member
A new item:
Code:
--------------------
9440	primitive alien necklace	194454961	aliennecklace.gif	accessory	t	0
primitive alien necklace	0	Mys: 10
Item	primitive alien necklace	Experience: +5, Cold Damage: +25, HP Regen Min: 2, HP Regen Max: 4, MP Regen Min: 2, MP Regen Max: 4
--------------------
 

Veracity

Developer
Staff member
Where did that come from? Was it a (rare) drop from the hostile alien?
(Where does the primitive alien loincloth come from? Same thing?)
 
Top