Page 1 of 1

vxlgen, a labyrinth generator

Posted: Wed Aug 14, 2013 6:42 pm
by ponce
Hi,

I've open-sourced my map generator used for this server http://www.buildandshoot.com/viewtopic.php?f=35&t=5239.

https://github.com/p0nce/vxlgen

Re: vxlgen, a labyrinth generator

Posted: Wed Aug 14, 2013 7:25 pm
by Jdrew
mind posting some pics or a download of one of the maps?

Re: vxlgen, a labyrinth generator

Posted: Wed Aug 14, 2013 10:59 pm
by learn_more
jdrew wrote:
mind posting some pics or a download of one of the maps?
activate your brain and just look at the topic he linked?

Re: vxlgen, a labyrinth generator

Posted: Thu Aug 15, 2013 7:28 am
by ponce
Hi jdrew,
Here is a sample map: https://dl.dropboxusercontent.com/u/541786/sample.vxl
You can find some picture on Github https://github.com/p0nce/vxlgen

Re: vxlgen, a labyrinth generator

Posted: Sun Aug 18, 2013 10:07 am
by thepolm3
I take my hat off to you sir.
well done

Re: vxlgen, a labyrinth generator

Posted: Sun Aug 18, 2013 10:23 am
by ponce
Thanks. It was very fun to do. Now I have a lot more respect for the people who actually master procedural generation like in brogue or Dwarf fortress.

@Thepolm3, for now the server is a sort-of randomized 1ctf + grenade teleport but I would be interested to hear what game mode idea you come up with. Blue_Tongue

Re: vxlgen, a labyrinth generator

Posted: Sun Aug 18, 2013 10:35 am
by thepolm3
Hunted.
each player has only one player he can kill, and only one player that can kill him.
Run away from your hunter and go kill your prey
Been sitting in my mind for a while

Re: vxlgen, a labyrinth generator

Posted: Sun Aug 18, 2013 11:14 am
by ponce
O-O should be scary as hell
A variation would be to keep teams so that regular kills are possible, but only prey-killing making points.
For the labyrinth it would need messages "<prey> is at floor Z, coordinates X, Y, you are at floor Z2, coordinates X2, Y2
(EDIT or perhaps better with directions like north/south/west/east)

Re: vxlgen, a labyrinth generator

Posted: Sun Aug 18, 2013 11:18 am
by thepolm3
:) that would be killer

Re: vxlgen, a labyrinth generator

Posted: Mon Aug 19, 2013 7:33 am
by thepolm3
Code: Select all
def intel_spawn_location(self):
    loop = 0
    while True:
        AREA = 24 
        x = randint(255 - AREA, 255 + AREA)
        y = randint(255 - AREA, 255 + AREA)
        lvl = randint(0, 10)
        z = 3 +  6 * lvl
        z = 63 - z
        loop = loop + 1
        if (loop < 1000): # detect infinite loop (never happened yet)
            if self.map.get_solid(x, y, z):
                continue
            if self.map.get_solid(x+1, y, z):
                continue
            if self.map.get_solid(x, y+1, z):
                continue
            if self.map.get_solid(x+1, y+1, z):
                continue
            if self.map.get_solid(x, y, z-1):
                continue
            if self.map.get_solid(x+1, y, z-1):
                continue
            if self.map.get_solid(x, y+1, z-1):
                continue
            if self.map.get_solid(x+1, y+1, z-1):
                continue

        self.send_chat("The intel spawned " + level_to_floor(lvl) + ".")
        return (x, y, z)
Seems quite redundant.
Why not just have
Code: Select all
def intel_spawn_location(self):
    AREA = 24 
    x = randint(255 - AREA, 255 + AREA)
    y = randint(255 - AREA, 255 + AREA)
    lvl = randint(0, 10)
    z = 3 +  6 * lvl
    z = 63 - z
    self.send_chat("The intel spawned " + level_to_floor(lvl) + ".")
    return (x, y, z)
or even
Code: Select all
def intel_spawn_location(self):
    x,y = randint(231, 279),randint(231, 279)
    lvl = randint(0, 10)
    z = 63 - ( 3 +  6 * lvl )
    self.send_chat("The intel spawned " + level_to_floor(lvl) + ".")
    return (x, y, z)

Re: vxlgen, a labyrinth generator

Posted: Mon Aug 19, 2013 8:02 am
by ponce
It's not pretty but how would you avoid to spawn the intel in a wall then?

Re: vxlgen, a labyrinth generator

Posted: Mon Aug 19, 2013 10:00 am
by thepolm3
Code: Select all
def intel_spawn_location(self):
    x,y = randint(231, 279),randint(231, 279)
    lvl = randint(0, 10)
    z = 63 - ( 3 +  6 * lvl )
    while self.map.get_solid(x,y,z):
        x,y=x+randint(-1,2),y+randint(-1,2)
    self.send_chat("The intel spawned " + level_to_floor(lvl) + ".")
    return (x, y, z)

Re: vxlgen, a labyrinth generator

Posted: Thu Oct 24, 2013 12:54 pm
by Kuma
learn_more compiled it for all of us
https://www.dropbox.com/s/w81l5t28svfzh8o/vxlgen.exe