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?)