Monday, January 09, 2017

Unnamed Horror Game

My newest project is going to be a 3D Horror Game.  I think 3D is the way to go (hello 1995!) these days; it may be harder, but for me at least, simple 2D games just don't interest me, and certainly don't interest my kids who are my main audience.  With this in mind I thought a horror game that scares them would be fun.

Here's the very first video.  it's just me walking around:-

It's written in Java using the excellent JMonkeyEngine for the 3D.  I did have a look at using LibGDX which is also very good.  However, for the physics aspect at least, it was just a "leaky" wrapper for Bullet.  Bullet is written in C, and so even in Java it seemed to be a case of remembering to dispose of objects and other things I'd hoped to never have to do again.

Friday, January 06, 2017

Tips for Software Developer Recruiters

I've had quite a few Software Developer jobs, been an interviewee even more times, and sometimes even been the interviewer.  This is a brief rundown of some tips that I've picked up along the way to avoid wasting both the interviewers and interviewees time, and help you get the right people.

1) Read This

For the love of God, read this before you do any interviews.

2) Be flexible with interview times

...preferrably holding them out of hours.  A consciencous interviewee who already has a job doesn't want to risk endangering that job, or waste their holiday allocation, or go through the minefield of taking time of work, if they can help it. 

You will make it so much easier for potential recruits if you can do the interview out of hours, or in some way make it as easy as possible for them to get to the interview without disrupting their current job.

3) Test their development skills by getting them to develop something

Software development is about developing software, not about knowing the definition of Dependency Injection or what the definition is of each of the method modifiers available in your chosen language.  There is so much to know in Software Development the no single person can know everything, and by asking specific quiz questions, you're turning the interview into a lottery (for both you and the interviewee) where the "winner" is determined by who was lucky enough to have recently read the specific fact that you asked them.

Go through the process of developing software with them.  Allow them to use Google and Stack Overflow, and discuss their code as they write it.  Allow them to use technologies they are experienced in (or claim to be experienced in).  In short, get them to carry out a microcosm of what the actual job would be.

4) Look for Passion

Good software developers love programming, whether it's part of their job or their hobby at home (or anywhere outside their job).  I'm always wary of an interviewee who doesn't write code at home.  If they do, don't worry or expect that it's actually any good; most hobby development is just for fun, and once it stops being fun it gets abandoned.  The fact that they do it is the only important thing.

Friday, December 23, 2016

Escape from Krakatoa Remake

I've been working on my remake of the classic game Escape from Krakatoa for a few weeks now.  I'm already the top Google result for "Escape from Krakatoa remake" (about the top 5 results actually) which says more about the fact that no-one has attempted a remake of this game rather than my internet omnipresence.

The game "components" that I've managed to create using JBox2D is the helicopter, a rope, the landscape, water, the tanker and the rocks thrown from the volcano.

Here's a video of a few of them combined.

They are all basic polygons at the moment (with the exception of the water), but it shouldn't be too difficult to replace them with proper graphics once everything has come together.

At the back of my mind is what new aspects I can add to the gameplay.  I was thinking of something like, the player can (must?) transport crates to the islanders or the tanker to keep them supplied, whilst also defending them against rocket attacks.  And, unlike the original, maybe the player can actually help the islanders escape from Krakatoa?

Saturday, December 10, 2016

Just discovered JBox2D

I think I'm pretty late to the 2D physics library game; I've just discovered Jbox2D and I can't believe what I've been missing.  Apart from anything, it handles all the collision detection for you, which saves tons of coding straight away.  But not only that, it also handles them in realistic ways.  As a game developer, you just create all the physics objects and then let the physics engine do everything else.  All you need to do is draw the graphics and handle user input.  It's so good, I'm surprised at the lack of example code on the internet.

Here's a small vid one of my first experiments - water and getting something to float in it.

It's pretty simple, but what's even simpler is the code required to do this.  I've just created the particles and the rectangle, and then the rest is automatic.  The main bit of code I had to write was drawing it all.

I've been messing about with it for a few weeks now, and my first "big" project with ti is going to be a remake the classic Escape from Krakatoa using JBox2d.  It's a game that lends itself to a physics enghine; the player flies a helicopter, must avoid rocks being thrown from a volcano and rescue people from the island.  I'm going to check I can recreate each aspect using the physics engine, and then put it all together.  Next up is flying a helicopter.

Tuesday, October 18, 2016

Easy Network Programming For Games

When you start developing your latest multiplayer game, and get onto the networking aspect, do you wish there was a way to avoid having to re-write the same code over and over again?  All the handling of sockets, multiple network threads, keeping track of clients etc...?  Me too, so that's why I wrote the Generic Multiplayer Connector.

The Generic Multiplayer Connector (GMC) is a library to help turn any single-player game into a multi-player game by allowing clients to easily connect to a shared server and pass data to each other without having to worry about all the usual networking complications. It uses a client/server model, and when a client sends out any data, it is automatically received by all other clients in the same game. Clients also receive notifications of when a game has been won and who the winner was.

