• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

2D collision problem

5 posts in this topic

How exactly are you determining when the polygons collide? In my mind it seems that if you know they collide then you should automatically know where they collide... perhaps I do things differently.

-fel

0

Share this post


Link to post
Share on other sites
Ya, im using line - line interesection tests. I need to find the exact point of contact where one vertex of one polygon contacts an edge of the other polygon. The polygons dont move fast enough to warp through each other so i dont usually do point in poly tests, except for bullets.

-ddn

0

Share this post


Link to post
Share on other sites
I've thought about this a bit over the last few weeks, but been too busy to implement or test anything, so I don't know if any of it works... It sounds like what you're doing is much like what I'd like to do (Mine is an optional extra atm though, so is sitting on the sidelines *sigh*), might like to have a little chat with you and compare

The binary interpolation method should work, but there may be a problem with accuracy with integer division (an object moves 15 pixels in 1 frame, hence 7 pixels in 1/2 a frame, 3 pixels in 1/4... May not be a problem tho)

You could also extend your collision detection routine to, instead of simply saying 'yes' or 'no', to specify exactly which polygon edges participated in the collision. If your polys move within certain speeds, this info should be enough to interpolate an approximate collision coordinate.

Another method I just thought of (so have no idea at all about viability) is to extend the poly collision algorithm to return the 1/1000th of a frame segment in which the polys collided... that'd cascade down to the line intersection routine, to handle moving vectors. I'll work this one out on paper and let you know.

Regards,

White Fire

Addit:
I never did find a satisfactory way to handle three-way collisions... the collision time becomes too critical, and do you dynamically recompute the velocity and redetect for purther collisions? Ideal, certainly, but how computationally expensive to be accurate?

[This message has been edited by White Fire (edited August 19, 1999).]

0

Share this post


Link to post
Share on other sites
Thanks for all your suggestions. Well it seems like the best path for me, is not to worry about it. I have an adequate collision detection routine, and since i'm not doing a realsitic physics simulation i dont need the true time and point of collision. cya!

But from thinking about it the binary interperlation is actually the best way, but i would cull down the set of lines to be tested. Also since i wanted to know when 1 vertex hits another line, i would use point to line inclusion tests (when a point is inside of a poly vs outside) instead of line line intersection tests. From a sample of my test collision cases it about 2 lines and 2 points, so its not too expensive. You might want to try that White Fire.

-ddn

0

Share this post


Link to post
Share on other sites
Doesn't it always seem the way though? The easiest way to fix it is to work out how you can do without it? (I'm lucky and can make a choice between destroying one of the objects or ignoring it totally) Would have been nice to work it out, tho. (sigh)

Not sure about that point-in-poly testing tho... that's basically just a sequence of line segment tests, and I've optimised all heck out of my line testing code (Worst case when lines aren't parallel: 9 additions, 10 multiplications and 2 integer divisions, plus the requisite dozen-odd comparisons and logical ands

Might be interesting to shunt the binary interpolation side of things back into the line intersection code tho, save untold redundant line checks...

Anyway, luck with your project,

White Fire

0

Share this post


Link to post
Share on other sites
Hi, I'm making a top down game, and i'm having problems with the collision detection. It's a top down game so im only concerned with 2d collision detection. All the entities are bounded by collision polygons. Now, i can find when the polygons collide, but for accurate physics i need to know the exact points of collision. I've got some ideas, using a binary search in the time inbetween the collision and last frame, to find the collision point but that would be very expensive for the number of collisions i'm expecting to occure at one time. Any ideas?

-ddn

0

Share this post


Link to post
Share on other sites