Jump to content

How to make the game smoother?


Stephanus
 Share

Recommended Posts

Hello everyone, I play '0 a.d.' on Linux Mint 14 and have gameplay not as smooth as in this video:

(tried it also on Windows 7 - the result in the same).

It's not smooth because of loading different actions and operations during the game.

How to make everything smoother? Or it's just alpha and everything's going to be polished in the future?

Regards

Edited by Stephanus
Link to comment
Share on other sites

When does it get not-smooth? Is it from the start of the game? Or does it start later?

How many players? AI/human? What are the specs of your computer?

There are a lot of things that influence the smoothness of the game. If you take a look around you may find what you seek, most (if not all) of the important issues are already of the forums.

Link to comment
Share on other sites

Same here. I'm running the game on ubuntu 12.04

Its not-smooth from the start of the game (the menu is smooth of course)

It's just me and one enemy (AI)

specs:

AMD Phenom 9600 Quad-Core Processor × 4

ATI Radeon HD 7850 (VESA: -102)

8GB RAM

By the way: Interresting game. Hope to learn to help you with blender ;)

  • Like 1
Link to comment
Share on other sites

When does it get not-smooth? Is it from the start of the game? Or does it start later?

How many players? AI/human? What are the specs of your computer?

There are a lot of things that influence the smoothness of the game. If you take a look around you may find what you seek, most (if not all) of the important issues are already of the forums.

It's not smooth from the start of the game because of everything being processed - orders, appearance of units and so on.

Two teams - me and AI. My PC is Intel Core Duo 2.4 Ghz, nVidia GeForce GTX 550 Ti 1Gb, 2 Gb RAM.

Link to comment
Share on other sites

Zoot's completely correct, hence the "alpha" title.

I'd just like to point out that mostly the bottlenecks are CPU-bound, not GPU-bound. Pathfinding is our largest bottleneck and that's entirely CPU. Disabling some graphics settings will help some (the graphics stuff hasn't been well optimized, but it's still reasonably fast), but still expect a lot of lag even if you do.

Link to comment
Share on other sites

I suspect a lot of that video was recorded without any AIs by someone on a fast computer.

I'm not sure what you mean by "smooth" though. What frame rates are you getting? In the early game it is very "smooth" even on my relatively old computer. The lag only hits late game.

Link to comment
Share on other sites

this appears to be a regression. I think there was a previopus alpha that did this(2-3 versions back?). my desktop is fairly well spec'd (fx8350, 16GB 1866mhz ram, 990fx MB, Radeon HD 5800 Series) and the previous alpha ran just fine at least until 3-4 players on 4 player map with all eye candy had reached their full population, chaotic war on all fronts, etc. Now it's freezing as if on a timer from early in the game.

Link to comment
Share on other sites

this appears to be a regression. I think there was a previopus alpha that did this(2-3 versions back?). my desktop is fairly well spec'd (fx8350, 16GB 1866mhz ram, 990fx MB, Radeon HD 5800 Series) and the previous alpha ran just fine at least until 3-4 players on 4 player map with all eye candy had reached their full population, chaotic war on all fronts, etc. Now it's freezing as if on a timer from early in the game.

