increasing the spawning frequency of "randomly" spawned actors

mrHigginsmrHiggins Member Posts: 5
edited May 2012 in Working with GS (Mac)
preface: imagine some kind of bastard, mutant clone of fruit ninja where there's two dudes throwing fruit and bombs at you at the same time. the object obviously being grab the fruit, skip the bombs. each dude can only throw one object at a time but considering there's two of them they could both be throwing something at you simultaneously or they could take turns... kind of a series of randomly true booleans i guess.

how would one preserve the randomness of the spawning projectiles coming from two directions while increasing the frequency gradually over time?

so far my experiments have been too predictable and either too infrequent or too frequent.

any help, whether it's advice or links to resources/information that may be useful would be greatly appreciated.

thanks.

-mrHiggins

Answers

  • sneakydustsneakydust Member Posts: 5
    You could use a table stating the number of spawns, and use a timer to increase this table in increments?
  • mrHigginsmrHiggins Member Posts: 5
    i'll definitely poke around with that. not sure how to really tap tables in gs yet but i'm sure there's a tut somewhere that'll get me started. :)

    i'll let you know how it goes.
  • MotherHooseMotherHoose Member Posts: 2,456
    @mrHiggins@Tshirtbooth has tables videos
    www.gshelper.com or his YouTube channel

    image MH
  • mrHigginsmrHiggins Member Posts: 5
    yeah i remember seeing a couple there i just didn't remember what type of stuff he went over in a way of knowing what exactly might apply to my situation. i haven't had a chance to get into GS since i posted the original question between mentoring a college student and my mac permissions getting screwy leaving me essentially bricked until i can either find my install disk or find someone to loan me one.

    my PSA for the day:
    unknowingly following sarcastic advice on how to fix computer problems when you're new to the platform is a bad idea, kids. leave it to the professionals like me.
  • mrHigginsmrHiggins Member Posts: 5
    edited May 2012
    so i was looking at this table stuff to at least get freshened up on it a little bit and was wondering how logical this knee-jerk hypothesis was and maybe see if someone would be so kind as to test it for me--considering the current state of my mac--should they have the free time. it might even prove to be beneficial to other chefs further down the line if they wanted a similar effect and they could kinda see how it was done.

    so my initial thought was something like:
    -have an actor spawning my "fruit" every [variable]. maybe 3 seconds at first and have a table that would update the variable based on how long you've been playing. ie, every minute of play (give or take) would reduce the variable by .5 seconds. this would also allow me to have a plateau so the game wouldn't become unreasonably fast.

    -have a second table that has all the actor names i'd like to be able to spawn. this way i could not only spawn "bombs" at random but vary the "fruit" as well.

    -the expression value for what to spawn would be something like...

    tablecellvalue(table 1, 1, random(1, tablerowcount))

    -rather than have a single cell be dedicated to one variable projectile, have an array of them. for example, have cells 1-50 be an apple, 51-100 an orange, etc.

    -also have an array of cells dedicated to a null value so that the frequency of spawned projectiles is seemingly random. it seems like it might be easier to spawn something that's not there than it would be to tell it not to spawn at certain times... if that makes sense. maybe have the range for this be double the range for the individual fruit; like 101-200 (give or take).

    -do the same with the "bombs" as with the "fruit" but have a smaller range so "fruit" is more frequent. maybe even have the bomb range be at the beginning so that the likelihood of them spawning also gradually gets more frequent by altering the above proposed code to start with a variable (lets say it starts at 50) and it gradually gets lower thus expanding the range of the usable table data.

    ie
    tablecellvalue(table 1, 1, random(var, tablerowcount))

    would this work? if so, do you think i would be wasting too many resources by throwing away cycles on null values in my table? am i over simplifying this?

    sorry for the novella.

    -mrHiggins
  • MotherHooseMotherHoose Member Posts: 2,456
    tables are just a list of comma separated values …
    their beauty is in their conservation of resources!
    so null values in tables are very efficient

    and, though you can put all you want to store in Attributes
    … tables give you a faster, smoother, and smaller byteSize project!

    image MH
  • mrHigginsmrHiggins Member Posts: 5
    Been distracted working with my design partner for a couple days while I wait to borrow an osx disk. Still haven't been able to play with this but I wanted to thank everyone that helped point me in the right direction. this I'd proving to be a pretty nice community to be a part of.
Sign In or Register to comment.