• Post Reply Bookmark Topic Watch Topic
  • New Topic

GPU Parallelism?  RSS feed

 
Joshua Rodrigues
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below code is very old, but I was wondering if the Player Updating (it's a packet that sends the player updating data) that you see below would work on the GPU? I'm able to parallelize the Player Updating on the CPU but if I were to add many bots (4K+), would it be possible to load it onto the GPU for parallelism? I'm really hoping that I could. Also, I've been reading about GPGPU and packet processing. Would handling packet processing on the GPU be a good idea as well? I know data parallelism (and SIMD) would work great on the GPU but I'm not sure if packet processing would work well or not. Also, I know ForkJoin in Java deals with divide-and-conquer (recursion) and I was wondering if the player updating packet would work well with ForkJoin?

EDIT: Forgot to add in the code. Sorry! http://pastebin.com/zqYYkjt5

Thanks in advance!
 
Mich Robinson
Ranch Hand
Posts: 260
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not simply put the bots in a multidimensional array? You could then just process all bot movement etc in a simple loop in a separate thread. 4k items isn't a huge amount to deal with. Obviously if you're passing data back and forth between 4k real players on different computers then that's another matter!

You could further improve speed by marking what part of the map the bots are in. If they're not close to the player then you could just ignore them or only process them when not much is happening. If the bots are traveling together in a vehicle then you'd want to mark this so you only process the vehicle and not all the bots within it.

Out of interest what's the game you're building? Do you have a demo? Is it just you coding it?

Personally I'd avoid GPU processing (or any wild new technology) because adding a complicated new technology just pushes your end date way into the future. If you're a team working on the program and someone is willing to learn then perhaps that's OK but what happens if they leave?

Mike
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!