test content
What is the Arc Client?
Install Arc

Foundry Trick: Random Generator

zovyazovya Member, Neverwinter Beta Users, Neverwinter Hero Users, Neverwinter Guardian Users, Neverwinter Knight of the Feywild Users Posts: 0 Arc User
edited June 2013 in The Foundry
As with everything, there is more than one way to do something. Here's my trick to get random choices implemented in a quest.

Say I have a quest and I want one of three bosses to spawn at the end. I want it to be randomly different for each play, well as randomly as I can be bothered to craft.

Just like the trigger timer, I have guards fighting mobs in an adjacent hidden room that the player cannot get to. I have the hard guards spawn equidistantly between 3 easy mob encounters in little stalls. I have the walls spawn first, then the guards and mobs, that way the engine doesn't artificially assign an unfair advantage to the first mob to spawn. Then I have ONE wall, and one wall only, despawn to trigger the random generator (again, to remove any priority the game engine might introduce). The fight is on.

It's important to use ranged mobs and guards (that don't use DOTs) so that everyone stays in place. When one mob encounter is defeated, spawns the appropriate boss in the boss room, it will also drop a wall in front of the other 2. That way you don't have all three bosses spawn. There are very rare cases where 2 encounters could die before the wall drops in front of them, therefore spawning 2 bosses. Prepare for this problem by having the bosses spawn in different locations in the room so the player doesn't have to fight 2 boss encounters at once.
Post edited by zovya on

