Spacegate

AlbinoRhino

Active member
You are sure one dedicated astronaut! :) There is no way I could have stuck with such an involved project as this like you have. Thanks for the updates.
 

Veracity

Developer
Staff member
My hope was that I could eventually reverse engineer how the planets are generated.

If we assume that the first letter designates difficulty, the remaining six letters allow 26**6 = 308,915,776 different planets at that difficulty. That is 28.2 bits of information.

If I wanted anomalous plants + anomalous animals at difficulty G, how many of those 308 million planets have both? It's not a common combination; the Wiki knows of none, but my database contains 6 examples, out of 2766 known planets. (152 of which are unvisited by me, yet, and hence unverified). That is .21%, so I'd expect to find more than 670,000 such planets at G difficulty. How many of those have no other life? How can I generate (a set of) coordinates to select such a planet?

Reverse Engineering is a daunting prospect, so I am continuing to collect data until I feel like trying some strategies.

I note that taltimir has, apparently, discovered a correlation between which hostile alien trophy is generated by hostile aliences with particular images (sgalienbX.gif):

spear: 1, 2
blowgun: 3,4
loincloth: 5,6
totem: 7,8
necklace: 9,10

So, that is two planet attributes which draw from the same part of the bitspace. There are only a handful of planets that have been publicly shared that contain trophies. Considering that we know planets for all 5 trophies, there is no competitive advantage to NOT sharing such coordinates, but I suspect that most people are not obsessing on Spacegate like I am. The fact that built in support for it into VMF probably accounts for some of those. :)

Reverse engineering will consist of saying "76 of the 2767 validated planets (and 5 of the 152 unvalidated planets) contain anomalous animals. What do all of those coordinates have in common?" Not sure how to do that, yet. If I generate a code from 0 to 26**6-1 (or 26**7-1), perhaps they are all divisible by XXXX? Or perhaps they all have bits X,Y,Z set?

> ashq print( 26 ** 7 )

8031810176
ASH has no problem handling numbers as small as 8 billion. Depending on the complexity of the algorithms, I wouldn't even need to code my experiments in Java - although I could certainly build in ASH Runtime support for prime factorization, if that would be useful. :)
 

Veracity

Developer
Staff member
Revision 293 includes planet data for all remaining planets from the public spreadsheet (and new RANDOM planets).
My five characters have now personally visited 2956 planets.

Gonna be all RANDOM, all the time, from now on.
 

Magus_Prime

Well-known member
In 2021 I was able to get all of the primitive alien trophies, except the blowgun, courtesy of this script. Thank you!
One more to go. :)
 
Last edited:

Veracity

Developer
Staff member
Sweet!

Did you specifically farm planets that were known to have the trophies?
I found them via visiting random planets, because I was trying to augment the database, but I was patient. :)

