jdnsystems.co.uk

Here for you since 1996

Tel: 08003 357645
Tel: 01768 510105
Tel: 01228 420240
Tel: 01539 898043
Sorry, did you say Dragon?
(Written: 04/08/2019, Updated: 29/08/2019)

JDN Simple Games Engine V1.6.

I'm house-sitting at present for a new bathroom installation here at home.

So I've been doing a bit more work on JSIG1v6, the JDN Simple Games Engine V1.6.

It's a self-contained video game engine, designed to hide the interface to the platform, which is initially Windows.

It enables a new programmer to write simple, single-threaded, purely procedural program code to get to grips with the basics of programming itself.

I wanted to strip away as much of the complexity of the various programming paradigms as possible in order to get straight to the fun, ie: the wonder of seeing a machine obey your instructions and create an interactive experience all of your own design.

I also wanted to get the new programmer familiar with the syntax of the C language, on which most other modern languages are based.

Scratch online, for example, puts a heavy emphasis on multi-threading and objects right out of the box.

These are important concepts, to be sure, but having seen a young user struggle to relate Scratch's parallel object metaphor to an essentially linear story progression, i wanted to wind that narrative back a step or two.

Let's not be too quick to step over the concept of procedural, linear control flow. After all, each object event handler has to be linear and procedural at some level. There will always be a critical path in every problem domain.

So much, then, for philosophy. Progress requires a bias towards action, not excessive planning.

My main approach in developing this product is to expand the engine functionality by using it to write versions of some classic games.

All the games are, so far, only partially implemented.

The list of games is as follows:
Pong,
Space Invaders,
Dress Up,
Shepherd,
Archery,
Dungeon 1,
Dungeon 2.

Until recently I was working on Dungeon 1, but due to a certain "learning curve," I've now swapped to working on Dungeon 2.

Dungeon 1 is a dungeon crawler with an isometric player perspective (45,45 degrees).

The problem with that is in the creation of suitable sprite graphics.

In a classic dungeon game, the map is drawn from the same perspective and each sprite, eg: the
player character, has to be drawn facing in at least 8 different directions as it moves around.

This applies to every pose and action of every frame of every animation for every character and also for every other piece of graphic which can rotate in any way.

Since an isometric player's perspective is 45 degrees pitch and -45 degrees yaw, each of those frames has to be drawn separately.

None of the frames can be automatically derived from another one, since when you observe an
object from an angle of 45 degrees, the closer parts of the object hide more distant parts
differently at each point in the rotation.

As an experiment I hand-drew a simple 8-frame walk-cycle for a stick-man archer advancing to the right while holding his bow at the ready.

It took me an hour using MS-Paint.

I could have used a vector-based graphic tool to do this more quickly, but it was an experiment. Styx would have worked here.

Then it dawned on me how many other versions of this sequence, each with a different perspective, I would have to draw by hand...

So the logical approach would then seem to be to model all the sprites in 3D first. Then they can be either rendered as 3D directly in the game using OpenGL or DirectX, or automatically pre-rendered to 2D bitmaps for use in the game later.

This post-mortem video of the classic game Diablo is instructive.
https://www.youtube.com/watch?v=VscdPA6sUkc

At that point I stopped working on JSIG and started working on JD3D2v0 - a wireframe 3D modelling program.

JD3D is specified as a 3D modelling tool with a very easy-in tool set.

I love Blender, for example, but it's "learning curve," is a misnomer. The experience is much more like driving into a brick wall at high speed in the dark with no lights.

Progress on JD3D has gone well and I've enjoyed it a lot. I made good progress on the basic wireframe manipulation UI.

After a while, however, during work on JD3D, I came across the Humble Bundle Pixel Art resource bundle and it dawned on me that a top-down RPG style game would be a better use of time in working towards the core goals of the JSIG project.

So, because of the extra complexity in Dungeon 1, I've put Dungeon 1 on hold in favor of the simpler, more targetted game, Dungeon 2.

Dungeon 2 is a top-down RPG-style game.

Because the player's perspective is directly overhead, any sprite needs only to be drawn facing right. We can then use program functions to mirror and rotate the bitmap to make it face in any other direction, as needed.

Yesterday i wrote a function to create a rotated copy of a bitmap image in memory.

Today I wrote a function to create a horizontally-mirrored copy of a bitmap.

I started to specify the tree of data necessary to list out all rotations of all frames of all animations of all actions for all characters within the Dungeon 2 game code.

I've also spent some time reading around libpng. This is a program code library to read an image in the PNG file format into memory as a Windows bitmap.

We need this because most of the stock art comes in PNG format. It makes sense, since PNG is compressed, but lossless, and can also carry a full alpha channel. In other words, the artist can specify variable transparency in the image on a per-pixel basis.

Having previously looked at libjpeg for other projects I wasnt surprised to discover, again, how complex and technical are the issues around image file formats. Fortunately the library comes with sample code...

The next step for Dungeon 2 is to write a separate program to locate, read, crop, convert, store, index and enumerate all character animation frames from the parts of the Humble Bundle resource set that interest me.

Update:
* More progress since then.
* Graphics are in.
* Local keyboard multiplayer is working nicely.

More to come soon...

Please ContactUs if you have interest in this project.


Router Rooter Rowter?
This device that my internet connection comes through - how do you pronounce it? Read More

Welcome. We're back. Again...
Welcome to the website. We are currently rolling out a new version of our web framework here. So... we apologise that functionality and content may be minimal while we iron out some bugs. Please feel free to contact us on the numbers above, or via our Contact Us form in the meantime. Business is ongoing and we look forward to your call. All the best, from Julian Neeves. Read More

Lightning has been breaking things again...
There's been a storm a-coming this week and it's finally been and gone done a-storming too. Read More

Mobile Broadband Brings Hope for Not Spots
Several of our customers receive a landline broadband speed of only 0.3 Mb/s. Such a slow connection is often unreliable even for email. Often they don't realise that mobile broadband is available to them. Even in marginal signal areas, 2-4 Mb/s offers some hope for people in these so-called "not-spots". Read More

All content and functionality on this website is Copyright (C) 2017-2020 JDN Systems.
SitePanic
ThreadMsgs=20240425035427181: JDWBHTTPRequest1(): fwrite(): PXD: Len: incomplete;