Well that's not good. Perhaps something actually is messed up. I haven't experienced such a problem at all however, from Alpha 10 to Alpha 13 (actually 13 feels faster, probably thanks to sbte's work). Are you using up-to-date graphics drivers?

Link to comment
Share on other sites

Perhaps you can have a look at the profiler during a game and look at the timings. The profiler can be brought up with F11 (and framerate with alt+F ). It shows how many milliseconds were spent on each separate step, info that help determine where your computer has a bottleneck.

I have attached an example of the profiler, at the start of the Mauryan Punjab demo with 1 Aegis AI bot:

post-14722-0-64760200-1365163120_thumb.p

The sim parts (simulation, pathfinding, AI and such) and the render parts (drawing the models to screen) are the most important (the rest should be fairly quick, plus there isn't that much that can be done about those). In my example you can see that the sim steps take up about 26 ms per frame, whereas rendering takes 81 milliseconds. No surprise the framerate is just 7fps.

If you would open the Settings dialog from the top right corner menu, you can turn on and off different things and see it reflected in the render time. For example, turning off particles and shadows each reduces the render time by about 10 ms/frame for me. None of it is going to help me much, because my computer won't ever come close to a bearable framerate (anything 20+ fps) on a dense map like Punjab. Even on the lowest settings quite empty maps like Oases give me only 25 fps. But such stark differences show that for my computer the graphics are the main bottleneck. In my case I could switch from OS X to Windows on the same machine to improve the performance by quite a bit (30 fps should be possible with low AI action going on).

So, profiling can help you determine what causes a low framerate. In my case I could switch to a lower resolution (1920x1080 is clearly too much) to improve performance. On the other hand, even if rendering took no time at all, the framerate would still be just 40 fps.

Edited by dvangennip
  • Like 1
Link to comment
Share on other sites

I've written above that the game is twitchin' even with all the graphical options off.

Here are my rates during active playing for Athenians against Iberians (me vs. 1 AI) with all the options on (FPS is lower when zoomed out and higher when zoomed in (varies from about 20 to 80 FPS).

7fa878e5920a00f37ca9579dc2015b5e.jpg

Edited by Stephanus
Link to comment
Share on other sites

Guys that's not because of graphics adapter or so. That's because of everything processed during the game. Maybe it's rough CPU work or so.

Right, because you're an expert on that.

Seriously, check your graphics drivers. The game isn't laggy at all at the start, unless you're either on a really old computer or have really bad drivers.

Link to comment
Share on other sites

:P There is nothing unusual in your profiler output, so it would have to be something unprofiled. No one else seem to have encountered it over the ~6 month development cycle, though. (Edit: more like 3 month, but still.) Edited by zoot
Link to comment
Share on other sites

Well that's not good. Perhaps something actually is messed up. I haven't experienced such a problem at all however, from Alpha 10 to Alpha 13 (actually 13 feels faster, probably thanks to sbte's work). Are you using up-to-date graphics drivers?

well i certainly don't mean to criticize anyone's work. 0ad is the only game i play. :) just seems like it's something with the game to me, but i'm not 100% sure that a package update didn't cause it.

environ details: mesa and related: 9.1.1-1, xf86-video-ati: 1.7.1.0-3, xorg 1.14.0-2, linux 3.8.5-1.

Link to comment
Share on other sites

Perhaps you can have a look at the profiler during a game and look at the timings. The profiler can be brought up with F11 (and framerate with alt+F ). It shows how many milliseconds were spent on each separate step, info that help determine where your computer has a bottleneck.

I have attached an example of the profiler, at the start of the Mauryan Punjab demo with 1 Aegis AI bot:

post-14722-0-64760200-1365163120_thumb.p

The sim parts (simulation, pathfinding, AI and such) and the render parts (drawing the models to screen) are the most important (the rest should be fairly quick, plus there isn't that much that can be done about those). In my example you can see that the sim steps take up about 26 ms per frame, whereas rendering takes 81 milliseconds. No surprise the framerate is just 7fps.

If you would open the Settings dialog from the top right corner menu, you can turn on and off different things and see it reflected in the render time. For example, turning off particles and shadows each reduces the render time by about 10 ms/frame for me. None of it is going to help me much, because my computer won't ever come close to a bearable framerate (anything 20+ fps) on a dense map like Punjab. Even on the lowest settings quite empty maps like Oases give me only 25 fps. But such stark differences show that for my computer the graphics are the main bottleneck. In my case I could switch from OS X to Windows on the same machine to improve the performance by quite a bit (30 fps should be possible with low AI action going on).

So, profiling can help you determine what causes a low framerate. In my case I could switch to a lower resolution (1920x1080 is clearly too much) to improve performance. On the other hand, even if rendering took no time at all, the framerate would still be just 40 fps.

thanks for the info. my rendering stays somewhere between 15ms and 25ms(30 maybe?) but sim update is spiking to 125-210ms or so right at/after the freeze occurs so i'm guessing it has something to do with that (unless that's just a coincidence/indirectly related and is within acceptable limits). I'm not seeing anything else taking any time to speak of. also, turning off all graphics extras in settings doesn't seem to have a noticeable effect and i never had to turn any of that off before, either(assuming i keep it at or below 3 players on a 4 player map with default pop limit).

Edited by clever_nick_here
Link to comment
Share on other sites

Try running the game with Very Sleepy. That profiler doesn't look super in depth, although maybe I just can't see the buttons.

http://www.codersnotes.com/sleepy

I had a huge lag issue on my project and that thing made it super easy to find and remove. It traces all the functions and the functions they call all the way down to new delete and allocs and what not.

Link to comment
Share on other sites

The game also has a built-in, web-based profiler that you can access by pressing F11 in-game and then opening profiler2.html in source/tools/profiler2 (you probably need SVN for this)

The problem with performance issues is we know they exist, but they have different causes for different systems. Since the renderer and gameplay run in a single thread, the user may feel like they're experiencing graphics related lag, because the UI will become less responsive, when really it's the AI or pathfinder causing the trouble - and that varies depending on the exact map and game situation (large formations? water? dense trees?). Sometimes slow hardware can be the problem, more often bad drivers, but with good drivers and a decent system, you shouldn't have much trouble. Multiplayer games add another potential for lag with network latency. Without in-depth profiling it's not simple to distinguish all these cases.

FWIW we had a staff multiplayer match a few weeks ago, it was 8 players (4 human, 4 Aegis bots) on a large random land map, and there was surprisingly little lag, either from the game or network related.

Link to comment
Share on other sites

thanks for the info. my rendering stays somewhere between 15ms and 25ms(30 maybe?) but sim update is spiking to 125-210ms or so right at/after the freeze occurs so i'm guessing it has something to do with that (unless that's just a coincidence/indirectly related and is within acceptable limits). I'm not seeing anything else taking any time to speak of. also, turning off all graphics extras in settings doesn't seem to have a noticeable effect and i never had to turn any of that off before, either(assuming i keep it at or below 3 players on a 4 player map with default pop limit).

As has been said before, many things are cpu-bound right now. You can step into the different components with the number in front of the lines, so maybe you can localize the culprit by stepping into sim update.

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...