Roguelike Adventure Generator (PART 1)

I’ve been watching a lot of shows lately that involve high fantasy adventures – most of which involve some kind of power grab. They’re the kind of shows full of shady politics, tactical dealings, huge battles, and vast ambitions. I want to try and distill this into game format.

The most recent example of such a show is Game of Thrones. It has all sorts of characters going on all sorts of grand adventures. There’s dairy queen, for example, uniting a bunch of misfit armies, freeing the slaves, and taming dragons on her quest to claim the iron throne.

The best example of an epic adventure, though, is probably the Lord of the Rings. The sheer amount of stuff that Frodo gets up to on his quest to throw the one ring into Mount Doom is honestly quite ridiculous. I’d like to make a game that enables this kind of interesting quest.

Thus, long story short, I’m going to make an adventure generator!

Currently, my plan is to create a deeply simulated fantasy world. I want to fill the world with a bunch of different factions and let god sort them out.

The result should be a ton of chaos that I can exploit for procedural quest generation by using something similar to Stalkers A-Life or Bethesda’s radiant AI systems. I don’t know how these systems work, but it doesn’t matter. I’ll figure something out when needed.

I have to make the world super interactive in order to support maximum freedom of choice while also giving it enough depth that the player can get up to all sorts of zany antics.

Anyway, let’s get down to brass tacks. I’ve been pouring ungodly amounts of in-depth design analysis into my super project so for this series I’d rather focus on getting things done. I’ll go into excessive detail when it’s necessary instead of front-loading everything like I usually do.

The first thing I need to do is build the world. The game is going to focus on player-centric activities but without a world and its inhabitants, there’s no activities to be had! Thus, I need to create a basic simulation. I need to generate terrain, factions and who knows what else.

The first step is to generate noise. Lots of noise! It’s never actually that easy, though.

Let me show you what plain old noise looks like. It’s not very useful or pretty!

Here is some plain old simplex noise. The result would be largely the same even if I used perlin, wavelet or anything else. The problem is that noise is kind of worthless by itself. It needs to be treated like a worthless lump of clay and shaped into something more useful.

The brown tiles are what I’m currently using to represent land. The entire map defaults to being filled with land because I’m not applying a threshold. This means it doesn’t matter if a particular tile of noise is 0, 1, or something in-between. It considers everything land.

This is what happens if I apply a threshold of 0.2!

There are some blobs of water showing up now! This happens because increasing the threshold basically causes gaps to appear in the noise array. I’m only accepting values that are greater than the threshold – so anything below it doesn’t get carved to the map. I turn any tiles that aren’t land into water which is why more of it appears as the threshold rises.

As you can see, the higher I raise the threshold the less land there is.

You might also notice how each of the examples has a similar pattern. That’s because I’m using a seed number for the noise generator. I’m going to do that from now on for continuity purposes. This way, even a hundred posts from now, the map will still look familiar! I think it will be neat to compare an old version of the map to a fancier one a couple posts from now.

By the way, the map is actually far larger than I’ve led you to believe. The above images are only showing a small section of the world. This section is all I can fit in my 1280×720 game window! Even if I maxed out my game resolution to 1920×1080 or greater it still wouldn’t be enough to fit the whole world. The map is 200×200 which comes out to 40,000 tiles in total while each individual tile is 12×12. I’m only able to show 75 of these tiles at a time.

Let’s switch over to pixel scale. This means I basically draw every tile as an individual pixel instead of a 12×12 tile. If you take into consideration that every tile takes up 12 pixels then you can imagine the space-saving that occurs by compressing them to 1×1!

This is the result of switching over to pixel scale. I went ahead and included the rest of the map area just so you could really comprehend how much smaller things are. If you look closely you’ll notice the previous images pattern is now visible at the pixel scales center.

Anyway, since we can now see so much more it’s time to up the map size. Let’s go from 200×200 to 700×700. That brings us up to a grand total of 490,000 tiles from 40,000!

That’s better. I’m still using the same seed and threshold so due to how noise works, the previous image can be found in this images upper left corner.

Scroll up to look and then back down and you’ll see what I mean.

The next step is to make the world a little more interesting. I’m sure you’ve noticed how repetitive the noise looks. It was fine when we were zoomed in but now that we’re zoomed out a very obvious pattern has emerged. It doesn’t look like any kind of terrain I’ve ever seen! It comes off as some sort of bizarre planet covered in lakes.

