Results 1 to 13 of 13

Thread: Collision detection and other woes

  1. #1

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Post Collision detection and other woes

    I decided it might be fun to "knock out" a game or two.

    as all they seem to want to teach me is database access I realised I was going to have to teach myself this stuff.

    I've got clear in my mind the static background, scrolling background and scrolling foreground.

    The trouble is I would really rather avoid useing a massive set of tiles to program the play area itself.

    Is there anyway I can draw the level, mask the fella and then use a simple(ish) set of calls to see if my non-discript charicter should stop falling now please.

    Then that opens up the head ach of acurately locating enimies die when you tutch this thing, things etc.

    I think I may need to use a whole new approach but it's got me beat.

    Any help on this would be very cool as I refuse to start a program until I know exactly how I inteand to go about it.
    ?
    'What's this bit for anyway?
    For Jono

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Can you give me some geometrical background, collision detection is a fairly simple geometrical principle, but i need some parmeters so that i know what simplifications can be performed.
    1. how many dimensions?
    2. What shapes of objects?
    3. What kind of movement?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    a good long sideways scrolling screen.

    Left and right with some jumping (and falling) so up and down as well although a lot more down than up.

    nice rectangual platforms hidiously iregualy other things currently existing as a nice long BMP (static bits anyway)

    Just what else the as yet undecidedly shaped hero will be and his equally defined areas of doubt and uncertainty baddies depends largly on if I come across any decent BMPs in my travles.

    sorry I can't be more specific I've only being working on this idea a few days.
    ?
    'What's this bit for anyway?
    For Jono

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    about the hidiously iregualy other things, can they be approximated to rectangles as well or ellipses or even circles? (rectangles to prefer)
    All rectangles are perpendicular to each other?
    The "level" rectangles are bound to a map matrix or just floating around? are they all same size and square?
    Does the irregular shapes bump into each other?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Angry erm yes no, maybe

    the main static thing will aproximate to an equalatral triangle coz it'll look ace. (I hate trig maths it does my head in)

    platforms very rectangle

    i guess i could keep the bad guys pritty much elipsoidical

    I was hopeing I could get away with drawing a bmp file and masking it then telling vb don't move movable thing if it hits non transparrent bit then I could give an aprox location for items and have them drop till they land on a platform!

    ladders and floaty up and down I hoped to tell go float nearish to this bit etc.

    was also hopeing to slap in a few invisible markers to play amusing noises when encountered.

    I'm thinking my draw it and apply a nice simple (ish) engine is going to become a thing of the past.
    ?
    'What's this bit for anyway?
    For Jono

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Okay you have ellipses, triangles, rectangles (can they be angled?) what collisions between these?
    btw forget about going trough the rasters, it'll hog up lots of performance if you have them running on objects trouh each frame. Also what amount of objects (about) do you have moving at the same time. Collision detection will hog up in rate of permutations between them so better keep it reasonable or else you would need a bsp tree which is pretty much opposite to the simpleness you want :/
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    I was thinging about 5 to 10 elips types "running" around and maybe six or seven up/down rectangles plus five or size left/right.

    Colision detection would mainly be of the stop falling here order.

    as well as the can't walk here coz its a wall (duh) order as well.

    oh yes and the very important tutch the triangle and die type.

    was considering the old tutch it to collect it thing as well.
    ?
    'What's this bit for anyway?
    For Jono

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    ok, I assume they are all perpendicular, most sidescrolling games i've seen has it that way.
    We define the ellipses, btw we can pretty much use rectangles instead for collection between them and walls/floors, as:
    A,A+C
    A being offset vector and C being the size of the sprite.
    Collision between any of them and any rects (a,a+c) is pretty straigh forward:
    A.x+C.x>a.x and A.x<a.x+c.x and A.y+C.y>a.y and A.y<a.y+c.y
    About the triangle, can you approximate it as a rectangle as well? that would help.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    Ok thanks I think I follow.

    I guess I could approx the triangle to rectangles but the collision detection might look a bit cack.

    Thanks for the help tho... My brain will now go and craw under the carpit for a bit.
    ?
    'What's this bit for anyway?
    For Jono

  10. #10

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    I must confess that I don't fully follow.

  11. #11
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Okay (sorry for the delayed reply) i am willing to explain again, if you don't understand something.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  12. #12
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    You should definately go for a tile engine
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  13. #13

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    Originally posted by kedaman
    A being offset vector and C being the size of the sprite.
    Collision between any of them and any rects (a,a+c) is pretty straigh forward:
    A.x+C.x>a.x and A.x<a.x+c.x and A.y+C.y>a.y and A.y<a.y+c.y
    About the triangle, can you approximate it as a rectangle as well? that would help.
    with all that algibra after such a long time (6 years) my mind is simply boggling and refuses to process the information.

    Sorry to be dense do you think you could break it down for us old fickos.
    ?
    'What's this bit for anyway?
    For Jono

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width