Results 1 to 3 of 3

Thread: help on random map generation

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    on Earth
    Posts
    110

    help on random map generation

    i need to generate a map with randomly placed walls.. and AI monsters are placed inside roaming the map.

    I need to make sure those monsters will not be stuck inside a wall. According to my lecturer, he recommends the use of something called Binary Tree. I understand how to use it but I don't know how to implement it in this game. I need to make sure that no monsters will be blocked by walls.. and the monsters for sure will be able to get out of the map.

    any idea?
    thanx

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I dont know why he's suggested a binary tree.
    That's just another data structure...

    If you're generating the walls, when you create an enclosed space, you could check to make sure that when you're adding a monster, that its not inside that space.

    The easiest way of doing this is if you use the FloodFill API (assuming your walls are touching one another in the enclosed space).
    So floodfill (just like you would in painbrush) the area with a different colour.
    Then when placing a monster, keep picking random co-ordinates until the co-ordinates you pick don't have a background colour of that colour
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

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



Click Here to Expand Forum to Full Width