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:
To any developers out there, I have to ask, why does rendering terrain takes so long?[/url]
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.
Playlist with ALL games of the Dark Tournament Youtube.com/CorrodeCasts Consider supporting OpenRA by setting a bountyor by donating for a server
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.