Results 1 to 10 of 28

Thread: cavern generator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

  2. #2

    Wip update, fire and ice

    found a way to improve performance, and i've updated or created all the style routines.
    (although the style routines pretty well wipe out my performance gains)

    Click image for larger version. 

Name:	4c8aff2d0a000066.jpg 
Views:	202 
Size:	187.4 KB 
ID:	29114 Click image for larger version. 

Name:	4c8affd90a000066.jpg 
Views:	176 
Size:	185.6 KB 
ID:	29115
    Last edited by drow; 09-11-2010 at 12:54 AM.
    >>< drow ><<

  3. #3

    Wip getting closer...

    my algorithm for identifying chambers within the caverns mostly works,
    though it's pretty complicated and could probably be improved.

    the second map is a desert caverns scaled for print.
    about 3.5 minutes to generate, the majority of which is creating and dealing with image masks.

    Click image for larger version. 

Name:	4c8decd20a000066.jpg 
Views:	260 
Size:	254.7 KB 
ID:	29206 Click image for larger version. 

Name:	4c8ed07e0a000066.jpg 
Views:	227 
Size:	1.68 MB 
ID:	29228
    Last edited by drow; 09-14-2010 at 05:46 PM.
    >>< drow ><<

  4. #4

    Default final

    i'm down to about 4 seconds for a standard medium size cavern map,
    10 seconds with style, and 2 minutes with style at print scale.

    i think i'm done with optimization, unless anyone knows some deep magic
    for dealing with cellular automata across 9 million cell arrays.
    Last edited by drow; 09-17-2010 at 01:07 AM.
    >>< drow ><<

  5. #5

    Default more final

    my brain won't stop working on this.
    now down to 2 seconds, 5 seconds, and 1 minute.

    a colossal cavern only takes 15 seconds, 26 seconds with style.
    at print resolution should take about 8 minutes, but the process
    consumes all the memory on my machine and grinds to a halt.
    >>< drow ><<

  6. #6

    Default

    I dont know what you are talking about but I like the results ; )

  7. #7

  8. #8
    Guild Journeyer
    Join Date
    May 2008
    Location
    PEI, Canada
    Posts
    213

    Default

    Have you mapped out your memory usage in your algorithm? What exactly are you doing with your system memory? Do you have anyway to cut a map into chunks for fine detail processing and then automatically stitch it back together after the fact?

  9. #9

    Default

    Quote Originally Posted by Talroth View Post
    Have you mapped out your memory usage in your algorithm?
    What exactly are you doing with your system memory?
    that's been this morning's work, aside from a quick trip to ikea.

    the generator is written in perl, so i'm at perl's mercy regarding memory allocation and usage.
    and perl is rather notorious for sacrificing ridiculous piles of memory for performance.

    i've converted the cell map from an array of arrays of integers (lazy)
    to an array of strings, using vec() to manipulate it.

    $map->[$r][$c] # uses a lot of memory
    vec($map->[$r],$c,1) # a lot less memory, and isn't any slower

    much better! a colossal cavern, standard style and print scale, now takes 3.5 minutes to generate,
    and the process consumes just over 500 MB of memory, instead of the 3+ GB it was sucking down before.

    the parchment style is the most computationally expensive, and pushes that to 7.5 minutes.
    the resulting image is an 8051 x 8051 pixel jpeg, 13 MB in size.
    Last edited by drow; 09-19-2010 at 05:24 PM.
    >>< drow ><<

  10. #10

    Default

    Awesome! Love it! I'll be using this a lot!
    Last edited by MadCatUSA; 10-28-2010 at 05:04 AM. Reason: Didn't read page 2!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •