Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#522 closed defect (fixed)

Latest 0ad SVN source is running slow

Reported by: Kieran P Owned by:
Priority: Must Have Milestone: Alpha 1
Component: Core engine Keywords: speed, slow
Cc: Patch:

Description

I tried 0ad pre alpha 3. Despite my fairly modern computer (3 years old, 2gb ram, 256-512mb graphics card), it was running slow (moving mouse had about a second's delay). So I've checked out the latest source and tried to run it, with no change. It gave the follow message:

Your graphics drivers do not support S3TC compressed textures. ...[snip]...
Installing the libtxc_dxtn library will fix these problems.

So I followed the link in the message, compiled and installed the library, and things got FAR WORSE!! Moving the mouse had a 5 second delay, and for only 1/4 of the distance I moved the mouse (non-technical term would be jumpy). I couldn't even reach the exit button, so had to force quit the game and uninstall the dxtn library.

I've already taken advice to disable water and shading etc etc. But with no change, because... this slowness is happening on the main menu, not even within the game where most of the effects are.

It's not just this computer. Another computer, with a different OS, different specs, has the same speed issues. I love the concept of an AOE like game, and looking forward to when multiplayer is actually possible, but at it's current state, I'd be lucky to find anyone with a computer fast enough to show me what the game is like.

What am I doing wrong? What information can I provide you with to help get this speed up? I'm very keen to be of any help to get this sorted, so please demand anything from me :-P I am a web developer, and I have slightly dabbled in C before, so if you want any small source changes on my end to gather debug data, let me know what they are.

Keep up the great work, and look forward to solving this speed issue.

Change History (12)

comment:1 by Kieran P, 14 years ago

"I am a web developer, and I have slightly dabbled in C before"

That is to say I am very familiar with Javascript, which I see some/most files are written in, and I have basic knowledge of C.

comment:2 by Kieran P, 14 years ago

So, I was able to get things working a bit faster with an update the the version of the nvidia graphics drivers I was using. Menu is working nicely now, and the game starts off reasonably.

However, when I build around 30 units, and get 20 or so to work on the same task (like chopping wood), the game slows to a crawling speed. Is this something that can be addressed on my end or is it algorythm speed related?

comment:3 by Kieran P, 14 years ago

Had a quick multiplayer game with a family member, and the same issue with the amount of units showed itself fairly quickly. Within minutes, units slowed down, and the game became unresponsive, and this was over a LAN connection with two reasonably fast computers. For an AOE clone, you sure need a lot more modern of a computer. What's up?

In addition to the speed issues, we both noticed numerous issues. Now, issues are understandable, it's a pre alpha. The question is, do you want these all ticketed, or shall I wait until the official alpha?

comment:4 by Philip Taylor, 14 years ago

So the menu slowdown was just caused by outdated drivers? Hmm, it'd be nice if we could detect that and warn users, but I've got no idea how.

Are you compiling the game in Debug mode (the default) or Release mode (with "CONFIG=Release make" then run ./pyrogenesis, or click appropriate buttons in VS on Windows)? Debug will be much slower because compiler optimisations are disabled.

Pathfinding for large groups of units is slow (it probably needs a new pathfinding algorithm for that case), but in Release mode it should generally work okay for a few dozen units.

There's a lot of known issues (bugs and performance problems) but there's a lot we likely haven't noticed yet, so it'd be great to know what you've seen. We want to do an alpha release very soon so there won't be many more changes before that. Opening lots of tickets would probably not be a good use of your time (since most may be duplicates or already planned to be fixed) - if you can just list them here or on the forum or something, I can sort them out and file any new issues.

in reply to:  4 ; comment:5 by Kieran P, 14 years ago

So the menu slowdown was just caused by outdated drivers?

Yes, it increased the performance of the game, but it decreased the performance for everything else :-( Windows opened slower, the screen refreshed slower. Once I downgraded back to the old drivers, the OS worked fine again, but the game was slow. So not sure I'd call this fixed :-( Why does the game require so much resources/advanced graphics compared to AOE2?

Are you compiling the game in Debug mode (the default) or Release mode (with "CONFIG=Release make" then run ./pyrogenesis, or click appropriate buttons in VS on Windows)? Debug will be much slower because compiler optimisations are disabled. Pathfinding for large groups of units is slow (it probably needs a new pathfinding algorithm for that case), but in Release mode it should generally work okay for a few dozen units.

I had compiled it on debug mode. I'll give the release build a try and let you know if there is much difference.

it'd be great to know what you've seen. ..[snip].. if you can just list them here or on the forum or something, I can sort them out and file any new issues.

Ok, here is what we found:

  • Before a multiplayer game, in the chat screen, the last 2 chars of the username were not the same color as the letters before it. e.g. in a string of "<Kieran>", "<Kiera" would be red, and "n>" would be coloured black.
  • Player 2 started with their view centered on Player 1's town center. They were able to select units but not control them obviously. This caused some confusion.
  • Auto attack isn't working. Player 1's units stopped attacking nearby enemies after killing one enemy. And Player 2's units did not auto attack when Player 1's units were in range.
  • Players can see each others bases... the game needs some type of FOW, and undiscovered land implementation.
  • It became very hard to locate units behind a building. You need to provide a key which toggles building visibility in favor o just outlines on the ground, so that people can see their units, or IIRC, like AOE, show an outline of the person through the building.
  • The rings around the base of each selected unit are very thin and white is not the best color. I suggest a thicker green circle, and a sound that says something along the lines of "At your service" or something appropriate for the unit.
  • As already mentioned, the game became very slow, very quickly, even on fairly modern computers. (~2.2ghz windows xp, 2 gb ram,  and a ~2.5ghz ubuntu, 2 gb ram, both with at least 256mb of graphics ram). When each side had about 15 units, the game became unbearable, and the other person quit :-(

It seems like the team may want to work on some speed ups before the official alpha or I'd imagine a fair amount of the people who try this won't be able to play, which is a shame because this game could be really, really, awesome!

in reply to:  5 ; comment:6 by Philip Taylor, 14 years ago

Replying to k776:

Why does the game require so much resources/advanced graphics compared to AOE2?

We have much more complex graphics (3D instead of 2D), and the engine is designed for flexibility more than efficiency (e.g. lots of code is in easy-to-edit Javascript files), and there are bugs that make it very slow in certain situations, and we haven't spent much time optimising it heavily. Still, it should work fine on fairly old computers - I've run it on an old Pentium 4 with rubbish Intel integrated graphics and it's been bearable, so it shouldn't be such a problem on yours. It sounds like there may be some driver issues, but I have no idea how to fix that.

I had compiled it on debug mode. I'll give the release build a try and let you know if there is much difference.

I'll try to get the build instructions and pre-packaged builds to use Release mode by default - I used to prefer Debug mode since we have bugs to debug, but the performance makes it much less usable now.

the last 2 chars of the username were not the same color as the letters before it.

Hmm, I've never seen that problem, and it looks fine when I test it now, and I've not seen anyone else mention that problem. Could you perhaps attach a screenshot of what it looks like?

Player 2 started with their view centered on Player 1's town center.

I fixed this for some maps a while ago, but not for all maps. I've fixed it properly now so it should be better in the next release.

Auto attack isn't working.

This was added about five days ago, so it should work in the next release (or the current SVN version).

Players can see each others bases... the game needs some type of FOW, and undiscovered land implementation.

We do need this - probably won't be in the next release but hopefully the one after that.

It became very hard to locate units behind a building.

Yeah, we definitely need to do something about that (ticket #144).

The rings around the base of each selected unit are very thin and white is not the best color. I suggest a thicker green circle, and a sound that says something along the lines of "At your service" or something appropriate for the unit.

Thicker lines seem sensible. I don't know how well green will work, given that the terrain is often grass - I'll experiment and try to see what looks good.

Thanks for your comments!

in reply to:  6 comment:7 by Kieran P, 14 years ago

Sorry for the delay in replying. Life's been busy.

I've run it on an old Pentium 4 with rubbish Intel integrated graphics and it's been bearable, so it shouldn't be such a problem on yours. It sounds like there may be some driver issues, but I have no idea how to fix that.

Since my last communication, I have bought a new Windows 7 computer, 2.4 GHz CPU, 4 GB RAM, and 1 GB VRAM. Alpha 1 runs fast and smoothly (till you have about 100 units doing things). And the same computer I had issues on before, I installed over with Windows 7 and also works fine, though slower than this new computer. So it looks to have been an issue with Ubuntu's support of my graphics card.

the last 2 chars of the username were not the same color as the letters before it.

Hmm, I've never seen that problem, and it looks fine when I test it now, and I've not seen anyone else mention that problem. Could you perhaps attach a screenshot of what it looks like?

Sure. I'll try reproduce the issue tomorrow in a multiplayer match, now that I have two computers which can run it.

comment:8 by Kieran P, 14 years ago

Some good news. I checked out the 0ad source and ran the precompiled exe. The game is performing much better than PreAlpha 1. Where I was only able to get ~60 units in PreAlpha 1 before it started to have trouble managing all units, I was able to get ~270 units in the latest version. There is still much to be done though. I was only using 50% CPU and 40% RAM, so plenty of resources left to do calculations.

comment:9 by Kieran P, 14 years ago

Resolution: fixed
Status: newclosed

I'm going to mark this as fixed. Some great performance improvements recently. Keep it up! :-D

comment:10 by Kieran P, 14 years ago

Quick update: Game now uses up to 56% of available RAM, and only 40% of CPU, but the latest 0ad codebase allows me to get up to ~1000 units before things become too slow to play effectively. Compared with the current release (where I can only get ~60), you've made a whopping 16.6 times improvement on the amount of supportable units (1666% more)!! Please keep up the great pathfinding performance improvements!!

There is still plenty of RAM (44% left) and CPU power (60% left) here to utilize if need be and at all possible.

comment:11 by (none), 14 years ago

Milestone: Alpha

Milestone Alpha deleted

comment:12 by historic_bruno, 12 years ago

Milestone: Alpha 1
Note: See TracTickets for help on using tickets.