How to make accelerometer smoother
MattButlerStudios
Member Posts: 486
Hi everyone, I am making a portrait labyrinth game and I need some help with the controls. I have tried many different things but nothing seems to work. Could someone give me information on what to use as the basis for this? I have tried making rules for x,y, and z coordinates but the ball doesn't move properly at all. Any help would be appreciated. Thanks
Comments
please clarify, what sort of issue are you facing while using accelo. We'll be more than glad to help.
You might want to take a look at tshirtbooth's tutorials for basics on accelo.
Besides the tutorial videos (Google gamesalad accelerometer), try adding a DisplayText behavior with each accelerometer attribute and watching when you tilt the device. That's how I learned to use accelerometer controls.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the responses. Before I start testing my accelerometer with the display text feature could you please tell me if the coordinates will be the same as in the video since he use landscape mode? Is Y-left X-right and Z-up and down? @kinzua @tatiang
www.mbstudios.co | Free Stuff
Honestly, I have no idea. I don't memorize that, I just test it in GS Viewer and then I know. Not trying to be a pain... but if you're going to be using accelerometer controls, you need to be testing on an actual device.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@MattButlerStudios, @tatiang, I agree with tatiang 100% when using Accelerometer you absolutely have to test on your device.
I'm working on my first game using the Accelerometer and had controls built on my Mac (testing with keyboard controls on the Mac), when I tried it on my iPad using the Accelerometer controls I hated them! They were not smooth and did not function at all like I expected them too. I had to spend the next 3+ days rebuilding and testing and re-testing on my device to get them just right. I've never built so many adhoc builds so quickly!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I am currently using gamesalad viewer but I just want to know how to go about starting to set up the accelerometer
www.mbstudios.co | Free Stuff
The basic idea is that you include an accelerometer attribute in a Display Text behavior. You can choose X, Y, or Z... it doesn't matter which you start with. The values go from positive to negative with zero being level/centered. So when you watch the actor with the DisplayText, you can see that when you tilt to the right, the value goes positive (or negative) and when you tilt the other way, it switches. Somewhere in the middle is zero. Once you know those values, you can start to build rules ("Oh, so when I tilt right in iPad Landscape, X is negative* so if I want my actor to move right when I tilt right, I would have a rule that says When accelerometer.X ≤ 0 or maybe ≤ -0.1, move 180°").
*I made that up but you can check the real value.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
https://drive.google.com/folderview?id=0By4MA0vriD89MXFvOFlCRWo1Z0k&usp=sharing
Here is what I have currently.I am using x for the R & L and y for the U & D. I don't really know what to do from here. What I am trying to do is have a portrait game that move a ball around the screen in all directions (fluently). I'm sorry if I am reiterating, but I just want to make sure that we are on the same page. Any help is appreciated. I have tried following tshirtbooth's videos (if you have seen them) but it doesn't seem to work for me. Maybe it could if I knew how to convert it to portrait since he is in landscape mode.
www.mbstudios.co | Free Stuff
What happens when you add a Display Text behavior with the X, Y, or Z accelerometer attributes and then tilt the device?
If you want, you can use this file I just made: https://www.dropbox.com/s/gz7q1gfyb2xdg1u/accelerometer display.zip
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the file. When I tilt it I can see the values changing. Now how do I apply this?
www.mbstudios.co | Free Stuff
Well, that's what I explained in an earlier post, but here goes again:
Let's say you notice that when you hold the iPhone (or iPad) in portrait mode and tilt to the right, the value of the attribute assigned to right/left tilt is a larger positive number the more you tilt to the right. And when you tilt left, it gets smaller... then zero, and finally large negative numbers. To harness that attribute, you would make a rule (as in the video) depending on the value of it. If it's greater than 0.1 then the device is being tilted to the right. If it's less than -0.1, then the device is being titled to the left. You would create rules to check the value and based on certain conditions, move the actor.
Don't know if this image helps to explain the concept, but just in case it does...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you for your continued help with my issue. I have applied what you told me and the left controls are not working. Here is what I set into place (the left and right are X and the up and down are Y) https://drive.google.com/folderview?id=0By4MA0vriD89MXFvOFlCRWo1Z0k&usp=sharing
www.mbstudios.co | Free Stuff
The left controls might not be working because you turned the Accelerate behavior Off.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Man do I feel stupid. Haha thanks for the help. Another question, the ball doesn't seem to react very fast to my movement inputs. Would changing the density help this? What would you recommend me changing?
www.mbstudios.co | Free Stuff
I've heard that from several people in the past few days and I'm not sure what the answer is. Other than briefly playing around with the accelerometer controls, I haven't spent much time with it. Maybe someone else on the forums can provide some insight.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ok, thank you VERY much for the help! I greatly appreciate it!
www.mbstudios.co | Free Stuff
My game is currently using an accelerometer. However, the reaction times are a bit delayed as I tilt my device. What should I change to make the ball respond quicker to movement. (My game is a portrait labyrinth) Thanks everyone!
www.mbstudios.co | Free Stuff
I'm creating a game that uses the accelerometer and I am having the same problem.
Need Help? Email Me | Templates | Full Game Source Code
Yeah, I have the accelerometer set up but it just doesn't respond like it should
www.mbstudios.co | Free Stuff
How is it set up in the code?
@zweg25 https://drive.google.com/folderview?id=0By4MA0vriD89MXFvOFlCRWo1Z0k&usp=sharing (only exception is that accelerate is on for accelerometer left)
www.mbstudios.co | Free Stuff
[merged two threads]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
This is the rule I came up with after experimenting with the accelerometer for my current project.
I'm only checking the game.accelerometer.X and adjusting my linear velocity.X but you could use the same formula for the Y direction as well.
You'd likely need to adjust .005's in the Conditions and the 900 in the expression editor to match the movement you want in your game.
But what this is doing is using the actual accelerometer value to control my actors movement so the further I tilt the device the faster the actor will move. A quick tilt gets it moving fast and a little tilt moves it slow.
Hope it helps
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks a lot @jamie_c I really appreciate the response!
www.mbstudios.co | Free Stuff
It looks to be much smoother, which is nice. @jamie_c could you please tell me what you have set under density, friction and anything else that may be applicable?
www.mbstudios.co | Free Stuff
I'm not using the built in physics in my game so they are all zero'd out.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Ok. Do you have any tips on how to get the ball to react even faster to accelerometer input? It seems as if it is hard to navigate the ball because the reaction time is rather slow. Also does that mean you are using no physics in your game since they are all zero'd out? Thanks again. (I hope these questions aren't annoying since I am relatively new to gamesalad) @jamie_c
www.mbstudios.co | Free Stuff
I am testing on the gamesalad viewer. I am just asking how I need to to about setting up the accelerometer. When I watched a video on YouTube discussing setting up the accelerometer they were in landscape mode. Would the same apply to portrait? I will fine tune it on my own, but I just need help on getting this started
www.mbstudios.co | Free Stuff
I am currently using gamesalad viewer so testing isn't an issue. I am really just asking how to start going about setting up the accelerometer. Can the same rules be applied to a portrait view that were used on a landscape project?
www.mbstudios.co | Free Stuff
I am currently using gamesalad viewer so testing isn't an issue. I am really just asking how to start going about setting up the accelerometer. Can the same rules be applied to a portrait view that were used on a landscape project?
www.mbstudios.co | Free Stuff