Collision without "Physical Response"?

Non-platform specific questions.

Collision without "Physical Response"?

Postby Hblade » Sat Apr 10, 2010 11:38 pm

Is there a way to make a collision event without using Physical Response?
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Collision without "Physical Response"?

Postby Camper1995 » Sat Apr 10, 2010 11:56 pm

Yes, I was thinking about this too and I must tell you, that is really easy.

First make variable called "collision" or however you want.
Then you just add. When player collide with object > collision=0;

Collision finish>collision = 1;

Ok. Then just put on draw actor: If collision == 1 {speed}

I think this should be work. ;-)
________________________________________________________________

CAmPeR :D
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Collision without "Physical Response"?

Postby Hblade » Sun Apr 11, 2010 12:42 am

Cool thanks :D So simple yet effective :D + 1 :3
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Collision without "Physical Response"?

Postby Camper1995 » Sun Apr 11, 2010 6:51 am

Hehe :D No problem ;)
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Collision without "Physical Response"?

Postby Hblade » Sun Apr 11, 2010 12:17 pm

This will prevent lots of lag ^.^
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Collision without "Physical Response"?

Postby Camper1995 » Sun Apr 11, 2010 4:49 pm

Sure it will. But I was testing that and if you have too high velocity, you actor go trough the colliding object. :S

Dont know, maybe its just wrong in my script
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Collision without "Physical Response"?

Postby Thanx » Sun Apr 11, 2010 5:32 pm

No, the reason is GE's collision detection misses collisions, because the actors simply go through eachother from one frame to another. The way the whole thing works, is that the objects are not moving, but teleported every frame. Collision detection makes sure that when an actor is teleported next to, near, or on another one, then it checks to see wether they really met, then does the actions.
At high speeds the teleport takes the actors farther, and the result can be that one of the actors simply get teleported to the other side of the actor... It's GE's collision detection that needs to be corrected...
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Collision without "Physical Response"?

Postby Hblade » Sun Apr 11, 2010 7:14 pm

That's correct, thankx but if you were to use specify rather then the original, for example:

w.JPG


You won't run into that problem :D Even if the frame has the actor skip like 40 pixels it'll still collide correctly. Atleast I think thats how it works because one time I did have the perfect collision :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Collision without "Physical Response"?

Postby Thanx » Sun Apr 11, 2010 9:15 pm

Ok... Well YOU have the codes for GE and not I!!! :lol: Maybe you could check out what's the reason for that? :D
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Collision without "Physical Response"?

Postby Hblade » Sun Apr 11, 2010 9:20 pm

I think the reason is because the actor's graphic doesn't load if he's being transported like, say if he is here:
[]
[]
[] o.o

And he moves left to the size of the wall, he will be here:
___[]
___[]
o.o[]

But if you use specify, it loads the pathway that he's going I think... Something like that so if he's going to be colliding with the wall, it'll calculate the remaining pixels he is from the wall and then prevent him from moving that far
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Collision without "Physical Response"?

Postby DST » Sun May 30, 2010 5:07 am

Thanx wrote: It's GE's collision detection that needs to be corrected...


I wouldn't say that it needs to be corrected, because for most things it works just fine. If ge were to use a predicting method of collisions based on angle and velocity, you'd have two major problems:

1. it would gobble cpu with high actor count. My games 'Monkey Apocalypse' and 'Orbs of Death' would not be possible.

2. it would have just as many errors, because actor speed and velocity can change anytime. If you have four actors bouncing in a cluster, then the first two collide, and their velocities change. So which velocity do we use? The one going into the frame, or the one after the last collision in the frame? In the latter case, collision priority would be a matter of the order in which the objects were rendered, by their position in a. the actor list and b. their cloneindex.

Predicting the outcome would be impossible for you, the user. While order is still determining the current collision method, at least its based upon the actual xy position, rather than predicted position. That means a much more realistic outcome of a cluster of 4 actors than if you used the predicting method. The last actor might not collide with anything at all because the other three are predicted to be somewhere else by now, resulting in a visual collision that you saw happen with your own eyes, yet resulted in no physical response at all.

I believe Ge's method is as good as it gets, and it is based upon methods that are used in games industry wide.

The old saying rings true: Better, Faster, Cheaper. Pick two. Ge is designed to let you make whatever game, not just certain types. And there's no way Mak can predict what you are going to make next.



A side note on previously mentioned issues with "left side of block collision takes precedence over right side collision in platformers". The reason for this is actually quite simple:

When you test for collision, you flip thru the pixels of each actor until you find two pixels that are in the same space and both not transparent. When that collision is found, the script stops, and enacts your collision event, therefore left(min) will be found before right(max).

If it did not dump the script upon finding the first colliding pixel, but instead read through the entire pixel array of both actors, the speed would be reduced exponentially. And with a platform that exports to phones and gp2x, speed is of the essence.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron