Skip to main content

Yet Another Space Game?

Lots of "life stuff" has happened over the last couple of years. Needless to say, I am back in Seattle, doing data pipeliney stuff by day with pyspark and pandas.

For the last year or so I have been working on drum roll... a space-based dwarf fortress game.

screenshot

I have been writing it in rust using specs-ecs, ggez. The tileset is the excellent oryx 16-bit scifi which I did not make. So far its served as a reasonable placeholder though I think I will probably need quite a few more tiles than it currently has. Also, the license on it makes it a bit annoying to share any work using it.

Probably write some updates on how it works and what the game does in another post.

Match 3 Game

Edit: replaced direct embed of flash game with a link to it

I mentioned I was working on a match-3 game here is a very rough version of it. Unfortunately it is flash only until I can sort out an openfl bug that seems to break the html5 version.

Screen shot match-3 game

In addition to the normal match-3 mechanics I am playing around with directional collapsing like threes or 2048. The goal is to clear the board. I think at this point it needs more polish and a nicer more predictable progression to the end.

It was built with haxe using haxepunk. Not 100% in love with the language haxe which seems to have inherited the warts of action script but it is productive. Many frameworks and libraries from flash have been ported over which makes it great for 2d games.

New new blog setup

Kicking crotal to the curb. Unfortunately its not very well maintained or well written. nikola does basically everything crotal does but better. The only downside is the pre-built theme is a bit ugly.

New blog setup

Switched to crotal for my blogging from blogger. So far crotal seems a bit janky but I much prefer editing a markdown or html file to blogger's depressingly bad UX and terrible wysiwyg editor.

Right now blog.space-wizards.net is broken and will just redirect here once whatever dns plumbing that is not working currently resolves itself.

Too many side projects

I have forsaken working on my space tactics game to work on side projects. I felt a bit overwhelmed with the design and scope of the game. If I do go back to it I might start with the over-world and prototype something there. I think the idea has merit still.

Here are some of these projects I have dabbled in since my last post which was ages ago:

Side scroller
Where you are a corgi exploring planets in space similar to something like commander keen or space man spiff. Wrote this in haxe but it never really got past a prototype level. HaxePunk and tiled are pretty great tools for building a side-scroller but my inspiration for the design of the game kind of evaporated.
Match 3 game
Also in haxe has some variations that I am playing with which could be cool. Still working on this and it is coming along pretty well. The trickiest part here is the design of the game itself. Though haxe at many points has tested my patience far beyond most normal software development tools.
Robot!
I am building a robot out of a cheap tank chassis I found on amazon. I have the chassis and gearbox build and a arduino with a motor shield that was miraculously able to solder correctly driving it. Need some kind housing for the arduino and I need to hook this all up to a raspberry-pi and a battery. After that I can add some sonar and SLAM to it.
Random Rust experiments
Started writing a toy lisp interpreter and playing with Piston over the weekend. Technology and community seems promising though I doubt rust will replace anything beyond c/c++ in my set of tools.

I think any one of these could probably be blog post. I have used haxe enough now to see its warts (and still keep using it). I think I am a ways off for rust but it is interesting enough I could probably rant on it at length already.

Here is my new corgi Pontus' reaction to the test of my robot's motor shield:

Minimum Viable Blog Post

In the startup and web development world which I hail terms like "fake it till you make it" and minimum viable product often heard reverberating off exposed brick and across ping pong tables. When you work at a small company there is only so much you can accomplish so you need to make it count. I think this goes doubly if you have a side project that you want to actually get anywhere. I simply don't have the time and reserve of motivation to go chasing down rabbit holes.

Another thing I have found when you are slogging along on a long project alone you need inspiration. Besides this blog there is no forcing function to make me work on this besides my own imagination and itch to build. When working I try to keep a bank of work I know can easily keep me going either due to it being satisfying to do or has satisfying results. Since I last updated I have worked on a mix of this and trying to get a the core combat gameplay working right.

The biggest reward/cost was doing a small graphics update. I made a couple of sci-fi tiles and stole an image of space in lieu of writing a star field generator. I think in total the work probably took an hour at most and most of that was me trying to do pixel art.

I also have added a number of long needed technical improvements:

  • Line of sight matters for shooting and the AI attacking you. Though now it is obvious that I am going to need some sort of system for the AI being able to hear commotion and footsteps (which also means a system for player knowing this is happening).
  • Infinite worlds sizes (sort of). The map now can expand as much as needed. I added a hashtable in front of the bitmap/tile chunks. The sort of is because there is no path for unloading yet so it is effectively a memory leak :)
  • Fog of war! You no longer can see the entire map just your ship and whatever you explore. This system needs some tweaks. Probably going to have two concepts here: explored vs currently visible.
  • TMX loading for ships. Instead of trying to start out with a ship generator I think it would be better to get gameplay working the way I want then focus on that.

