Multiplayer Football Simulation

The multiplayer football simulation was for the Simulation and Concurrency module, which I did in the second semester at Hull. It was quite a huge project, compromising of physics, networking, threading, AI, and all the other random stuff that makes up a game. Towards the end I was working on 48hr days as I'd only end up getting to bed every second night. I'm not even in the industry yet and I already hate crunch time.

The Brief

Like I said before, the brief was tear-inducingly huge for the amount of time we had to make it, added to the other projects on the go at the same time (peaked at something like 5 at once). Briefly (if you'll excuse the pun, aha-ha):

The Finished Version

The finished version (though I'm still probably going to add more stuff to it) includes pretty much everything except the rigid body physics and goal net spring and dashpot modeling. It does however look very pretty and is also pretty fast, even with all those connections.

Controlling the players by applying force tends to make it quite difficult to actually hit the ball unless you start from a standing start and the ball doesn't move in the mean time. Still, it's quite fun to play, especially with a lot of people.

I implemented quite simple AI for this. Basically each player has a zone of control (see the server picture in the Images section to see what I mean). If the ball enters this zone, then the player gets a vector from the ball to where the opposing goal is. It then extends this out to a point on the ball and aims to hit that. Simple, effective, and sometime frustrating when you're about to hit your carefully lined up shot and an AI player plows into the ball and sends it to the opposite end of the court. There is one big flaw in it, which if you think it out becomes immediately obvious, but I'm not too bothered about it so I left it in.

I actually really liked working on this project, so I plan to revisit it when I've a bit more free time and put in some goal nets. Ah, the challenge of developing a net that doesn't go mental when touched...

Anyway, I've stuck up some images of the game in action, though you can also check out some movies of it as well. As for downloads, you can download the source code (1.98Mb), the release version of the client (1.89Mb), the release version of the server (29Kb), and the project report (150Kb). If you want to play it over a LAN, then just get the IP address of whomsoever's running the server, and plug it into the environment.txt file. Enjoy!


Submit a comment

* indicates required