This is another problem with noise. It’s very repetitive looking. This happens because the noise isn’t as random as you might think. If it was, then these images would look like static.

It’s beyond the scope of this blog to explain how and why the noise generates shapes instead of useless static, but this wiki entry about noise might help you a little bit.

Either way, static isn’t very useful in regards to terrain generation. The repetitive patterns, though, aren’t exactly ideal either. They look artificial and just plain weird.

The answer is more manipulation. I’ve found the best way to reduce this sameyness is to mix your noise with more noise. That’s what we’re going to do next. I’m going to generate some big and small noise and then evenly mix them together to see what happens.

Here is an animated version of the same images to try and better show the combination.

The end result is certainly more interesting visually but it’s still pretty samey. The only thing I really accomplished was replacing the old pattern with a new one. It’s rougher, sure, as if the world has been eroded over time, but the map still looks very repetitive from top to bottom.

It’s just less squiggly and more spikey.

To further improve this, I’m going to make both sets of noise bigger.

I’m pretty happy with this result! It also helps show off the whole noise combination thing a lot better since you can more clearly see how each set of noise influenced the final result.

This worked better because each set of noise had a bigger scale.

Previously, each set of noise was like static. Theirs shapes, sure, but they’re just a bunch of small patterns. The big noise, though, due to taking up so much space can’t repeat itself as much. This makes the end result more unique when it gets combined with other noise.

This is the map I’ll be using from now on so get used to it! The next thing I want to do is some noise maintenance. I’m going to nuke a few of those small islands from orbit.

Before and after small areas of land were turned into water.

Here is the end result. I turned any landmasses that were less than 30 tiles in total into water. The next step is basically the same thing but used on different terrain. I’m going to use my godly powers to erase any blobs of water that are too small now instead of land.

Before and after tiny bodies of water were turned into land.

I settled on a minimum water count of 50 after some trial and error. It gets rid of all the dumb puddles while retaining a few lakes and other interesting bodies of water.

What’s next? It’s time to give the world some actual terrain. Forests, mountains, deserts and other stuff like that! Believe it or not, I’m going to use more noise to accomplish this.

Here is our map with the addition of forests. It looks stupid because I need to add some new carving rules. I need to restrict the forests to only being carved over land tiles.

This is what it looks like after only letting the forests overwrite land. I also cleaned up any blobs of forest that were less than 20. I’m still using a seed for everything so if you compare this image and the previous one you’ll notice its the exact same noise distribution.

I think the forests might be too big, though, but I don’t care enough to mess with them further. I’ll probably come back to them later and fiddle with the noise values a bit more.

Let’s add some freshwater next. This doesn’t take any noise generation or anything! Instead, I’ll just be converting small bodies of landlocked water into freshwater.

This is what the map looks like with freshwater. I’m turning any water that is less than 10,000 tiles in size into it. That basically means everything but the ocean itself gets converted.

This isn’t a perfect solution. It’s possible for a landlocked blob of ocean tiles to exist that is greater than 10,000 tiles in size. This method wouldn’t detect and convert such a scenario into freshwater. That’s just how procedural generation is. There are infinite possibilities due to the nature of randomization which means theres too many edge cases to handle.

The mountains are next. These are a pain in the ass to make in a satisfying way. Originally, I wanted to create fault lines and simulate volcanic activity along them to create nice looking mountain ranges. This is the kind of appearance I was going for.

Satellite image of the Himalayan mountains. Credit: NASA.

I want nice long ridges like the above image and other curvy stringy mountain range shapes.

However, after several days of tinkering, I’ve decided to give up on that approach. I was making progress but it was slow and soon began to feel ridiculous. The terrain doesn’t really matter right now so every second spent perfecting it was largely a waste of time. I fell into that design trap of working on irrelevant things or optimizing when optimization isn’t needed.

I decided to take a less advanced approach. No geological modeling, unfortunately! Instead, I’m basically just generating a bunch of circles and then corrupting them with noise. There are too many steps involved to screenshot so I’m going to create a gif and then explain it.

Editing on wordpress is like stepping on legos.

I made the gif by just recording my screen. I built an in-game noise visualizer for debugging purposes. It’s a lot easier to figure out what you’re doing when you can see the results!

