Happy Holidays Gift -- Free AutoSpawing Table Cell Reader

RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
Hope everyone enjoys the season!

I'm not sure how to describe this little gift -- except its free.

It automatically spawns tiles in a grid formation. You can specify the width and height of the tiles. And you can tell it how many rows and columns to create. It then uses a recursive spawning process to create the grid/array/tiles.

Each tile reads and writes to its corresponding cell on a table. That is, a tile at 3,4 reads/writes to the table at row 3 column 4.

It can be used to set up your own table-based games (like bejeweled, tetris, freeflow, minesweeper, etc,).

http://www.mediafire.com/download.php?ddksabn4a1yj1ra

Happy Holidays!
RThurman

Comments

  • LiquidGameworksLiquidGameworks Anchorage, AKMember, Sous Chef Posts: 956
  • old_kipperold_kipper Member Posts: 1,420
    Many thanks and a small something in pm box. Happy Christmas!
  • carlblanchetcarlblanchet Member Posts: 755
    Very nice of you, thanks!
  • mrpacogpmrpacogp Member Posts: 400
    Happy Christmas for all of you!
  • haplo67haplo67 Member Posts: 38
    Thanks!!!!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2012
    "Spawn a new spawner"... what madness is this? :)

    Nice of you to offer this up. I was just thinking about making a somewhat similar demo. You saved me the trouble!

    What I don't get is why it appears to complete the spawning before any other actors run their rules (see demo below). Or at least any other typical loop functions (based on a timer). If I set the grid to 300 cells and then check the game.time before and after, they both report 0.0 seconds. How?

    What kind of magician are you, @RThurman?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    A Study of Loops

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited December 2012
    @LiquidGameworks, @old_kipper, @carlblanchet, @mrpacogp, @haplo67, @tatiang

    Glad you are enjoying this Holiday trinket. I hope it holds something intriguing for all skill levels (from novices to grizzled old GS veterans).

    Happy Holidays!
    RThurman
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Neat! Thanks man!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited December 2012
    What kind of magician are you, @RThurman?
    LOL -- Its the magic of the season for all good little guys 'n gals!
  • maxbeaumontmaxbeaumont Member Posts: 616
    Nice man! I'm sure many people are going to find this helpful :)

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    This is pretty cool. Though hehe when you set it to spawn 1x1 actors to fill the screen thus asking the Engine to spawn 153,600 actors at once apparently GS can't handle this. :)) who woulda thunk it.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited December 2012
    @tenrdrmer
    Yes -- I thought of the same kind of thing. Originally, I wanted to use GS to create a paint program. I think it would be fun to do flood-fills and such. I want it to work at the individual pixel level.

    Unfortunately, there is a lot more memory overhead for an actor than there is for a pixel (even if the actor might be represented by only one pixel on the scene).
    -----------------

    I hope that those newer to GS will find other fun little tricks in this project.
  • finalcutbobfinalcutbob Member Posts: 130
    This is very cool I'm sure, but from a newb point of view what would you do with it?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    This is very cool I'm sure, but from a newb point of view what would you do with it?
    Well -- I think that's a very fair question. Here is my attempt at an answer.

    Its just a little freebee that's packed with examples of how to do things. Like GameSalad, it is provided for free -- but it is up to you to figure out what you would do with it. And like GameSalad, I'd be careful about discounting it simply because it is free. Nevertheless, here are some suggestions:

    If it is absolutely unintelligible, then I'd suggest just trashing it. In this case, it's just a waste of bits. We've all received gifts that were unwanted. (I certainly have.) If this is the case for you then I completely understand if you simply delete it.

    If it is completely transparent, and you already know how to do all that stuff, then I'd suggest just trashing it. In this case, it's just a waste of bits. We've all patiently (and kindly) waited while someone who thinks they know it all shows/tells us something we already know how to do. It's probably polite to say thank you and then ignore it all -- since you already know what to do.

    If it is something that prompts a question like, "How does that work?" Then, I'd suggest it might be a cool thing to study it out and see "How does that work!" It this case, it might be a waste of bits, but you won't know unless you study it for a little while.

    If it's interesting but you can't see how it is useful (yet), then I'd suggest just looking it over, and noting what/why/how it does certain things. It might be a waste of bits now, but perhaps in the future there might come a time when you will need something that this little project gives a hint on.

    Like any gift, what you would do with it is completely up to you!
  • finalcutbobfinalcutbob Member Posts: 130
    Uhhh.... Sorry if I offended anyone, that wasn't my intention.

    I guess what I really meant was, being new to GameSalad you see all kinds of neat templates and when you see something like this, which is obviously above my skill level, it makes you wonder what it is used for.

    How would an experienced GS user put this to use? An answer to that question would be much more helpful than, well, saying something like "its up to you to figure it out."

    I hope this doesn't come off as sounding harsh which wasn't my intention either, I was just hoping for a better explanation.

    Thanks again.
  • DeadlySeriousMediaDeadlySeriousMedia ArizonaMember Posts: 838
    I think, as a person new to something, the question "what would you do with it?" is more from a connection point of view. You could look at something foreign all day but until you know what it's for you are really gonna have a hard time understanding how it works.

    @finalcutbob is really just asking for examples as to how this can be applied in the real world in a useful way so he can better understand what it's doing when looking through the project file.
  • finalcutbobfinalcutbob Member Posts: 130
    @DeadlySeriousMedia
    Thank you DSM. Thats exactly what I was trying to say only you put it much more eloquently.
  • DeadlySeriousMediaDeadlySeriousMedia ArizonaMember Posts: 838
    No problem! Don't know much about tables yet, but I would imagine you could use something like this to spawn levels. Like setting the floor and platform coordinates and spawn the appropriate actors for each tile. I could be off base with that though.
  • finalcutbobfinalcutbob Member Posts: 130
    Sounds cool.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited December 2012
    @finalcutbob & @DeadlySeriousMedia
    I wasn't offended at all! I think that your question was a very fair one. And I gave an answer in a good faith effort.

    Perhaps my reply sounded too philosophical? The intent was to let you off the hook if you didn't see any use for it right now. But, I also meant to imply that you might want to study it over and see how things work before it goes into the trash. (Or if you are like me these just go into a what-not folder since I can't seem to throw out anything that might have some potential some day.)

    It seems that most people concentrated on the way to spawn things recursively -- and how much faster that is than any looping method to spawn things. I didn't think that would be the big deal. (Although it was kind of fun to discover that.)

    For me the fun part was seeing how to get a bunch of actors to individually tie into a bunch of table cells. It would save a lot of effort.

    The next most important thing (to me) was that this makes it much easier to get started with table-based games such as tetris, bejeweled, minesweeper and such. For example, many think that tetris is done with jointed tiles to make the shapes. But it is really done with tables.

    There is also stuff in there on how to use floor() and ceil(), how to get and put table cell values, (and other fun stuff).

  • finalcutbobfinalcutbob Member Posts: 130
    @RThurman
    Thanks RT and thanks for the effort.
    I hope to be able to repay the community someday with little gems like this one.

    Lets all go have a beer! I'm buying!
  • finalcutbobfinalcutbob Member Posts: 130
    Oh, wait a minute.... I haven't had breakfast yet. We better hold off a bit.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I used something like this to build a 3D maze and 2D small map of the maze (see video below). It was all built on tables using a setup similar to @DeepBlueApps.com's awesome Collisions with Tables template: http://www.deepblueapps.com/collisions-with-tables-template.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @tatiang -- pretty nice! Gotta love that GameSalad. (And those awesome @DeepBlueApps templates.)
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Posting an updated Study of Loops that includes a mod1 loop actor based on @domenius' marvelous work here: https://forums.gamesalad.com/discussion/44707/timers-are-for-chumps-gs-optimization-tips/p1.

    Note that I've disabled the rule for @RThurman's magical Spawner Loop actor because it prevents the other loop actors from starting properly the way they're currently coded. You can of course enable the rule. I've also set game.maxIterations to 500, but you can change that to run different speed tests.

    I've also labeled the loop counters on the scene and given credit (via Notes) where credit is due.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Thinking about loops again... @RThurman, if I test your "spawn a spawner" loop, it takes .00012 seconds to complete 500 iterations (stunning!) when Previewed, but if I test it on a device with the iOS Viewer, it takes over 10 seconds to complete. Have you had any luck using it for any "real" applications?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    That was interesting, thanks for posting ... I'm sure what would be handy is if someone who had a bit of spare time would make a demo of the timer replacements, so people could visualise the after, for and every (looping) timers without using GS standard behaviours
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2013
    @beefy_clyro That's a great idea. I haven't done that, but I did think about additional ways to create a loop. I started with Interpolation, which was really hard to get a handle on (how do you trap each integer along the way?...) and then moved on to Accelerate, which is so-so.

    The speed is equivalent to an Every 0 timer loop. Well, it's a little slower actually. But it's tricky to get it to work properly without missing counter values, and it slows way down at about counter=200.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.