• 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.
Sign in to follow this  
Followers 0
dpadam450

Physics Engine Basics

6 posts in this topic

I just bought real-time collision detection and should be here tomorrow. I have used newton game physics for years at a very minimal rate but I would like to work on my own physics possibly or at least read up on it. Any other recommendations, really I would be happy just learning collision response between a stack of boxes.
0

Share this post


Link to post
Share on other sites
Start with a simple 2D iterative impulsive simulation.

* Use euler integration.
* Use the Separating Axis Test to find the minimim axis of penetration between shapes. This will give you enough information for a contact point like this:

struct Contact
{
Vec3 Point;
Vec3 Normal;
float Depth;
};

* Iterate all of the contacts, applying an impulse between the bodies to keep the relative velocity constrained (along the normal and friction axes).


Then pile a lot of boxes up and watch it fail miserably.
You'd see that a single box on the ground jitters back and forth as it solves a contact to completion in one frame, and then detects the other the next frame.

When boxes stack up, the bottom ones are pushed through the world. Stacking is impossible.

* Add persistent contacts. As contacts are detected they are compared with previous contacts and if they match, the contact is updated. Contacts aren't removed until they separate by some margin.

With that the first box on the ground doesnt jitter quite as bad. Both contacts are solved each frame. But it's still not stable. Stacks still don't work.

* Add sequential impulses and temporal coherence. Everything gets 100 times stiffer.

Boxes smoothly come to rest on floor. Each box that stacks reacts as if the box below it is completely solid. Impulses are propagated through chains.

Then to make things practical you'll need a broad phase, continuous collision, sleeping, islands, multi-threading, collision callbacks/filtering, joints, vehicles, characters.

That should keep you busy for a while. The devil is in the details (performance, memory, leaks, ease of use, features, asset pipeline). Use lots of other physics engine as a guide. They're all pretty much the same.

Read this: [url="http://graphics.cs.cmu.edu/courses/15-869-F08/lec/14/notesg.pdf"]http://graphics.cs.c...c/14/notesg.pdf[/url]
0

Share this post


Link to post
Share on other sites
[quote name='dpadam450' timestamp='1320129497' post='4879160']
I just bought real-time collision detection and should be here tomorrow. I have used newton game physics for years at a very minimal rate but I would like to work on my own physics possibly or at least read up on it. Any other recommendations, really I would be happy just learning collision response between a stack of boxes.
[/quote]

Stacks of boxes are about the most complex and difficult thing to solve in physics simulation full stop! :)

I would start learning at a more basic level...

I wrote these three tutorials which you might find useful which describe:

The basics of a physics engine, Collision detection and Advanced physics engine topics, in that order:

http://www.wildbunny.co.uk/blog/2011/04/06/physics-engines-for-dummies/
http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/
http://www.wildbunny.co.uk/blog/2011/06/07/how-to-make-angry-birds-part-2/

Cheers, Paul.
2

Share this post


Link to post
Share on other sites
I use Pauls speculative approach at the moment and it works wonderfully for bodes moving at any speed. It's also a neat trick to apply to other things that you want to arrive cleanly. It should be called, "the right way to clamp things."

The ghost collision side effect is very noticeable at high speed (100m/s, 30hz).
0

Share this post


Link to post
Share on other sites
Look at Erin Cattos presentation. They come with a simplified version of Box2D called Box2D [b]Lite[/b]. Take this simple engine and port it to 3D. You will learn a lot from this and also have some orientation. If you feel more comfortable you can add more features later on. There is a lot of information out there and some stuff like the Baraff papers are really outdated since solving on the acceleration level can lead to infinite friction forces. This is what all the impulse stuff is about.
0

Share this post


Link to post
Share on other sites
Wildbunny's got some good stuff. I understand most of the concepts, majority of the collision methods, but its really just the response. Like this collided here and is moving, is every single rigid box that hits a plane, applying a torque from the center of mass and the point of collision? Is that how you always find the way to apply angular velocity/rotation? I'll go back and check that website in-depth.
0

Share this post


Link to post
Share on other sites
[quote name='bzroom' timestamp='1320133025' post='4879167'] Impulses are propagated through chains.[/quote]

Sounds very interesting. Could you please link to a ressource explaining this in further detail?

Cheers,
Mike
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0