Tilt to live Possible with GS?

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
Is there a way to use Tilt where the more you tilt the faster my ball rolls in all directions?

Im trying to do a Tilt to Live concept (i understand GS wont be able to handle loads of actors but its just a test)

I want the controls to be very tight but cant seem to work this out.



Any help guys?

Darren.

Comments

  • JoshKahaneJoshKahane Member Posts: 470
    It definitely is I think! I remember seeing something on here a long while ago about it. I will try and dig it up, but it is possible!
  • UtopianGamesUtopianGames Member Posts: 5,692
    Thanks Josh, the only thing i could find on tilt was TshirtBooths old video.

    It would be great if we could manage tight controls like the game above and move very slow if tilted a little and fast if tilted a lot.

    Darren.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You could prob use a bunch of rules that set max speeds;

    i.e.

    if accelerometer.x >0.1 set max speed to 200

    if accelerometer.x >0.3 set max speed to 300

    etc etc

    On your ball actor you would just say when accelerometer.x >0.1 accelerate at whatever speed you wish.

    In theory this is one way which could work, i dont have my mac here at work so cant test this.
  • ValanValan Member, BASIC Posts: 410
  • ORBZORBZ Member Posts: 1,304
    yes, it's possible to do that:

    accelerate
    direction vectorToAngle(accelerometer.x, accelerometer.y)
    speed magnitude(accelerometer.x, accelerometer.y)*100

    under motion set max speed to 200

    done.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I have just starting redoing Say No to Dougs to act more like tilt to live. The problem I am running in to is the number of moving actors. GS starts to really lag when you add lots of moving actors.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Any chance of a demo ORBZ?

    I have tried what you said (landscape mode game) and i cant for the life of me make it work properly....its very sluggish with no top end speed and the x y are messed up.

    Am i right to think i still need 4 rules for left right up and down?

    This is what im using atm and it works well but im using 3 rules for left for eg attribute game.Accelerometer.x >0.1 >0.3 >0.5

    max(100, min(1000, 1000*abs( game.Accelerometer.Y )))

    Cheers m8,

    Darren.
  • UtopianGamesUtopianGames Member Posts: 5,692
    email sent to sales@......

    Cheers m8,

    Darren.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    @tshirtbooth,

    I'm working on a space shooter would benefit from good (read: working) tilt-based navigation. Any chance you could post (or email: barkbark00 at gmail dot com) a stripped down demo with the ball logic? Thanks in advance!
  • rebumprebump Member Posts: 1,058
    The way gravity is now setup (with X and Y components), you could use those tied to accelerometer values and place contrarian rules in only the actors that are not affected by the tilt.
  • Stryfe01Stryfe01 Member Posts: 146
    Interested to see how this turns out. My game uses a tilt function for a balancing level. Not sure if it will turn out well but going to try it.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I have the best game ever* in the works. Here are some thoughts on this subject...

    The biggest problem you will likely run into with making a tilt to live style game is the effect that moving actors have on FPS. I am making a game for the iPad and with 30 bad guys the FPS goes to around 40 and when I have 40 moving bad guys it becomes distractingly noticeable. What makes tilt to live fun and challenging is when nearly the entire screen is filled with moving red dots. If you used GS to do this it would likely crash. So what I have done is put a limit on the number of moving dougs (I mean bad guys) and then I also have on moving bad guys that have a simple two image animation to at least give them a little life without destroying the FPS. The combination of moving and nonmoving bad guys seems to find the balance between making the game challenging and having a reasonable FPS.

    *in the Dougs category of games (you know, doug induced coma, addicted to dougs, doug overdose, etc.)
  • Player_EPlayer_E Member, PRO Posts: 604
    Don't know if anyone has posted a solid solution for this yet, but this is what I came up with and it works just fine for me.

    You will need 4 rules ill do a sample of each.

    This is when iPhone is in landscape position (Y axis becomes left and right, X axis become up and down.)

    1st rule

    Move Left
    When Attribute game.Accelerometer.Y > 0.1
    Move
    Direction 180
    Speed 500*gameaccelerometer.Y

    2nd rule

    Move Right
    When Attribute game.Accelerometer.Y < -0.1
    Move
    Direction 0
    Speed -500*gameaccelerometer.Y

    3rd Rule

    Move up
    When Attribute game.Accelerometer.X > 0.1
    Move
    Direction 90
    Speed 500*gameaccelerometer.X

    4th Rule

    Move Down
    When Attribute game.Accelerometer.X < -0.1
    Move
    Direction 270
    Speed -500*gameaccelerometer.X

    You can find the reasoning behind the whole (When attribute game.accelerometer.Y >.01) in the how to section, so I will not explain that part.

    Now the speed result I guess is the main focus on this. in Tilt to Live the more you tilt the iPhone in one direction the faster it moves. Due to this you want a speed that involves the accelerometer. Now if you just put the speed as
    Speed = accelerometer
    your actor would be moving at a speed in between .01 - .80 (just rough estimate numbers)
    this type of movement is hardly noticeable. This is the reason why I have the 500*accelerometer this will multiply the value of the accelerometer by 500 which will bring you around 100-200 speed range based on how much you tilt it because .20*500=100 and .40*500 =200.

    **Note the number 500 can be replaced with any number you please to adjust the speed of the actor.**

    Now the reason why I have the minus sign in front of the speed for down and right.
    Due to the landscape changing the planes to move right you are going into accelerometer-Y and to move down you are going into accelerometer-X.

    for the speed to come out as a positive number just through the minus sign in from of the 500 and we all know a minus multiplied by a minus equals a positive. :)

    I hope this helps as I guess this could be considered my first tutorial i have contributed to GS.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    @Player_E,

    Any thoughts as to how to add a calibration option?
  • Player_EPlayer_E Member, PRO Posts: 604
    hmm possibly.
    I have not mastered GS yet so this isnt a "top notch" calibration idea, but you could try it.

    on you calibration screen have the actor in the middle, so users can test it.
    then have some buttons on the screen as well that would change the "500" number that I have in the previous post.

    So it would be kinda something like this.

    I have buttons A, B, C, and D.

    button A (default) when touched turns "500" or any number it has been switched to back to 500 and saves it.
    button B when touched turns 500 (default) to 300 and saves it.
    button C when touched turns 500 (default) to 400 and saves it.
    button D when touched turns 500 (default) to 600 and saves it.

    This could possibly work for you as the lower numbers would make the ball move slower relative to how much you tilted it and the higher number would make it move faster.

    Just a thought you can try out if you like.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    That should work for speed, but I would imagine that be a level specific attribute.

    I was talking about calibrating the accelerometer for center. Example, if I start the game tilted at an angle then the xy calculations are all off...
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    mulchay has a calibrate demo
Sign In or Register to comment.