Topic:   Random Phrases/sentences/titles   (Read 6353 times)


0 Members and 1 Guest are viewing this topic.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Random Phrases/sentences/titles
« on: March 23, 2010, 08:36:38 PM »
I was trying to think of a good system for random titles/phrases and it's tricky  to do. My current plan is to make arrays for certain categories (e.g. beginning middle, end) and pick one from each but it doesn't always fit.
I'm curious if there are any more ideas for it.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Random Phrases/sentences/titles
« Reply #1 on: March 23, 2010, 08:48:46 PM »
Hmm....
You can have 3 string arrays and try to fill them with as many pieces as possible.
For example:
(1) Av
(2) is
(3) aria

Randomize and eventually get nice names like: Avisaria


-Gan

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Random Phrases/sentences/titles
« Reply #2 on: March 23, 2010, 09:21:55 PM »
that's cool, in fact there are lots of fantasy name generators there, but I was trying to do something with whole words or phrases.
PS - how do you combine 2 strings?
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Random Phrases/sentences/titles
« Reply #3 on: March 24, 2010, 10:47:39 AM »
LET string$ = string1$ + string2$
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Random Phrases/sentences/titles
« Reply #4 on: March 24, 2010, 11:57:51 AM »
Code: [Select]
LET playerName$ = "Silverwind"

LET playerTitle$ = " the Great"

LET playerName$ = playerName$ + playerTitle$
That would make "playerName$" equal "Silverwind the Great" :)
I survived the spammage of 2007

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: Random Phrases/sentences/titles
« Reply #5 on: March 24, 2010, 01:11:51 PM »
This looked like it could be fun. Run this code in GameMaker


X = RANDOM 12
IF X = 1 THEN first$ = "Ivan"
IF X = 2 THEN first$ = "Morigard"
IF X = 3 THEN first$ = "Erlan"
IF X = 4 THEN first$ = "Roderick"
IF X = 5 THEN first$ = "Lucas"
IF X = 6 THEN first$ = "Boris"
IF X = 7 THEN first$ = "Percival"
IF X = 8 THEN first$ = "Derigard"
IF X = 9 THEN first$ = "Fenwick"
IF X = 10 THEN first$ = "Kerrigan"
IF X = 11 THEN first$ = "Hector"
IF X = 12 THEN first$ = "Tobias"

X = RANDOM 12
IF X = 1 THEN second$ = "Terrible"
IF X = 2 THEN second$ = "Horrible"
IF X = 3 THEN second$ = "Hunter"
IF X = 4 THEN second$ = "Destroyer"
IF X = 5 THEN second$ = "Lucky One"
IF X = 6 THEN second$ = "Rock"
IF X = 7 THEN second$ = "Bruiser"
IF X = 8 THEN second$ = "Bone Breaker"
IF X = 9 THEN second$ = "Loanshark"
IF X = 10 THEN second$ = "Crusher"
IF X = 11 THEN second$ = "Impossible"
IF X = 12 THEN second$ = "Great"

fullName$ = first$ + " the "
fullName$ = fullName$ + second$
PRINT $fullName$$



Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Random Phrases/sentences/titles
« Reply #6 on: March 24, 2010, 03:06:58 PM »
Nice Name Generator
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

GabrielCA


  • GMG-er

  • **

  • no avatar

  • Posts: 224
Re: Random Phrases/sentences/titles
« Reply #7 on: April 10, 2010, 08:45:42 PM »
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. ")
Creator of the deprecated plugin KeyDetect (2005)

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Random Phrases/sentences/titles
« Reply #8 on: April 11, 2010, 12:04:45 PM »
Yeah, I once read an interesting article on a random generator based on sound input.

I guess that clears the whole "Is the universe random?" thing up though. ;D
I survived the spammage of 2007

GabrielCA


  • GMG-er

  • **

  • no avatar

  • Posts: 224
Re: Random Phrases/sentences/titles
« Reply #9 on: April 11, 2010, 12:38:33 PM »
See also : http://www.random.org
Quote
RANDOM.ORG offers true random numbers to anyone on the Internet. The randomness comes from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs.
« Last Edit: April 11, 2010, 12:38:48 PM by GabrielCA »
Creator of the deprecated plugin KeyDetect (2005)

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Random Phrases/sentences/titles
« Reply #10 on: April 11, 2010, 12:40:20 PM »
Ah, that's the article I read. :D
I survived the spammage of 2007

GabrielCA


  • GMG-er

  • **

  • no avatar

  • Posts: 224
Re: Random Phrases/sentences/titles
« Reply #11 on: April 11, 2010, 01:09:39 PM »
Randomness was also briefly discussed here :
http://www.gamemakersgarage.com/cgi-bin/yabb/YaBB.cgi?board=looneybin;action=display;num=1268362069

Quote
One of the more interesting bits :
"Improve randomness of RANDOM command. " (in v2.4 - 9/23/98 )
I wonder if in 1998, "random" had the same connotation it has today...
Quote

I think the problem was it seemed to give very similar sequence of numbers all the time.

Creator of the deprecated plugin KeyDetect (2005)

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Random Phrases/sentences/titles
« Reply #12 on: April 12, 2010, 10:20:24 PM »
I had noticed when you do the "Random Test" (in the test game) it tends to have the same number twice in a row fairly often or get similar patterns each time...
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Random Phrases/sentences/titles
« Reply #13 on: April 13, 2010, 12:34:21 AM »
If you want to make something really random I suppose you could

x = RANDOM 10
REPEAT x
x = RANDOM 10
END REPEAT

That is a way of making something extra random.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Random Phrases/sentences/titles
« Reply #14 on: April 13, 2010, 02:52:59 AM »
But the odds of the roll would change significantly. You could have something like this instead:

Code: [Select]
x = RANDOM 10

REPEAT x
 Â   x = RANDOM 10
END REPEAT

EDIT:

Whoops! My mistake, that's exactly what you had. ;D At a glance I thought it was "X = RANDOM X" in the repeat block.
« Last Edit: April 13, 2010, 02:54:25 AM by Silverwind »
I survived the spammage of 2007