GMC is also completely open source and can be downloaded here: 

Why should I use GMC?

That's a very good question. There are lots of other networking libraries out there. However, the real advantage of GMC is that it requires minimal setup, configuration and handling:
  • Running the server is simple a case of running a jar. Because the server is generic, a single server can be used for any number of different games.
  • Once a client is connected, it can send data, and will automatically receive data, from all the other clients playing in the same game. All you need to do is decide when to send data, what data to send, and what to do with the data when it's received.
  • You don't need to worry about handling network connections, multithreading, keeping track of other players etc.. Just send and receive data.
  • There are built-in methods for accessing the current status of the game (waiting for players, started, finished), notification when a player has joined/left, and who the winner of the game was.
  • There is a free publicly-accessible server waiting for you to use.


Example Code

Running the server:-
    // Run this in a command prompt
    java -jar GMCServer.jar 
All the following code is run on the clients.

Connecting to the server:-
    // This will bring up a form for the user to enter an IP address etc..
    ConnectorMain connector = StartGameOptions.ShowOptionsAndConnect(this);

    // Alternatively, if you have your own method of getting the 
    // connection details:
    ConnectorMain connector = new ConnectorMain(this, "", 
        9996, "Steve", "MyGame", 2, 99);
Joining a game:-
Sending data to all other clients:-
    // There are other ways, this sends a key/value pair by TCP.
    connector.sendKeyValueDataByTCP(code, score); 
Receving data
    // 'game' is your class that implements the IGameClient interface.
    game.dataReceivedByTCP(int fromplayerid, int code, int value);
Damn, I've been killed in the game
I've got to the end! Was I the first?
But who has the server confirmed as the winner?
    System.out.println("The winner was " + connector.getWinnersName() + "!");


 Quickstart Guide

These are step-by-step instructions on how to incorporate it into your project:-
  • Run the server GMCServer.jar, or decide to use the public server described below.
  • Add the GMCClient.jar to your project.
  • implement the IGameClient interface in a class in your game.
  • Create instance of ConnectorMain().
  • Call ConnectorMain.connect() to connect to the server
  • Call ConnectorMain.joinGame() to join a game.
  • Wait until all players have connected ("ConnectorMain.getGameStage() == GameStage.IN_PROGRESS") and then start your main game loop.
  • Send data to other clients with any of the ConnectorMain.sendKeyValue..., ConnectorMain.sendString... or ConnectorMain.sendByteArray... methods. All the other clients will receive any data sent.
  • Receive data using any of the IGameClient.dataReceived... interface methods.
  • Call ConnectorMain.sendIAmTheWinner() if your client won the game, or call ConnectorMain,sendOutOfGame() if your client is out of the game.
  • End your game when "ConnectorMain.getGameStage() == GameStage.FINISHED", or if your client has finished (i.e. the player has died), call ConnectorMain.waitForGameToFinish().
  • Once the game has finished, you can get the winner's name with ConnectorMain.GetWinnersName().
  • You can then call ConnectorMain.joinGame() to join/start another game, or ConnectorMain.disconnect() to close all network connections.


Public Server

I run a server at that can be used by anyone.  As stated above, any GMC server can be used for any game or any number of games.  (See the source file for the port). Note that this server is not guaranteed to be available 24/7 forever though, and should not be used for anything mission-critical.

Thursday, October 06, 2016

Ares:Dogfighter now Open Source

Due to lack of popular demand, and the fact that I've slowly stopped developing it, the source code and assets of Ares:Dogfighter are now available on BitBucket here.  It should be pretty useful to Java programmers looking to get started with 3D.

Here's a video showing its current state:-

Wednesday, September 28, 2016

Stuck in a Loop

I'm at that juncture again where I ponder the question to myself "Why am I writing games?"  I've been working on a game called "Ares:Dogfighter" for a few months now, but I'm slowly getting bored with it and there's a chance it will get slowly abandoned.

I always start with the best of intentions, and starting on a new game is great and exciting: the idea is epic in scale, the possibilities are endless, the screenshots in my head look great, and I know how I'm going to write all the code.  However, fast-forward a few months and I'm stuck debugging a small but frustrating problem that's taking up a lot of my time, and nobody has played it (or at least, no-one has told me they've played it).  So why am I spending the time writing it? 

Part of the problem is the time that marketing a game now requires, but without marketing, no-one will see the game among the other trillion games out there.  Setting up the blog/website/twitter account and regularly posting to it takes time, and my time is already limited as it is.

I'll probably stop developing games for a few months and start playing them again.  Or I could jump onto an open-source game and contribute to that, but I find it very hard to find semi-decent Java open-source games.  Eventually I'll have an amazing idea for a game, start work on it, and the process will start again.