Saturday, August 01, 2020

Overblown Released

I've released Overblown, the split-screen multiplayer FPS.



Download it from https://stephensmith.itch.io/overblown

Wednesday, July 22, 2020

New Overblown Hero: Boomfist

The second hero to be added to Overblown is Boomfist.  Here he is in action:-



Overblown uses the Bullet physics engine for all its movement and collision.  The main problem I had with Boomfist was hist PowerPunch ability.  I originally tried applying a force to his centre, but due to the damping of the player's avatars (which is there to stop them sliding about too much) the force was initially too fast, andf slowed down too quickly.

My solution was to simply remove the dampening effect until the player's linear velocity dropped below a certain threshold, at which point it was re-applied.  I also used the player's linear velocity to check if they were in the middle of a punch when they hit another player (as opposed to simply walking into them).

I also created a new logo for the game:-


LibGDX 3D Camera lookAt() Problem

If you've ever used the method camera lookAt() method, you may have noticed that afterwards, your view of the (virtual) world is slightly off-kilter. 

For some reason, the methods alters the camera.up value, which should ideally be (0, 1, 0).

What is the solution?  Just manually set the direction yourself like so:-

tmpVector.set(targetPosition).sub(camera.position).nor();
player.camera.direction.set(tmpVector);
player.camera.update();
I've no idea why the lookAt() method does what it does.

Tuesday, July 14, 2020

New Gamedev Project: Overblown

In the interests of trying to get players to actually play my games, I've decided to start with an audience closer to home: my kids.  Their current obsession is Overwatch, so my new project is an Overwatch clone/parody called Overblown.  This will be split-screen multiplayer, and use a proper physics engine.  One of my aims was to have a properly destructive environment, something that even Overwatch doesn't have.

I decide to use LibGDX, basically cos it's pretty good, I know it most out of all the engines I've used, and I've got loads of old code I can re-use.

I've already created several split-screen games (like Chrono Cup), so I started off re-using this code.  The first thing I needed was a decent map, not the usual uninteresting flat space that I come up with.  For some reason, generic 3D map editors seem very rare, so I created my own:-



One of the hardest things about creating a map is getting the textures to look right.  it's very easy to fall into the trap of looking like an old 90's game with overly detailed textures on simple shapes.

Once I had the map, it was onto creating the characters.  I had loads of ideas for parodying the characters, and the first one that seemed ripe for copying was Pharah, or Phartah as she is called in this game:-




Once I came up with the name Phartah, the in-game jokes wrote themselves.

The next character is Boomfist.  I pretty much enjoy coding more than I enjoy playing games, and one of the fun aspects of this project was trying to recreate the Overwatch character's abilities in my own game.  The next challenge was Boomfist's PowerPunch ability....


Wednesday, May 06, 2020

Investigating WebVR and WebXR

After buying an Ocuus Go, it was only a matter of time before I started looking into the easiest way to develop my own games for it, and WebGL definitely seems the way to go.  Of course, this opens up the next question: what framework to use to implement WebGL?

Anyway, here's a few things I've learnt that might save other people a lot of time:-
 

Thursday, April 16, 2020

Announcing Chrono Cup - Quantum League Remake

I read about Quantum League just a few days ago, and it sounds like a really good game mechanic.  I've been looking to try and implement some kind of "time" mechanic in games for years, going all the way back to the 80's since I read about a game that the legend that is Julian Gollop wrote (the name escapes me now - it might have been Timelords).

Anyway, after reading about Quantum League, and being between projects, I decided to see if I could re-purpose my split-screen FPS engine to implement the rewind and play effect.  It was quite a mental challenge, but here is the result:-



I've come up with the name Chrono Cup for it, until I think of something better.  And please ignore the simple placeholder graphics.  Hey, I've only been working on this for 2 days!

If you don't know how Quantum League works, basiecally you play an FPS-style game for 15 seconds.  Then time rewinds back to the start, and you do it again; however this time, a "ghost" plays out your actions from the first phase.  Then it rewinds for a 3rd time, and you have two "ghosts".

This may sound good albeit simple at first, but it potentially leads to lots of interesting twists, since (for example) the ghosts bullets still have an effect as long as the ghosts aren't killed.  So if you can kill a player/ghost who shot you the first time, you won't die, so your ghosts will be alive for longer in a later phase!

