Dynamic rooms, random rooms

Started by Kjammer, Sat 03/05/2008 20:13:11

Previous topic - Next topic

Kjammer

I'm not sure if this is in the right forum.  My question is, is it possible to use the AGS editor to make random rooms with a pseudo-random layout?  That is, make a random room with walkable areas, hotspots and object/characters in specific spots relative to the room layout.  I just want to know before I try something impossible.

If not, then can the game launch an external program to do the generating and read off the files it produces?

Pumaman

Probably not, though I'm not entirely clear about what you're wanting to do.

However, whatever it is could probably be done through an editor plugin.

Mr Flibble

If things like hotspot areas and walkable areas can be directly accessed through the script, then this should be possible with some kind of random variable determining them from a predefined range.
Ah! There is no emoticon for what I'm feeling!

GarageGothic

#3
If you establish a quite simple general layout, this should definitely be possible. For example the entire sea in A Tale of Two Kingdoms consisted of a single physical room. If you want to make a maze where the rooms have more or less the same layout (you can always randomize different backgrounds to avoid it being repetitive) but with between one and three exits depending on location, you can use objects for the exits and turn on/off the walkable area near them. Your main concern will be to get the walkbehinds working properly in all cases, but you may replace walkbehinds with objects.

You would have to initialize the randomization beforehand (either in game_start or when entering the sequence of random rooms), possibly storing the pseudo-room states in a struct. That way the rooms are random but will retain their state as the player walks back and forth between them (I assume this is what you want).

Edit: Just a thought. Something like the minotaur maze in Ben Jordan 6 could easily have been randomized this way. You just have to make sure that the script checks that all rooms can be entered and all objects/characters accessible when needed to avoid dead ends.

Vince Twelve

#4
Yeah, you really do need to be more specific about what you want to do.

If all the rooms are fairly consistent and similar, you could easily shift around objects/exits/walkable areas to pre-set possible locations.

I made a quite complicated random room game where each room was a randomized board of tiles and the doors connecting the rooms would be randomized as would the enemies within.  I could specify rooms, to make them exactly as I wanted them, or just leave them to the game to randomize.

This alpha of the game demonstrates just six rooms, but each time you play they'll be different.  To clarify, the rooms aren't complicated, but the scripting sure was.

So, yes, you can make randomized rooms depending on what you're trying to do with them.

Kjammer

Okay, Ill be more specific.  I want to make a game where the character has to run through a maze of rooms; when an instance starts, the rooms are generated; each individual room layout comes from a grab-bag of basic room layouts with regions to place walls, doors, objects and access points to adjacent rooms at random; The rooms stay the same until the player either quits or changes instances (levels).

Similar to what  Vince XII is making (can't wait for the complete version), but with much different gameplay mechanics in mind.

My original question was along the lines of weather or not something like this possible with AGS.  And the answer seems to be yes.  But, you let me figure out how to implement this because that's where the fun in game design lies. ;D

Vince Twelve

QuoteMy original question was along the lines of weather or not something like this possible with AGS.  And the answer seems to be yes.  But, you let me figure out how to implement this because that's where the fun in game design lies. ;D

You nailed it on the head there!  This is definitely possible, but it will be quite tricky to implement!  I'd recommend approaching it by making a data structure that that contains the necessary data for each rooms' layout/objects/exits/position in the maze/etc.  An initialization function could randomize the rooms, filling in the data for each room's objects and walkable areas and whatever, and the tricky part: making sure that there is a way through the maze.  Then, you could either have the room build itself based on this struct when you first enter each room, or you could have the entire game take place within one AGS "room" just moving everything around each time the player changes in-game rooms.  The second way is how I made that alpha.  (which I won't be continuing in the foreseeable future, sorry!)  Each time you go through an exit, it just rearranges the current room and moves the player to the opposite side, so it looks like he's entering a new room.

Either way will be tricky but fun!

SMF spam blocked by CleanTalk