[quote=“Soron, post:43, topic:1214”]Well, I’ve tried the remaining potentially-standards-compliant bits of LazyCat’s suggested code (removing InvalidateRect and the sleep calls from getch), and it doesn’t seem to have any significant improvement to the lag. That’s even true while reading, despite my suspicion that the many getch calls (for the newly-added interrupt feature) might be incurring some high overhead. Also, for reference, the refresh call in getch (i.e., the bit that’s in contention in LazyCat’s suggestion) is aborted early if the window in question isn’t marked for drawing, so it’s highly unlikely that not removing the refresh call is making much of a difference to lag.
So… I got nothin’.
What we really need, I think, is for someone to write a Windows renderer using tools that they understand well. I know that it’s possible to get much better performance, even with frequent redraws and real-time keyboard input. I mean, just look at any action game. So it’s presumably something about the way we’re doing things in Windows that’s causing issues.[/quote]
I don’t see there is any more lag than before even with the binary you released, except when near overmap borders. You first need to find out what lag are people talking about: what, how, when and where, exactly. I think all the reports are about the lag that happens only near overmap borders.
You can of course re-write the whole thing and improve performance hundreds of times. You just need OpenGL or whatever other API to gain access to hardware accelerated texturing. You then simply print your font in the texture grid or use some pre-drawn tile map image, and all you have to do then is to replace you current printchar() function and its friends with equivalent OpenGL calls that will blit ASCII symbol corresponding sub-texture to the back buffer. That way everything stays in video memory and doesn’t leave graphic card, hardware accelerated, lightning fast, and taking the whole drawing load off of CPU.
But, it was not lagging before, so it is something that can be fixed to be at least as good as before.
Tell you what, you put in my above ground z-levels in the game so Acidia can design more and I’ll give you lightning fast drawing code where you could use any ASCII symbols or whatever tile graphics just the same, with mixed font/tile sizes and arbitrary rotation, millions of colors, particle effects, transparency, motion blur… and what not. And I’ll do it in a week, it’s my expertise after all. Do we have a deal?