Monday, 28 March 2011

Projectiles Ahoy!!

Did some more work on "Tank" today. After discussion with my IRC friends (yes, they are friends in real life too!), the game seems to have chosen that name for itself.

After some highly technical (and frankly, baffling) talks with a highly intelligent colleague, I've decided it might not be a great idea to use PhysX for the in-game projectile movement. This makes LOADS more work for me because now I need to code some sort of physics engine in software to allow for gravity and the ballistic properties of the projectile, but the reasoning is sound - if this game is to be played multiplayer - which is the eventual aim - and some players have nVidia cards (with a PhysX GPU) and others have ATi cards (software only PhysX) then there might be some discrepancy with the projectile placement co-ordinates, thus giving nVidia users an unfair advantage. Presuming the hardware GPU is more accurate than a software one, which one would expect.

Aaaanyway... Tank now has a turret. It is movable by design only along the x-axis (it can only be raised and lowered, not swivelled left to right). I did this for two main reasons, (1) to control a turret independently of the main Tank body would mean having an extra set of controls. While this wouldn't be too hard to code, I want this to be an arcade game not a Tank simulator. And (2) after playing around with the game model, it's too easy to turn the turret to 90°, pop out from behind a building, fire off a shell, then reverse back behind the building. At least if the turret is fixed (along the z-axis) then the player will be forced to drive out, physically align his Tank with the target, then fire off the shell. This will hopefully force the gameplay along and not turn it into a pop-out-and-shoot-then-hide turn based game of chance.

Talking of the projectile, the Tank can actually fire one now! OK, at the moment it's just a White sphere, but just pretend it's a Quazar Pulse*. Or something. I have incorporated a reload cycle to stop spam-shelling, and an ammo counter which depletes with each shot. The plan is to eventually have ammo crates dotted about at strategic positions. Of course during development I can re-arm the Tank without an ammo crate.

The projectile also incorporates collision detection. I'm still working on this subroutine at the moment because it's not entirely accurate (or it can be very accurate but slows the game down too much for my liking). My next job is to optimise this collision detection routine. Also, I need to write something that signifies the shell has hit a building or something.

The Tank also has a very primitive health system which I am still tweaking, more of that in my next post.

UPDATE: Here is a small youtube video showing the engine in action. As you can see, I have written an explosion routine, but the projectile doesn't disappear just yet.

Onwards and upwards...

(*The term "Quazar Pulse" is copyright ©petethesparky 2011).

Friday, 25 March 2011

Making some progress

I had a good day today. While the end isn't even in sight yet, I feel compelled to do more and more, the ideas are flooding in with each addition I make to the program. I need to keep it real though and not be tempted to add things to the plan that I have no ability to realistically implement.

I now have a floor upon which "Tank" sits. It is flat, and textured randomly with a selection of Four tiles which change each time I run the program. This is only a temporary solution, once I somehow get a graphic artist on board, I should be able to get a futuristic tile set created which  will make it look so much better. I am so pathetic at graphics that I've just labelled them Tile 1 - 4 for now. But at least the code works. If the tiles are to have any form of intentional placement, then I'm going to have to code some sort of level designer. That in itself is a large undertaking given my limited knowledge of coding. But this is why I started the project right, to challenge myself?

So at the moment, the entire tile set looks like that. Impressive huh?

I also added some "buildings" instead of the block which I was using to judge speed and distance. These are currently just randomly placed blocks of varying height. Again, to create a meaningful level, I'm going to have to invent some sort of level editor. But at least I get the feeling of driving as I manoeuvre Tank along the paths and inbetween the "buildings". And I implemented collision detection now! At the moment it just stops Tank dead but it's a start.

My ToDo list is growing by the hour, and I don't know where to begin. But I've only been at this for a few days, and already I'm starting to feel like I've accomplished something.

Wednesday, 23 March 2011

First Steps

I actually started coding today. It is the most basic of stuff, but it is code - and it does something!

The package itself has some great help files, and the community forum is really good, it didn't take long to get the hang of some basic commands. Some of them I remembered (miraculously) from my coding attempts of the distant past, but the ones I've used so far are very self-explanatory, such is the way with BASIC, it's the main reason I chose to use it.

