My programming language of choice, Rust, allows you to write code in independent libraries of modules, called “crates”. Other languages do it too, it’s nothing new, but in Rust it’s seriously easier, and the benefits are immediately usable.
This has this effect on our progress: a programmer can work on independent crate for months, without a visible effect on the main project. It happened when we worked on crates for:
- Shadowcasting (for visibility and projectiles) – credit to Maria;
- Tiled (tile map editor) integration with graphics framework;
- Animations engine – credit to Maria;
- Talk (our dialogue engine);
- UI – credit to Maria;
- “Buff/debuff” – an engine for effects like “10% to speed, Speed gives extra +15% Dodge”;
- and lately – Thin Walls.
Now I can declare that Thin Walls are officially ready for beta testing.
Wait, what Thin Walls?
In short, this is one of my bad decisions that prolong development for months and lead to overengineering. It is a gimmick – I wanted to have not only traditional roguelike full-tile walls, but also walls between tiles.
This broke a cascade of things:
- Shadowcasting;
- Pathfinding;
- Map loader;
- Tiled maps.
But now it’s usable in the game engine. Thanks to this, I have the map from an earlier post running in the engine. Green lines are a debug tool for actual walls, red circles are tile visibility.
Now, next crate I’m creating is – finally – Combat
I’m finally working on something that resembles a game. This something is an example for Combat crate. In Rust, again, there is an out-of-box mechanism with which you can create examples for each crate, for documentation, demonstration or learning purpose. I also use them to try out my code design for this crate.
In this crate, that depends on Thin Walls above, you actually control a character, and, tada! you have a team of enemies that can attack you with melee or ranged attacks. This crate is about creating the dumbest AI that I could think of.
It’s still blocked by the lack of pathfinding and some features in visibility on Thin Walls, but hey, I’m getting close to that.
Here is the Combat crate example. Looks a bit like LaserTag room, isn’t it?