More coming soon....


Monday, April 06, 2020

Visual Studio is a bug-ridden pile of crap

Let's start a new project and add a class to it:-


Oh, we don't seem to have the option to add a class file to the project.  Maybe the project properties are wrong.  Let's have a look.


Oh, we get a nice error.  Looks like I'm not the only person with this problem.  You would have thought after all these years, Microsoft would be able to write a piece of software that wasn't bug-ridden crap.

And while we're on the subject, why does Paint not have an Edit menu, like every other normal program in the known universe?  And does MS SQL Server need pointless extra services to work, like Server Browser?

Thursday, March 12, 2020

Split-Screen Multiplayer Engine

So I've been developing a split-screen multiplayer FPS engine using LibGDX.  It can handle up to 4 players.

Since (like most hobby developers) I can lose interest in a single project very quickly, this project contains several different games.  The first game was a remake of the classic game 3D Monster Maze.  However, I'm also working on a game of Tag, a Tower Defence game, a driving game, an FTL-type game and several others.

Source is here: https://github.com/SteveSmith16384/splitscreenfps_libgdx

Early example video here (Monster Maze level): https://www.youtube.com/watch?v=hM-P-M--Or4&t=108s

Tuesday, January 28, 2020

How to be Terrible at Overwatch

This is something I wrote about a year ago.  It's unfinished (or "work-in-progress") but I thought I'd out it here for now.

After all, what's the point of playing as part of a team and winning the game when, even though you probably killed more players than anyone else, the game result will only mention that you were on the objective for 3 minutes, which impresses no-one.  It doesn't matter if your team loses as long as you're on that leaderboard with the most medals!


Tactics

Work Solo

After you've been killed (along with probably several of your team), don't bother waiting for others to re-spawn and attack en-masse: just charge straight back into the match and get those kills in while you can.

Know where the battle really is

Okay, it's a payload mission.  But (if you're attacking) leave the boring task of moving the payload to other weaker members.  If you can keep a single enemy busy by fighting them in a far flung corner of the map, nowhere near the payload, that's got to be a good thing. And if you're defending, then the further back you can push the enemy the better.  It's not like any of them will be able to sneak past you without you noticing.  Leave moving the payload to the n00bs who are probably cont as good as you.


Team make-up

Stick rigidly to your favourite character, regardless of the makeup of your opposition; that way you get lots of practise at using them.  Don't be tempted to be a healer, they can hardly do any damage.



Characters


Bastion

Make sure that you use his ultimate as soon as you have it.  Even if you've found a great spot to mow down the enemy, use your ultimate and charge right into the middle of the battle with your cannon firing.


Pharah

This ultimate is ideal for getting revenge on a single enemy who's really annoyed you.  Just walk up to them a press the Suicide Ultimate button.  You will die yourself of course, but it's a small price to pay for revenge.


Mai

If you haven't tried this trick before: here's something that the other people on your team will find hilarious: when attacking, just a second before the spawn point opens, build an ice wall right in front of exit.  Brilliant!


Mercy

One thing that impresses every player, and gets you a few more kills (maybe), is when you play as Mercy, rather than heal, show your skill by shooting enemies with your pistol instead.

If you do feel the need to heal, just concentrate on one single player, ideally a tank who has lots of health anyway.  Also, don't bother resurrecting anyone, as it will probably get you killed.

Another good tactic with Mercy is to select her at the start of the game, but then change just after everyone has left the spawn point.  It will take players a few minutes to realise they don't have a healer on the team.

Thursday, January 02, 2020

Reading PS4 controllers on a Raspberry Pi in Java

