Projects

Simple Virtual DOM

I made my own virtual DOM 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.
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.
While I have created this website it in it is definitely NOT indented 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.
A ship in space near a space station and star.
A ship in space near a space station and star.
Dialog with another dog on a space station. You can see your ship outside too.
Dialog with another dog on a space station. You can see your ship outside too.
A space portal that lets you see into another star system.
A space portal that lets you see into another star system.

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 2021