G'day! I'm an Indie developer, lone-wolf style! I'm a Christian, I'm Australian, and for some reason I live in Canada. KarBOOM is my debut title, coming out for Windows, Mac & Linux this Tuesday!
KarBOOM made the Top 100 for IndieDB Indie Of The Year! Thanks so much for the support :) Voting has been reset for the next phase, so I'd love it if you vote again to get KarBOOM into the Top 10. There are lots of great games in the list, so I'm certainly not expecting to get that far -- but I wasn't expecting KarBOOM to make Top 100 either, so who knows?
Okay, it has been out for a few days already, but I hadn't mentioned it here yet. KarBOOM 0.3.4 is out, adding offline LAN play, some bug-fixes, and my new favourite mutator: king of the hill. Check it out on KarBOOM's page...
...or wait for 0.3.5 to come out (I'm expecting to release it this week). This adds some UI improvements and team play, which is shaping up to be really cool. Most of the team stuff works -- I still need to have it work in online play, have some mutators changed to accommodate the team play, and update the results screen.
Follow me on Twitter @JibbSmart for all the information as fast as it comes -- I always update Twitter first, and it always has links to the most relevant info.
Also, the nomination stage has begun for IndieDB's Indie Of The Year! Please vote for KarBOOM (you can vote for as many games as you want) as I hope to really polish things up by year's end.
I haven't had anything to say for a while, and just want to offer my reassurance that the next update for KarBOOM is still coming along. It's going to be the biggest update yet, with many mutator improvements and additions, new levels and surface types, obstacles, hazards, smarter bots, improved graphics and more graphics settings, improved sound, and online changes to improve chat, make it easier to find the game you want, and make it easier to host games.
Development was slowed to a near halt with lots of university work, but now it's all over, and I'm free to focus on KarBOOM over the next few weeks. I'm hoping to release the next update within the next two, and (as usual) follow it up with a few smaller updates with little improvements.
So watch this space!
I've just played some KarBOOM Online today with 5 other players, and I've gotta say I had a lot of fun. We smashed into each other. Sometimes we'd all just stop and chat for ages, mostly about how the chat system needs to support multiple lines of input and other ways KarBOOM needs to improve. And then someone would smash into someone, steal the flag, and start drifting around the ring. There was laughter, there was plenty of lag for some users (we had USA, Canada, and Russia playing on a German server), and all in all it was a good time.
It's weird, though, how I'm sure for players playing KarBOOM 0.2.2 a lot of it is "new and improved" -- new and improved for KarBOOM, that is. For me to play online with other people I need to open up the latest public version -- 0.2.2 -- but I've also got a working private version 0.2.3, and even though the changes are slight (small bug fixes, UI tweaks, and KarBOOM now remembering your login details), it feels like such a step back to be playing 0.2.2.
When testing KarBOOM 0.2.3 I just open it and click "login". My details are already there, and there's a little "Remember Me" checkbox that's already checked. Some bugs have been squished, and more improvements are still to be done. But it's weird to be on the developer's side of things -- by the time a version goes public, it's pretty much already out of date.
Wow. Okay. Online is still coming to KarBOOM, of course. But what an effort it's turning out to be! After a ridiculous amount of work since the last update, the current state of KarBOOM Online (not publicly released yet) has a serverlist system that makes it pretty easy for people who want to start a new game to get their session listed online and pretty easy for people who want to join a game to find one. Joining a session puts one car into the level that is controlled with the first keyboard controls.
And that's it, for now.
I still have to implement mixed offline-online play, password protection, player accounts, scoring, rounds, mutators, player disconnection, menus, wannabe-hosts who need to set up port-forwarding and whatever else is going to come up! There's still so much to do! But I really want to get a solid and fun KarBOOM Online publicly available by Christmas!
The dead-reckoning system I've just finished is pretty solid. Dead-reckoning refers to position-prediction techniques to cover up the effects of lag. Obviously, to prevent cheating all game logic is performed on the server, with clients simply sending their input. Their's a different function governing the motion of cars depending on whether that computer is the server or a client. The server's car function is easy -- it's actually the same function I've been using all this time for offline play, with a fourth input type: online packet (the first three being keyboard, gamepad, and bot-logic). Also, a few lines of code are added sending each car's state to all the clients at regular intervals. And that's all it needs to be a find-and-dandy server.
The clients are a bit tricker.
I originally copy-pasted the function I use for replay-cars and modified it from there, with cars interpolating their positions based on states coming in from the server rather than saved game-states. This proved much less effective in this situation, however, since the more I smoothed out their motion, the more lag was exaggerated. To be more clear: I could either have sudden jumps to each new position as soon as it arrived to reduce lag as much as possible -- but that was ugly and unplayable -- or I could smoothly interpolate between the previous position and the latest position, but that just meant by the time the car reached the last-received state it was already well out of date.
What I've done now is much better: player states are now sent even less regularly from the server, but player input is sent from the server to the clients quite regularly. Player input packets are much smaller than player states, and they assist in predicting appropriate motion for each car, so all-in-all this reduces network traffic. Now, each car displayed on the client contains two states: one that you can see, and one that is updated as regularly and quickly as possible by the server as before (with no smoothing). Each frame, player input as received from the server (or, if the car is controlled by this client, straight from the player his/herself), and appropriate physics calculations are performed on both states. That is, the visible car is moved forward according to its acceleration, direction and player input; and the latest player state received from the server is moved forward according to its own acceleration, direction and player input.
What we end up with is two new states:
The final state the player sees is an interpolation between those two states. This new state is used as the visible state for the next frame, while the modified server-state is used as the server-state for the next frame unless a new state is received over the network. It requires some fine-tuning -- if the interpolation factor is too high we get sudden jolts again between states; if the interpolation factor is too low then the visible state will get further and further out of sync with the server's state. But it appears to be working well!
I can't wait to see how well it works with people on opposite sides of the world playing with and against each other!
I've got to say, I was pleasantly surprised at how smoothly it went adding bots to KarBOOM. If you haven't read the news yet (or you're really quick and you're reading this before IndieDB has made it available), KarBOOM 0.1.4 is out now. Get it on the downloads page if it's ready, or at KarBOOM's website, which always has the latest version of KarBOOM pretty much as soon as I finish it.
I was having a little trouble getting the bots to be intelligent about avoiding the boundaries of the level, but in the end I didn't need to at all. You see, a few years ago in my first semester of university in Australia, we had a task to build and program Lego robots to fight each other in a ring. The ring was marked with black tape on a white board, so every robot took advantage of light sensors to see where the boundary was and stay away from the edge. Every robot except ours, that is.
Why complicate things with a light sensor? We could always be sure that unless the round is over there were no boundaries between one robot and another. All our robot had to do was spin until it saw something with its sonar, and then charge ahead as fast as it could. It came second in the tournament.
The bots in KarBOOM have a similar strategy. Being cars, they can't spin on the spot. But as long as they know how to make a three-point turn and can tell where their opponents are, these cars almost never find themselves outside the ring unless forced by another car.
Also, at time of writing, there's still time for phase 1 of the voting for Indie Of The Year. You can vote for as many games as you want, so if you like KarBOOM please support it with a vote. I'm by no means expecting (or even hoping for) actually obtaining the first-place title of Indie Of The Year with the likes of Minecraft out there -- and Minecraft well and truly deserves it. But the ranks of the top 100 are published, and the top 50 get considered for other honours besides Indie Of The Year, so a vote is a great way to show your support.
As I've been trying to get online play into KarBOOM, the first thing I've had to deal with is the hardships of setting up a server list. I'm often working away, watching my game/application/project come to life, and think: Programming is easy. Then I get stuck on something and get infuriated at how difficult it is. How terribly buggy can computers be? Why do I insist on working in such a frustrating field? Why did I stop working at that fast-food restaurant!?
Last night I was working on the server list, and all was looking fine and dandy. I need the lobby to be up 24/7, but I'm not on the kind of budget where I can have a dedicated server meeting that need, so the obvious choice is to have the server list on an online database on a free host, and have the game interact with the server list through http posts. There are plenty of free hosts that provide PHP and MySQL support -- I went with 000webhost.com. I've had no trouble with them so far, but until KarBOOM Online goes public it's not exactly under much stress.
I'd written a server list system using the same engine and the same host before, so I thought getting it working would take no time at all. In under an hour clients could request the server list and parse the resulting information into an interactive lobby system. Minutes later, servers could add themselves to the list.
But then came the heartbeat system.
Ideally any server that goes offline informs the server list when it does so. But I need to account for hosts being unexpectedly disconnected from the internet, resetting their computer, or ending KarBOOM improperly. To prevent a dead server being left on the server list with no one able to connect, each server sends a "heartbeat" every few seconds to the server list, letting it know that it's still alive. Then, when a client is looking for a host, the server list can eliminate any hosts that haven't sent a heartbeat in a while. This is also something that I'd done before, and so I knew it would work.
But it didn't. The heartbeat was sent, but the database wasn't updated. For the life of me, I could not see what was going wrong. I literally spent hours trying to figure it out, filling my code with printf's and inserting all sorts of tests into the PHP server -- all of which worked without trouble, but did nothing to show me what was going wrong.
I'd updated my engine since the last time I'd written such a system, so I began to blame the engine. Why won't you work? What have you done to break my perfect system!? Make it WORK!!
And then at 1 this morning I noticed it: I'd given the wrong name for the field that keeps the time of the last heartbeat. I changed one variable name, saved, and tested it; and everything just worked. Just like every time in the past when something had gone wrong, I was kicking myself for thinking that for once the software I was using was faulty -- for thinking that for once it wasn't my fault.
Today I'll be getting back to work, getting clients to connect to servers and getting them to communicate with each other properly. And the whole time I'll be thinking: Programming is easy, but it's not idiot-proof.