I recently had a go at trying to get a LibGDX to run on a Raspberry Pi.  Any project.  Unfortunately I failed.  (If you've succeeded, please let me know, but from what I could glean from googling, no-one has succeeded yet.).

So instead I tried to get some Java code working that could read PS4 controllers/gamepads on a Raspberry Pi.  My aim is to use the Pi as a mini-gaming-console, so I can keep it near our big TV and create some simple co-op games that I could play with my kids, rather than drag them over to a small laptop with its small screen.

And I succeeded!  By standing in the shoulders of giants (in this case, the JInput authors) and finding the native JInput modules compiled for AMD, it seems to work.

The repo is here: https://github.com/SteveSmith16384/jinputtest .  Currently only tested with PS4 gamepads.  Let me know if it works for you.

Wednesday, October 23, 2019

Recreating Speccy Games in 3D

I've decided to have a go at recreating some classic Spectrum games in 3D, with the eventual aim of stringing them all together into one big epic adventure.

Here's the first one:-


Tuesday, August 13, 2019

Open Source Software Statuses

Looking for open source software is a bit like getting a (free) car.  It might look good (or not) and in order to find out whether it is any good, you need to spend the time investigating it and using it.  It might be a supercar, but look like an old banger.  It might not even be built yet, or it might look amazing but the engine doesn't work.  Unfortunately, it always takes time, often to find out that it was a waste of time.

In order to alleviate this situation, I propose a set of statuses to help determine whether an open-source project is what you want:-

* Non-existent - No code has actually been written yet.  There seems to be lots of repo's in this state
* Not yet playable - Typically started, but won't run (or won't even compile)
* Runnable - it will compile & run, but who knows what will happen
* Basic but Playable - There is something to do, but by no means a complete game
* Fully playable - It's pretty much a game ready for players.

One thing to remember with open source is that they are never finished, only (eventually) abandoned, but that's not necessarily a bad thing.  If a project is fully playable, it doesn't matter if it's been abandoned if other people can use it.

These statuses do oversimplify the state a game could be in.  A game could be fully playable, but have massive bugs that cause it to crash.  Unfortunately, there's no way to easily categorise these.  But the above statuses will at least save people some time when searching.

Monday, August 12, 2019

Simple Platformer, with Source Code

I've written this simple platformer game using LibGDX.  It's a multiplayer game where the aim is to collect more coins than your opponents before you run out of lives.  The screen constantly scrolls upwards, and you have to avoid being left behind at the bottom.  I've tested it with PS4 controllers, I assume (probably incorrectly) that X-Box controllers should work as well.

Full source code is available here.

Wednesday, June 26, 2019

A New Roguelike Project

Roguelikes really suit my programming style: they can be ASCII based, which makes creating the graphics very easy, and they are usually grid based, so positioning entities and checking for collisions is simple.  This means that I can spend more time actually creating a game rather than writing all that boilerplate collision and graphics code.

I wrote my first roguelike (Astro Commander) several years ago; it was based on what I thought FTL was like, having never actually played that game.  I've now decided to write another roguelike, after deciding that 3D graphics are too much hard work.  Also, I wanted to have another go at creating an even-better ECS system.  And of course, the theme of the game will be a classic Spectrum game: Alien (Mind Games).

In this game, you will control the crew of Nostromo.






Do you know, I always feel I should write about the games I create in order to "get them out there".  However, when I'm excited about a new project, I prefer to spend my time creating it (rather than writing about it and taking screenshots).  Once this excitement has passed and I've completed all the interesting challenges, I'm then too disinterested in the project to bother writing about it, since I'll probably start another project and won't look at this again.
 
If you want to look at the source code, it's here.  It contains a good ECS system, and units can walk around.  But now I've decide the writing a co-op game is my next project, maybe in Unity.

Friday, June 21, 2019

What is an Entity Component System?

Let's assume you've written a game.  Imagine you've split your game logic into several well-defined classes, e.g. a movement class, a collision class, a drawing class.  Let's call them "systems".  Each has a specific and obvious role.  Also imagine that your game has a bunch of "things" that make up the game, such as the player's avatar, power-ups, bullets etc...  Let's call them "entities".

Each entity is basically a collection of data, and depending on what data it has, it can be handled by one or more systems.  For example, if it has "bounding box" data, it can be handled by the Collision System.  If it has image data, it can be handled by the drawing system.

Your game then works by cycling through specific systems that are required to run each game loop, e.g. Player Input System, then the Movement System, then the Drawing System.  Each system then "processes" all the entities that apply to it, e.g. draw all the entities which have image data.  Systems may well call upon other systems as-and-when required.  For example, your Collision System may call upon the Score System if a player's bullet hits a perp.

And that's it!

The advantage of this is that it's very easy to pinpoint which bit of code is doing something.  If there's a problem with the animation, it will probably be in the Animation System.  If there's a bug with collisions, it will probably be in Collision System.  If you need to implement explosions, create an Explosion System.

Designing a game now becomes a task of defining your systems based on what your game is.  Once you have clearly defined and scoped systems, the rest is easy.

I've created a simple ECS system which I use in my games, over at GitHub:  https://github.com/SteveSmith16384/BasicECS

Thursday, June 06, 2019

C# Gotcha - "static readonly" v "const"

On the face of it, there seems very little difference between these, apart from one takes longer to type out.  However, there is one difference that could easily catch you out: you can reference a "static readonly" from pretty much anywhere in your code, but until your code gets to the line where it is declared, it will have the default value (typically zero for numbers).

Time for an example:-

public static readonly int size = width * height;
public static readonly
int width = 100;
public static readonly
int height = 50;

public void Test() {
    Console.WriteLine($"The size is {size}");
}

Yes, this program will output "The size is 0".  Probably not what you wanted.

Thursday, March 28, 2019

Super Spectrum World

If you're like me and a big fan of the ZX Spectrum (especially the games) please take a look at Super Spectrum World, my homage to lots of classic Spectrum games.

I wrote this as a test of the features of LibGDX, and so far it's been great.  If you lament the end of Java applets and were looking for a way to create apps that could be embedded in a web page, look no further.

Currently the game has about ~20 screens, all with graphics taken from various games.  In JSW style, your objective is to collect as many glasses as possible, and keys are O, P and Space.

Have fun!

Wednesday, March 13, 2019

Why does anyone use MS SQL Server?

Everything about MS SQL server seems designed to make it as difficult as possible to do anything.

Want to restore a backup database?  You'd better be restoring to a database of exactly the same version or else you're not allowed.  Even if you're restoring from v10.000.000.1 to v10.000.000.2, that different version number will stop you.  This might make sense if you were restoring to an older version, but you will be blocked even restoring to a later version of the database, which could and should be able to understand an earlier version.

Want to import an SQL file?  You may think that SQL Server Studio would have that sorted (and indeed it does for small files) but if you want to import an SQL file of more than 250Mb, get ready to use the command line.  And if you have any errors in your SQL, don't expect SQLCMD to tell you the correct line number!  And you are bound to get an error; I don't think I've ever managed to directly import an sql file (that was directly exported from MSSQL) without having to manually edit something in it first.

And then there's "named pipes" and "instances" to adde extra layers of complication.  And different versions: LocalDb, SQLExpress, SQLServer, each with their own features and problems.  Some will work with IIS, some won't.  Apparently LocalDb is "a SQL Server Database Engine that developer them write and test Transact-SQL code without having to manage a full server instance of SQL Server."  Why not just run a full server instance, or have MS realise that it's just too cumbersome?  That developers (unlike end-users) have seen through the looking glass and know better than to use it, but are forced to in order to develop for it?

Tuesday, March 05, 2019

LibGDX Setup Problem

LibGDX is a complex technology, which utilizes lots of other complex technologies, so getting a project up-and-running the first time can have a few problems.  Here's a rundown of the problems I experienced, along with solutions. 

This article assumes you are using Eclipse and running the default "blank" project (which shows the LibGDX logo).


Eclipse Error: GWT jar missing:

Do an Eclipse "quick fix"

Eclipse Error: Web.xml missing:

Move the web.xml to \war\web-inf

Running the program, get the error "File not found: badlogic.jpg"

The application will fail the first time. Open the Run Configuration you just created and set the working directory to the android/assets/ directory.
Go to Run => Run Configurations.. => choose DesktopLauncher, Arguments Tab => Working Directory => Others then browse to yourproject-android/assets/ and click Apply
https://stackoverflow.com/questions/22822767/file-not-found-when-running-new-libgdx-project

Eclipse Error: EntryPoint not found

You need to download the Gradle plugin for Eclipse, from http://gwt-plugins.github.io/documentation/gwt-eclipse-plugin/Download.html


Running Gradle, get error "could not reserve space for object heap"

Check you're using 64bit java for Gradle.
If that doesn't work, add the environment variable "_JAVA_OPTIONS" (with the underscore) and set it to something higher, like "-Xms256m -Xmx2500m".


--
Hopefully, once you've got through all those problems, your project should work!

Thursday, January 10, 2019

My Open-Source Projects

I've created a seperate website to showcase all my open source projects.  Take a look at https://my-open-source-code.blogspot.com, and maybe use them to kickstart your own projects.