Projects

Lysithea

A scripting language designed to live inside other systems to glue them together
Main features:
  • Lisp style syntax.
  • Builtin support for booleans, doubles, strings, lists and key-value-pair objects.
  • Conditionals as expressions, use an if or switch statement like a function.
  • Virtual machine is very light weight and allows for using many at the same time.
  • Script execution can be controlled by the host environment, limit how many code lines can execute at a time.
  • Simple code, easy to port to new host systems.
  • Ported to C#, C++ and TypeScript. Examples written for Unity.
  • Reasonably good performance, compared to other NLua or MoonSharp for C#.
Example of code in Lysithea
Example of code in Lysithea

Tailspin

A space game about going on an adventure and exploring space with some smart animal companions.
Main features:
  • Flying your own spaceship from the cockpit.
  • Walk around the interior of your spaceship and interact with different components.
  • Fly around large spaces, past stars, black holes, into nebulae, land on planets and dock with space stations.
  • Dock a smaller ship in your larger ship for different away missions.
  • Explore space to find old shipwrecks to find salvageable parts.
  • Find asteroids to mine for resources that can be used for crafting new parts.
  • Be self-sufficient in deep space by looking after your ship.
  • Made in Unity 2020
Some of these features are still being worked on, however I am keeping a devlog on YouTube.
It's very ambitious and who knows how far I'll get, but I've already gotten a lot further than I thought I would.
Currently I'm not planning on releasing the source code as it also contains paid for Unity assets.
A scene showing a nearby planet and the star at the center of the system.
A scene showing a nearby planet and the star at the center of the system.
A ship using it's tractor beams to pull in some rocks that have just been mined from an asteroid.
A ship using it's tractor beams to pull in some rocks that have just been mined from an asteroid.
An example of a ship engine sitting outside of it's hardpoint before it's installed into the ship.
An example of a ship engine sitting outside of it's hardpoint before it's installed into the ship.

Simple Virtual DOM

I made my own virtual DOM (simple-tsx-vdom) inspired by React and Preact.
It was created for learning but I wanted to take it to the point where I could build something non-trivial with it so this portfolio is the biggest example of it right now.
You can find the source for this portfolio page on GitHub.
Main features:
  • Small filesize (about 2.5kb after compression) written with no dependencies.
  • Written in fairly straight forward TypeScript that is all class based and can be extended.
  • TSX support (hence the name, also simple-vdom was taken).
  • Optional server-side rendering and client side hydration with the help of two extra packages.
  • A simple diffing algorithm to reduce DOM manipulations.
  • SVG support
  • Supports both class and functional components.
  • Supports custom handling of removed elements. For example if an element is removed from the vdom you can control how it's removed from the DOM, such as via animation before it's completely removed.
While I have created this website it in it is definitely NOT intended for production use!
A code snippet from this website.
A code snippet from this website.

Simple Data Store

I like what redux and other functional state management libraries have done for UI but I found them too unstructured and too generalised. So I put together my own version that is still general but puts just enough structure to fulfil my needs.
Unlike simple-tsx-vdom I have used simple-data-store in production to good effect, even without the extra features of browser devtools.
Main features:
  • Small filesize (about 0.5kb after compression) written with no dependencies.
  • Immutable data structures.
  • Selector support, similar to reselect for redux.
An example of a really simple counter store.
An example of a really simple counter store.

Space Doggo

A space adventure/exploration game that I've been working on for a while now.
The main goal is to explore space and to find things. The scope is deliberately small so that hopefully I'll finish it one day.
Main features:
  • Features flying ships, floating around inside ships, teleporting to planets and walking around on planets.
  • Uses 'space portals' to view other star systems and seamlessly move between locations without loading screens.
  • A compendium of animals and things to fill up that makes use 'live photos' that takes a copy of each object in view so that they can be animated later on.
  • Written in C++ using SFML for cross platform support.
  • Makes use of Box2D for physics, and earcut for creating polygons for collisions.
  • Tile based planets that use tmxlite for loading Tiled maps.
  • Uses yoga for UI layout and Dear ImGui for debug UI.
  • All data is stored in plain JSON and loaded using nlohmann JSON for parsing.
I've also been keeping a dev log about my progress and uploading them to YouTube.
The inside of a ship that you can pilot along with the dog player.
The inside of a ship that you can pilot along with the dog player.
A spaceship near a portal showing what is visible on the other side.
A spaceship near a portal showing what is visible on the other side.
A planet surface with some local birds eating their food next to a nest.
A planet surface with some local birds eating their food next to a nest.

LOSS: Lua Operating SyStem

A project to create an operating system that's built around using Lua with the intention of being light weight.
The main use case was for a game where you may want many simple in-game operating systems that look like a *NIX shell but without actually running a VM.
Main features:
  • A modified version of the Lua VM that supports running multiple Lua States in the same thread using Boost Coroutines
  • A virtual file system the supports mounting different types of file systems.
  • A tmpfs for virtual files (such as /dev and /proc)
  • A persistent file system for long term storage.
  • A Fuse implementation that allows for mounting the persistent hard drives and modifying them outside of the VM.
An example of starting the VM with an init.d file that just prints some text.
An example of starting the VM with an init.d file that just prints some text.

LOSS v0

An earlier attempt at creating an OS for use in a game, specifically for a space game. This was a relatively naive approach that used NLua which is a C# implementation of Lua for use in Unity.
Main features:
  • Basic shell for running Lua.
  • A simple VT100 terminal emulator that used built in Unity components for text rendering.
  • A very simple file system, however it did not support mounting.
A screenshot of the UI in Unity.
A screenshot of the UI in Unity.

Unity Voxel Engine

A small voxel engine aim at being able to create and edit levels entirely within Unity. It performed well enough for the scale of the levels I wanted to created, however getting the editor tools to behave the way I wanted proved to be the most tricky aspect
Original intended to be in the style of Might and Magic series which is why the original repository is called 'mm'
Main features:
  • Chunked editing and loading. Maps are stored as individual binary files which is optimised for updating chunks during editing.
  • Multiple different shapes beyond a cube such as ramps and different corners to allow for smoother terrain.
  • Unity editing support for creating levels without needing additional tools.
A screenshot of the Voxel Engine UI in Unity.
A screenshot of the Voxel Engine UI in Unity.

RPG Game

A topdown 2D RPG game engine written in C++ built using minimal dependencies for the purpose of learning.
This is a fairly old project now, but it does represent a lot of learning in terms of C++, integrating a scripting language, handling modding, dealing with complex UI and handling an audio system.
Main features:
  • Tile based 2D graphics with a tile overlapping system for blending between tiles.
  • Sound system that supports streaming OGG and WAV files.
  • Lua Bindings for controlling just about every aspect of the game. From how a new game is created and loaded to how a door should behave when interacted with.
  • Maps are created through Lua and has a mechanism for determining if the map is being played new or loaded from disk, allowing for map scripts to upgrade old save files.
  • A dialogue system based on The Elder Scrolls: Morrowind with topics, keywords and actions bound to those keywords.
  • HTML documentation taken from the C++ comments using a Python script.
  • In game text uses a simplistic CSS and HTML system for rich text.
  • An in game map editor for creating new levels.
A screenshot of the RPG game
A screenshot of the RPG game
A screenshot of the in game map editor
A screenshot of the in game map editor
Alan Lawrey 2023