First, I create two arrays full of randomly positioned and sized circles. That’s Hills1 and Hills2 in the animation. Then, I feed these two circle arrays to a zany math function. It compares the two circle arrays and spits out a weird combination of the two. The combination seems to detect overlapping values and blends them into football-like shapes. The result is that Hills3 is now full of crescents and other vague mountain shapes instead of perfect circles. The first two hill arrays are purposely similar to one another to take advantage of this side effect.

Then I create two sets of small noise. That’s Small1 and Small 2. This noise is evenly mixed together to create Small3. The mixture is then eroded to rough it up even further. Finally, I mix Hills3 with Small3 and apply a gaussian filter to smooth things. The mountains are done!

Here is our familiar world with mountains.

Also, since this is the last dose of terrain generation for the time being, here are some other worlds. They’re made using the exact same noise settings. I just randomized the seed value.

The result isn’t perfect but it’s close enough. There’s some stringy mountain range shapes and other decently peaky looking things so I’m going to call it a wrap and move on.

Here is what the current world would look like if converted into an island if you’re curious.

This is accomplished by creating a map sized centered gradient circle and blending the landmass with it. It basically causes the land to taper off the further it gets from the center.

If you remember, I started adding terrain as a stepping stone towards supporting a basic simulation. I need a world to populate, of course, before I can do anything interesting. I’ve met that goal, so let’s move onto the next step! I’m going to start adding resources now.

I generated terrain first because resources are often tied to it. It’s possible to find ore in the middle of nowhere, for example, but it’s more likely to show up in the mountains. The same goes for wildlife resources like sheep. I guess they could be found in a swampy wasteland but they probably prefer grassy areas near fresh-water sources like natural springs or lakes.

There’s not enough biome variety to accurately simulate resource distribution yet but that’s alright. I’m not aiming for realism right now. I just wanted to build some kind of foundation to work off of instead of just throwing everything around randomly.

Why don’t I just throw it around randomly, though? I don’t literally need terrain. I could just as easily generate resources without it. The answer is that I want resources tied to terrain in preparation for faction generation. Towns, industries and entire civilizations have sprung up around useful resources. The best example I can think of is Egypt and the Nile river or the middle east and its oil. I want to say Rome and its bronze, too, but I’m not entirely sure.

Either way, I think an easy way to make factions more interesting is to give them unique access to certain resources. If one faction has access to lots of iron, for example, then they’ll be able to make some great equipment while everyone else is stuck with copper or stone. It then stands to reason that they’ll develop high-end blacksmithing as a result and potentially claim a good portion of the world due to their access to strong metals and talented smiths.

I could just randomly generate factions and give them access to random resources but then the world would have no weight to it. They would just be an intangible background element that can’t be interacted with. They’d be more like perks or upgrades than resources in this state. If iron is a real resource, though, then factions can trade, steal or even fight over it.

It has implications for the player, too, since resources are now a legitimate in-world thing.

The first iteration of this will be quite simple but should nevertheless help make the world a little more diverse at almost no cost to me complexity wise. I like the way the total war series of games handle resources. They’re just single tile objects on the map. I was originally going to generate fields of resources using noise, but have decided to go this way instead.

Medieval total war is the best total war.

I’m going to generate some resources, and then, if a faction is near said resources they’ll claim it. They’ll build a mine on diamonds, a farm on wheat or ranch on cows. This will be a real place the player can visit and people will staff. Traders will transport goods back and forth between them and whatever town the resource belongs to.

I think we’ll stop here, though. I’d like to put more thought into resources and factions before committing to anything. Come back next year when I add resources, factions and more!

Mystery Conquest Project (PART 1)

Follow me on the twatters.
Subscribe on youtube for vidya.

Hello! It’s time for miscellaneous Wednesday. I recently started the development of a new project that I think is pretty interesting. I can’t think of any roguelikes (or modern games in general) that go for this kind of thing anymore. I’m going to start documenting its progress before I get too far ahead. What is it, though? It’s a horrifying combination of my favorite elements from a million different games all shoved into one.

The core of the game is largely based on two games. I’ll focus on those. There’s galactic conquest mode from the Star Wars Battlefront line of games and Warfare mode from Arma 2. There’s a bunch of other Arma modes (and mods) that provide additional inspiration but talking about them is beyond the introductory scope of this post.

So, let’s start with galactic conquest. The name is pretty self explanatory!

