The Daily Click ::. Forums ::. Klik Coding Help ::. I'm having some problems with my game engine(collision wise)
 

Post Reply  Post Oekaki 
 

Posted By Message

Chris324



Registered
  30/05/2007
Points
  5
20th June, 2007 at 00:43:30 -

In the game I am working on I am having collision problem when my character moves too fast. When you are at a low speed the collision is fine, but as soon as you get past 1000 pixels Frames per second its gets bad. You'll see what I mean with my example. I locked some things...nothing personal, but I'm a bit paranoid. If something does need to be unlocked just ask me.

I'm using Platform movement engine, and for the wall jumps to give a boost of extra speed I use Current position of active X +2, and X -2

X for Knives
Z for attack(beta)
SpaceBar for Jump
Wall Jump like you would in any other game.

I can't continue with my game until this is fixed.

http://www.megaupload.com/?d=DMQG1JM0



 
n/a

BROO



Registered
  31/10/2002
Points
  595
20th June, 2007 at 04:19:24 -

Why megaupload? File will be downloadable tomorrow :---(.

I experienced some problems about platform movement when combining FL pixel-perfect moving operations with "Machine independent speed".

I don't clearly understand "1000 pixels Frames per second". 1000 pixels during one TGFLoop (MMFLoop)?

"Platform movement engine" is an extension or Custom Platform Movement done by yourself? If the second option, it would be better to split these pixel-perfect movement into two movements: 12px-perfect movement and 1px-perfect correctional movement.

It works like this: if you have to move character by 100px in dir0 in one TGFLoop, then normally you'll have to do 100 pixel perfect detections and detector movements. But it'd Be Better if you force character to do 100/12 times 12px detections, and after that, you do (100 mod 12) times 1px detections. If during the first 12px detections your character "smashes" the wall, ruch correctional 1px-perfect loop 12 times, which moves left OR... or simply move character dir16 by 12px and Then ruch 12 times 1px-perfect detection in dir0. You surely know how to handle 1px-perfect detections so I will not talk about it.

Some time ago I've done some research about ways of detecting obstacle.
http://www.tymczasownik.republika.pl/lab_detekcja.gif

Translation to EN:
Sposoby detekcji = Methods of detection
Czas wykonywania = Time of doing detection
Przemieszczenie = PX to move per single TGFLoop

1px (G&D) - pixel perfect movement (moving both character and detector every single FL Loop)
1px (D) - pixel perfect movement (moving only detector every single FL Loop and when it finishes - adjust character's position to detector)
2px (G&D) - 2px-perfect movement (when smashes the wall - correctional px-perfect loop is executed) (G&D = character & detector moved)
2px (D) - the same as above but only detector moved.
4px (G&D), 4px (D), 12px (G&D), 12px (D) are 4 and 12px-perfect provided with 1px-perfect correctional FLoop.

Note that, when you have movement like 100px, then 12px (G&D) are Way Better than any other! Function is aproximated so you can't see that 12px (G&D) "falls down" every 12px.

 
n/a

Chris324



Registered
  30/05/2007
Points
  5
20th June, 2007 at 08:43:55 -

Um what??

oh and http://www.uploading.com/files/3ZQ28OQG/Run_time_v.015L_256col.mfa.html

If that doesn't work...um...I don't know, on google it said it was the best for file uploading.

 
n/a

BROO



Registered
  31/10/2002
Points
  595
20th June, 2007 at 09:10:11 -

Oh... Multimedia Fusion :---(.

Well, never mind :---), it seems I can't help you.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th June, 2007 at 13:33:17 -

BROO, what the heck are you on about in your first reply?

Chris324: Don't touch the active's X position, it seems to mess up the PMO's own collision detection. Instead, change the PMO's X velocity variable and let it do the rest.

 
n/a

waffleton



Registered
  20/04/2007
Points
  794
20th June, 2007 at 13:38:44 -

Polish math

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
20th June, 2007 at 13:45:50 -

Couldn't open the file as the viewport object doesn't work for me (if you can make an example without it I'd take a look), and I also don't quite understand what you're saying. If the "1000 pixels" does mean a speed of 1000 pixels each game loop, then the obvious first question is "why on earth do you need soemthing to go that fast?".

Anyways, if the problem is just with collisions not working with fast moving objects (objects going through each other etc), maybe try the "move safely" extension? Alternatively, you can use fastloops to move the object in steps. Instead of moving the object 1000 pixels, you'd have an event to move it 100 pixels and check for collisions, and then an always event to loop it 10 times per frame.



 
n/a

BROO



Registered
  31/10/2002
Points
  595
20th June, 2007 at 14:55:56 -

Axel: these are some ways to do pixel-perfect detection of fast moving elements with doing less amount of calculations.

But if Chris324 is using ready-made Platform Engine, it is Obvious that manually setting its position may disturb built-in collision detection system.

Chris, just imagine that standard platform movement engine (yes, that useless) also has some problems when position is set manually. All Platform Movement Engines are like saying "I'm doing here all the work! Don't touch my object, I can touch him - use me!".

(a little hint when browsing TDC: Listen to Axel, he is smart ;---))

Image Edited by the Author.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th June, 2007 at 16:03:56 -

Yeh! That's why I've got so many stars

 
n/a
   

Post Reply



 



Advertisement

Worth A Click