It's out.
Throw a wrench, change the galaxy.
Mostly nebulae.
Windows, dunno about others
John Winder
Chris Harvey
Tom Francis
John Roberts
Get on our mailing list so we can tell you when we release a new game.
We're @HeatSig on there.
I started making Heat Signature mainly to figure out if the mechanics would be as fun as they seemed in my head, so I built all its systems in the cheapest, fastest, simplest possible way. That worked – it’s now got to the point where I’m laughing out loud at something ridiculous happening most times I play.
But the slapdash way I built it has the following problems:
All of these systems need a total rewrite, and I know how to make each one massively faster and more reliable now that I’ve had some experience with how they’ll be used. I’ve been working with the bad code for so long that I’m actually really excited to rip this awful shit out and make it all clean, fast and efficient.
A good way to get motivated about the boring task of redoing code is to just keep working with the bad code until you want to die.
— Heat Signature (@HeatSig) July 13, 2014
But I’m also aware that this means it will look like exactly the same game until I finish all three rewrites, which might be a while. So while I’m at it, I’m making some of the more superficial tweaks I’ve been planning, just to make the game feel fresh on the outside too. And the first of these are tweaks to the way ships randomly generate their interior floorplans.
I talked about how I built that system at the time, and it’s really simple:
That generates interiors that look like this:
I was pretty pleased with this! From only three rules, it makes sure every module is used, every corridor leads to a room, and there’s a path from every module to every other, but it’s usually not trivial. Despite being simple, the pattern didn’t seem to be obvious – to me or others. I posted a shot on Twitter and asked people to figure out the rules – no-one got them right.
Its main shortcomings were:
So I made a few tweaks, and the new system generates stuff like this:
How much you get out of this image might depend on how much you care about corridors, but I am fascinated by it. It’s so much more intricate, organic and complex than the rules I added seemed – I look at it and think “Wait, I didn’t tell you how to do that!” But evidently I did. Again, I think it has good Rule Stealth: the rules are right there on display, but I don’t think you’d guess what they were, right? If you want to try, do so before clicking this:
The bits that surprise me are bits like this:
How did it know to build a corridor branching off from a lengthwise passageway to lead to this out-of-the-way room?! My algorithm builds the ship one lateral row at a time, and each one has no idea what was in the last one. This makes it look like whoever built the ship planned ahead to make sure there was a corridor leading to this otherwise isolated room.
I get it, of course: three modules in a row all decided to make a door to the previous row, which meant all of them could block themselves off from each other laterally. And in the row it made afterwards, the middle module failed the chance to create a door leading back, so the room behind it was left with only one connection. And being a dead end, it became a room rather than a corridor.
The fact that it’s reachable is not luck, it’s a result of some logic I intentionally put into rule 3: we’re only allowed to block ourselves off from the rest of the row if we know the rest of the row also has a back-door. That way we can still get to them by going back one row.
But what if there’s a lateral block there too? Well, they’ll only create one if they, too, have doors on either side of the block leading backwards. What about the row behind that? Same rule, all the way to the very back row of the ship, which will never create a lateral block because it’ll never have two back-doors – it won’t have any.
But it’s so interesting how much intentionality I can read in to the result of these rules. It looks so much like they isolated this room for a reason, and built that corner corridor to lead to it. And that adds meaning and character to whatever we put there.
Once the room types are in, that might end up being a cargo hold with a locked door and valuable loot in it. Clearly, it’s isolated by these thick sturdy walls for security reasons.
But random is random, so it could just as easily end up being living quarters. Now the isolation looks like privacy: maybe they don’t want to be kept up by ship noises. Or it could be a bathroom, and they don’t want sound to travel for other reasons.
That’s why this new system fascinates me. It seems to create intentionality out of algorithms, and the more stuff I put into the game for it to combine with, the more unexpected combinations will come out.
Jordan:
Very interesting! Well done!
Looking great Tom! If you’d like to offload the more meaty AI and procedural generation programming to focus on other aspects I’d love to help.
Marc Forrester:
It can actually be a good thing if pathfinding takes place over multiple frames – I’d expect the crew to hesitate for a second or two as their ship breaks in half around them.
Yeah, I might actually have the crew not change their path until the one they’re on unexpectedly leads them to a dead end.
One way of implementing that would be to have each crew member maintain their own beliefs about the structure of the ship that they use for A*. When they encounter a missing room they update their beliefs and search for a new path, and when encountering other crew members they exchange beliefs as if they were communicating with each other.
The same exchangeable beliefs system can be used for things like awareness of where the player was last sighted, location of items the AI can use, and position of other crew members they can run to for safety when panicked. This opens up plenty of possibilities for the player to exploit the AI’s partial awareness of the environment when preparing ambushes or trying to avoid detection.
I’ve implemented something similar in one of my projects, and with relatively little effort the agents would exhibit surprising emergent behaviours that give the illusion of intentionality, just like in your level generation algorithm.
Some extra reading: http://en.wikipedia.org/wiki/Belief%E2%80%93desire%E2%80%93intention_software_model
DrD:
Curious, are you already using the yoyo compiler in Game Maker?
Woodwald:
The new generator is really nicer. Everything feels a lot more intentional, as you put it. The only thing that still bug me a little bit are the short corridor loops you can see on the last picture. It somehow doesn’t feel right. Anyway, nice update.
(Also first post, love gunpoint, love the blog)
Connor:
It think it would be great that if an enemy sees you, he will either attack you, or he’ll go and tell someone else that he saw you. That’s the problem with alot of games I play, it doesn’t make sense that all of the enemies know of your presence.
DrD: I’ve tried it, but since it’s only compatible with Windows, I can’t rely on its performance gains or Mac & Linux users will be screwed.
Luckily Heat Signature’s performance is easy to scale: when there are more than X ship modules being simulated, it picks the most distant ship that the player has never interacted with and stops simulating it.
So X can be set to whatever value causes the game to chug. With the old, inefficient systems, it’s about 300 modules. With the new one it should be a lot more. And either way, I can add it as a menu option so people can crank the simulation as high as they like. If YoYo Compiler is compatible enough to use as the default Windows version, I could set the default higher there.
(You’ll also be able to put a tracker on a ship to keep it tracked however far away it goes)
DrD:
Something I stumbled upon as well, not sure if it can be done using the shaders module in GM but there is a blog entry that uses WebGL for pathfinding, thus leveraging the GPU for processing. I would think the same could be done with OpenGL ES. http://nullprogram.com/blog/2014/06/22/
Snowskeeper:
I saw that isolated room and immediately thought “biological organism containment area.” Is there any chance that a ship you attack might be transporting something alive and dangerous, like a Space Rhinoceros or virus of some sort? This is one of those silly Hey If You Have Time things, but retrieving a bio-weapon for one of the factions could allow them to attempt to deploy it into an enemy space station and effectively destroy it.
Diego:
I’m in a similar situation, working on a game with terrible and highly complex code. Although your tweet made me laugh out loud it wasn’t very motivational lol
Anonymous:
I just wanted to let you know I love supporting game developers like yourself. You built a great game, offered a demo, kept the price reasonable. Good on you =)
Teaching Heat Signature’s Ship Generator To Think In Sectors - a post on the Heat Signature site:
[…] haven’t talked about the way I randomly generate spaceships in Heat Signature since this post – before it even had actual art. That’s partly because I’ve barely touched it […]