Your goal is to conquer all the planets. To do this you move your fleet to worlds you don’t own yet. You can have more than one fleet but you can only move one of them per turn.

The neutral worlds are instantly claimed when your fleet arrives while enemy worlds require a fight. This is where the fun begins! Each planet can be thought of as a collection of maps.

To capture the planet you have to take control of all the maps by defeating the enemy on every single one of them. Each planet is a tug of war battle for total control.

Here is my attempt to peel back the layers a little bit more to help further explain things. This diagram was made in a free program called Dia. The red and blue planets represent the two different factions while the black one is neutral. The orange planet is contested which means they’re fighting over it. The rectangles connected to the contested planet are its maps. You can see how some of the maps belong to different factions. The orange one is where the current fight on the planet is located. If all those maps are captured by one of the factions then they capture the whole planet!

The maps are your standard control point based affair. If you’ve played any multiplayer FPS game before then you know what I mean. Even if you haven’t then you probably still know what I mean since it’s such a common mechanic. There’s also a ticket system. Tickets are basically respawn points. Every time a team member respawns one of those tickets gets taken away. This means that there are two ways to win. Either capture all the control points or kill so many of your enemies that they run out of tickets.

This is where my project begins to take on a form of its own. First, I plan to make planets and the maps on said planets more important. They’re going to be a source of bonuses instead of just territory. This will add a little more strategy to what you decide to attack and defend. Battlefront has bonuses but you just buy them with the credits you earn from fighting. It’s a pretty underdeveloped system that I forget to use most of the time. It’s unbalanced, too, since some bonuses are overwhelmingly better than others! I’ll always choose increased weapon damage over that stupid control point defense turret, for example. This is what a galaxy map in my game might instead look like.

I left faction ownership out of this example to avoid over-complicating things. You can see that planets and their maps now have bonuses tied to them. If you control a map then your faction gets the related bonus. If you control all the maps on a planet then you also get the planetary bonus. The bonuses hint at some of the fun stuff I plan to add later. I’m not going to talk about those yet, though!

I’m getting antsy with excitement and want to start working on the project so its time to move on! I’m going to start by making a map with control points. There’s also going to be two factions on the map that will be fighting over said control points. I’m not going to do any planet or galaxy stuff yet. There’s no point without the maps working.

To help keep things balanced for more sustainable testing purposes I’m also going to give each faction a headquarters. That’s a special type of control point that can’t be captured. This way, if one faction captures all the control points then the other faction will still have a place to spawn. This is an idea I got from Battlefield 2142. I forget what they’re called but that game has a few maps with the same mechanic.

The green base with the red crossed out circle cannot be captured. I don’t remember what the in game term is for these places but I’m going to continue calling them headquarters. Enough talk, though. Let’s go! I’m going to use the paint image to game map conversion method I’ve previously talked about in my super project series.

There’s not much to look at since everything is so simple right now. The red and green dots are each factions respective headquarters while the grey dots are neutral control points. The AI are finite state machines with two interests: capture control points and attack any enemies they come across. That’s it! I’m going to have each faction spawn an agent per turn at their HQ until a maximum of 100. Let’s see what happens.

Ah, yes. Truly flawless programming. There’s a ton of things going wrong! The agents aren’t attacking one another which probably means field of vision calculations are broken. They’re spawning near the top left corner instead of at their headquarters and for some inexplicable they’re pathfinding to their own headquarters? Mysteries abound.

Okay, I did some fixing! They’re now spawning at the proper location and targeting control points. The targeting system is still broken though so they’re not shooting each other yet. I’ve also now given them the code necessary to capture multiple control points whereas previously they would stop after getting the first one.

It looks weird. They move like flocks of birds. The agents tend to get all stacked up since they’re allowed to occupy the same tile. I need to get combat working.

I ripped my poor targeting code out since its not working and replaced it with a scummy brute force method. It’s slow but it works! Unfortunately, a problem I predicted might happen is actually happening. The pathfinder, due to being so efficient, is causing agents to move around the map in massive streams. This is due to the whole straight line between two points being the shortest path principle. I don’t like this because it means the player would be up against a never-ending line of enemies. The player needs to be capable of capturing points on their own and otherwise standing a chance in combat. That’s not going to be possible with how things currently are!

