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

Supporting 100000 objects in box2d

9 posts in this topic

Hello everybody, our team is developing a game and now we're in search of an engine that can simplify our project.

1) Can box2d be scaled to use more than 100000 bodies?
2) Can box2d be scaled to do collision detection of more that 100000 shapes?
3) what is the order of the raycast algorithm used in box2d for checking if 2 bodies are in line of sight of each other?
4) What 2d engine can be used for rendering more than 100000 characters?

Thanks!
0

Share this post


Link to post
Share on other sites
[quote name='AzureBlaze' timestamp='1340110844' post='4950561']
This is more a hardware problem. My on-broad Intel HD Graphics 3000 can render around 8K 32*32 sprites with same texture at 60fps, while doing game logic and rendering simple background. With some decent graphic card you could do maybe like 50K simple sprites or particles, but 100K "characters" don't sound promising.
[/quote]
This is meant to be run on server, while showing only small part to frontend.
0

Share this post


Link to post
Share on other sites
[quote name='driuha' timestamp='1340114637' post='4950577']
[quote name='AzureBlaze' timestamp='1340110844' post='4950561']
This is more a hardware problem. My on-broad Intel HD Graphics 3000 can render around 8K 32*32 sprites with same texture at 60fps, while doing game logic and rendering simple background. With some decent graphic card you could do maybe like 50K simple sprites or particles, but 100K "characters" don't sound promising.
[/quote]
This is meant to be run on server, while showing only small part to frontend.
[/quote]

Then you don't have to render anything, to simulate 100k users on your server you need to either keep the simulation really simple or distribute the simulation across multiple physical machines. (Looking into distributed simulations is almost essential for any proper MMO project and is one of the biggest technical challenges that separate them from normal multiplayer games)
1

Share this post


Link to post
Share on other sites
Is box2d scalable to 100000 characters? The problem with the engines out there including box2d is that they run a loop and in each loop check for collisions between objects. but if instead of checking for collision on each object in each loop if we calculate when the next collision for an object occurs using equations of motion then i think it will be the most efficient.
0

Share this post


Link to post
Share on other sites
[quote name='driuha' timestamp='1340133626' post='4950683']
Is box2d scalable to 100000 characters? The problem with the engines out there including box2d is that they run a loop and in each loop check for collisions between objects. but if instead of checking for collision on each object in each loop if we calculate when the next collision for an object occurs using equations of motion then i think it will be the most efficient.
[/quote]

it really depends on what a character is, if it is just a box that you do collision detection on and nothing else then yes, Box2D should handle 100k of those unless you keep them all very close to eachother (But in that case you really don't need Box2D since detecting collisions between boxes is trivial), if you start adding in forces and actually use Box2D for what its meant for then it will most likely be far too slow for a game and there is no way around this, proper physics for 100k entities isn't really reasonable on todays hardware (Today this is solved by not doing any physic simulation at all for resting objects (objects tend to be put in a resting state if they havn't moved noticably for a few updates and are woken up again if a new force is applied to them or if the object they're resting against moves, this however doesn't work with characters as they tend to be constantly moving)
1

Share this post


Link to post
Share on other sites
physics engines use sleeping for dynamic objects. if most of them are sleeping it is not a problem.

on the other hand 100000 bodies means 100000 entities.
this means 100000 batches to renders all of them. i dont thing any cpu can handle that many render calls.
You need some awesome instancing method to keep batch count low.
even if you do so, say each character is 100 tris (low because of LOD), that is 10 million polygons, and you want 60fps?

i say: give up :)
1

Share this post


Link to post
Share on other sites
You could easily do thousands of colliding instances if you implement some clever spatial partitioning. I've seen some grid based solutions used in physics engines that allowed for a lot of colliding objects . Also having hundreds of thousands of objects in a scene does not mean you have to render all of them. The trick is determining the potentially visible set, which you can do with a quad tree, bsp or whatever spatial partitioning technique best fits the job. You might want to look up some stuff on [url="http://en.wikipedia.org/wiki/Space_partitioning"]spatial partitioning[/url] too while you're at it.

EDIT: That quadtree collision video, top left corner says ~10,000 objects:

[url="http://www.youtube.com/watch?v=jOGRwtPcQlU&feature=relmfu"]http://www.youtube.com/watch?v=jOGRwtPcQlU&feature=relmfu[/url]

After watching this, I think you should re evaluate your need for that many entities... lol Edited by M6dEEp
1

Share this post


Link to post
Share on other sites
Yes, Box2D does Spatial Hashing, I'm sure (chipmunk-physics does for sure, and you define the grid size). And, I'm sure Box2D handles sleeping objects (again, I know chipmunk-physics does).

So, it really depends on how you're setting up your environment, and how many objects are truly active, and how close the objects are to each other.

BTW, this question should really go onto the Box2D forums. They would be able to give you more detailed answers.
1

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