Jump to content

Can concurrency solve 0ad's problem?


Recommended Posts

It is a known issue, that when the map is crowded, the game lags...

Can it be fixed by simple CSP technique, giving every object a lightweight thread, and streaming all the processes by channels. If everything goes right, than I should expect a performance boom.

Link to comment
Share on other sites

This has been discussed many times. The idea is yes, the main thing we want is to split the AI and pathfinding from the main thread into their own threads, and send info back to the main thread. This would help a lot.

Before we do that though, we want to make sure that each part of the system is already fast'ish. For example, at the moment, each AI is keeping a copy of their own unit collections and terrain data, rather than sharing it. wraitii was last seen working on a new AI that shares it's data, which is the first step before then splitting the AI into it's own thread.

So progress is being made, but it is slow. If you're experienced enough to help, pop on IRC, irc.quakenet.org #0ad-dev and have a chat with a few of the developers if they're online. If you plan to help, make sure that everyone agrees with your solution before you start. Nothing worse than many man hours for a solution that won't fit into system neatly.

Link to comment
Share on other sites

It is a known issue, that when the map is crowded, the game lags...

Can it be fixed by simple CSP technique, giving every object a lightweight thread, and streaming all the processes by channels. If everything goes right, than I should expect a performance boom.

I'm not sure what a CSP technique is, but giving every object a thread sounds like a significant architectural change, which I wouldn't expect. I don't think there are major performance limitations in the current simulation architecture, except as Kieran says on the AI and pathfinding side which are currently more like rough prototypes and relatively easy to change (there has been significant discussion on both of these). Also it's true that they should work efficiently in a single thread first since we can't assume everyone has a multicore system, even if most users do, and threads complicate everything.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...