Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
collision check how? help thanks
Old
grandstream
Guest
 
Status:
Posts: n/a
Default collision check how? help thanks - 06-10-2006, 01:18 PM

I'm doing a collision check for my alice project. Prevents the object to run into the maze.

Currently, my script is





but i can't get it to work, help please thanks in advance.
   
Reply With Quote
saved by zero
Old
Jabberwocky
Guest
 
Status:
Posts: n/a
Default saved by zero - 06-10-2006, 01:31 PM

Less than zero? Try distance to hedge less than 1 instead.
   
Reply With Quote
Old
grandstream
Guest
 
Status:
Posts: n/a
Default 06-10-2006, 01:32 PM

tried that too.. the object just go through thanks anyway
   
Reply With Quote
collision detection
Old
Jabberwocky
Guest
 
Status:
Posts: n/a
Default collision detection - 06-10-2006, 01:38 PM

collision detection
   
Reply With Quote
Old
grandstream
Guest
 
Status:
Posts: n/a
Default 06-10-2006, 01:54 PM

Quote:
Originally Posted by Jabberwocky
sorry for asking stupid question without searching. thanks again
   
Reply With Quote
Outside the Wall
Old
Jabberwocky
Guest
 
Status:
Posts: n/a
Default Outside the Wall - 06-10-2006, 02:41 PM

No problem... collision is tricky. If you set the arrow keys to control the camera you won't walk through objects. (Make sure your line of sight is in line with the object though; if you can see over the hedge you'll just walk right through.)

Achieving a third person perspective, above and behind fatherRabbbit, so you can watch him move through the maze, will require a lot of the work. You'd have to do a lot of proximity checking; for each wall of the maze.... but I'd think that would be a problem as the maze is one big object with no sub-parts.

Perhaps you could either build your own maze with individual walls, or place invisible objects in front of the walls and proximity check against them.

Fun, fun!

Last edited by Jabberwocky; 06-12-2006 at 10:18 PM.
   
Reply With Quote
Old
grandstream
Guest
 
Status:
Posts: n/a
Default 06-10-2006, 03:16 PM

Quote:
Originally Posted by Jabberwocky
No problem... collision is tricky. If you set the arrow keys to control the camera you won't walk through objects. (Make sure your line of sight is in line with the object though; if you can see over the hedge you'll just walk right through.)

Achieving a third person perspective, above and behind fatherRabbbit, so you can watch him move through the maze, will require a lot of the work. You'd have to do a lot of proximity checking; for each wall of the maze.... but I'd think that would be a problem as the maze is one big object with no sub-parts. Walking inside the maze your proximity becomes like what you were trying to achieve less than zero .

Perhaps you could either build your own maze with individual walls, or place invisible objects in front of the walls and proximity check against them.

Fun, fun!
thanks again, will try to place invisible objects along the walls of maze.
   
Reply With Quote
too many!
Old
grandstream
Guest
 
Status:
Posts: n/a
Default too many! - 06-10-2006, 03:45 PM

i tried to insert "invisible" items into the blocks of maze. The inflexibility of alice is the "distance to" is measured from centre of the item to the other's . As a result, i can't simply insert one string of long text... It will still be measured by the centre of point.

If i insert so many items inorder to fit them into my big maze... OMG, the file size would be so big and the numbers of item to test for collision is so much to more. Imagined "if nested if if if if if" with the amount of objects ..the numbers of if would be unbearable. I haven't have the chance to test if making a list of those object would work.


Kinda stuck now, gonna sleep first and try again tommorrow.
   
Reply With Quote
If these walls could talk!
Old
Jabberwocky
Guest
 
Status:
Posts: n/a
Default If these walls could talk! - 06-13-2006, 12:13 AM

Using the "distance to" command, Alice measures from the center of an object on all 3 axes (x, y, & z). Checking for less than zero doesn't work because the distance between two objects is always positive, depending on your point of spatial reference.

The square is the simpliest object I see in the shapes folder, it's only 2k. HedgeMaze3 is 468k. You could use 234 squares and just match the size of the maze. World size shouldn't be a problem. Regardless of the size of the barrier segments, you'd definately want a list to store the barriers in.

The example world, Flight Simulator, checks for a ground collision by checking if "distance above object < 0". Checking for less than zero is appropriate here. "Distance above" is related to one coordinate plane, height, anywhere you cross (in x or z plane) triggers the event. "Distance in front of" works like the "distance above" command.

If you use "distance in front < 0", with any sized object, and cross to the negative side (-z) you would trigger it no matter where you were on the x & y planes. The problem is the maze folds back on itself. If you check "distance in front of" on one pathway and then walk around to the back following the maze, you'd be behind the object on another legitimate pathway but triggering the function from the opposite side.

You should check into the other proximity commands and maybe even the spatial ones. Perhaps a combination might do the trick. Let me know if you find a solution.

Good luck!

Last edited by Jabberwocky; 06-13-2006 at 12:31 AM.
   
Reply With Quote
Monkey See, Monkey Do
Old
Jabberwocky
Guest
 
Status:
Posts: n/a
Default Monkey See, Monkey Do - 06-13-2006, 06:08 PM

For an excellent example of collision detection check out the racing game by crazychimp132.

I was thinking you'd need to use the "while key is pressed" routines so you could stop the rabbit from walking, and avoid the user just barreling through a wall. As well as set up indicators as to what pathway you were on like the checkpoints, and set up something for spatial orientation like the axes here.

Nice!
   
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump



Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.