Tom's Hardware > Forum > Games General > Games General Discussions > generating dungeon material while processing LOS etc.

generating dungeon material while processing LOS etc.

Forum Games General : Games General Discussions - generating dungeon material while processing LOS etc.

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: rec.games.roguelike.development (More info?)

 

Hello,

For lack of a good debugger, my debugging usually consists of
slapping 'debug(<some character> )' throughout offending code to narrow
down on exception-throwers. Working on LOS precomputation stuff i
ended up throwing in quite a few of these at once at various points in
various nested loops. It struck me that the resulting gibberish
printed on the screen (which the knowing observer can use as a kind of
backtrace) actually had structure to it-- a result, no doubt, of the
way the loops were nested, and so on.

It makes me wonder: could one harness this phenomena for the power
of good, and instead of dump gibberish on stdout, put very carefully
tuned gibberish in RAM in this way and use it to very quickly make very
chaotic, yet structured, random dungeons? Of course to throw off
statistically traceable correlations with the source, one could use
static variables in the gibberish-writing function which would
periodically be changed.

Here's a hypothetical example...

void line_of_sight( void )
{
for ( some long loop )
{
gibberish_handler( 0 );
some_los_related_function();
for ( another long loop )
{
gibberish_handler( 1 );
another_los_related_function();
while ( yet another loop )
{
gibberish_handler( 2 );
yet_another_los_function();
}
gibberish_handler( 3 );
}
}
}

void gibberish_handler( int index )
{
static char gibberish[] = "#.<>";
static int counter = 0;

if ( counter-- == 0 )
{
counter += some_random_number();
randomly_rearrange_string( gibberish );
}

my_pending_dungeon[pending_dungeon_head++] = gibberish[index];
}

Of course a lot of testing and fine-tuning would be needed to make it
work in practice. Maybe I'll look into it later myself...

Snis

Sponsored Links
Register or log in to remove.

Archived from groups: rec.games.roguelike.development (More info?)

 

"Snis Pilbor" <snispilbor@yahoo.com> wrote:
> Hello,
>
> For lack of a good debugger, my debugging usually consists of
> slapping 'debug(<some character> )' throughout offending code to
> narrow down on exception-throwers. Working on LOS precomputation
> stuff i ended up throwing in quite a few of these at once at
> various points in various nested loops. It struck me that the
> resulting gibberish printed on the screen (which the knowing
> observer can use as a kind of backtrace) actually had structure to
> it-- a result, no doubt, of the way the loops were nested, and so
> on.
>
> It makes me wonder: could one harness this phenomena for the
> power of good, and instead of dump gibberish on stdout, put very
> carefully tuned gibberish in RAM in this way and use it to very
> quickly make very chaotic, yet structured, random dungeons?

No, you couldn't. At best, you would get a little entropy to use in a
random number generator; but massaging that into usable random numbers
would be more computationally intensive than just running Mersenne
Twister in a low-priority background thread, and much harder to
understand. Besides which, for most dungeon generation algorithms,
using structured data in place of random numbers won't get you a
structured dungeon, it'll get you an infinite loop and a crash, or a
dungeon with only one room, or something worthless like that.

Unless you're shooting for deliberate obfuscation, this is an
unworkable idea.

--
CalcRogue: TI-89, TI-92+, PalmOS, Windows and Linux.
http://calcrogue.jimrandomh.org/

Reply to Anonymous

Archived from groups: rec.games.roguelike.development (More info?)

 

I don't see how this "gibberish" is any different than the output of a poor
random number generator (poor since there are bound to be hidden biases and
correlations).

--
Blog:
Shedletsky's Bits: A Random Walk Through Manifold Space
http://www.stanford.edu/~jjshed/blog
"Snis Pilbor" <snispilbor@yahoo.com> wrote in message
news:1120186122.941276.301490@g49g2000cwa.googlegroups.com...
> Hello,
>
> For lack of a good debugger, my debugging usually consists of
> slapping 'debug(<some character> )' throughout offending code to narrow
> down on exception-throwers. Working on LOS precomputation stuff i
> ended up throwing in quite a few of these at once at various points in
> various nested loops. It struck me that the resulting gibberish
> printed on the screen (which the knowing observer can use as a kind of
> backtrace) actually had structure to it-- a result, no doubt, of the
> way the loops were nested, and so on.
>
> It makes me wonder: could one harness this phenomena for the power
> of good, and instead of dump gibberish on stdout, put very carefully
> tuned gibberish in RAM in this way and use it to very quickly make very
> chaotic, yet structured, random dungeons? Of course to throw off
> statistically traceable correlations with the source, one could use
> static variables in the gibberish-writing function which would
> periodically be changed.
>
> Here's a hypothetical example...
>
> void line_of_sight( void )
> {
> for ( some long loop )
> {
> gibberish_handler( 0 );
> some_los_related_function();
> for ( another long loop )
> {
> gibberish_handler( 1 );
> another_los_related_function();
> while ( yet another loop )
> {
> gibberish_handler( 2 );
> yet_another_los_function();
> }
> gibberish_handler( 3 );
> }
> }
> }
>
> void gibberish_handler( int index )
> {
> static char gibberish[] = "#.<>";
> static int counter = 0;
>
> if ( counter-- == 0 )
> {
> counter += some_random_number();
> randomly_rearrange_string( gibberish );
> }
>
> my_pending_dungeon[pending_dungeon_head++] = gibberish[index];
> }
>
> Of course a lot of testing and fine-tuning would be needed to make it
> work in practice. Maybe I'll look into it later myself...
>
> Snis
>

Reply to Anonymous
Tom's Hardware > Forum > Games General > Games General Discussions > generating dungeon material while processing LOS etc.
Go to:

There are 849 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them