Anyway, so far I've managed to accomplish the following:

  • Set up a display port, and limit the framerate to 60fps using the vertical sync.
  • Hide the mouse pointer
  • Set up some variables (Integer and Floating Point)
  • Create and position a 3D Block (which I am calling "Tank" for the moment)
  • Create and position another 3D Block, set it to be semi-transparent, and make it rotate at the rate of 0.25 Degrees for every cycle of the main program loop (This is a temporary marker which I can use as a reference point to judge distance and speed of "Tank")
and here is the cool part... (well I think so)...
  • Use the cursor keys to move "Tank" forwards and backwards, and turn left and right - at rates defined by the variables I defined earlier
  • "Tank" is also affected by a friction variable, meaning he doesn't stop instantly if you stop pressing the "up" key, he gently slows to a stop. I intend to use the friction variable to accommodate different driving conditions/surfaces. Maybe.
That's pretty much it for now, here is a screencap of where I am right now...

Tuesday, 22 March 2011

Starting point

Not really a blog update as such, but a screenshot of what I'm looking at right now.

This is where I start, I guess...

Monday, 21 March 2011

Development platform

So I did some reading on the various development platforms available. They range from a "point and click" game creation studio, right down to barebones C++ coding.

I needed something that was reasonably powerful, yet easy(ish) to learn and use. Something that wouldn't take me weeks and weeks just to be able to open a viewport. This pretty much ruled out C++ and Java. Yes, they are both great dev platforms but the basics alone are pretty overwhelming. I want to create something, not get bogged down in the how's and why's of what makes a machine tick.

I did consider Microsoft VB (Visual Basic) but it seemed very restrictive graphically, and most of my ideas rotate around a non-text based game scenario. There are a couple of very impressive (and not too expensive) high level languages out there, which can be compiled down to low level code and give quite impressive results. I was torn between Blitz Basic and DarkBASIC Professional.

I have used DarkBASIC Classic in the past, so I was already edging towards DBPro as my choice, but having read a little more, I noticed that DBPro is very different to DBC. So I did a bit more reading. Both platforms are based on BASIC (Beginners All-purpose Symbolic Instructional Code) but to be honest, the word "Beginners" is a little bit of a misnomer because it can get pretty complicated in there!

In the end, DBPro won out. There is nothing wrong with Blitz Basic, but the sheer amount of support, resources, plugins and add-ons for DBPro won me over. Not to mention the support for Sprites, Shaders, PhysX and DirectX generally. It helped that there was a great offer on DBPro over at the official site (good timing or what?), so a quick blast with the credit card and a download later I am left with a fully installed and set up GUI with which to start work.

A blank canvas.

Sunday, 20 March 2011

And so it begins...


It's there in all of us in one form or another. The need to express ourselves through art, it's what sets us apart from the animals (that, and opposable thumbs). Whether it be painting, literature, music, performance, photography, anything. Creating something for the sake of creation. It's a natural human desire.

You might be thinking "what the hell is this?" right about now. Well I'll tell you. I am no "spring chicken" as they say. I'm not getting any younger. I'm on the wrong side of Forty. You get the idea. The thing is, I need to keep my brain active. A healthly mind supports a healthy body, or something.

I sit in IRC each night, socialising with friends, sometimes playing multiplayer games. It's great that I can do that, but I feel that my mind is becoming "stale". I feel the urge to create something, to start a project into which I can pour my creative juices. Something I can get my teeth into, to keep my brain working, with the only reward for my toils being the knowledge that I am making something, creating something from nothing. So I have decided to embark on a journey, a journey through something that will hopefully broaden my mind and make me think about things.

I have decided to create a videogame.

No, it won't be a huge blockbuster with super-fancy graphics and a massive budget, it will be a small but playable game with dodgy graphics and iffy sound effects, bedroom coded as opposed to being created by a team of Fifty people in a dedicated building. It will, most likely, be not very good at all. But it will be a creation. Something I (possibly with the help of some friends) have created, brought into this world from the confines of my mind.

I have big ideas but I'm also realistic in what I am able to achieve. The last thing I coded was in 1994 which was a fair while back, so I'm pretty much going to have to re-learn everything I once knew. So now to look at the pro's and con's of what's available to me as a development platform...