Comments

  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    I'm trying to think of a way to do this without the possibility of multiples.

    btw, I used your mob timer in my first foundry quest. Works pretty well.
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • mosby1mosby1 Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 288 Bounty Hunter
    edited June 2013
    Specifically which mobs and guards do you use? I'm having some issues with my timer (it works great when I'm in the Foundry watching it, but not when I'm out of the timer room). Thanks.
    DM's Studio - NW-DHZ5DAV4R
    The Cursed Emerald:
    1. Weird of the Weather-witch -- NW-DEZAK4QPA
    2. The Ambitious Apprentice -- NW-DLRAVW4S4
  • zovyazovya Member, Neverwinter Beta Users, Neverwinter Hero Users, Neverwinter Guardian Users, Neverwinter Knight of the Feywild Users Posts: 0 Arc User
    edited June 2013
    The mobs and guards have to be in close proximity to the player. Too far away and they either don't spawn, or stop fighting.
  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    Okay, I think I got it.

    I managed to get multiples to spawn when using this method on zombies, but haven't been able to get multiples when using melee drow. I think the zombies, with their low hit points, got killed simultaneously by the guards. There's gotta be a race condition, but it's a pretty small chance.

    Using an example of 3 bosses, and some boolean logic...

    Stack 3 easy melee single drow on each other in a secret room, named with numbers to make it easy to find, for a total of 3 groups, Z1, Z2, Z3.

    Now, set each drow group to appear on the same trigger, and disappear when other groups die.
    Z1: Disappear when components complete: Z2 and Z3
    Z2: Disappear when components complete: Z1 and Z3
    Z3: Disappear when components complete: Z1 and Z2

    Spatter some heavy melee guards around in the secret room.

    Bosses depend not on their zombie group getting killed, but the OTHER zombie groups getting killed.
    Boss 1: Appear when components complete: Z2 and Z3 (causes Z1 to disappear, too, preventing other bosses from spawning)
    Boss 2: Appear when components complete: Z1 and Z3
    Boss 3: Appear when components complete: Z1 and Z2

    The only thing you have to worry about are aoe attacks, but that's not an issue with melee guards as far as I know. Apparently, you have to worry about a mid-swing attack while disappearing, if that swing will kill you.

    The failure mode is interesting, though... If it fails (and I've only gotten it to do that once over many tests), it spawns all 3 bosses! :)
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    Bah, nope, I'm still getting failures now and then. Probably 5-10% of the time. I've run it a bunch, and seen it once.
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • zovyazovya Member, Neverwinter Beta Users, Neverwinter Hero Users, Neverwinter Guardian Users, Neverwinter Knight of the Feywild Users Posts: 0 Arc User
    edited June 2013
    vuelhering wrote: »
    Okay, I think I got it.

    I managed to get multiples to spawn when using this method on zombies, but haven't been able to get multiples when using melee drow. I think the zombies, with their low hit points, got killed simultaneously by the guards. There's gotta be a race condition, but it's a pretty small chance.

    Using an example of 3 bosses, and some boolean logic...

    Stack 3 easy melee single drow on each other in a secret room, named with numbers to make it easy to find, for a total of 3 groups, Z1, Z2, Z3.

    Now, set each drow group to appear on the same trigger, and disappear when other groups die.
    Z1: Disappear when components complete: Z2 and Z3
    Z2: Disappear when components complete: Z1 and Z3
    Z3: Disappear when components complete: Z1 and Z2

    Spatter some heavy melee guards around in the secret room.

    Bosses depend not on their zombie group getting killed, but the OTHER zombie groups getting killed.
    Boss 1: Appear when components complete: Z2 and Z3 (causes Z1 to disappear, too, preventing other bosses from spawning)
    Boss 2: Appear when components complete: Z1 and Z3
    Boss 3: Appear when components complete: Z1 and Z2

    The only thing you have to worry about are aoe attacks, but that's not an issue with melee guards as far as I know. Apparently, you have to worry about a mid-swing attack while disappearing, if that swing will kill you.

    The failure mode is interesting, though... If it fails (and I've only gotten it to do that once over many tests), it spawns all 3 bosses! :)

    That's an interesting alternative. I was going to say, that even my way, it is VERY rare that it fails.
  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    I've run about 50 tests. It looks like there are lag issues, or else things are happening internally that I can't see. But generally, if two guards kill the last 2 critters at the same time, it spawns all 3. I was thinking the despawn would be faster than, say, and arrow flying through the room.

    The real way to do this is to have only a single guard attacking. That would prevent that one guard from hitting anyone else during the swing. But that's not possible, so I'm still trying to come up with something.

    The thing I'm trying to figure out now is to just have a tie-breaker. If B1 is spawned, B2 can't spawn.
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • angryspriteangrysprite Member Posts: 4,982 Arc User
    edited June 2013
    Why not "minion" strength guards versus one HULK or other super strong melee beastie? Why does it have to depend on guards winning? Just make it depend on the HULK winning the fight against the weakling guards.
    This way the Z1, Z2, Z3 routine (in either implementation) should work relatively well with absolutely minimum failures, but in that case, build in an error checker: if all three bosses appear, spawn a fourth, the three disappear on the appearacne of the fourth... or sumfin.

    Just thinkin' out loud.

    //Smoke and mirrors!
  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    Using 3 soldiers (standard, 2 brutes) and 3 drow (easy, 1 assassin), I haven't gotten it to fail. It's possible, but the brutes take a while to kill, which seems to give it time for the race condition to work itself out.

    That's a good idea, Angrysprite... testing that.
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • izatarizatar Member, NW M9 Playtest Posts: 1,161 Arc User
    edited June 2013
    The DM's Studio (NW-DHZ5DAV4R) has an example of an easy way to do random.
  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    Okay, a foulspawn melee Diff 3 has a single attack, and he can kill an easy guard archer in one shot.

    If you put all the archers in melee range, it's pretty random which group he kills last, and there's no chance of spawning multiples. You have to use the method I wrote above (last group spawns, instead of first group).

    It takes about 30 seconds, though, so you should program this decision before it's needed.
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • casten24casten24 Member Posts: 121 Bounty Hunter
    edited June 2013
    zovya wrote: »
    As with everything, there is more than one way to do something. Here's my trick to get random choices implemented in a quest.

    Say I have a quest and I want one of three bosses to spawn at the end. I want it to be randomly different for each play, well as randomly as I can be bothered to craft.

    Just like the trigger timer, I have guards fighting mobs in an adjacent hidden room that the player cannot get to. I have the hard guards spawn equidistantly between 3 easy mob encounters in little stalls. I have the walls spawn first, then the guards and mobs, that way the engine doesn't artificially assign an unfair advantage to the first mob to spawn. Then I have ONE wall, and one wall only, despawn to trigger the random generator (again, to remove any priority the game engine might introduce). The fight is on.

    It's important to use ranged mobs and guards (that don't use DOTs) so that everyone stays in place. When one mob encounter is defeated, spawns the appropriate boss in the boss room, it will also drop a wall in front of the other 2. That way you don't have all three bosses spawn. There are very rare cases where 2 encounters could die before the wall drops in front of them, therefore spawning 2 bosses. Prepare for this problem by having the bosses spawn in different locations in the room so the player doesn't have to fight 2 boss encounters at once.

    I'd suggest having the guards patrol between a spot where they can't be targeted and a spot where they can... have the ranged mobs all on the same area.

    ______________
    |....................|
    |..<
    >...|
    |......... ______|
    |TTTTT|
    |....x....|
    |______|

    Something similar to this set up... The x is the ranged mob spawn point, the Ts are the barrier to keep the melee guards from getting to the ranged mobs (it's also where you place the invisible wall) and the arrows are the guard's patrol points. Start the guards equidistant from each other and have them patrol that route. Have the disappearance of the invisible wall trigger upon the players reaching a particular Place Marker to essentially randomize the time that the mobs start attacking. Place two or three ranged mobs in the protective area and, if all works correctly, they'll group target the closest and second closest first, meaning you'll always have at least one mob that is relatively untouched. And just have disappear according to which mobs died. I.E. Guard 1 dies, Boss 1 disappears, Guard 2 dies, Boss 2 disappears. Other than that, set up the mobs of the random generator to despawn if they're the last one alive. i.e. If guards 1 and 2 die, guard 3 will despawn.

    lol. I hope I made this clear enough.
    The Portrait Gray Campaign
    Prologue: Fort Neverember
    NW-DL2RVQ54C
    Chapter 1: The Gray Portrait
    NW-DHGEFBMGD
  • zahinderzahinder Member Posts: 897 Arc User
    edited June 2013
    Keep in mind that you don't have to use all your guards -- you can put some guards in a different room, so that only one faster (or whatever) remains in the main room.
    Campaign: The Fenwick Cycle NWS-DKR9GB7KH

    Wicks and Things: NW-DI4FMZRR4 : The Fenwick merchant family has lost a caravan! Can you help?

    Beggar's Hollow: NW-DR6YG4J2L : Someone, or something, has stolen away many of the Fenwicks' children! Can you find out what happened to them?

    Into the Fen Wood: NW-DL89DRG7B : Enter the heart of the forest. Can you discover the secret of the Fen Wood?
  • vuelheringvuelhering Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 0 Arc User
    edited June 2013
    casten24 wrote: »

    ______________
    |....................|
    |..<
    >...|
    |......... ______|
    |TTTTT|
    |....x....|
    |______|

    Last edited by casten24; Yesterday at 04:30 PM. Reason: The ascii map didn't come out how I expected, so I went to old "rogue" route and added periods to better separate the walls.

    Holy HAMSTER, I was just going to say that it looked like the old rogue 4.1.

    I've been kicking around the idea of an old-timer's rogue quest for the amulet of yendor :)
    Knights who say Ni!
    Foundry name: Vuelherring (with an extra 'R', matey)

    "Bring out yer Dead" NW-DAI945C2G #humor #story #solo
  • zovyazovya Member, Neverwinter Beta Users, Neverwinter Hero Users, Neverwinter Guardian Users, Neverwinter Knight of the Feywild Users Posts: 0 Arc User
    edited June 2013
    izatar wrote: »
    The DM's Studio (NW-DHZ5DAV4R) has an example of an easy way to do random.

    I checked that out. Really great tool. That is a flip coin though, so just 2 choices. I was hoping for more.

    By the way, when might you do another video? I love listening to your voice. :)
  • casten24casten24 Member Posts: 121 Bounty Hunter
    edited June 2013
    zovya wrote: »
    I checked that out. Really great tool. That is a flip coin though, so just 2 choices. I was hoping for more.

    By the way, when might you do another video? I love listening to your voice. :)

    I think the author actually mentioned in the dialogue that more drops can be added to increase the amount of outcomes. He doesn't really go into how that would work, though. Which, I've made sure to mention in my post on his forum page concerning his studio.
    The Portrait Gray Campaign
    Prologue: Fort Neverember
    NW-DL2RVQ54C
    Chapter 1: The Gray Portrait
    NW-DHGEFBMGD
  • mosby1mosby1 Member, Neverwinter Beta Users, Neverwinter Guardian Users Posts: 288 Bounty Hunter
    edited June 2013
    casten24 wrote: »
    I think the author actually mentioned in the dialogue that more drops can be added to increase the amount of outcomes. He doesn't really go into how that would work, though. Which, I've made sure to mention in my post on his forum page concerning his studio.

    I did, yeah - but I may not have thought it through :)

    My thought was for dX, you would have X encounters and X items. Each item is set to appear when its associated encounter is complete, and disappear when ALL other encounters are complete.

    So if the death order is: 2 3 1
    Item 1 would: nothing / disappear / appear
    Item 2 would: appear / nothing / disappear
    Item 3 would: nothing / appear / disappear

    You'd be left with just item 1. I'll have to test it, but I think it will work.

    It should scale, since no matter how many encounters you have, only 1 can die last.
    DM's Studio - NW-DHZ5DAV4R
    The Cursed Emerald:
    1. Weird of the Weather-witch -- NW-DEZAK4QPA
    2. The Ambitious Apprentice -- NW-DLRAVW4S4
Sign In or Register to comment.