Page 1 of 1
Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 3:17 am
by HaunterV
Would it be possible to populate the dungeon on the fly? as in use scripting to put in doors, alcoves, monsters, etc... as the player moves throughout the level?
I envision a zelda NES style dungeon except in this case the next room would be populated as you are in the current room solving the puzzle/fighting.
Too much script work?
a potential perk to this is people that load up your dungeon in he editor to see where everything is would be real real confused unless they read every line of code.
Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 5:17 am
by ScroLL
Edit: nvm
Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 7:29 am
by antti
Static assets (alcoves, pits and so on) might not work correctly when spawned on the fly but it should be possible to spawn these randomly in the initialize stage (by inserting script to init.lua).
Doing dungeons that are entirely random should be possible too, at least in theory. I've been waiting for someone to start doing a roguelike-mod for quite a while now.

Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 8:32 am
by Blichew
On a side-note and quasi-related stuff:
Can mapDesc (forgot the exact name) property in Dungeon.lua file can be accessed and changed from lua script ?
You know, so at the beginning i have like:
######
##..##
##..##
#####
and after fulfilling a few conditions (one of them being a check if party wouldn't be standing "outside" the dungeon after the change) it changes to:
######
###..#
###..#
#####
Blichew
Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 12:24 pm
by petri
Unfortunately the dungeon geometry is built only once when the game is started and can't be dynamically changed. Sorry!
Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 12:29 pm
by Neikun
Counter-point!
The use of secret doors as all walls would produce entirely changeable geometry. All you have to do is fill the map with floor.
Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 12:31 pm
by Blichew
:EDIT: @Neikun, that's the general idea, you posted it faster and even answered already, thanks
Ouch...
Ok, another way then - is it possible ?
1. Draw a room
2. onSomething spawn a wall
3. if certain conditions met: destroy that wall
4. will the floor persist beneath the wall ? or do I have to clone the wall object (name should be in asset pack, right ?) and change the replaceFloor property (if there's even such one) ?
Thanks for the reply

Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 12:57 pm
by petri
You don't need to destroy the secret doors, just open/close them when needed.
Re: Draw/populate the dungeon on the fly?
Posted: Thu Sep 27, 2012 1:19 pm
by Neikun
Petri's got the idea.
Re: Draw/populate the dungeon on the fly?
Posted: Sat Sep 29, 2012 4:37 am
by HaunterV
I did concieve of doing an all floor with all secret doors maze then wait for someone to mod an ogre to look like a minotaur and have a thesius vs the minotaur map. Constantly changing maze.