Skip to main content
Tweeted twitter.com/StackGameDev/status/665830957769957376
Clarified and condensed wording.
Source Link
Anko
  • 13.5k
  • 10
  • 56
  • 82

Multithreaded How can I exploit multithreading in collision resolution?

I'm trying to wrap my brain around how to getspeed up my collision resolution to work withby using multiple threads.

I'v read through theBox2D's source code of Box2D and while quiteit was challenging and educating, not something toit didn't really point me to how I could use multiple threads.

I'm ready to make some sacrifices with accuracy,. I just need to be able to use multiple threads, sinceam investigating this because I have boatloads of objects in the game objects.

My current implementation handles AABB checks for 100000 objects in about 10 ms. I have no idea if this number is good, but for my purposes it seems sufficient.

WhatNext, I'm trying to figure out next is how to resolve collisions.

What would be a good way to How could I get power out of multiple threads here?

 

This is what i'm currently planning to do: (Do you see any issues with it?)

  1. Calculate position for each object in separate threads based on manifold data
  2. Update existing manifolds in separate threads
  3. get New collisions for moved objects in separate threads
  4. Repeat 10 times or until no changes

Multithreaded collision resolution

I'm trying to wrap my brain around how to get my collision resolution to work with multiple threads.

I'v read through the source code of Box2D and while quite challenging and educating, not something to really point me to how I could use multiple threads.

I'm ready to make some sacrifices with accuracy, I just need to be able to use multiple threads, since I have boatloads of objects in the game.

My current implementation handles AABB checks for 100000 objects in about 10 ms. I have no idea if this number is good, but for my purposes it seems sufficient.

What I'm trying to figure out next is how to resolve collisions.

What would be a good way to get power out of multiple threads here?

This is what i'm currently planning to do: (Do you see any issues with it?)

  1. Calculate position for each object in separate threads based on manifold data
  2. Update existing manifolds in separate threads
  3. get New collisions for moved objects in separate threads
  4. Repeat 10 times or until no changes

How can I exploit multithreading in collision resolution?

I'm trying to speed up my collision resolution by using multiple threads.

I'v read through Box2D's source code and while it was challenging and educating, it didn't really point me to how I could use multiple threads.

I'm ready to make some sacrifices with accuracy. I am investigating this because I have boatloads of game objects.

My current implementation handles AABB checks for 100000 objects in about 10 ms. I have no idea if this number is good, but for my purposes it seems sufficient.

Next, I'm trying to figure out how to resolve collisions. How could I get power out of multiple threads here?

 

This is what i'm currently planning to do: (Do you see any issues with it?)

  1. Calculate position for each object in separate threads based on manifold data
  2. Update existing manifolds in separate threads
  3. get New collisions for moved objects in separate threads
  4. Repeat 10 times or until no changes
Source Link

Multithreaded collision resolution

I'm trying to wrap my brain around how to get my collision resolution to work with multiple threads.

I'v read through the source code of Box2D and while quite challenging and educating, not something to really point me to how I could use multiple threads.

I'm ready to make some sacrifices with accuracy, I just need to be able to use multiple threads, since I have boatloads of objects in the game.

My current implementation handles AABB checks for 100000 objects in about 10 ms. I have no idea if this number is good, but for my purposes it seems sufficient.

What I'm trying to figure out next is how to resolve collisions.

What would be a good way to get power out of multiple threads here?

This is what i'm currently planning to do: (Do you see any issues with it?)

  1. Calculate position for each object in separate threads based on manifold data
  2. Update existing manifolds in separate threads
  3. get New collisions for moved objects in separate threads
  4. Repeat 10 times or until no changes