Random key/lock sytem - how?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Fhizban
Posts: 68
Joined: Sun Oct 21, 2012 2:57 pm
Location: Germany
Contact:

Random key/lock sytem - how?

Post by Fhizban »

akroma222 told me that crisman is working on something called a "random key/room generator".
I would like to ask you if someone else has a system like this in the working or has some thoughts about the subject.

its not the code, more the logic im asking for. who would this be done?

1. ok, you find random loot and there is a x% chance to find a key
2. the script scans the room you are currently in (big questionmark here) and looks for the nearest locked for
3. the script now spawns exactly the key that you require to open that door? (again big questionmark)

alternatively the game scans the whole level when starting and places keys in reachable tiles nearby the doors... :?:

and while i am already on it, has someone tought about similar scripts like:

* random secret door generator (place them in the editor and let a script decide wich one is open/closed)
* random trap generator

yep, im the "random guy" - you can guess wich road of development im taking :mrgreen:
--
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Random key/lock sytem - how?

Post by cromcrom »

I will release TLC source today, I am also very heavily involved in randomness, you will probably find systems to help you there. About almost everything is random, from craft to encounters to loot to whatever ^^
A trip of a thousand leagues starts with a step.
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Random key/lock sytem - how?

Post by crisman »

I made a test dungeon with that script, if you are interested you can give it a try!
https://skydrive.live.com/?cid=74CFADF6 ... E98%215304
the file name is: Test.rar
Only the editor will open it.

What you have to do:
Don't move the starting point in the editor!
You'll find 2 keys in front of you, and a hall with doors scattered around. Each door can be opened by one, and only one, key.
Every room closed by a door contains a key - except the last one, with the golden locks.
The test is over when you open the door with the 2 gold keys.
(also having two gold keys in the inventory it's fine )
With each key found in the hub you must be able to find a gold key sooner or later.
Keys will open its appropriate locks (geared lock - gear key, prison lock - prison key etc...) the wooden door is opened by the brass key.

I think the script is fine, but if you are unable to complete the test dungeon, let me know!

EDIT: anyway, my script is not that hard. What I wanted to do is having a hub, with several locked doors, and the keys are in predetermined spots - which key you'll find thought, will be random. So the order the player will visit the hub, will be completely random. Of course, the script mustn't spawn a key right behind the door that opens.
User avatar
Fhizban
Posts: 68
Joined: Sun Oct 21, 2012 2:57 pm
Location: Germany
Contact:

Re: Random key/lock sytem - how?

Post by Fhizban »

@crisman thanks, i guess that is the file akroma was talking about. ill check it out later!
--
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
Post Reply