Handling crazy amounts of secret doors (new problem)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by HaunterV »

SpiderFighter wrote:#stuff (is this for the One Room? Lemme know, please, and I'll change my concept, since you're going before me).
It is.
SpiderFighter wrote:It's definitely possible to do this all with plates, counters, and timers, but the most difficult aspect is clutter on the screen. When you have one plate with 25 lines radiating off it to different walls, it becomes extremely difficult to see the wall that you missed connecting to. Moreso, if you are using the same plate to close additional walls. Your best friend, as you've said, is graph paper. I'd recommend picking a direction (clockwise, counterclockwise) and sticking with that as you start connecting things. Regardless of whether you make the connections by hand or by scripting, though, keep your plates 3 squares away from any shifting walls or the player will be able to duck underneath them before they close (that is, two spaces between your plate and the wall).
That tells me i need to go bigger!

That's why I plan to 'assemble' the 'roomlets' in various parts of the map then slide them into position afterwards. So, when creating I'll make the layout of the 1st 'room' in the bigger main room. Then select it all and slide it to the top right corner, repeat for the other configurations - making them, hooking them all up, and then sliding them aside. Then I'll slide the 'roomlets' into place one at a time, stitching them together triggerwise where needed. This is of course tedious and prone to mishaps as there is no undo action in the editor yet so one false click and drag, and it'll all go up in smoke.

I can of course look into the various scripting solutions, while mentally more taxing they seem like they might be a touch more reliable.

Skuggasveinn wrote:
- Earthquake-ish sound, i will find a suitable sound for this as the current earthquake sound lasts forever
you can just redefine the current one with no loop

Code: Select all

defineSound{
       name = "earthquakenoloop",
       filename = "assets/samples/env/earthquake_01.wav",
       loop = false,
       volume = 1,
       minDistance = 1,
       maxDistance = 6,
    }
I saw this in the screenshake thread and really don't like the idea of it cutting off abruptly.... can i make the volume decrease overtime? like some sort of volume = -.01 overtime script?
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by SpiderFighter »

HaunterV wrote:
SpiderFighter wrote:#stuff (is this for the One Room? Lemme know, please, and I'll change my concept, since you're going before me).
It is.
Ah. Bummer. Oh well, it'll be cool to see someone else's take on the concept. And now I have a lot of legwork done for another placement!

HaunterV wrote:That's why I plan to 'assemble' the 'roomlets' in various parts of the map then slide them into position afterwards. So, when creating I'll make the layout of the 1st 'room' in the bigger main room. Then select it all and slide it to the top right corner, repeat for the other configurations - making them, hooking them all up, and then sliding them aside. Then I'll slide the 'roomlets' into place one at a time, stitching them together triggerwise where needed. This is of course tedious and prone to mishaps as there is no undo action in the editor yet so one false click and drag, and it'll all go up in smoke.
Good idea. I'm not sure where you are on the list, but don't forget you can create stairs and start on a fresh map, if you need to. Might make it easier to design.
User avatar
lurker
Posts: 107
Joined: Thu Nov 01, 2012 9:58 pm
Location: Richmond, VA
Contact:

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by lurker »

SpiderFighter wrote:It's definitely possible to do this all with plates, counters, and timers, but the most difficult aspect is clutter on the screen. When you have one plate with 25 lines radiating off it to different walls, it becomes extremely difficult to see the wall that you missed connecting to.
I just completed a level using the timer approach last night and it works well, but as SpiderFighter points out, it is a challenge to keep things straight. I ended up having about a dozen different timers ranging from 7 (which seemed to be about the minimum) to 25. I did a play through last night to see how it would feel and it worked out even better than I thought. You feel that you must keep moving in order to catch the next opening. Or, if you are whacking away at one spider, some doors open and two more join the fray!
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by Komag »

Might be better to have a timer ticking along a tick counter which does different things at different times. Here is an example from the re-creation of the dance dance puzzle:

Code: Select all