I need to spread the AI out a little bit more to reduce this wall of death phenomenon. First, I’ve randomized each agents sight radius. This helped a little bit when it comes to agents clumping up during combat since they detect each other at different ranges. The next thing I did was slow down the agent spawn rate. There’s now a spawn delay of 10.

It helped a little bit but also introduced a new problem: unbalance. If I let the simulation run for long enough then one of the factions always becomes the dominant force. This is because the units have a tendency to slowly form into groups and as a result they steamroll anyone they come across. This causes a scenario where the other faction cant replace their losses fast enough. It’s a death blow that can’t be recovered from. I guess that’s technically fine, though? If this was a full game rather than a prototype for testing then the faction being dominated would eventually run out of tickets and lose.

Let’s get back onto the pathfinding topic. I booted up Battlefront 2 classic and entered a random skirmish with the AI. The goal here was to just watch how things played out. Even though I can’t see the actual code I can sort of figure out what’s going on behind the scenes just by watching how things play out. I don’t know if this is a unique ability of mine or all developers in general but here’s a clip of what I was watching.

If you can set aside the obvious graphical differences between this game and mine then they look very similar! In regards to agent behavior, at-least. The agents go from control point to control point and attack any enemies they come across. I noticed a few major behavior differences in agents between my game and Battlefront while watching.

First, the agents seem a little more efficient when it comes to control point selection. In my game, the agents choose one at random whereas in Battlefront the agents seem to individually pick the one nearest to them. I’m going to go ahead and give my agents a targeting upgrade by implementing this feature in my game. This is what it looks like.

I think its better as a result. It’s kind of weird how similar my agents are to the Battlefront agents now. I turned my map into a crude representation of the Endor map so the similarities are a little more obvious. The majority of combat is focused on the center of the map while the occasional guy slips through and captures a rear point. Unfortunately, I didn’t capture a good video on this update and I’m too far ahead to make a better one.

The other thing I noticed is that Battlefronts agents, while going from control point to control point, aren’t doing so in perfectly straight lines. I’m not sure why but they seem to spread out a little bit more. I originally thought its because they were getting thrown off course due to combat but then I saw some AI spawn and take an inefficient path to a nearby control-point without them getting involved in combat.

I think instead of pathing directly to a control point they’re pathing to a random coord near said control point. This makes sense on further examination. The control points in Battlefront don’t work like mine do. To capture them you just need to be near them instead of directly on them. I’m going to make that change in my game. The control points will now have a radius and agents will path to a random coordinate within said radius instead of directly to the point itself.

It looks more like Battlefront but it didn’t do much to solve the snowball affect. In fact, the red faction really spirals out of control near the end. I’ll have to find a better fix.

I’ve now made some major performance improvements behind the scenes. The game now rarely goes below 50fps whereas previously it was struggling to stay above 20. I’ve increased the maximum amount of agents per faction to 200 to take advantage of the improved performance. I’m not sure why but 200 seems to be the sweet spot balance wise. The ball of death phenomenon seldom seems to happen at that specific number. I also turned off the respawn delay to more quickly test mass agent behavior. I’m pretty happy with the results now. The blob, while not properly fixed, now only shows up on occasion. I’m going to move onto other things until it becomes an issue again.

The next difference I noticed is how spawning works. In my game agents spawn one at a time. In Battlefront, though, multiple agents seem able to respawn simultaneously. That makes sense since its a multiplayer game. It would suck if players had to wait in a long que to respawn! I think theres a separate respawn counter for each agent rather than a single shared one. I’m going to implement that next!

I’m pretty happy with the result. It actually increased the pace of things since multiple agents can now respawn simultaneously and get right back into the action. I didn’t see anything even close to a wall of death form, either! What else can I do? I think the next thing I should add is the ability for agents to spawn at owned control points.

Looking good. I think I’ve reached the limit of what I can accomplish on this map, though. It’s so small that more advanced testing is out of the question. The agents are constantly in such close proximity that its hard to see any real patterns anymore.

Unfortunately, the game is already at the limit of what my 1920×1080 monitor can handle. I could increase the map size but then portions of it would be off screen. The game is setup for map scrolling but in order to properly test things I need to be able to see it all at once. It’s time to switch over to pixel scale rather than ascii representation.

