2 Minute Hidden Cave

This is going to demo using the rails block, this allow one machine to run along a rail. In this case I’m using it to create a secret opening to a cave

Link

So that’s great (he says modestly) but pushing things along rails can get boring fast. So can you power the rail so that it can move on its own?

I wouldn’t have asked the question if you couldn’t, so here’s the video

Link

So a rail can be controlled not only by a button directly but remotely using antennas, which is, if I’m honest, much more useful.

You saw there was an addition/subtraction block. This is because a positive signal will move the rail one way, and a negative signal the other way

addSubtractWithAntennas

Tech Stack!

For the more technically minded amongst you here is the tech I use to create my blockworld.

Language: Java

Because Java is almost as fast as C++ but with none of the manual memory management rubbish. Also Java is great!

Framework: jMonkeyEngine

jMonkeyEngine is a bit like Unity in C++, its a scene graph based 3d graphics library for java that uses OpenGl under the hood (i.e. it runs on the graphics card so its fast!).

[Full disclosure I think its got a lot more in it besides that but that’s what I largely use it for]

jMonkeyEngine is great because you can get started really really quickly, here’s a hello world

public class SimpleBox extends SimpleApplication {

    public static void main(String[] args){
        HelloJME3 app = new HelloJME3();
        app.start();
    }

    @Override
    public void simpleInitApp() {
        Box b = new Box(1, 1, 1); // create cube shape
        Geometry geom = new Geometry("Box", b);  // create cube shape
        Material mat = new Material(assetManager,
          "Common/MatDefs/Misc/Unshaded.j3md");  //use a built in material 
        mat.setColor("Color", ColorRGBA.Red);   //make the material red
        geom.setMaterial(mat);                   //use the material on the cube
        rootNode.attachChild(geom);              //make the cube appear in the world
    }
}

And that creates:

redBox

So; easy!

But jMonkey doesn’t stand in your way when you want to do more advanced stuff.

You may be thinking; hey that looks like a block, is your game made of hundreds of thousands of those? And the answer is: originally yes, until I found out that that is a terrible terrible idea. It works but is really really slow because the graphics card hates all those separate geometries (it asks if you can see each one, each has its own material etc etc). So what do you do? You merge blocks together into chunks. These are great because they are small enough that you can recreate one from scratch in a single “tick” but big enough that they can be drawn efficiently. But we’re getting into architecture now so I’ll leave that for another post.

2 Minute Hovercraft

In the last post I showed a video of finished product; an aircraft, a hidden entrance, a turret and a car. which makes for a nice demo but doesn’t really show you how the game is actually played so I want to show some really short videos starting at nothing and building something that shows off a feature of the game. They may not be as pretty but they will be up and running quickly.

So to start; a 2 Minute Hovercraft

Link

(Possibly that explosion at the end was a little over the top for a gentle crash into a tree, work in progress!)

So, that’s got engines to move, a command chair to bind keyboard input to the wire outputs, a skype notification noise (sorry about that, I did say these would be less pretty) and two weird looking blocks that didn’t seem to do anything:

antigrav and stabilisation

These blocks are “physics is hard, sort it out for me!” blocks. Or more specifically the antigrav block (gravity doesn’t affect any machine with one of these) and the stabilization block (keeps the machine more or less flat, the more of these you add the more it tries to keep it flat, but one is usually enough).

So what if you don’t have these blocks. I’m sure that would be fine.

No stabilization block:

Link

No antigrav block:

Link

Turns out a hovercraft without an antigravity block isn’t really a hovercraft. That said its utter failure showed off how blocks that get broken off machines become their own separate machines so I’m counting that as a success

Blockworlds!

I plan on using this blog to write about my progress writing my blockworld game. If the name “Blockworld” doesn’t mean much to you its because one game in particular dominates that genre, but it isn’t the only one. So this is a blockworld:

blockworldIntro

Great, so now we’re on the same page. Now a lot of you will have just said: “But that’s *REDACTED*!” and I’ll agree it does look pretty similar. So why do I want to remake a game that already exists? Well the answer is I don’t. Blockworlds you’ll have seen before tend to be fairly architectural; a building here, a bridge there, and if I’m honest that is already really fun, so many hours sunk, so many. But, when I was a child I didn’t make buildings and bridges out of Lego, I made spaceships and machines and things that moved (or at least that I imagined moving) and that’s what I wanted from my blockworld. Something like this:

tradeship

That incidentally is something you could build in my game (I really need to decide on a title). You can see it has engines to move and maneuver and those green things on the end are energy projectors (weapons) linked up to sensors (the red blocks) all wired together to detect and shoot at hostile machines. But that particular ship is something that is also generated by the game and under Ai controll, it will wander around the world and if you shoot at it it will turn hostile and start shooting back and never forgive you (mental note; need to fix that last bit, slightly player hostile).

So; enough with the screenshots, I keep talking about “things that move” so here’s a video of all the things that move: