Game Maker's Garage Forum

Game Creation => SilverCreator => Topic started by: Connors on June 10, 2010, 11:44:02 PM

Title: Randomized Game
Post by: Connors on June 10, 2010, 11:44:02 PM
I'm gonna try putting together a randomized game in SC. Not extremely complex, however I'm still working out exactly how to put the code together. I'm trying to make it create a 25x25 grid of rooms that are all connected to the next room without any weird mistakes. (like you exit to the east and the next room has no door on the west. Unless there's an invisible door on purpose hey I think I'll put that in!)
Anyways I figured a good way to do it is (this is what I'm trying to do now) when you enter a room you haven't before THEN the program creates it based on what's next to it. It would prevent insolvable puzzles like the key being in a room behind the door that you cant reach yet.
I'm still trying to get a solid plan for it so I don't screw it up so I could use some tips if anyone has some ideas.
Title: Re: Randomized Game
Post by: Gnome on June 11, 2010, 01:55:17 AM
Simple Doors are sprites.

Then all you have to do as make a 5 line code snippet like

SPRITECOLLIDE 1, 2

door = left
IF door = left THEN
SPRITE 1, 50 50 (basically adds a left door.)

Having the door lead BACK to the old room is a much harder problem.
Title: Re: Randomized Game
Post by: EqwanoX on June 11, 2010, 10:53:39 AM
i think tiresdragon did this a while back, maybe he'll let you use the sourse
Title: Re: Randomized Game
Post by: WarHampster on June 11, 2010, 11:15:23 AM
All you need to do is pick a spot randomly to be the center of a room, then hollow out everything around it. To make sure everything is connected, hollow out passage ways from the center of all the rooms to the sides of the map and the other rooms. A simple line drawing algorithm should suffice.
Title: Re: Randomized Game
Post by: Connors on June 11, 2010, 03:12:26 PM
I'm not quite following you WarHampster. you mean draw lines between rooms that are already there?
Also a big problem is that I need an easier way to keep track of the details of each room without making thousands of variables. (or 15 different arrays.)
Title: Re: Randomized Game
Post by: Gan on June 11, 2010, 05:43:16 PM
Create a custom class to hold all individual room data.
Oh wait. Sc doesn't have those.
You're going to have to force through it.


-Gan
Title: Re: Randomized Game
Post by: EqwanoX on June 11, 2010, 06:00:15 PM
...or tires can just tell you how he did it
Title: Re: Randomized Game
Post by: Silverwind on June 11, 2010, 06:22:24 PM
TD used an ingeniously simple "edge joining" routine which rewrote the collision values of two ajoining edge tiles to make them traversable. The collision map of the rooms themselves weren't randomly generated, just picked randomly from a predefined list of 20 or so variants. It's a really clever and effective method that could easily be reproduced on a large scale.
Title: Re: Randomized Game
Post by: EqwanoX on June 11, 2010, 08:42:22 PM
why rooms? why not just make one large randomly generated scrolling map
Title: Re: Randomized Game
Post by: Connors on June 11, 2010, 08:59:48 PM
because I've never managed to make a non-scrolling map yet. ::)
Title: Re: Randomized Game
Post by: GMG Mike on June 11, 2010, 09:26:36 PM
Quote
Create a custom class to hold all individual room data.
Oh wait. Sc doesn't have those.
You're going to have to force through it.

Dude, we get it, there's no classes in SC. Obviously you've evolved past SC so just leave it alone. It's a free product that I work on in my spare time and when you write stuff like that it's not encouraging at all.
Title: Re: Randomized Game
Post by: EqwanoX on June 12, 2010, 12:38:15 PM
mikes been touchy latley. but it is annoying when people diss sc, but it can also be an unexpected compliment that theyre compareing sc to objective c. maybe i should just remake the irpg in sc and make it even better, lol
Title: Re: Randomized Game
Post by: WarHampster on June 14, 2010, 12:31:27 PM
Quote
I'm not quite following you WarHampster. you mean draw lines between rooms that are already there?
Also a big problem is that I need an easier way to keep track of the details of each room without making thousands of variables. (or 15 different arrays.)

1. Randomly decide on a number of rooms and DIM an array of double that number.

2. Go through the array and put random x and y values in each field of the array.

3. Go through the array and use every pair of fields (ex. (1) and (2) would be a pair) as the coordinates of the center of a room. I assume you have a tilemap done already, carve out all the room centers.

4. Carve out a box of random size around all the room centers.

5. Use a line drawing algorithm to draw lines between all the room centers, storing the coordinates of the points in the lines in an array.

6. Carve out all those points.
Title: Re: Randomized Game
Post by: Connors on June 14, 2010, 02:55:11 PM
Quote
mikes been touchy latley. but it is annoying when people diss sc, but it can also be an unexpected compliment that theyre compareing sc to objective c. maybe i should just remake the irpg in sc and make it even better, lol
Good luck with that. ;D
...I like SC but I am still thinking about other languages. I noticed Gan put up tutorials but I don't know if I can get the programs I need.
Title: Re: Randomized Game
Post by: GabrielCA on June 14, 2010, 04:53:40 PM
Randomness is always a hot topic.

Quote
BTW About the whole random thing :
One thing I always found interesting is that computers, being entirely logic-driven, are actually incapable of generating truly random patterns.

See for example :
http://www.freepatentsonline.com/6215874.html
(Quote : "Unfortunately, computers are only capable of generating pseudo random numbers. These numbers may follow known sequences for they may rely on date and time information making them predictable. ")
Title: Re: Randomized Game
Post by: EqwanoX on June 14, 2010, 06:15:48 PM
Quote
Good luck with that. ;D
...I like SC but I am still thinking about other languages. I noticed Gan put up tutorials but I don't know if I can get the programs I need.
i WOULD like to recreate irpg's battle system in sc cause i like it but i wouldnt take on the whole game

just keep in mind that sc is much easier to use than other languages and requires less work. i wonder how long it took gandalf to make the earlier balloon game cause it only took me a couple hours
Title: Re: Randomized Game
Post by: Connors on June 14, 2010, 08:29:02 PM
Didn't he say he had templates and such? And Did this game you made have a tiled background??

But I digress, I seem to remember someone said there was a tile engine that people could use? I'd at least like to look at it.
Title: Re: Randomized Game
Post by: EqwanoX on June 14, 2010, 08:37:34 PM
yea thats v7, the download isnt available right now, ill post an update soon, its advanced alot sinse its first release

http://www.silvercreator.net/cgi-bin/yabb2/YaBB.pl?num=1260901384
Title: Re: Randomized Game
Post by: Silverwind on June 15, 2010, 05:54:25 AM
Quote
yea thats v7, the download isnt available right now, ill post an update soon, its advanced alot sinse its first release

http://www.silvercreator.net/cgi-bin/yabb2/YaBB.pl?num=1260901384
Gadzooks man, it's V6 with a map rendering routine!

Quote
just keep in mind that sc is much easier to use than other languages and requires less work. i wonder how long it took gandalf to make the earlier balloon game cause it only took me a couple hours
Yeah, GM and SC are certainly the easiest platforms out there (and that's the hook for me), but there's great reward for muscling the toil of those 'advanced' languages. Indeed, it well deserves a Disney musical parody.

*opens Garageband*
Title: Re: Randomized Game
Post by: EqwanoX on June 15, 2010, 03:06:16 PM
Quote
Gadzooks man, it's V6 with a map rendering routine!
theyre so different, v6 determines boundries from the map code, v7 determines boundries from the tiles code, a tile can be set as traversable or not

heres the update:
http://www.silvercreator.net/cgi-bin/yabb2/YaBB.pl?num=1276631819
Title: Re: Randomized Game
Post by: Silverwind on June 15, 2010, 04:52:20 PM
*grumbles something about "core mechanics" and "Meadowlark Lemon's disapproval"*
Title: Re: Randomized Game
Post by: EqwanoX on June 15, 2010, 08:34:51 PM
i dont understand your vendetta with v7, just the fact that it renders maps is a huge advancement over v6

also i was able to recreate iRPG's real-time combat system useing my rpg engine as a template in just a few hours, i love real-time its so much better than the turn based system AND it was easier to program! i'll polish it up a bit and post it tomarrow
Title: Re: Randomized Game
Post by: Silverwind on June 16, 2010, 01:59:14 AM
Hehehe... ;D Well in all truth, I love V7, I just don't consider it to be version 7 of the navigation engine. Collision data for maps is stored and retrieved in exactly the same manner as it is in V6, thus I don't recognise it as an update of the nav engine. The map rendering routine is great, but it's entirely separate from the nav engine, therefore I consider V7 to be "Navigation Engine V6 + Map Rendering Engine V1"