This is the new map. The previous one was 101×101 or 10201 tiles and was being drawn with 8×8 ascii. This one is 301×301 which is 90601 tiles. I’m now drawing things at a 4×4 scale using boxes. I still have a good amount of wiggle room if I need to reduce the size further! I’ve come to realize, though, that enormous maps like this probably wont be very fun to play on due to all the traveling involved. I could add automated pathfinding for the player or transport options such as vehicles and teleporters but it would nevertheless be best to keep things small. For testing, though, this is just fine!

I’m going to go ahead and give the agents a new routine now. It’s a short range patrol that causes agents to occasionally path to a random nearby location. I’m doing this to help further spread agents out for the same reason I’ve done it previously.

I’m pretty happy with the result! Each agent has a patrol counter and once it hits a certain threshold they patrol to a random nearby location. They still prioritize combat above patrolling but patrolling comes before capturing control points. This should make combat a less frustrating scenario once the player finally gets involved. I didn’t record a video for it, unfortunately. I was on a programming binge and forgot. You can see it in the following videos, though!

What’s next? I’m going to make the map a little more interesting by adding obstacles. Then I’m going to finally add the player! Creating obstacles will make the map actually look like a map finally. There’s going to be corridors to navigate and all sorts of stuff.

Okay, I’ve added buildings. I was originally going to make it symmetrical but decided not to. In fact, I went haywire doing the exact opposite! I removed the corner control points and instead added a new ones near the top and middle bottom. The design is inspired by planetside 1 and 2 with all its interesting building layouts.

I think that’s enough for today, though. Come back next time for player gameplay!

(PART 1) Super Project

Youtube | Twitter

I have a super project that I’ve been wanting to make for a long time. This idea is actually one of the original reasons I learned how to program in the first place. The problem is that my idea is so complicated that I don’t know where how to begin.

Imagine trying to make something as complex as Dwarf Fortress but on a galactic rather than planetary scale. Then consider I want to individually simulate all the agents, species, factions, and planets so everything that happens in the game is real.

I say real due to a lack of a better word. Dynamically, perhaps? Naturally? I don’t know.

Let me try to explain it with an example.

That contract you see on the black market to recover a stolen item wasn’t generated out of thin air. It was created because a starving citizen stole said item out of desperation. It wasn’t created specifically for you, either. It was generated as a natural consequence of events.

If you don’t do it then someone else will. The game aims for a certain type of realism that can be summed up as things happening for a reason. It’s built on the idea of the butterfly effect. You’re just a cog in the machine of a living breathing world.

If that sounds daunting then you don’t know the half of it. It’s not like I haven’t tried, either!

Every one of my previous attempts has ended for basically the same reason. I put a bunch of work into building something only to realize I’ve barely accomplished anything. The end goal is so far away that no amount of work makes it seem feasible. That’s usually when my inspiration fizzles out until the next wave of motivation hits.

The problem is that it would probably take years of work to establish what I would only refer to as the foundation. The amount of time I would have to spend building this foundation so I can work on the actual fun stuff is what keeps crushing my spirit.

The obvious answer is to build it in baby steps but my question to you is: what’s the first step? Every time I start from what I believe is the bottom-most step I end up realizing there are another thousand floors beneath me. I just can’t get close to the metal.

Anyway, let me try and explain this so-called super project.

I’m going to use Star Wars as an example setting. It sucks, but it’s a setting that just about everyone knows and it can be compared to my idea in a thousand different ways.

The main similarity is that Star Wars has a classic big bad faction vs little good faction. Or, more specifically, the Empire vs the Rebellion. The entirety of my game revolves around this concept. The player is apart of the Rebel Alliance and the goal of the game is to defeat the Empire. That’s not as simple as just crawling through a dungeon and defeating the end boss, though. It will require more than I can even begin to reasonably explain. Imagine how you would go about winning a guerilla war of galactic scale.

Would you bribe politicians to remove laws that harm your movement? Blow up fuel refineries to cripple the Empires fleet movement? Take out generals so enemy forces are without leadership? Free slaves so they join the Rebel Alliance alliance? Sabotage top secret research to delay the release of terrifying new weapons? Steal enemy clothing/documentation so you can sneak into their base to plant false evidence? Lure an enemy patrol into a minefield you recently built? Hack a orbital defense laser to destroy other such lasers so the planet is open to invasion? Befriend distant alien races for unique technology? Pay smugglers to help you escape through an Imperial blockade? Antagonize civilian unrest so they riot in the streets? That commotion sure would make your assault on the capital easier!

