• 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.
  • entries
    46
  • comments
    91
  • views
    64070

Middleware and 3rd Party Libraries in Auxnet - Part 2 - PhysX

Sign in to follow this  
Followers 0
Squared'D

1305 views

Middleware and 3rd Party Libraries in Auxnet - Part 2 - Phys X


PhysXbyNV_220x125.png

It's been a couple of weeks since I've updated, but I want to continue writing about the different middleware and 3rd party libraries that I've been using. Now I'll give some information on how I use the popular physics library PhysX by Nvidia.

What is it?


PhysX is the physics library from Nvidia. It was made by Nvidia, but it works on non-Nvidia graphics cards. I use version 3 which doesn't require any additional drivers to be installed.

PhysX can be used for rigid body physics and collision detection. It has built in shapes that can be used such as boxes, spheres, and capsules. It also supports heightfields, convex hulls, and triangle meshes.

Why did I choose it?


I was in need of a nice collision detection system and this suited my needs nicely. At the time that I found out about this, I was just a hobbyist and was looking for a free solution (or at least something that would be free until I started to make money). I tried two other physics engines and felt the most comfortable with this one.

I also liked the Phys X 2 documentation. The documentation for version 2 is much more complete than PhysX 3, but after becoming familiar with 2.8, version 3 was not too difficult. If you don't have much experience, working with the Phys X 3 documentation may be a little difficult. Even I often have to study the example code to try to figure out what's going on sometimes.

How do I use it in the game / engine?


I currently only use PhysX for collision detection. My game engine has one major division in its objects based on class lifetimes. The first division is application level and the other is state level. Application level objects are classes that need to be alive from application start until the application dies, and state level objects live and die with a state. I also use a plugin system to add functionality that's similar to adding components in a component-based entity system. Because of this, I have two basic classes that I feel fit nicely with the way PhysX is organized, CPhysX3AppAddon and CPhysX3StateAddon.

CPhysX3AppAddon
This class is responsible for physics objects whose lifetimes are the same as the app and things that shouldn't be created and recreated. It includes the following:[code=js:0]physx::PxFoundation *m_Foundation;// This should be created first to instance the higher level SDKs. As stated in the// docs "Every PhysX module requires a PxFoundation instance to be available"physx::PxPhysics *m_Physics;// This is a factory class used for instancing objects in the Physics SDK.physx::PxCooking *m_Cooking; // Only if needed// This is used to preprocesses or cook raw data and turn it into a form that can be used by PhysX
CPhysX3StateAddon
The main job of this class is to take care of the scene. So it keeps an instance to a physx::PxScene *m_Scene object. All physics bodies should be associated with a scene. As stated in the docs, "a scene is a collection of bodies, particle systems and constraints which can interact. The scene simulates the behavior of these objects over time. Several scenes may exist at the same time, but each body, particle system or constraint is specific to a scene -- they may not be shared."

The engine uses component based entities. Physics components are registered with this class.

What are my future plans?


I hope to be able to do more things with PhysX in the future like being able to throw things and have them bounce in a realistic way. I also want to see what interesting effects I can achieve by adding things like forces and adjusting gravity. Code-wise, when it comes to the ever evolving design of this engine, I want to see if CPhysX3AppAddon is even necessary. Maybe it would be better to keep things together and create and destroy all Phys X objects with the state.

Squared'D on social media


These days, I've been trying to increase my internet presence. I'm on Google+ now, and I have a YouTube channel. If you'd also like to gain more exposure, let's subscribe and follow one another so we can pick up more followers. I think this could help some of us grow our brands. You can leave a comment below if you think this sounds like a good idea. I'll follow most games; however, I'm not into over the top violent and horror games.

Google+: Squared'D Game Google+ Page


YouTube: Squared'D Youtube Channel


dtalogo.png

auxnet+wall+paper-medium.png

0
Sign in to follow this  
Followers 0


2 Comments


Just a little clarification so as not to confuse readers. Physx only support GPU simulation only on Nvidia GPU, all other platforms will run the simulation on the CPU.

1

Share this comment


Link to comment

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