Alice Community Lagless collision detection?
 User Name Remember Me? Password

 Thread Tools Display Modes
 Lagless collision detection?
 sam.no21 Guest   Status: Posts: n/a Lagless collision detection? - 06-04-2010, 03:34 AM Is there any way to reduce the lag when using loops for collision detection? I find if I make anything to big or complicated using infinity loops the world will struggle to run. All help appreciated!
 Dameria Senior Member     Status: Offline Posts: 976 Join Date: Sep 2009 Location: United States 06-05-2010, 12:14 AM Try putting in a Wait statement into your infinite loops. Some things, like collision, cannot really have too much of a long wait or else it will not function right, but if you have any infinite loops that do not require a constant checking, put a 1 second wait on it (or less if you need to it check more often). For collision detection, I use an infinite loop to determine how far away I am from a certain group of objects, and those objects are in a list. The infinite loop only runs every 0.5 seconds, and if it is near the group of objects it starts the collision for that group of objects, and then if you go far enough away from the group of objects, the infinite loop checking every 0.5 seconds to see if you are close to the group will turn a boolean variable back off, and the collision will stop on that list. It is quite complicated, but I actually got it to work on one of my worlds that I have not yet published. I have 4 groups of objects, and there is a boolean for each determining if I am in a certain range of the objects to turn it on. Once the boolean is turned true, the collision is started in a while statement, with the boolean being the argument, so that once I go far enough away from the objects the boolean goes back to false and the collision stops, making it about 30 less infinite loops running at once, significantly helping to reduce the lag. Check out my best projects so far and please comment: Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548 Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408 Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725 Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
 zonedabone Senior Member     Status: Offline Posts: 577 Join Date: Nov 2008 Location: In the interwebs 06-06-2010, 08:11 PM 'Apple Macintosh' - An anagram of 'Complaints Heap' M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs. You're *such* a mac person.
 sam.no21 Guest   Status: Posts: n/a 06-13-2010, 09:19 PM Thanks for the ideas! I have built a grid of cubes over my world. Each cube can determine what objects are in it so that the colision detection is only on for the object in the cube that the person is in. The next problem that I have is that I need to have a huge set of if statements to access the lists stored in each cubes variables (I have had this problem for many other things). Any ideas? Pic attached
 Rabizaman Guest   Status: Posts: n/a 06-14-2010, 02:30 AM Some threads are really unique. Forums are for the benefical of people. This Thread is an exmaple of good post. I have the same question running in my mind and thank you my question has been solved now. The same Forum and topic i read on forextradingevo. com , nice forum and nice comments always appreciated by the people. Keep posting ...

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge