Seed for grid based level
ArcticSquire
Member Posts: 14
Hello.
I'm trying to come up with a way to generate a grid/level from a seed.
I'm thinking of using a 6 x 6 grid with 3, possible tiles in each.
The seed for that would be 108 characters long, i doubt anyone would want to copy 108 char long seed.
(Any ways of shortening it?)
I thought a fun way would be to use words.
Separate the the grid into three 2 by 6 lines. and have each line represented by an english word.
The player would then just type in 3 words which is a lot easier & gives a kind of name to the level.
Any thoughts on how i could achieve this?
Thank you for your time,
Jordan
Comments
If you store all 108 possible combinations in table rows, you can just give the player a single number (e.g. 22 for row 22 of the table) and then generate the level from the column data. Or if you want words instead, tack on a column for the seed name and pick something simple ("lion", "tiger", "bear"). When they enter that seed name, search for that value in the table and use the resulting row as your level data.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
If there are 3 possible tiles and 36 grid spaces then there would be over 150 quadrillion combinations (150,094,635,296,999,140). 108 is just the number of grid spaces, or the 'seed' (if each of the 108 characters / numbers represents 1 of 3 choices).
I made a similar suggestion elsewhere recently, but your seed could be an angle (like 274.062deg), you could then extract the sin(angle) and use this for row 1, increment the angle by, for example, 123.456deg (so now we have 397.518deg) extract the sin of that for row 2, add another 123.456deg for row 3 and so on.
You'do then do a simple bit of maths on each digit to bring it into range (to produce 1-3).
This would given you an unknowingly complex series of numbers from a simple seed (274.062 or whatever angle you start with).
The problem with using words . . . (entirely depending on how you extract 1 of 3 values from each character) . . . is that some letters are massively over represented (e, t, a, o . . .) whereas others are much rarer (j, q, x, z . . .), which would skew tile frequency.
108 seems excessive, you can create a seed very easily with 36 characters. If you're willing to do some leg work, that can be reduced down to a 9 character seed pretty easily.
Just use letters, and if you want to keep it short, work out all the possible combinations of a 2x2 grid and assign each one a letter. Slit your grid into 9 "mini-grids" and that's 9 characters to represent the whole grid.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
You'd be short by 55 letters !
Sometimes I can feel as though I've just walked into a room where everybody is speaking in Serbo-Croat! Could somebody do me a favour, and direct me to some decent resources, so that I can learn what seeds are, why they're useful, and what I could possibly do with them? Muchas gracias in advance!
Why? Each 2x2 grid would need to accommodate only the possibilities within that grid.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
There would be 81 possibilities, each of the 4 grid squares can contain 1 of 3 possible tiles (3 x 3 x 3 x 3 = 81).
You can also extract the overall possible combinations number I mentioned earlier (to tatiang) from this:
81 x 81 x 81 x 81 x 81 x 81 x 81 x 81 x 81 = 150,094,635,296,999,140
That's not to say you couldn't create a 9 character seed, but the character set couldn't be base 26 !
I think you're misunderstanding what I'm proposing. Edit: I'm wrong. But you'd have 62 characters to play with, so you'd not be that much short :P
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Yes ! I understand, I'm just saying that you'd need 81 characters (rather than 12) to represent all the possible combinations in a 2x2 grid (with 3 possible tiles for each position).
Yes sorry, as I edited my last post to say I was completely wrong, way too little sleep last night! With 64 different letters (including numbers) to play with, it would still be pretty possible to stick to a 9 character seed if you branched into special characters.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Lol, near enough ! And what alphabet are you using that has 62 characters !?
A lower case and upper case letter aren't the same :P
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
26 letters + 38 numbers !?
I'm confused !
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
1 2 3 4 5 6 7 8 9 0
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Ah ! I see !
If only the intenational alphabet authority listened to my suggestion for lowercase numbers we'd nearly be in bussiness now.
Why am I now thinking of Ouija boards ?
How about these? ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₀
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
1 2 3 4 5 6 7 8 9 0 < > * & ^ % $ £ @ ! € # ¢ ∞ § ¶ • [ ]
81 ! we're in business !
I'd go with < > ! @ $ % ^ & * ( ) # { } [ ] - +
You don't want someone to have to press three keys at a time. That confuses people!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
> @Armelline said:
I think it's going to be a little confusing regardless ! . . . EEi&[9lg£ . . .or s(<8^jQ{- . . . aren't that easy to remember ! I say go with angles, your seed need be little other than 32.70° or 115.92° . . . ?
Lol ! At last my dream has come true !
Gentlemen, my head is bleeding, and it's all your fault...
See this is why math is no fun.
Edit: I like how Vanilla Forums changes my devil into a smiley face. Can't get anything right today... lol.
At least now you know that all you have to do is populate your table with all 150,094,635,296,999,140 possible combinations and then pull a row from that table and...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
backs out slowly
then quietly closes the door
Sounds like a plausible idea. Im not the best with math, how would I create the angle?
Say i do 9 rows of 6. so starting from 111.111 all the (base block type). I take that string and make it an angle. (repeat for all rows).
Could i then combine all the rows? and do something similar to make one string of
---.---
what would i do to reverse the sin(angle)?
Thanks
EDIT:
I think i understand now. Not fully sure how id implement it though. Any help/ideas would be appreciated.
The idea is that levels would be made, and then shared with the seed.
So a random seed will probably give an unplayable.
@ArcticSquire , attached is a project with a word as seed.
This uses some "lua pattern matching functions" to speed things up.
How it works:
Change the game.SeedWord in the Control actor to test
Could be added (left out for simplicity):
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Thanks for your time Hopscotch. Looks like it could be what i need.
How would i set the "seed word".
I've made an editor, to spawn the grid and edit the "tile type". I have a one column table with all the tile types (1-4) set from the editor. could you talk me through how id translate those into the seed?
Heres what i have so far (excuse the sloppiness, I'm new)
https://www.dropbox.com/sh/ut76nwws9t3ol9p/AABIxiM0Nm7LyqThMqiY_N1Ha?dl=0
Thanks