Wednesday, 13 February 2008

Basic asset support

Huzzah! Primitive Texture, Shader and Material objects are implemented. In the end I gave up trying to work out where the GL -> Java -> Scala chain was breaking down with glGetInfoLogARB, and just started checking the shaders by hand with the GLSL Syntax Validator (which, by the way, is rudimentary to say the least).

That done, it was but a short head/wall reciprocatory interlude before DevIL was playing nice too, and I could start cobbling together some test shaders. Of course, lacking anything except Paint.NET (a very nice but somewhat lightweight image editor) I didn't spend long on the textures. Behold the mighty effect of a Julia set rendering combined with Clouds for a normal map!

There's also a bit of hackery going on with the worldspace position and frac (or fract in GLSL parlance, because that extra 't' sure makes a difference to legibility! Bastards.) to draw a rudimentary grid too. My thinking is that a shiny'd up version of this will be on a button - maybe tab - to help with tactical stuff on natural terrain where it's hard to gauge distance by eye. The nasty big black grid is just an error in the normal map. Yes, I'm so lazy I can't even be bothered to make any of it tile nicely at this point. Or give them mipmaps. Aliasing is lovely, don't pretend you don't want it.

Also great news, the Java wrapper for SQLite plays nicely with Scala. I've been wanting to do this for a while and not done it because it'll take some planning, but having a real database at the heart of this game should add a huge amount to extensibility. The ultimate aim is to have in-game creation of new enemies, items and spells, at least to a limited degree, by allowing editing the databases through console commands. Coupled with LuaJava for scripting, this should be fairly powerful, but will need a vast amount of work to make really nice methinks.

Even just creating variants and advanced forms of existing game objects could be a massive bonus though. After all, roguelikes and CRPGs in general traditionally reuse enemies painted a slightly different hue, often to denote some elemental or behavioural trait. The idea of wandering down a dungeon, finding a level that looks a bit sparse and creating a new flavour of orc with red skin and tons more hitpoints than his brethren is just... good. I look forward to seeing if I can pull it off.

No comments: