Honeymoon!

I am still not quite ready to blog about ocaml so I thought I would post about something completely different: my honeymoon trip!

I mentioned in my last post I got married last year and the ceremony was awesome and small by the beach in Washington.

Even more fun was our honeymoon which took place in Ireland. We ended up traveling counter clockwise around the circumference of the island starting in Dublin.

Dublin was a remarkable city in that it has quite a bit of history but also seems to have an interesting nightlife and food in and around the temple bar district.

Once we left Dublin I started driving and that was quite interesting. Driving on the opposite side of the road you are used to is an interesting mental exercise. Many of Ireland's small rural roads make this even more fun.

If I had to summarize what I liked most of all of Ireland I would say that despite being heavily cultivated in areas for farming it retains a natural beauty that is hard to match. The greens are so much more vibrant than anywhere in Washington State. The coasts and beaches are remarkable in and of themselves.

The only downside it is a bit touristy in places. We spent quite a bit of time waiting in lines and paying fees to see things. If you do make a trip to Ireland I recommend driving since it is the countryside itself that is quite remarkable.

Update

Married

Not much has been happing over the last year programming-wise but I am now married to my beautiful wife Kerry! We went to Ireland on our honeymoon during the summer and I could probably fill a blog post with that trip!

Other notable technical miscellany

Moving away from Django at work

At work we are moving to micro-services and using flask to do this. Flask seems like the lesser of many bad python web-frameworks. Not a huge fan of thread locals and globals but at least flask is simple.

I may break down and write my own framework someday (as if the world needs another one).

Frustrated with python

Getting more into functional programming which creates friction when working with python. You can write in a functional style surprisingly well using packages like pyrsistent and simplegeneric.

The biggest problem actually is the python community--which is awesome but generally not making libraries that work this way. For example flask seems like a nice library but it uses thread locals. Falcon also looks nice but mutates an object in the simplest front page example!

Looking at communities like clojure or other functional languages and I am getting envious.

Trying out ocaml and other languages

I have dipped my toes into a couple languages this year. The most notable and new addition is ocaml. I am trying out ocaml since it is kind of how I have started programming in python for the most part (or at least how imagined ocaml). So far it seems to have a lot of nice things but quite a few odd short comings like no concept of "repr" built in.

Also its community seems less vibrant than python and the documentation of many libraries does not seem as nice. Many libraries also seem to be abandoned.

So far the best resource in learning it has been the online book Real World OCaml. I would recommend since unlike python ocaml's manual really isn't a good enough resource to learn everything you need from.

Future blog updates

  • I have started a new project so I will probably post on that soon.
  • More ocaml thoughts once I know enough to post something intelligent.

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.