danceTick = 0
function danceStep()
  dancePlate:setTriggeredByParty(false)
  if danceTick == 10 then
    danceSpawnerM:activate()
  elseif danceTick == 40 then
    danceSpawnerM:activate()
  elseif danceTick == 60 then
    danceSpawnerL:activate()
  elseif danceTick == 80 then
    danceSpawnerL:activate()
  elseif danceTick == 100 then
    danceSpawnerR:activate()
  elseif danceTick == 105 then
    danceSpawnerM:activate()
  elseif danceTick == 110 then
    danceSpawnerR:activate()
  elseif danceTick == 125 then
    danceSpawnerL:activate()
  elseif danceTick == 140 then
    danceSpawnerL:activate()
  elseif danceTick == 150 then
    danceSpawnerR:activate()
  elseif danceTick == 157 then
    danceSpawnerM:activate()
  elseif danceTick == 164 then
    danceSpawnerL:activate()
  elseif danceTick == 171 then
    danceSpawnerM:activate()
  elseif danceTick == 178 then
    danceSpawnerR:activate()
  elseif danceTick == 185 then
    danceSpawnerM:activate()
  elseif danceTick == 195 then
    danceSpawnerL:activate()
  elseif danceTick == 205 then
    danceSpawnerR:activate()
  elseif danceTick == 215 then
    danceSpawnerL:activate()
  elseif danceTick == 225 then
    danceSpawnerR:activate()
  elseif danceTick == 230 then
    danceSpawnerM:activate()
  elseif danceTick == 235 then
    danceSpawnerL:activate()
  elseif danceTick == 240 then
    danceSpawnerM:activate()
  elseif danceTick == 245 then
    danceSpawnerM:activate()
  elseif danceTick == 250 then
    danceSpawnerR:activate()
  elseif danceTick == 255 then
    danceSpawnerM:activate()
  elseif danceTick == 260 then
    danceSpawnerL:activate()
  elseif danceTick == 269 then
    danceSpawnerR:activate()
  elseif danceTick == 279 then
    danceSpawnerL:activate()
  elseif danceTick == 287 then
    danceSpawnerR:activate()
  elseif danceTick == 292 then
    danceSpawnerM:activate()
  elseif danceTick == 350 then
    danceDoor:open()
    danceTimer:deactivate()
    return
  end
  danceTick = danceTick + 1
end
the single timer nearby is set to 0.1 seconds and just keeps ticking away at the script, causing each spawn at the right time in sequence, etc. You could do anything you want at the different times.
Finished Dungeons - complete mods to play
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by HaunterV »

Komag wrote:Might be better to have a timer ticking along a tick counter which does different things at different times. Here is an example from the re-creation of the dance dance puzzle:
SpoilerShow

Code: Select all

danceTick = 0
function danceStep()
  dancePlate:setTriggeredByParty(false)
  if danceTick == 10 then
    danceSpawnerM:activate()
  elseif danceTick == 40 then
    danceSpawnerM:activate()
  elseif danceTick == 60 then
    danceSpawnerL:activate()
  elseif danceTick == 80 then
    danceSpawnerL:activate()
  elseif danceTick == 100 then
    danceSpawnerR:activate()
  elseif danceTick == 105 then
    danceSpawnerM:activate()
  elseif danceTick == 110 then
    danceSpawnerR:activate()
  elseif danceTick == 125 then
    danceSpawnerL:activate()
  elseif danceTick == 140 then
    danceSpawnerL:activate()
  elseif danceTick == 150 then
    danceSpawnerR:activate()
  elseif danceTick == 157 then
    danceSpawnerM:activate()
  elseif danceTick == 164 then
    danceSpawnerL:activate()
  elseif danceTick == 171 then
    danceSpawnerM:activate()
  elseif danceTick == 178 then
    danceSpawnerR:activate()
  elseif danceTick == 185 then
    danceSpawnerM:activate()
  elseif danceTick == 195 then
    danceSpawnerL:activate()
  elseif danceTick == 205 then
    danceSpawnerR:activate()
  elseif danceTick == 215 then
    danceSpawnerL:activate()
  elseif danceTick == 225 then
    danceSpawnerR:activate()
  elseif danceTick == 230 then
    danceSpawnerM:activate()
  elseif danceTick == 235 then
    danceSpawnerL:activate()
  elseif danceTick == 240 then
    danceSpawnerM:activate()
  elseif danceTick == 245 then
    danceSpawnerM:activate()
  elseif danceTick == 250 then
    danceSpawnerR:activate()
  elseif danceTick == 255 then
    danceSpawnerM:activate()
  elseif danceTick == 260 then
    danceSpawnerL:activate()
  elseif danceTick == 269 then
    danceSpawnerR:activate()
  elseif danceTick == 279 then
    danceSpawnerL:activate()
  elseif danceTick == 287 then
    danceSpawnerR:activate()
  elseif danceTick == 292 then
    danceSpawnerM:activate()
  elseif danceTick == 350 then
    danceDoor:open()
    danceTimer:deactivate()
    return
  end
  danceTick = danceTick + 1