The answer is all of the above and then some. The rebs will have to engage is just about every form of espionage imaginable to accomplish their goal. I intend to support as many strategies as possible. If you can think of something then it should be a possibility.

Here’s the problem, though – remember what I said earlier? I want things to be more natural. I don’t want the player walking up to random dudes with quest markers floating over their head telling them where to go and what to do. I want a more realistic setting where there’s no real guidance or obvious gamification. The purpose behind this reasoning will be explained further below. It can be summed up as making your own destiny, though.

Imagine looting a data disk from some high ranking imperial officer you just took out. You weren’t sent to target him specifically or anything. You were just following an encrypted signal that lead you into the forest where him and his crashed ship were waiting. Turns out you were following a distress signal! It could of just as easily been a bandits trap or random noise from a malfunctioning droid. He was shot out of orbit a few hours ago by pirates. They were bested by the officers escort ships but not before they shot his transport down.

These pirates didn’t know about the data disk or anything. They just wanted the treasures his well guarded ship may have contained. The officer didn’t just randomly spawn with it, either. There’s no random loot table non-sense. He was trusted with its transport by his superiors – whom are also as fully simulated as he is!

I’m going to stop the what if shenanigans here as this could go on for awhile. Finding a way to access the data disk and then actually make use of its contents is another couple of paragraphs on its own. The point was to show you the ever expanding web of interactivity that results from even the simplest of things in such a setting. It was also to try showing you the potential depth of a setting where everyone is living their own lives.

You could call all of this random chance but it nevertheless happened on its own. It’s chaos, sure, but it’s automatic chaos. It’s about as close to a living breathing world I can imagine code being.

It wasn’t something I specifically programmed to happen. I didn’t spawn the pirates. They were poor civilians that turned to piracy as a means to an end. I didn’t tell them to attack the officer. They needed money and knew a guarded transport might contain riches. I didn’t give the officer a top secret data disk full of information. He was trusted by his superiors due to outstanding performance. I didn’t lure you towards the officer with that signal. You just happened to be in the right place at the right time. I think that’s great and it’s the underlying basis for the whole game. This concept is the meat and potatoes of my super project and it extends to everything.

I’ll basically create the initial universe and then let things go off the rails on their own. The cool thing is that this simulation happens in a live setting. There’s no history to pregenerate. You help shape history by being apart of it rather than just living in the afterglow. I just spawn the planets, factions and other necessary set pieces and let the AI take care of everything else. They’ll all just start living their little silly lives and chaos will unfold by itself.

Is it worth it, though? I think so. The potential for story really interests me. This system gets around the constraints of being a person. There’s only so much content I can add and my creativity is limited. I’d rather make a chaos generator than code a thousand missions or random events by hand. I think the end result would be better.

I think the reason for my obsession with this idea is that a lot of sandbox games feel empty. If you play them long enough you realize a lot of stuff is being faked behind the scenes. That fleet you just destroyed, for example, doesn’t really matter. The game will just replace it with another one when you leave. In my ideal game it would matter. Their would be consequences instead of illusions. The Empire would have to spend resources to rebuild it. That means time, money, metals, labor. Their would be a whole production chain going on that you can interrupt at any level. If implemented properly you’d be able to not only do some genuine espionage but also experience the consequences of your actions! For example, if you keep raiding those ore mines then Imperial ship production will genuinely slow down.

That brings me to my final point of the day: consequences. This is where a lot of games that do what I’m trying to do end up falling short. They create this elaborate background system but fail to make the player adequately aware of it. Thus, everything they see or interact with might as well be random. To get around this problem I’ll be doing a lot of work to help reveal the worlds complexity to the player. I could add graphs so the player can see the long and short term effects of their actions or individual unit history logs so they can see what others have been up to. I think that kind of stuff would go a long way to helping players realize the richness of the setting and their impact upon it. There’s no point having an interconnected universe when you can’t examine the connections.

That’s all for today. This wall of text was several hours in the making. I should probably spent my time coding instead of talking but sharing my ideas helps motivate me. I don’t know what we’ll be talking about next. I might start going into detail about how I’ll be actually implementing this or just talk about more abstract stuff that only makes sense to me. Who knows?

If I do any actual coding progress I’ll be sure to let you know. I intend to document the process with videos because the idea of having its creation history on record from start to finish interests me.

Continued in part 2.