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.

Tuesday, January 08, 2019

SteveTech1 now has voxel support

SteveTech1 now has the built-in ability to create (and destroy!) voxel worlds.  Now you can create a PUBG/Fortnite clone in Java with Minecraft style voxels.

See it in action in this simple and rough demo that I created:-


SteveTech1 can be downloaded here: https://bitbucket.org/SteveSmith16384/stetech1

Sunday, September 30, 2018

More Games Made with SteveTech1

Here's a couple of other multiplayer FPS games I've been developing with SteveTech1:

Bug Hunt:



This is going to be a bit like Alien Isolation.  It's very early in the development process, and so far I'm just walking around avoiding zombie's that charge at you.

Two Weeks in the Pub:



If you're going to write a multiplayer FPS, surely it's only a matter of time before you write a PUBG/Fortnite clone, and here's mine.

I should probably say that SteveTech1 can handle more than just low-poly models, it's just that those are the best free ones I could find on the internet.

Thursday, September 27, 2018

Multiplayer Tower Defence

I've just started a new project using SteveTech1, which will be a Multiplayer Tower Defence FPS.  Read the in-progress tutorial at http://multiplayertowerdefence.blogspot.com/

Friday, March 09, 2018

Laser Squad in 3D

Laser Squad was probably my favourite game on the Spectrum, and I played it for hours at a time back in late 80's (one reason why I created Stellar Forces).  Now that I'm developing a multiplayer FPS engine in Java, an obvious candidate for a game is a realtime version of Moonbase Assault, one of the original missions in Laser Squad.

In that mission, one side had to defend a moonbase from attack by the other side, who had to destroy the moonbase computers.  My realtime version is a long way off yet, but here's a preview showing me walking around the moonbase.



For those who remember the game really well, you should recognise the layout of the map and be able to follow it as I go.

Wednesday, February 21, 2018

Java Open Source Multiplayer FPS Engine - Preview

"SteveTech1" is my code name for my new Multiple FPS Engine for Java (a name in tribute to Id).  Obviously, the only way to prove that my Multiple FPS Engine "SteveTech1" actually works, and is useful, is to create a game with it.  Here is a preview of that game:-




It's called Undercover Agent.  In a nutshell, all the players (and scenery) look exactly the same.  The aim of the game is to find the enemy players before they find you.  Since everyone looks the same, the way to identidfy them is when they move.  But then you have to move to find them!  Aargh!  In this level, everyone is a snowman, surrounded by inanimate snowmen.  Did I see one of them move...?

Once I'm sure that SteveTech works, I'll be releasing the source.

Wednesday, January 31, 2018

Why do software publishers change software for no good reason?

"If it 'aint broke, don't fix it"

Since the dawn of time, 95% of desktop GUI's have a toolbar with a minimum of File, Edit and Help.  If you wanted to open a file, e.g. a Word document or Eclipse project, you went to File and selected Open.  If you wanted to know what version of software you were running, you could rely on a "Help | About" menu option.


Now I challenge you to find out what version of Word, or any of the MS Office suite, you are using, on the more later version.  I don't know which versions, exactly since I can't see how to discover the version number I am on, but the ones where, for some unexplained reason, they've removed the Edit and Help menu, and clicking on File takes you to a whole new window.  It also makes it much harder to Google for the solution, since you can't search for what version of Word you are using, so 90% of results still say "Go to Help | About".


As well as that, they've also redesigned the file dialog; now it's impossible to go directly to any directory on your computer.  You can only go up or down a level, although if you click on the right area, it brings up the original classic file dialog!  Why is this hidden?  I can only assume it's so they can keep people paying for the MCSE certificates, or whatever they're called these days.

The latest culprit is Firefox.  What is the point of Firefox's "Other Bookmarks"?  If a user bookmarks a page, wouldn't they want it to appear under Bookmarks, not in some obscure folder that hardly anyone even knows about?  I imagine new users abandoning Firefox since their bookmarks don't seem to be added, which was my first thought.  They changed this feature a few months ago.  Why??  Was it too straightforward and logical?

Tuesday, January 30, 2018

Free Quality Open Source #2: Space War!

Everyone remembers Thrust don't they?  Or Gravity Force?  If not, they were some of the first gravity/physics games, and great fun.  So that's why I wrote SpaceWar.  The full source is available here.  It's in Java, and should "just work".




The game uses jBox2D in order to do the physics.  This means that all values can be easily edited, such as mass, acceleration, gravity, bounciness etc...   The gravity also comes from the masses of the object rather than "down", so players will gravitate around planets etc..

For the multiplayer aspect it uses the keyboard and as many gamepads as you can plug into your USB ports.

Since it's fully open-source, you can do whatever you want with it.  Please let me know how you get on.



Friday, January 12, 2018

Simple Physics Engine for jMonkeyEngine

I'm currently developing an open-source multiplayer networked FPS engine, after getting addicted to Overwatch and TF2 and then wondering why there's not a single open-source Java multiplayer source game anywhere.  I aim to fix that, and at the moment progress is coming along nicely; it was never going to be easy but so far it has remained fun.  There's nothing to actually release yet; I'm going to wait until I've actually got a full game working before I release the source.

Anyhoo, the project has necessitated some additional code not directly linked to the project, which I can release.  The first one is a Simple Physics Library for jMonkeyEngine.

jMonkeyEngine comes with an excellent physics engine.  However, it is almost too excellent, and has a lot of features that I don't require which takes up CPU usage.  In addition, a multiplayer networked FPS requires the ability to "rewind" time on physical objects, which the existing JME physics engine can't do.

The full source is available here, which includes an example "first-person walking around" game.

And here is a video showing it in action.


Monday, January 08, 2018

Free Open Source #1 - Tricky Towers

Being a good citizen, I like to give as much as I receive.  So, on the assumption I might one day find some open-source code that is actually any good (only joking) I'm going to post about my own open-source code that is available to anyone that wants it.

The first one is this game called Tricky Towers, which is a simple clone of the game Tricky Towers, which I've never actually played but looked really fun.

It's an up-to-3 players game, where the aim is to be the first to pile blocks all the way up the top of the screen.  However, it is physics-based, meaning unbalanced towers often topple.  It can get quite frenetic and fun when there's 3 of you, especially if one players tower topples into another.

Full Java source is here.