end
the single timer nearby is set to 0.1 seconds and just keeps ticking away at the script, causing each spawn at the right time in sequence, etc. You could do anything you want at the different times.
this does sound like a more intuitive way of handling it as opposed to my previous method. So i would replace spawnerM with sd_rm_cfg_1_ ?
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by Grimwold »

HaunterV wrote:
this does sound like a more intuitive way of handling it as opposed to my previous method. So i would replace spawnerM with sd_rm_cfg_1_ ?
When I posted my example changeConfig() function earlier, I had envisaged using a timer that would activate the function.

I also wanted to re-write the door opening/closing portion to read like:

Code: Select all

for ent in allEntities(level) do
  if ent.id:sub(1,12) == "sd_rm_cfg_1_" then
    ent:open()
  end
so we check every entity in the level and match the first 12 characters of the id to the string "sd_rm_cfg_1_" if they match it's one of our doors for this config, so we open it.




So assuming you named all the doors as you mentioned, my whole example would be

Code: Select all

old_config = 1

function changeConfig()
  local configurations = {"sd_rm_cfg_1_", "sd_rm_cfg_2_", "sd_rm_cfg_3_"}
  repeat new_config = math.random(1,#configurations) until new_config ~= old_config
  for ent in allEntities(party.level) do
    if ent.id:sub(1,12) == configurations[new_config] then
      ent:open()
    elseif ent.id:sub(1,12) == configurations[old_config] then
      ent:close()
    end
  end
  old_config = new_config
end
and you would activate this function with timer of suitable Interval.


note you could even build in to this function a timer_1:setTimerInterval(math.random(x,y))) to randomise the interval slightly every time... maybe between 30 and 60 seconds or something ;)
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by HaunterV »

I've decided on a few things now, I want to;
A) use the timer idea
B) spawn monsters every time the room changes shape
C) have this whole thing continue until a specific monster is killed.

so;

for C) can i put some sort of kill script? or kill entity in the on die part of its definition? as long as i name the script Entity that this thing uses?

or can i mutate that scan level script and when it doesnt find the monster it stops running? or something like that?
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by Grimwold »

HaunterV wrote:for C) can i put some sort of kill script? or kill entity in the on die part of its definition? as long as i name the script Entity that this thing uses?

or can i mutate that scan level script and when it doesnt find the monster it stops running? or something like that?
Yeah, either of these would work.
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by HaunterV »

so i got my 5 configurations and the doors that seal the player in. now to compose the encounter....
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Handling crazy amounts of secret doors(thoughts on the w

Post by HaunterV »

Code: Select all

local configurations = {"sd_rm_cfg_1_", "sd_rm_cfg_2_", "sd_rm_cfg_3_", "sd_rm_cfg_4_", sd_rm_cfg_5_"}
gives me an unfinished string at }

edit nvm i see the spelling error

local configurations = {"sd_rm_cfg_1_", "sd_rm_cfg_2_", "sd_rm_cfg_3_", "sd_rm_cfg_4_", "sd_rm_cfg_5_"}
all better now

now to test it
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
Post Reply