(Time to release an updated database; I've been exploring RANDOM every day with 4 multis - and with my main, when in aftercore.)
(Revision 301 has that.)
 

Magus_Prime

Well-known member
I have it set to try planets known to have trophies. Once I get the last one I'll set it to random. How close are you to your goal of completely exploring the possible range of planets?
 

Veracity

Developer
Staff member
Completely exploring? Ha ha ha!

Coordinates consist of 7 letters (A-Z). That means there are (26 ** 7) = 8,031,810,176 different planets.
I have visited 4,339 planets so far.

My original goal was to collect a sufficiently large sample that I could, perhaps, reverse engineer from coordinates into planet features, and then, from desired set of planet features into a set of coordinates that contain them. How many planets have both exotic animals and exotic plants, for example?

> ash (26 * 26 * 26 * 26 * 26 * 26 * 26)

Returned: 8031810176

> vsg count exotic animals, exotic plants

Considering 4339 planets.
After filtering on 'anomalous animals', 109 left.
After filtering on 'anomalous plants', 12 left.

> ash (8031810176 * ( 12.0 / 4339.0 ))

Returned: 22212888.24890528

> ash (1200.0 / 4339)

Returned: 0.27656141968195436

There are 8 billion planets. If 0.27% of the ones I have visited have both exotic animals and plants, that indicates there should be more than 22 million of them out there.

Considering that 8031810176 fits within an ASH int, I could certainly iterate over the set of known planets and do bit-wise operations looking for clues. For example, "all planets with hostile aliens have bits 1 and 13 set, and all with image sgalienb10.gif have bis 2 and 19 set".

I have no idea if it would be that simple.
 

Veracity

Developer
Staff member
Today I migrated this from sourceforge using SVN to github using GIT.
Future updates will be pushed only to the latter.

I suggest you delete the SVN version (make sure you have KoLmafia r27304!) and then install it via GIT:

Code:
git checkout Veracity0/spacegate
 
Thank you , Veracity! This is one of the many things that interest me that I have done nearly nothing with, so I'm grateful for all that you've done on this.

And a billion other things. One billion thanks. <3
 

Veracity

Developer
Staff member
I just pushed the 1131 new planets (and 4 new trophies) I have spaded since I last published my planet data.
Total is now 7493 planets and 25 trophies.
Revision 2.
 

fronobulax

Developer
Staff member
I get beaten up or reduced to 0 hp too often running VSG with a level 190+ character. Some of that was my special combat handling for Spant soldier misspelled "soldier" but I still have an issue with rocks. My first impression is that my recovery options are not kicking in. I should always have at least 20K HP at the start of an adventure and as far as I know the rocks will never extract more than 10K. Is there a misunderstanding on my part or operator error or special restoration handling in VSG or a possible bug in recognizing Wide Open Spaces as a restoration trigger or what?

Thank you.
 

Veracity

Developer
Staff member
Well... if the planet has combats, before each adventure, it will restore all HP.
If it has no combats, it will restore 1 HP.

My thinking was, that will allow you to adventure, even if beaten up, although you may get beaten up again immediately.

But you don't NEED full HP unless you are (possibly) going to fight.

Is it important to you to spend resources (per your restoration instructions) to heal up to 20K HP every round when you will not be getting into a fight? Seems like that is using resources - if only MP - unnecessarily.

(Perhaps if you ARE beaten up and want to restore full HP, it should uneffect Beaten Up, regardless of your settings.)

I notice that it does not restore HP after all turns have been run, which could leave you beaten up when the script exits.
Nor does it restore your outfit.

Those things could/should go in the "finally" clause of visit_spacegate(), to leave you in your initial condition.
 

fronobulax

Developer
Staff member
Well... if the planet has combats, before each adventure, it will restore all HP.
If it has no combats, it will restore 1 HP.

My thinking was, that will allow you to adventure, even if beaten up, although you may get beaten up again immediately.

But you don't NEED full HP unless you are (possibly) going to fight.

Is it important to you to spend resources (per your restoration instructions) to heal up to 20K HP every round when you will not be getting into a fight? Seems like that is using resources - if only MP - unnecessarily.

(Perhaps if you ARE beaten up and want to restore full HP, it should uneffect Beaten Up, regardless of your settings.)

I notice that it does not restore HP after all turns have been run, which could leave you beaten up when the script exits.
Nor does it restore your outfit.

Those things could/should go in the "finally" clause of visit_spacegate(), to leave you in your initial condition.
What I am trying to avoid is the automation abort.

[2024358] Through the Spacegate
Encounter: Wide Open Spaces
Took choice 1256/2: acquire some more alien rock samples (with geology kit)
choice.php?whichchoice=1256&option=2&pwd
You acquire alien rock sample (6)
You lose 5,270 hit points

cast 1 Manicotti Meditation
You acquire an effect: Pasta Oneness (5)
> Recommended Combat Rate: +0 (now: 0)
> Recommended Initiative: +0 (now: 30)
> Recommended Item Drop: +0 (now: 192)
> Recommended Monster Level: +2,948 (now: 10)
Stack trace:

at do_adventure (VeracitySpacegate.ash:2883)
at visit_spacegate (VeracitySpacegate.ash:3028)
at main (VeracitySpacegate.ash:3197)

After the exit the character has 0 HP.

Perhaps I don't understand what caused the loss of 5270 hp?

Is it important to you to spend resources (per your restoration instructions) to heal up to 20K HP every round when you will not be getting into a fight? Seems like that is using resources - if only MP - unnecessarily.

This confuses me and perhaps I misspoke. My restore settings should only trigger if I have less than 10K hp. If they do trigger I should end up with 20K hp. So I should not spend resources every round unless something damages me for 10K every round.

There were 10 spacegate turns left when the above happened.

Tangentially my_maxhp() is not necessarily an efficient target for a never ascended character adventuring in a zone with non-scaling monsters. I usually run with restore up to 15% when hp is at 10% or lower.

Thank you.
 

Veracity

Developer
Staff member
What I am trying to avoid is the automation abort.
You showed a stack trace with the top frame "at do_adventure (VeracitySpacegate.ash:2883)"
That line has between_battle_checks();
That tells me that VSG is doing between battle checks.

That function does not abort. It does the following:

Code:
    void between_battle_checks()
    {
    // Keep in a good mood
    mood_execute( -1 );

    // Only restore one HP if there are no combats
    int hp_desired = combats ? my_maxhp() : 1;
    if ( my_hp() < hp_desired ) {
        restore_hp( hp_desired );
    }

    // Restore mp per your settings
    restore_mp( 0 );
    }

Actually, there is a blank in front of the stack trace - which is presumably the runtime library function and lower level calls.

mood_execute() will call YOUR betweenBattleScript. I assume that is what printed:

Code:
cast 1 Manicotti Meditation
You acquire an effect: Pasta Oneness (5)
> Recommended Combat Rate: +0 (now: 0)
> Recommended Initiative: +0 (now: 30)
> Recommended Item Drop: +0 (now: 192)
> Recommended Monster Level: +2,948 (now: 10)

Because nothing in KoLmafia - or VSG - prints anything like that.

After the exit the character has 0 HP.

Yes. Your script aborted and VSG did not get a chance to call restore_hp()

Perhaps I don't understand what caused the loss of 5270 hp?

You were on a high difficulty planet - the coordinates start with a late-in-alphabet letter - and environmental factors damaged you.

This confuses me and perhaps I misspoke. My restore settings should only trigger if I have less than 10K hp. If they do trigger I should end up with 20K hp. So I should not spend resources every round unless something damages me for 10K every round.

Your between battle script aborted before your restore settings kicked in.

There were 10 spacegate turns left when the above happened.

Yes. Your between battle script aborted.

Tangentially my_maxhp() is not necessarily an efficient target for a never ascended character adventuring in a zone with non-scaling monsters. I usually run with restore up to 15% when hp is at 10% or lower.

The monsters do scale - by planet difficulty. Just not per your stats.
 

fronobulax

Developer
Staff member
Thank you. I have much to ponder. There is something "wrong" when the same combination of scripts can maintain HP when damage is caused by monsters but not when it is caused by the environment but what may be wrong is my expectation. It is certainly clear that VSG was not in direct control when automation stopped. I also need to look at my settings since I don't quite understand how a planet with only rocks fits into my intended hope of gathering things for my DC. But I have a lot of questions I can answer/investigate so thank you.
 
Top