A topic I can actually take an interest in, wowsers!
Right now I'm working on what I called 'Bituary'. It doesn't exactly have a set purpose, other than for me to learn the ins and outs of typical "game programming" type things. I'm working with Visual C++ 2005 Express and the Win32 API. It was my first chance to get to grips with what applying C++ to a real situation was like and I've enjoyed it thoroughly. By no means am I an expert, but I've discovered plenty. Firstly, the Win32 API is bloody easy and has a disturbingly high amount of deprecated things in it. Secondly, MSDN sucks in a lot of ways. Still, there's only so many Hello World programs you can make before you want to try and make something that's more exciting, so that's what Bituary is.
It's slow progress, the code is probably not as good as it could be and I consider it my main serious pursuit when I'm not tied up with schoolwork or whatever. There's a lot of time and learning invested into it so I've done the wise thing and put it on a subversion repository (if you don't know what that is, you're not a developer to me) so that I don't end up screwing things up and being unable to revert whatever mess I've made. Subversion is great. Seriously, CVS is a piece of shit in comparison.
Anyway, all sorts of things have become much more accessible to me now after working on Bituary. One of the first things I wanted to do was work with DirectX and make something 3D - who doesn't - so that was one of the first aims of the project. DirectX isn't half as hard as you might imagine, and while I haven't made anything pretty and I don't have any model loading capabilities, I drummed up a very basic graphics engine that's able to manage some basic DirectX stuff:
<div align="center"> </div>
The 'engine' I've coded is quite capable, with just a few lines of code (see below) of loading up any number of amazing spinning triangles. Yeah, OK, it's not going to win any programming awards but the experience I gleaned from it was invaluable:
Code:
****for ( int i = 0; i != 50; i++ ) {
********Triangle* mcTriangle = new Triangle ( 0.05f * i, 0.05f * i, 0.05f * i, i * 0.01f );
********world->add ( mcTriangle );
****}
<div align="center"> </div>
The world engine is capable of taking in any kind of Object base class, so it could do spinning cubes or spinning puppy models for all I really care, but I haven't done that yet. I had a lot of other things I wanted to do first, and I considered that just about done for the meantime. In the future I do want something more exciting than a couple of DirectX primitives.
The second thing I wanted to do was add a free camera. This is actually harder than you might realise - implementing a 360 degree, any way you like camera is NOT the easiest thing ever. I learned a lot about matrices, vectors and the transformations that DirectX goes through so I was able to make a nice robust camera class. Rewarding experience for me, because it gave the game some degree of interactivity and I'm able to take any scene at any angle I like:
<div align="center"> </div>
Ironically after all the trouble I went to implementing the camera, which, bearing in mind it's completely free, lets you back-flip, roll and whatever a few people I tried it with found it confusing. So I added some constraints so it acts more like a normal camera, in that you can only tilt 45 degrees up/down. The combination of vectors and the mathematics involved was super interesting for me though. Took some time to get down, but it was worth it.
Next I wanted to get the game network enabled and acting more like a multi-player 'game'. So I actually ended up with Bituary being both a server and client program. This entailed getting to grips with Winsock and a lot of TCP/IP machinations. I really enjoyed this (is there anything computing related I don't enjoy, really?) and it was pretty clever how the protocols and Winsock worked together. TCP/IP is a stream protocol so I got to implement my own packet structure on top of that and soon enough I had a server and client that talked to each other. At this point I could make the program truly multi player and represent each player as a triangle, which I tried, but because I wanted to keep the architecture intact I reverted that soon enough after having a little fun.
A lot of the code was devoted to user management. The server should, in theory, be capable of dealing with any number of players but I'm sure it'd get quite laggy at around 40 or something. The client sends some information and 'ping packets' to say it's still being used. I suppose I could remotely deny people from running Bituary clients as a result, but that would be easily hackable around. Still, it's quite cool and I can see when people use the program and what OS they're on etc. I guess coding a trojan wouldn't be too hard with this knowledge by this point:
<div align="center">
(That stuff in the back is just IRC).</div>
So anyway, that's just about as far as Bituary is at this point. It doesn't do much, like I said at the start, but there's a lot of plumbing and potential behind it that's helped me learn a lot more. I definitely would do it again. I've been bugfixing and twiddling things around a bit, and I'm hoping to add a DirectX GUI into it now (that I'm going to have to code, hooray). That'll hopefully give Bituary some real interactivity for the player and then I'm going to start thinking about making it possible to connect to more than just the hardcoded server, perhaps actually make a game out of it. I don't really know where I'm going with it, but since it's all safe and cosy in subversion I'm happy to go wild and see where the wind takes me with things.
The good thing is that if I get bored of Bituary, I've earned a goldmine of knowledge in DirectX, Windows API, MSI creation, Winsock and C++ intricacies and I can take some of the little engines and classes out of it to use them elsewhere.
So that's my current project. Barely scratched the surface, really. I'll tell you how it progresses. Did I bore you?
Test releases with .msis I have given to some people, if you were expecting download links, but because of some dependencies and things it only currently works on Vista. I'm going to get it working on XP at some point (I mean, come on, as lovely as Vista is XP is still a key player and there's no reason why it should be dependent on Vista, I think I'm just linking it against a dumb DLL). It's also a bit of a garage project that I haven't spent any time on polishing. So I'd feel a little wrong allowing people to download a copy. That and I'm sure you'd find embarassing bugs or problems, ha-ha.
|
|
Bookmarks