Sunday 5 June 2011

Off on a tangent...again!

Anyone who has been following this blog will know that I tend to shoot off at random directions when it comes to coding stuff. I'm weak like that, too easily distracted.

Once again, while researching and writing test routines for my AI experiments, I got a bit fed up of working with a flat floor. My newly acquired model objects demanded some more interesting scenery to interact with. So I decided to bang together a quick program which created a randomly generated "matrix" of tiles. But the problem was that they literally were too random. Yes I could apply various restraints etc, but I wanted something that would reflect a realistic game level.

So again I "went off on one" and started a new project. This one is a level editor of sorts, based on a matrix system. This will actually be a useful tool I think, because not only can I use it to make test levels for the forthcoming AI routines, it can (or rather will) be used to make actual game levels once I learn how to code AI.

I was also partly inspired by the "MouseCam" routine mentioned in my previous post. This proved to be very handy in my "EasyMatrix" program, essential in fact. Also, you might remember at the end of my last post, I talked about working out a routine that would convert the mouse input for use in a 3D environment. Well, I nailed that one too! (An achievement I am pretty happy with, if I'm honest.)

So now I can control the camera in 3D space and I can use the mouse to point to any object or area within that space. I just know these routines are going to be useful to me one day, and they are already deeply embedded in my EasyMatrix project.


That picture shows the concept of EasyMatrix - a tile based editor, with 4 editable node points per tile, and a 3D viewing angle. This image was kindly rendered by my friend (and 3D/game design artist) Tom Joyce.

The development of EasyMatrix has flown along so quickly over the last week that I haven't really taken many screenshots. I must throw a shout out to another friend (and mathematical genius) Ragnar Karlsson, who helped me out with a particularly tricky algorithm. I never was any good at trigonometry.

Anyway, this is what EasyMatrix looks like right now...

 



That bottom picture shows the same viewing angle, but the left one is in "edit" mode while the right one is in "real world" mode. It will look a lot better when I implement the textures. It is still possible to edit the matrix in "real world" mode, but you have to be pretty accurate with the pointer, because the helper objects (red dots) are turned off.

So next I need to implement a way to move the point of view (at the moment you can pan around but the camera always points to the dead centre of the matrix), and I need to look into texturing the tiles, and I also better figure out a way to actually save or export the matrix otherwise this whole thing will be pretty pointless.

If you want to have a play with an early version of this, you can download the file by CLICKING HERE. It's a .rar file so you will need to unrar (unpack it) prior to use.

There are only a couple of requirements...
  • You must have at least DirectX 9.0c installed. But you already will if you're a gamer, right? (Get DX9 here)
  • Your mouse must have a clickable wheel. The camera pan only works when you hold the wheel button down.
That's pretty much it really. It will still work if you don't have a clickable mousewheel, but your view will be very VERY restricted. 

Now, I should make a start on that viewpoint movement routine. I think there is some Magners in the fridge...

No comments:

Post a Comment

Please leave a comment...