Alice Community  

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

Reply
 
Thread Tools Display Modes
Bullet Collision
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Lightbulb Bullet Collision - 08-11-2010, 04:26 PM

Not so much asking for help, but to help others ahead of time.

In this world, I have a way of making collision detection without making the actual bullet move.

Anybody else who might like to contribute their examples, feel free to do so.

WASD to look.

Penguin will flap its wings as long as it's within the line of fire.
Note that it is not meant to be a finished world, and you would need more variables to make the collision happen only when you're firing and whatnot.

To see what I did, look at the world.collisiondetect method and the world.collision function, located in the methods tab and functions tab respectively.
Attached Files
File Type: a2w collisionexample.a2w (749.6 KB, 169 views)
   
Reply With Quote
No replies?
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Question No replies? - 09-11-2010, 04:16 PM

lol 13 attachment views and no comments.

Seriously, do you think this is useful/better than perhaps other conventional methods for bullet detection?


And, if you think you have a good idea, go ahead and upload it!


Two-hundred and twenty-second post. YEAH!


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.

Last edited by debussybunny563; 09-11-2010 at 04:18 PM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 09-12-2010, 03:18 PM

This is the same way that I do my bullet collisions. The only thing that I do differently is, instead of "distance in front of" and "distance behind", I have "distance above" and "distance below", it seems to make it more accurate for me.

I am actually about to post a new world that I created, a Sniper example, that will demonstrate how to zoom in on Alice, how to add random recoil to a gun, and how to add this type of bullet collision (no bullets) that effect different subparts of the body, you will see it either later today or tomorrow.


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
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Thumbs up 09-12-2010, 04:56 PM

Quote:
Originally Posted by Dameria View Post
This is the same way that I do my bullet collisions. The only thing that I do differently is, instead of "distance in front of" and "distance behind", I have "distance above" and "distance below", it seems to make it more accurate for me.

I am actually about to post a new world that I created, a Sniper example, that will demonstrate how to zoom in on Alice, how to add random recoil to a gun, and how to add this type of bullet collision (no bullets) that effect different subparts of the body, you will see it either later today or tomorrow.
The way my bullet (or reference) is oriented, I have to use in front of and behind, so whatever.

Zooming, you change the viewing angles in the seldom used properties of the camera.

Random recoil, use the random number function and use min and max as your parameters.

For different subparts, just use the same bullet collision function, but in the parameter put the subpart in, and then make a method for each.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 09-12-2010, 05:40 PM

Quote:
Originally Posted by debussybunny563 View Post


The way my bullet (or reference) is oriented, I have to use in front of and behind, so whatever.

Zooming, you change the viewing angles in the seldom used properties of the camera.

Random recoil, use the random number function and use min and max as your parameters.

For different subparts, just use the same bullet collision function, but in the parameter put the subpart in, and then make a method for each.

Yeah I know, thats how I am going to make my Sniping example. It looks pretty cool so far, I want to know you opinion once I post it.

EDIT: Oh yeah, and the one thing that I have found wrong with this system of detecting is that it is not very accurate, for instance put the torus just a little above or below the penguin, it still makes him flap even though you are not aiming specifically at him, so its not the best for games because of it's inaccuracy. I have done extensive testing on this type of collision in the past (its the kind that I use for my walls as well, it works better as a 2d collision detection), and I found that it is never completely accurate unless the boundary of the object is the exact same size as the root of the object, making the object bigger or smaller will screw up the collision just a little bit, but making a huge difference when it comes to accuracy.


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

Last edited by Dameria; 09-12-2010 at 05:44 PM.
   
Reply With Quote
Well, better than other bullet collisions...
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Unhappy Well, better than other bullet collisions... - 09-12-2010, 05:49 PM

Anyway, I find it's a heck of a lot better than most other collision methods.

Once again, this is a thread to help people with bullet collision, and I strongly suggest, if you have a good/better example, post it!


Look forward to your snipe example.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.