Sign in to follow this  
Followers 0
Annozero

Performance Problems?

32 posts in this topic

Hi, first post here, I just discovered 0ad and think it is fantastic.However, I have some performance problems: as I create more units and buildings the game becomes increasingly slower, until (when I have about 100 units) it pauses for about half a second every two-three seconds, so that it is really difficult to play.I have a Quad core cpu at 3.5 Ghz, 8Gb of RAM and an Nvidia 285 GTX 2Gb. I'm on Linux amd64 using the proprietary driver.Is it a known problem? Thanks.

Share this post


Link to post
Share on other sites

Although not quite as impressive as your spec, my MacBook Pro has pretty good specs, and also doesn't run the game particularly well. I think at this stage it is normal.

Share this post


Link to post
Share on other sites

With those specs you shouldn't get that problem. There might be issues with the driver or something, but a computer with those specs should be able to run the game well even at this moment. I'm afraid I don't have any idea how to debug it though, but hopefully one of the programmers will.

Share this post


Link to post
Share on other sites

Try to turn off shadows, water reflections and don't use any bots. Make 100 units. Any difference?

Share this post


Link to post
Share on other sites

That would not make any difference. Likely it is the AI and pathfinding that is slowing him down. If he played in what I call "sandbox" mode, e.g. with no AI players, then I am sure his performance would increase substantially. If he's playing against AI players, then there aren't just his 100 units on the map, but each AI player will probably have near that many as well. The big problem with performance is pathfinding at this juncture. So, try playing it without an AI opponent and see how many units you can make without experiencing slowdowns.

Share this post


Link to post
Share on other sites

If he played in what I call "sandbox" mode, e.g. with no AI players, then I am sure his performance would increase substantially.

Yes. My "no bots" mode = your "sandbox" mode. The shadows and reflections could help only a bit when problem is in pathfinding.

Share this post


Link to post
Share on other sites

Thanks for your replies. The problem seems indeed AI related: with only me, I could get up to 280 units without any noticeable slowdown. Just to be sure, I tried again with a single opponent and by the time we both had about 130 units the game was really unusuable. Map size or graphical effects don't seem to matter.

Share this post


Link to post
Share on other sites

That's been what I see as well. I have a quad core, 4 GB DDR3 RAM, Radeon HD 4650, etc. The "graphical effects" in our game are minimal, really. Any graphics card and processor less than 4 years old should run the game rather well on the graphics side. We just have a lot of optimizing to do with the AI and Pathfinding.

Share this post


Link to post
Share on other sites

Just to add some more detail to this report. Myself and a friend have been playing multiplayer (internet, not LAN) games against two AI opponents. The slow downs seem to be fairly synchronised between us, lasting the same length of time as the game progresses until the game is fairly unplayable. We're able to finish the game, but it's freezing up every second for half a second by the end.

Our machines are both reasonably powerful, an AMD Phenom 9950 and an overclocked Intel i7 each with 4GB of RAM, I can provide a more complete hardware/firmware/driver breakdown if useful.

Share this post


Link to post
Share on other sites

Just want to mention that there's already been some changes to the code in SVN that makes the game quite a bit faster, and there's potentially a bit more on the way, so hopefully Alpha 7 will perform better on your computers :)

Share this post


Link to post
Share on other sites

Just want to mention that there's already been some changes to the code in SVN that makes the game quite a bit faster, and there's potentially a bit more on the way, so hopefully Alpha 7 will perform better on your computers :)

If I update SVN and build the game in Release mode in VS 2008 will this provide an accurate test? If so I'll do this now and let you know of the improvement.

Share this post


Link to post
Share on other sites

If I update SVN and build the game in Release mode in VS 2008 will this provide an accurate test? If so I'll do this now and let you know of the improvement.

No need to build it yourself, there is a Windows binary included in SVN :) Though sometimes it might be a short while between new code changes and the autobuilt binary is updated so at times it might be useful to be able to :) Generally the autobuilt one should work fine though.

Share this post


Link to post
Share on other sites

Sounds like the slowdown is mostly AI and/or pathfinding, and the changes in SVN have mostly been optimising graphics, so it's probably unlikely to make much difference.

Share this post


Link to post
Share on other sites

Hi, guys, first post, I am glad I found the great 0 A.D. and that I could join the community!

The performance issue seems to arise when a great number of units is moving around.

I just did a quick test on Peloponnese:

- Full scenario (six or whatever AI players) is totally unplayable. Disabling shadows and reflections gives no benefit;

