• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GPU Parallelism?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 287
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic