random map generator

Discussion in 'Mapping Questions & Discussion' started by adamspurgin, Apr 20, 2010.

  1. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    i saw a thread somewhere on the site and it inspired me to get this started up: a random map generator.


    i decided to make mine a little less random though. the one posted here just put blocks of random size across the map, whereas the program i'm working on is a bit smarter. i'm going to continue working on the decision making code until it actually produces decent maps.

    this is what i have as of now:
    [​IMG]


    i can control the size of the map, the size of each block, both vertically and horizontally. i can also control how many blocks appear on the map (by %).


    i plan to fix up the textures quite a bit, as well as incorporating a pathfinding algorithm and maybe adding support for a second floor, complete with ramps. if you guys want to help out at all, let me know, my own programming experience is lacking somewhat.
     
    Last edited: Apr 20, 2010
  2. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    Not to dishearten you... but all these random map generators are at the moment are just block producers, I mean, there really needs to be something more substantial before it becomes interesting. Hopefully you can get the actual layout thing working soon enough :rolleyes:
     
  3. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    i'm planning on doing a lot to it.

    by the end it should make semi-coherent maps, complete with control points and a world that is generated based on gameplay entities. i've got in mind some weighting algorithms that should get some interesting results.

    do i expect it to create great, or even decent maps? no. but maybe some barely playable ones.
     
  4. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,557
    This is atleast the third/forth random map generator we've seen here.

    Not that it's not an interesting concept, but... it's been done before, and several times.

    edit: if you can control the size of each block, horizontally and vertically, doesn't that make this not random?
     
    Last edited: Apr 20, 2010
  5. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    ok, that was poor wording bred from sleep deprivation. i'll be back to clarify that particular topic once i get some sleep, like 28 hours from now.
     
    Last edited: Apr 20, 2010
  6. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,739
    As long as you move into modular pieces from prefab .vmf files sooner than the other guys making random map generators you'll be onto a winner. Don't waste time dicking about making random shape and sized blocks, that's been done before and isn't in the slightest bit interesting.

    Displacements and proper buildings (even if they're made of pre-made modular bits) are what will make your generator better than the previous ones. get on it!
     
    Last edited: Apr 20, 2010
  7. Dr. ROCKZO

    Dr. ROCKZO L8: Fancy Shmancy Member

    Messages:
    580
    Positive Ratings:
    159
    I'd be impressed with something that could create a building out of 4 parts when given 8, or at least interested. Keep it up!
     
  8. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    i know exactly how i could get displacements to work, the hard part(at the moment) would be recalculating the normals, i have no idea which formula to use. what i calculate to be the normal and what shows up in a .vmf file after manipulating a displacement by hand don't match up. it should be something like (.9 .55 1) but it's (0 0 -1). i could implement displacements in no time at all, but they would look crappy because the lighting would be off.

    what i have now is basically a wall generator, not even a very good one as the walls just snake back on themselves over and over again. i still have plans for terrain and details, i just need to work out how they'll all fit together. i'm having the hardest time figuring out how to handle indoor spaces though. i don't know whether to just plop a "make_building(x1,y1,x2,y2)" function in there or to make a function to search for high walls with space between them and put a roof over it. the first would be much easier, but the second would produce much more interesting results.

    ps: i appreciate the ideas you all are throwing at me. even if i threw away an idea thinking it would be beyond me, someone bringing it back up gets me thinking on it more, and the more i think about it the more it seems possible. i think i might be able to fit a few things in here that i didn't think i could do.
     
    Last edited: Apr 20, 2010
  9. Tapp

    Tapp L10: Glamorous Member

    Messages:
    776
    Positive Ratings:
    211
    Focus on forming inspirational building shapes, rather than functionality and danger. The best use of a random map generator is mapping block.
     
  10. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    [​IMG]


    randomly generated placement and height weight maps so far.

    working on a simple pathfinding algorithm that doesn't take forever to ensure some path to the objectives/spawns. also working on implementing hollow buildings/structures


    now compatible with CP, CTF, KOTH, working on payload.

    i know what some of you want, but i don't don't feel i could live up to your expectations of a blocking program. generating genuinely original maps would require many more years education for me, i'm only a first year computer science major. besides, I don't feel that a computer program made by one student could ever compare to an intelligently designed map layout.
     
    Last edited: Apr 24, 2010
  11. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    I think what they're saying, is that you could give the illusion of a mapper created layout much more easily by having a huge set of pre-built structures, and link them together to make the map. The wholly random idea is admirable though.
     
  12. adamspurgin

    adamspurgin L1: Registered

    Messages:
    42
    Positive Ratings:
    1
    oh i'll definitely have some prebuilt structures on hand, i'll try to make it modular so the files could be read in from other files so i don't have a massive lump of code dedicated to building prefabs.