A lot of this has been in service of trying to get the core gameplay of the turn based combat fun. I think I have a ways to go still and will probably need improve the AI further as well as add things like cover, overwatch and reloading. I am thinking I wont actually need equipment as part of this effort. I am going to focus on that once I am done with this.

As a side note there is an episode of the podcast tone control interviewing the creator of the new x-com game.

Tools for building things with python

Like bike sheds the tools we build or software with tend to be the subject of great debate. I thought maybe I would write up a brief survey of how I get "shit done" for both my professional work in python and django and my side projects. Unlike most physical tools my criteria for selecting software differs: I want things that provide the most utility with incurring the least amount of existential despair and frustration. As a pragmatist I like to think I can handle imperfect tools. I try to avoid them when I can obviously. vim A pleasant and capable editor. I will admit I am a vim novice yet I find myself missing it whenever I am using something else. It is fast sleek and doesn't get in your way except for when you need to manage your vim's giant assortment of plugins which is quite painful even with tools like pathogen. If it had the kind of static analysis and automatic import manipulation pycharm and pydev have I might use it more for python. pydev and eclipse pydev's code analysis is insanely powerful and it's presentation as eclipse problems actually makes for a fairly decent workflow. Unfortunately it is poster child for obscene java programs. Its UX is like being trapped in an insane poorly decorated maze made by people who thought they were more clever than they really were. To be fair to the pydev creators this almost entirely baggage from eclipse and not pydev itself. pycharm A more performant and snapper IDE experience than eclipse. It still suffers from some weird obtuseness at times but for the most part it speaks my language unlike eclipse. With a vim plugin I can even get some of the nice visual mode fun back.

Proto-dwarven spaceships

Working on getting a feasible loop where you can go from your ship floating around in deep space to a boarding mission where your ship is docked with a randomly generated dungeon ship. The idea for the deep space portion is to have place where you can perform customizations to your ship and crew as well as do other non-combat based things I devise. Imagine it similar to the xcom hq or the starbound vessel.

What it actually entails right now is a dwarf in a box:

Don't let his calm demeanor fool you: this dwarf is a space captain

The transition works but you are spawned directly onto the ship. Need to copy the vessel to the freshly minted dungeon ship (or find some other way to do compositing). For now it will likely be a random location but eventually selecting a location to dock will be a thing.

Pathfinding and provisional combat

Got path finding working! Turns out it is extremely important to keep a closed set of nodes you have already visited so you never check them again. If you don't rule these out some path finding queries that require paths that are significantly higher than your initial heuristic estimates will have you going back and fanning back out over points you have visited (until those paths bloat up and become more expensive). Amit's AI pages seem like they will be pretty useful for tweaking it but for now it works good enough.

I have now that path finding has been working I have started work on basic combat which mostly involves shooting a space dragon with a test weapon. I have also spent some time writing more tests mostly around the UI system. Replacing nose as my test runner with pytest.

Also started thinking about random spaceship generation algorithms since my big KD tree divided dungeon box doesn't really set a very space like mood (unless you want a borg cube). Once I have combat working in a basic way I will be focusing on that and getting some kind of world map (universe map?) working.

Building a roguelike/tactics game in python and C++

I have been working on this as a side project for quite sometime and figured it may have grown large enough that it might be interesting. My plan is to build a turn based tactics game where you explore and attack spaceships and maybe open source the core engine when its done. Originally I was planning on building yet another fantasy roguelike or sandbox game like minecraft but there already a plethora of those games and space is awesome. Right now however it still uses dwarf fortress tiles and a dungeon generation algorithm.

A state of the art space dungeon complete with programmer UI

The stack

My current engine if you could call it as such is comprised of the following:

1. Cold paths written in python.

Most of the gameplay code, UI and other random buts are written in python. Python lets me use a number of interesting things such as a networked REPL (ipython) and live coding where code is reloaded as it is changes on disk. It is easy to unit test with and generally nice to write most algorithms in. It is also what I use for my day job which likely biased me :)

2. Hot paths implemented in C++ (for now).

I have the voxel storage written in C++. Python arrays are not too bad for this but having the voxels in C++ means I can also easily render things in C++ which does speed things up quite a bit. Once I figure out what I am doing with path finding and AI I may move those algorithms to this layer. At some point I may move all of this C++ code to rust-lang once that gets more mature but that is at least 6-8 months out I would imagine.

The future

Right now I am working on path finding. Next up will likely be visibility and then massaging my dungeon generation into something like looks like a ship so I can get minimal slice of combat working.