Posts

Showing posts from April, 2018

Shadowy Godot Experiment

Image
I have spent all of 2 hours with the Godot Engine , and I LOVE IT. I was reluctant at first, because of all the time I've invested in figuring out Unity and sorting things in that.  So when I wanted to play around with a 2D light/shadow game, I started searching for how to do it in Unity. No immediate answers popped up at me (maybe I didn't know the right key terms), but there were plenty of posts about writing shaders to achieve it.  There were some posts about plugins which only work with Unity Pro (but admittedly, they were quite old).  And a really old post where someone had written their own plugin. This blog post  was particularly interesting as it outlined an algorithm for nice-looking shadows. However, I wasn't looking for how to do beautiful shadows.  I was looking for a way of experimenting with them. So I searched for 2D shadows in Godot.  And I found a very brief chain about the example project showing exactly how to do it. Sure, I had a little both

Island Terrain Generation Part 2

Image
This is a follow-up to a previous post on Island Terrain Generation . I actually had to re-write a lot of the algorithm from scratch, which I'll explain in a bit, but here it is: Instead of triangulating an outline poly, I decided to generate a regular flat triangle mesh, rotate randomly chosen edges, then relax the mesh.  This made the island fully procedural, rather than the semi-procedural generation I wanted.  However, it was necessary to make progress. Once I'd generated the distorted triangle mesh, I could randomly select a point on the mesh to be the peak of the island, and generate ridges/troughs growing out from that peak.  The ridges can split into multiple after a few steps, but they have to stop before they hit the edge of the mesh. Once the ridges are grown, any untouched points can have elevations assigned according to how high their neighbouring points are. I also force all the edge points to have elevation zero. Then, I assign a colour to each tr

Vanity Project: System Emulator

Image
Having played with pico-8 (which I love!), I was wondering about creating an emulated computer system from scratch.  I couldn't really figure out what the point would be.  A demonstration system for secondary students? - probably too complicated.  A competitor to pico-8? - just why? pico-8 is awesome. A replacement for LMC ? - probably too complicated. A nostalgia trip about tinkering with the Commodore 64 back in the day? - maybe. Just for fun? - ... Well I eventually accepted the idea that I am actually crazy enough to enjoy putting together a virtual system for no other reason that it might be interesting to try.  With that in mind, I chose to do it in C# because I hadn't used MonoDevelop in ages.  (Writing a VM which runs inside the .NET VM does feel a little VM-ception though). I decided to start from a 6502-style instruction set, with Load Immediate and such (although I'll probably pass on the more complicated addressing modes), but I thought I'd ma

Island Terrain Generation

Image
I've been playing around with procedural terrain generation for literally years, and the paucity of large-scale successes has made me determined to celebrate small ones.  So, whilst this still needs a HUGE amount of work, here goes... In my recent coding, I've been exploring semi-procedural method for islands using python3.  Building on my python triangulator from the Before Times, I have managed to make this: Yes, it is currently pants. However, it is generated from the outline of the island and the ridge points, and if I apply a DeLaunay pass to the triangulation I am sure it will look a lot better. Also, a great deal of the work has been taken up by figuring out how to store the data in a structure which allows the kind of processing I want to do.  Refactoring this data structure is actually my next step, so I can build to more islandy-looking islands. But the signs are hopeful!