Just a quick note that yes, I’m still alive and kicking. Been a little distracted by various non-coding things, but have fixed up a few more rendering issues. Most notable new stuff is that we no longer waste time drawing terrain triangles which would have been drawn beneath the water (since the water surface is opaque), and some optimisations to my VBO implementation, which gives faster rendering overall (substantially faster, on my laptop).
I’ve also gotten a start on GUI stuff for MMORPG Tycoon 2, but that’s still in a very early state. Hopefully there’ll be new things which can be screenshotted and posted within a few days!
Apart from all that, I’ve also been enjoying Ghostbusters: The Video Game far more than it deserves by any objective game review criteria, been watching re-mastered episodes of classic Star Trek (which aren’t quite as cringe-worthy as I’d expected them to be), and listening to JUMPsplat.
So it’s been an extremely busy day today. Today I revamped a lot of VectorStorm’s underside, in order to support this magical feature that I’ve been wanting for a while; the ability to do the old style “bright vector glow” at the same time as rendering other geometry normally. Long-time readers will have noticed that all glow vanished from the MMORPG Tycoon shots a month or two back, as I simply wasn’t happy with the “brightness threshhold” mechanism I was using to determine which bits of the screen glowed and which didn’t. Now I have a system where I can mark any individual object as glowing or not, and it works (basically) as one would expect.
Notice, for example, in this screenshot that the red hook object is made up of stripes; half the stripes are brightly glowing white, and the other half are non-glowing red. Notice that the cursor outline glows, but the sky and clouds (which are both brighter than the cursor outline) are not glowing. This sort of trick is surprisingly tricky to do! But I’ve finally got it working, and at virtually no performance penalty. (In fact, in MMORPG Tycoon the glow will be cheaper than in previous games, as the lack of a flat black background means that I can get away with using a slightly cheaper Gaussian blur to generate the glow effect; the background noise helps hide the extra artifacting)
I’ve also fixed a more low-level performance bug which was causing VBOs to take about twice as long to render as they should have. Nice speed boost, and it means that I can use VBOs again, instead of using display lists for everything! Yay!
There’s an old maxim amongst programmers, that premature optimisation is the root of all evil. Or to put that in a less glib way, it’s generally a bad idea to perform optimisations before your program is completed, and it’s always a bad idea to perform optimisations if you have no way to check your performance before and after. In practice, this means that you need to use a profiler before you start thinking about performing optimisations.
So apologies, but it’s another technical post. For those who aren’t interested in programmer topics but are looking for pretty screenshots or discussions about game design, please feel free to skip this one. Coders, hit the ‘Continue Reading’, below. :)
Continue reading “On Optimisations”
It’s amazing what a few tiny water ripples will do for a scene.
Water effect heavily inspired by The Legend of Zelda: Wind Waker. Their water effects aren’t quite appropriate for this game, but their approach to handling water totally got me thinking in the right direction, so kudos to them! Also kudos to Alex May for suggesting I look at Wind Waker again for water inspiration.
Apart from this, I’ve managed very little development work today; been busy with a few other non-computery projects. Should be back onto MMORPG Tycoon later this weekend.
I have nothing to say, today. I just stumbled over this little setting, and had to take a screengrab.
Okay, I’ll confess; I’ve been hesitating to start on procedural building construction, because it’s kind of a large, scary topic. But I’ll start on it tomorrow, honest.
Instead, today I worked on sky rendering. In the previous screenshots I’ve shown, the MMORPG Tycoon sky was a flat gradient that was drawn behind the terrain; that gradient remained exactly the same, whether you were looking up or down or whatever. Today I threw that out, and replaced it with a proper sky dome, and added some moving cloud layers. I quite like how they’ve come out, actually.
I’ll start on procedural buildings tomorrow, honest. I’m not expecting to have much in the way of viewable results for a few days; there’s a lot of groundwork that has to be covered first!
Here’s something entertaining for you all; possibly a bit of a blast from the (recent) past. Today I brought most of the core structural code from MMORPG Tycoon 1.1 over into the new MMORPG Tycoon 2.0 codebase. This includes buildings, roads, quests, subscribers, monsters, devs, their AI and logic (but not rendering), and, in this screenshot, the UI. A lot of this code will eventually be heavily modified, but I thought you might like to see the old MMORPG Tycoon 1.1 user interface once more, inside the MMORPG Tycoon 2.0 world.
And yes, the UI boxes are still doing that infamous ‘wobble’. I’m going to remove that at the same time that I restyle them.
In fact, I’m planning to modify the UI to be one ’status’ bar along the top of the screen, and a button bar at the bottom of the screen, so most of the time the whole middle of the screen will be clear. That’s the theory, anyway.
A couple of things to talk about today. First, I’ve finally put in some frustum culling functionality. Basically, this is some maths to try to determine what objects are vaguely in front of the camera, so that we don’t spend GPU time drawing things that turn out to be behind the camera. With four square kilometres of terrain being drawn, anything I can avoid drawing is going to help speed things up! (Actually in the above shot, we’re sending less than two square kilometers of terrain to the GPU to be drawn; the rest has been determined to be outside of view)
Second, as you may notice in today’s screenshot, I found a little bug in the terrain drawing which was causing the ”shag” effect to vanish from north-facing and south-facing slopes. I also fixed a bug which was sometimes causing the “shag” to draw in a subtly incorrect shade. Finally, its length now changes based upon the surface. I think it looks even better now; I’m quite happy with the effect.
Yup, still here.
I’ve added support for water to the terrain rendering.. but there are some low-level rendering issues to be sorted out, because the water isn’t being z-sorted properly yet. Although it looks fine in this particular cherry-picked screenshot.
I’ve also been doing a whole bunch of work on Secret Feature Alpha, which I’m not ready to announce yet. But actual real significant progress is being made, even if it’s not yet visible there in the screenshots.
After all that time fixing and re-fixing VectorStorm’s 3D engine stuff during the development of Lord, I just found yet another whopper of a bug in VectorStorm’s 3D projection matrix (the projection matrix is basically used to ‘flatten’ 3D objects into a 2D plane so that they can be drawn to the screen) . This one was causing everything to render stretched horizontally.. more stretched, the more widescreen the window was.
Mental note: tan(halfFOV)*aspectRatio does not equal tan(halfFOV*aspectRatio). (It’s so obvious when you write it out like that, innit?)