In the game I'm writing, we have a coordinate system (x,y,z, with z representing the planet number). Moving from one coordinate to another is slow, but an advanced ability allows players to "jump" to nearby coordinates (distance <5 or so) where certain criteria are met. (basically a player action needs to be performed on the starting point and the ending point.)

For every one of those special coordinates, there is a list of the surrounding special coordinates. I don't want to directly give out which coordinates a certain "jump" results in, so instead they get a letter identifying each "jump" possible from the current spot.

The idea here is that the coordinate is the randomness telling how to shuffle the coordinates. This way, the jumps from a given coordinate are consistent forever in the future so they could record them and say "oh, to get to (1, 2, 5) from (10, 2, 4) I can jump A, C, G, Y."

The alternative is to generate the list of jumps once and store it. I do not want to do this, since the coordinate lists won't be used too often. The seed is already there in the form of the coordinates. The major problem, though, is the addition of a coordinate to the list of jumps. I would have to update every neighboring coordinate list. Removal would be a similar pain, and I'd need to ensure that the other items aren't disturbed.

There are also other applications that I have in mind, but this is the one that would benefit from this the most.


In reply to Re^2: A reproducible shuffle? ("stable shuffle") by AK108
in thread A reproducible shuffle? ("stable shuffle") by AK108

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.