Weather Effects

Posted by

One of the benefits of the way I've implemented the entity logic in Elium is that the skybox now gets it's parameters from an XML file, rather than having them set by a script. This has greatly simplified the skybox code (because it's not a "pull" model of building up the parameters, but rather it's a "push" model). But the other benefit is that it's allowed for a relatively simple "weather system" implementation.

Basically, the parameters of the skybox include things like cloud colour, amount of clouds, sky colour, sun position and so on. The format of the file is basically just a listing of times-of-the-day and the value of these parameters at that particular time. The code simply interpolates between the times for the actual values to use.

So today I extended that model slightly so that we can set the particular weather effect you want to see. You can see an example of "fine" and "stormy" weather in the screen shots below.

Fine Weather Stormy Weather

The actual parameters I've used here will obviously need to be tweaked (I only fiddled with them a little bit...) but the idea is there.

Also, one big problem which you can probably notice in those screenshots is that the ocean doesn't change colour. Even when the sky is gray and gloomy, the ocean is a nice bright blue! That's something that I'll need to fix up, since it looks really out of place.

One of the cool things is, when you change you the weather, it fades from the current weather to the new one over a period of time. I basically extended the interpolation code so that it gets the current weather and the "new" weather and then blends smoothly between the two. It actually looks pretty realistic when you see the clouds gathering before the storm...

Shadow Mapping

Posted by

One of the features we'd like to add to Elium is shadows. My understanding is that the Nebula 2 engine, which the game is currently using, supports shadow volumes, but we'd prefer to use shadow maps, which would be better suited to large outdoor environments (where you've got lots of shadow-casting objects like trees, rocks, etc). So I figured, fine, I'll just implement shadow mapping. Shouldn't take more than a few days, right?

Shadows in War WorldsWrong! Couldn't be more wrong, apparently. After many days of fumbling around, I'm still trying to figure out how it would "fit" in with the rest of the engine. So last weekend I thought, "that's it, either I'm going crazy or something is wrong here!" So I decided to take some time to try and implement shadow mapping in my own engine - which I'm obviously much more familiar with.

The screenshot to the left is the result of that work. It took not much more than an afternoon (I'd read quite a lot about shadow mapping in my previous attempts in Nebula, so I was already pretty familiar with the theory). It's not perfect and it's only basic shadow mapping, but it works pretty well. And it works! I'm not crazy!

(By the way, in case you're wondering, the light blue square is the shadowmap texture)

So why is it so hard to get going in Nebula? To be honest, I don't know. Of course, my engine is currently reeeally simple, so there's not a lot going on to begin with. Nebula is quite a complex beast, with support for multiple render paths, a data-driven multi-pass shader architecture, and so on. The biggest thing I'm struggling with is just getting the shadow map properly rendered in the first place. I don't know if I'm defining the camera incorrectly or what, but I can't seem to get it to render the scene from the angle I want it to render. It just seems to render some random junk...

Anyway, I've taken a break and am currently working on a system for defining entities in the game in a data-driven way (rather than via a script - the way it works now). That might be the subject of another post, though...

But now that I've seen that I can do it, it's boosted my confidence that I can do it in Nebula, too.

My new project

Posted by

So I've been a bit quiet lately. Mostly because I've been hard at work on my latest project! Elium is it's name, and it's a pretty cool-looking RPG in the early stages.

The website I linked to doesn't get updated all that often. But that's OK, because the important thing at this stage is the game itself! It's my hope that we get some nice progress in the game over the next couple of months.

Currently, I'm the only coder on the team, but we might be looking for another one in the future. Graphics are not really my forté, so I'd be happy to get another coder who can help there. In the meantime, I'm currently working on the save/load code so that we can actually have a game that you can play and come back to, rather than just a tech demo...

In any case, once there's some more to share, I'll be sure to share it here!

The Hot Dog Parable

Posted by

There once was a man who lived by the side of the road and sold hot dogs. In fact, he sold very good hot dogs.

He put up highway signs telling people how good his hot dogs tasted. He stood by the side of the road and called out, “Buy a hot dog, mister?”

And people bought his hot dogs. They bought so many hot dogs, the man increased his meat and bun orders. He bought a bigger stove so he could meet his customers’ demands. He opened up more hot dog stands to cope with the demand. Business was very good. And finally, he brought his son home from college to help out in the family business.

But something happened.

His son said, “Father, do you not watch television, or read the newspapers? Do you not know we are heading for recession? The situation is unstable, and the domestic economy is getting worse.”

And the father thought, “My son is a smart boy. He has been to college. He ought to know what he is talking about.”

So the man cut down his meat and bun orders, took down his highway signs, and no longer stood by the side of the road to sell his hot dogs. He sacked the staff at his other hot dog stands and closed them down.

His sales fell fast overnight. “You’re right son,” said the father, “We certainly are in a serious recession.”

[Source]

Windows 7 - So far, so good

Posted by

OK, so I only mentioned a couple of days ago that I might try Windows 7, and sucker than I am, I've now installed it.

So far, I'm pretty much liking what I see. It feels a lot "snappier" than Vista, but maybe that's just a placebo effect. With plenty of RAM, Vista is quite snappy, and given that I installed the 64-bit version (giving me a while 'nother gig of "available memory" - see my previous rant on that particular topic) it might just be that it's got that much extra RAM for caching and stuff.

In any case, there is one issue with the new taskbar implementation that I don't really like.

Actually, there's two issues, but the first isn't that serious: titlebars no longer go opaque when a window is maximized. I find that pretty distracting, personally, but I recall when Vista first came out a lot of people complained that it wasn't the other way around. I guess that's what you get when you listen to customers...

But the other problem is a bit more serious, in my opinion. See, if I've got lots of tabs open in IE (say), Windows 7 will display each tab separately. So lets say I'm on a particlar tab in IE and I switch to another window. Now, 99% of the time, if I want to switch back to IE, I want to switch back to the same tab I was on before. But how do I do that? When I click the button, this is what I get:

Lots of open tabs

Which one was I on? I have to look at the preview of each one and try to figure it out.

Now, to be fair, this may just be a bug in the beta version. I seem to remember that occasionally it'll have the old tab "selected" by default, but even when it does that, if I hover over one of the tabs, the selection moves to that one and I'm back to where I was.

I don't really mind having to click twice to get to the tab, but if the "current" tab was somehow highlighted (e.g. they could shade the preview window in the "highlight" colour for that button) then it'd just make it easier to do what I want to do.

Anway, if it really starts bugging me, at least I can put the taskbar back to the "Vista" style - one button per program. We'll see how it goes, perhaps.