Page 1 of 1

How I got OpenRA to run on a very old GPU

Posted: Fri Sep 16, 2016 11:45 pm
by lucassss
As some of you may have seen, I had to switch to a really old computer for a while. At first, I noticed that this computer takes too long to render. After some hacking in the source code, I managed to implement a "low-detail" mode for OpenRA. In case you are wondering, this is how it looks:

Image

To any developers out there, I have to ask, why does rendering terrain takes so long?[/url]

Posted: Sun Sep 18, 2016 6:18 pm
by noobmapmaker
Could be worse!

Always a little jealous of people who know what they're doing when it comes to computers. I mean real understanding of the hardware and the way software works.

Posted: Sun Sep 18, 2016 9:58 pm
by lucassss
Actually in this case, I can explain the change quite easily. I began by using the debug display to find out that the thing takes long is "render" and not "tick".
"render" is drawing things to the screen while "tick" is game logic. After that, I modified openra code to display times for different parts of "render".
This showed me several points of slowness, I removed each one of them from the code and saw what graphical glitches appear and how render time improves.
Eventually, I found out that the slowest point that remained and couldn't be removed was terrain rendering, so I got rid of all the sprite related code,
and instead wrote my own rendering code which simply draws a square for each tile, selecting the square color according to the terrain type.
Ore terrain and clear terrain are both black, since for ore terrain I left the original ore rendering code since it did not take long and it helped for clearer rendering of ore.
Also, if I render ore tiles using squares, I get the ore radar bug on the actual map, which would be a cheat, which is a big no-no.

Posted: Mon Sep 19, 2016 12:10 pm
by noobmapmaker
Nice approach, kind of understand what you did with your description. Thanks :)

Posted: Tue Sep 20, 2016 5:33 am
by Matt
The terrain rendering bottleneck is even worse for next gen mods: https://github.com/OpenRA/ra2/issues/273