Mesh Viewer

Posted by

It's been a while since my last War Worlds update, but at least I have an excuse...

Mesh ViewerNow that I've got my laptop back, though, I've been working on updating my mesh file format. Previously, I was using C# to read Collada-format files and turn them into my own internal format. It was hard to extend because I was just querying the XML directly, and Collada is actually a pretty complex format to parse, so I wanted something easier to use.

And that something turned out to be the Open Asset Import Library. It supports not only Collada, but a whole host of other formats as well. It also performs a bunch of post-processing to triangulate, optimize and rearrange the mesh, it's great!

Another thing I wanted to do was write a tool for viewing meshes with various different options for changing the view and so on. This was mostly for debugging so that I didn't have to start a whole new game just to see whether a mesh could be loaded properly.

So that's why I wrote the tool you see on the right. This is the "mesh viewer" tool and it's a standalone tool that lets you load .wwmesh files and view them with various different options. You can view them in wireframe mode, change the base colour, show/hide the ground and so on (actually, that's all you can do at the moment, but I'll be including more options in the future)

One of the things I had to do in order to allow this is I had to split up the game into "framework" (or "engine") and "game" code. I had already written the game such that there was a special "framework" directory which included things like my Direct3D interfaces, sound processing, etc - all the generic stuff that can be reused in another game - but I just had to make it into a static library so that I could use it for the mesh viewer tool as well.

I split it into a static library that is linked directly with each executable. I suppose I could've made it a DLL which was dynamically linked with the executable, which might've saved a bit of disk space (since I'd only have one copy of that code) but in the end, it would've meant quite a few changes to the build process, and to be honest I don't think the benefit was all that great. So static library it is!

The new .wwmesh file format that I've written is a binary format. I designed it so that reading in the data consists, basically, of a couple of calls to fread() and not much else - the data is already in the "native" format that I send directly to the GPU so it should be really efficient. Currently, it only supports the same features as the old .wwmesh format (which isn't many) but I'm planning to add animation to it in the near future.

One little feature that I'll mention is the "base colour" of the mesh. Basically, when designing the texture for the mesh, if you leave parts of the mesh with a non-1.0 alpha value, the pixel shader combines it with the "base colour". This is how I plan to implement different coloured units for different players. In the screenshot above, you can see the checkmark in the "red" colour and the mesh itself is also red. In other screenshots, you can see what different colours look like. In the future, I was thinking I could extend this so you actually supply a base texture and so you can have patterned units, but that probably won't make it into the initial release.

So anyway, the next step, as I say, is animation support. That might take a while, because my previous experience with animation has been pretty limited. We'll see how it goes anyway!

Website updates

Posted by

Since I haven't really be able to do any actual work on War Worlds, I've updated this website and added a page for War Worlds.

You can see it here.

The main reason I started that page is so that I can have the "TODO" list that you see on the top of the page. My problem was that I was starting to forget what I'd done and what I was planning to do, so I figure if I keep the todo list, I should be able to pick up where I left off pretty quickly once my laptop is back from the shop.

I'm going to keep the todo list up-to-date as I implement features and more come to mind. I don't expect too many updates for the next couple of weeks at least - not while I don't have my laptop :'(

13th October?!

Posted by

So I just called HP about my busted laptop, and they told me that they've ordered a new display panel apparently. Due to be delivered to them on the 13th of October!

That's almost a full month since I sent it in originally!

The support girl told me that she'll try to see if there's an earlier date that it can come in (why do they wait until you call to find out if there's an earlier date?) and she'll let me know. If I was a consipracy theorist, I'd get out my tinfoil hat and theorize that she'll call back and say something like "I managed to find one that'll come in on the 4th of October." And I'll think, well the 4th is better than 13th. Rather than saying up-front that it'll be the 4th and having me think bloody hell! two weeks!!

But I'm not a consipracy theorist...

Update (29-Sept): I got a call from them yesterday confirming the original 13th of October date, so it looks like my consipracy theory was wrong. I was hoping it was true because at the very least it would've meant I'd get my laptop back sooner :(

Update (1-Oct): Wow, my "conspiracy theory" was actually more accurate that I first thought! They just called today and said it'll be sent back to me tomorrow... so in my "conspiracy theory" I said it'd come back on the 4th, but since that's actually a Sunday the 2nd makes more sense (and it's still been two weeks). I was also right about me thinking "well, at least I'm getting it back and that's better than nothing." 88|

Busted Laptop

Posted by

It was less than a year ago that I bought my laptop, but tomorrow I have to send it back to the factory for repairs... such a shame!

You can see in the picture on the right what's happening. It runs fine for much of the time, but every now and then, the screen will flash to this white for a few seconds and then flash back again. As far as I can see, it's not related to load or heat or anything like that (I've seen it happen just after I booted up, with no programs running) so I don't know what's causing it.

I called their technical support line a few days ago, and they were actually pretty good. The only thing I found strange was they made me unplug it, take out the battery and then hold the "power" button for a full minute. When I asked what this was for, the tech. support guy said it was to "release the static electricity that may have built up." Whatever.

But other than that one strange request, they sent me the latest BIOS and video driver, which they asked me to install and see what happens. Today I called back and told them it didn't make a difference, and they booked it in for repair straight away! (Although the guy asked me if I had done that static-releasing thing again, I said, "yeah", but I'm still not sure why they're so obsessed with that?)

So tommorrow someone is going to come and pick it up, which means I'm now busily backing up all my stuff (I already use mozy for backups, but I hear it can be a bit of a pain to restore from them, so I'm just copying important stuff onto my media centre for the time being). Hopefully they won't delete all my stuff (why would they?) and I'll not have to worry.

But worst of all, I'll be without a laptop for the whole weekend! I guess it'll give me a chance to spend some quality time with my Xbox wife :)

Whipping horses

Posted by

There's a new rule in Australian horse racing. The rule states that a jockey can only whip the horse five times before the final 200 metre mark, and after the final 200 metres, the horse can only be struck three times in consectutive strides before the rider must wait for the horse to respond. It also requires use of a new kind of whip which is slightly padded. Now, I'm not a horse-racing expert so I don't understand the rule exactly, but it seems perfectly reasonable to me.

But it's not resonable to many jockeys, apparently, and they're threatening to strike during this year's spring carnival - possibly including the Melbourne Cup(!) if the rule is not amended to allow the to whip the horses as much as the like over the final 200 metres.

Who are they kidding here? Do they expect people to actually support them? I mean, to be honest, I'm not really a "hug the seals", "save the whales" kind of guy in general, but I thought our goal (as in, humanity's goal) would be to reduce the amount of cruelty to animals that we inflict. Who could possibly be opposed to that? Horse racing isn't exactly the kindest of sports as far as the animals are concerned, but is that any reason to just say "do whatever you like"?

It's not like the rule gives unfair advantage to anybody - everybody is affected in the same way - so what possible reason could there be for wanting to whip your horse as much as you feel like at any time?

According to the article I linked above, apparently jockeys argue that the new rules "raise safety issues"... um, what safety issues? The only thing I can think of is that it might mean the jockeys are too busy thinking about how many times they've whipped the horse and they might make some kind of mistake (hitting another rider, etc). But I'm quite sure that with a bit of practise it would become second nature. It's not like racing drivers are constantly checking their tachometer to make sure they don't go over the red line (and blow the engine) when they're racing - with a bit of practise you just naturally get a feel for it and the best drivers can push their car right to the limit without ever once taking their eyes off the road.

So I say to jockeys: suck it up. Nobody is going to support a rule which says you can whip a horse as often as you like. Even if it's only for short periods.