- Same map, no AI (players set to "Unassigned") - great FPS even with 128 static and ~72 units gathering resources;

- Same map, no AI - horrible performance with 128 units being moved in a formation ("Loose" being only available for female citizens) and ~72 units gathering resources.

PC is AMD Athlon II X4 640@3000MHz, 4 GBytes memory, kernel 32-bit 2.6.32-33.

Share this post


Link to post
Share on other sites

The biggest issues with performance right now are AI and Pathfinding. Your experience with the game pretty much confirms this. :) These are known issues and we're working on them. (y) What version of the game are you running, btw?

Share this post


Link to post
Share on other sites

The biggest issues with performance right now are AI and Pathfinding. Your experience with the game pretty much confirms this. :) These are known issues and we're working on them. (y) What version of the game are you running, btw?

It's the latest Alpha release, Fortuna, I think, built on 10.Jul.2011.

BTW, I think I saw 0ad utilizing only one of the cores in my SMT system.

Shouldn't it take advantage of SMT, also having in mind that almost all new PC systems sold worldwide are such?

Share this post


Link to post
Share on other sites

Our design predates the widespread availability of multiple cores and logical processors.

While we do have a few threads, it is very difficult to retrofit scalable parallelism into game engines.

Share this post


Link to post
Share on other sites

Our design predates the widespread availability of multiple cores and logical processors.

While we do have a few threads, it is very difficult to retrofit scalable parallelism into game engines.

The most processor-intensive ones should be rewritten to take advantage of SMT (Don't shoot me, that's just my opinion).

As you say, with the core created so long ago and with many basic features still missing from the game, reassigning developers back to it might be....difficult?

The other route seems to be to optimize everything so that it will run any map with any number of AI objects on any processor made today.

Share this post


Link to post
Share on other sites

I do confirm this bug still exists in Alpha 7 Geronium!

Really, guys, why bother add new civilizations, new features, new units, new UI, if the game is not playable with more than 60 units per party?

Share this post


Link to post
Share on other sites

I think Alpha 7 has some renderer optimisations, but no gameplay optimisations, so it shouldn't be any better. There's various performance problems in code I wrote that I'm interesting in fixing and have various ideas for (particularly redesigning the pathfinder to work much better in the worst case), but I've not had any time recently to work on them, but it's a high priority and should be much improved for the next alpha release :)

Share this post


Link to post
Share on other sites

Don't forget that people who can't fix the hard things can still work on other things. We had enough changes to warrant a release, but the programmers that work on performance related things didn't have nearly as much free time this cycle. :)

Share this post


Link to post
Share on other sites

what a pitty! i like to play 0AD... even if it is an alpha is fun playing with it

but when games began interesting i have to kill the match for this bug :(

is there any workaround?

Share this post


Link to post
Share on other sites

Hi, first post here.

I would like to add my 2 cents about performance.

My specs:

  • Intel 3.0 GHz Pentium D (Dual Core, but not Core2Duo)
  • Nvidia GeForce 7600GT, 256MB
  • Debian Squeeze
  • "nvidia-glx" driver package

My experience with the game:
  • Alpha 7 - "10288 release"
  • 1024x768 Windowed
  • Any game, with or without AI is very slow and laggy from the start.
  • CPU usage is always 100% when unpaused.
  • CPU usage is between 40% and 90% when paused.

This is probably (obviously?) not a problem with the path-finding algorithm consuming too many CPU cycles. Is there anything else I should/could investigate to find the source of this particular performance problem?

Share this post


Link to post
Share on other sites

This is probably (obviously?) not a problem with the path-finding algorithm consuming too many CPU cycles. Is there anything else I should/could investigate to find the source of this particular performance problem?

Hi, welcome to the forums.

You can use Shift-F to display the framerate, which give more quantified information about the lag. More interesting to you is if you press F11 you will load the profiler view, then you will get a breakdown of how much time each component is taking. 0AD doesn't limit the framerate so it is normal for the game to use as much cpu as it has available and I find it uses a significant amount of cpu for me while paused as well.

Share this post


Link to post
Share on other sites

Mine is Alpha 7 - "10288 release" too, on Ubuntu 10.04 LTS, Quad core 3GHz Athlon CPU and after a while the game becomes too slow with many units.

My Profiler shows initially some 10-20msec for both renderer and Interpolate, but after a while and after all bots gather armies, the Simulation update takes precedence with more than 100, and even more than 1000 at times. The map is Acropolis, default everything, 3xJubot and me, 150+ units each.

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