Alice Community Collision Detection
 User Name Remember Me? Password

 Thread Tools Display Modes
 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 11-14-2011, 06:37 PM Well object distance is based purely on pivot point and only involves points in a 1:1 scale. But lets insert numbers into the equation. An average model has four vertices per polygon. All, if not most, of these vertices are reused (And can be reused practically infinitesimally) so let's say each polygon (Quad) creates one vertex and reuses three other vertices. Let's also say I'm jumping the usual average margin, and our world contains 100,000 polys. That's still somewhere near 100,000 vertices. Let's say our collision check is simple; it searches for the distance of polys, derived by finding the geometric center of each vertex associated with the poly (X,Y,Z) and compares them with the direction they are considered facing, also described by XYZ. If the distance between them is negative, then they collide. This could take, what? Four calculations per poly? Now lets assume this calculation is done twenty-four times per second, because "smooth" human framerate is considered 24 frames per second. 9,600,000 calculations. From a quick google, you may read that the uber slow Pentium D Processor does 2.3 billion calculations per second. Constantly calculating collisions for 100,000 polys doesn't sound like much. Technically it is, but let's ignore that. At any rate, I have an idea for improvement. There is no game engine in the world that seriously checks collision for every poly in an object, since scenes tend to reach millions of polys fairly easily. They use simple shapes between six (boxes) and ~500 polys (Helicopter) for any given object. They call these simple shapes a "Proxy" object, and they are named that, and they do the calculations on these proxy objects. So the idea is: Add a true/false box in the Seldom Used Properties list that reads "Is Proxy." 3D Modelers will make a subobject hierarchy that includes the proxy objects, and when the box reads "True", collisions will be calculated for that object. Why use a property box? Because going into the Alice Object Gallery that seldom exceed several hundred polys and adding twenty more for a proxy is pointless. Only someone who is seriously inclined to add collision will go through the extra steps to add a proxy to reduce lag. Edit: The serious problem with collision lies in what you're going to do with it. In game engines, a lot of power is consumed calculating physics from collision. So, you're going to have a simple IsColliding function? There's nothing wrong with this if you want to make an object absolutely stop upon impact. The problem is, physics needs more information. Magnitude and speed and whatnot. You can get this from the object itself but the object needs to be about as complex as a sphere. Last edited by Mr Kidnapper; 11-14-2011 at 06:55 PM.
 Dameria Senior Member     Status: Offline Posts: 978 Join Date: Sep 2009 Location: United States 11-14-2011, 07:53 PM I think simple box collision is the best way to do it in Alice... no need to get complicated and use Battlefield 3 type collision detection where you can walk on every polygon. I mean, even the Call of Duty games still use box collision for most objects (except slopes). 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
 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 11-14-2011, 08:02 PM Call of Duty was never known for its graphics.
Dameria
Senior Member

Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
11-14-2011, 08:15 PM

Quote:
 Originally Posted by Mr Kidnapper Call of Duty was never known for its graphics.
*Facepalm*

Collision detection has absolutely nothing to do with graphics

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

 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 11-15-2011, 09:58 AM Oh sure it does. Collision detection is based on polys. While the polys remain unseen, it doesn't mean it doesn't have great impact on graphics or gameplay.
 Dameria Senior Member     Status: Offline Posts: 978 Join Date: Sep 2009 Location: United States 11-15-2011, 01:38 PM Unseen polys are not graphics. Graphics are the art of the game; the actual functionality lies in the code. I know what your saying though, I just wanted to make clear that CoD's graphics don't have to do with its collisions. In another game like BF3 though, the graphics might have to do more with collisions, but even there its really two very different things. 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
 drellem Member     Status: Offline Posts: 35 Join Date: Jun 2012 06-24-2012, 09:04 AM I completely agree that collision detection should be built into Alice. However, with many objects, things could get unnecessarily laggy. I think that Alice objects should have an isCollisionOn property. This way not every single on of the twenty trees in your game don't have to check for collision every time.

 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

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

 Contact Us - Alice.org - Archive - Top