• 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.

Sphet

Q: Implementating a Physics System

1 post in this topic

Hello, I''ve started working on a really small simulation that I hope will lead to other projects. What I am trying to do is have a collection of conveyor belts (defined simply by two points and a velocity vector), and a box. The box should obey the laws of gravity, falling from one conveyor belt to the other. What I am wondering is how best to implement the physics engine. Although all of my data is stored as 3D point data (I am using direct 3d for visualization), I am only concerned with a 2D side view. Does the normal collision sphere followed by triangle intersection test seem the best way to go? Can someone give me a basic rundown on the right way to do a physics engine.. how does one decide what order to check all the objects in the world, when is it done, etc. Also, if I have a couple of conveyor belts that are attached in a V, how do I figure out that, as movement on one length of the belt is finished, the box moves to the next.. I''m pretty new to all this, having implemented simple gravity in 2D side scrollers in a really simple way before. Many thanks.
0

Share this post


Link to post
Share on other sites
If your boxes aren''t rotating as they fall and your belts are horizontal, just use the standard box test. Roughly, in pseudocode:

if (bottom of box <= top of collision object) &&
(top of box >= top of collision object) &&
(left side of box is within horizontal range of collision object) ||
(right side of box is within horizontal range of collision object)
// Collide objects here


Otherwise, a circle test should work just fine. It''s like the sphere test but without the z-value. Note that you must constrain your objects'' speed per step or else use a trace-style intersection wherein you test the volume through which an object moves rather than the object itself. This applies to collision volumes as well.

A good physics engine will have a clock independent of (but preferably as fast as or faster than) its graphical counterpart. Testing collisions in the immediate area only (and, if you want, in "action areas", ie areas where interesting things are happening) will reduce the required processing power. I would suggest to you that you try using a graph of objects and a list of active objects. Populate the list with all active objects within the graph, and if a particular interaction affects a deactivated object, reactivate it, but wait until the next time step to work out the effect. Make sure that all your reactions are constrained, if possible, since you otherwise will get perpetual rattling, by which I mean objects will interact every frame and will not settle.

If you take a look at many last-generation FPS engines, a box or cylinder test is all that is used - no triangle intersection is calculated. Of course, for a physics-heavy game (see Hitman), triangle intersection is more important.

As to the V arrangement, use the circle test and use a physics clock to run your system. Run the clock at all times, of course.

ld
0

Share this post


Link to post
Share on other sites