74

Forensic Friday 74: The Final Iteration

📣David

Hey Readers! #

Hey everyone, it’s been 3 weeks this time! We would have released this blog post last week but I had graduation! Yep, I finally graduated from university, which means I started and finished a master’s degree before this project finished, which is humbling. But we don’t count the first 2 years anyway…

That’s a little old me standing awkwardly alone (taken by my girlfriend my family was there don’t worry), but I can finally say I have a master’s in computer science! Hopefully, that translates to better code for the game!

As for the state of development, we are well underway in the “GAME DESIGN” stage of things. The past 4 years have been a botched 1st draft, and now we are tightening things, fixing bugs and for the most part simplifying a lot of the game mechanics. Turns out realism doesn’t make for good game design, which was something we didn’t quite understand and has led us to question design decisions. But these mistakes exist no more! This week will cover the rewrite of the power and fluid system. The two systems we never said would need a rewrite, suprise suprise, needed a rewrite. But luckily it was terribly quick since it was a lot simpler than the original.

On to the news!

New Architect Menu #

The architect menu has gone under a complete redesign, formerly a really bulky menu that just got in the way, now leaves a lot more screen space. This makes building a much more pleasurable experience, especially without the need to scroll through the menu to find what you need!

In the screenshot above you’ll also notice blueprints! Which is another new addition. Blueprints are pretty self-explanatory; they help you plan out your site before you start committing to building things. Here’s the old one for reference.

I think we can all agree the redesign is a lot better! The architect menu is now a “Deep Menu” which is a term we use for menus that drastically change the interface.

Fluid and Power System Redesign #

This is the two-thirds of the big redesign of the logistical systems of Containcorp. The last third is refactoring walls and floors to be voxels instead of entities, but we’ll get onto that. The first question you may ask is why we decided to redesign these 2 elementary systems at such a late stage in development when they were supposedly already finished polished and ready. Well, they were not finished and polished and ready! We built these systems of flawed design, and thus they must die and be replaced by something better, simpler and well… better.

The problem with the previous interaction is that every pipe/wire was its own entity. Which did wonders for saving and loading save files. This was also a problem with walls and floors! Every wall and floor was its own separate entity, which as you can imagine was not a good use of resources. This was something we knew we’d eventually have to fix, but we pushed it to our “future selves” Well, the future is here and it’s looking bright!

From Entities To Voxels #

Walls and Floors are no longer entities, but, taking a note from Minecraft, are now voxels. This makes them use a more data-oriented approach, which lends itself to being incredibly performant. A must if we want players to build infinitely up and down in the game. Of course, the game isn’t perfectly optimised so the floors will be limited to some number, but optimisation doesn’t harm a game. When that optimisation means the difference between 10 fps or 70 fps on just one floor, then it’s worth taking. The main issue transferring to Voxels fixed was file saving and loading time, and ultimately the file sizes themselves. As you can imagine saving each entity separately with its data makes for a lot of files! We’ll optimise the saving of entities later on, but there was just no need for every wall and floor to be a separate entity.

With this fundamental change, the power and fluid systems had to be rewritten. It’s something that has been at the back of my mind since we started getting the logistics into shape. The design never felt right, it was always incredibly clunky to build any sort of power generation set-up or working with pipes. Power was especially bad since we had so many different mechanics we thought were cool, but were really just unnecessary complexity and design bloat.

All that’s been cut out! So without further ado, I’ll just start by showing off the new systems.

New Power System #

The screenshot above shows the diesel generator and if you look closely you might be able to make out the power cable coming out of it to the right. If we go into the logistics view you should get a clearer picture of whats happening.

But it’s all greyed out, so what’s happening? Where is the power? Well, diesel generators need to be fueled!

After it’s fueled, then it’s just about placing the cables throughout your facility to power everything you want. It’s pretty simple, which if you have been following the blogs is a massive reduction in what used to be a mess of transforming between 3 useless power types, and placing 5 objects down just to get things powered in a basic way. Why on earth did we think the game needed power poles? Because Factorio did it. But our game isn’t factorio!

Appliances are powered quite simply through smaller cables.

Appliances currently take a fixed amount from power grids, meaning grids have a maximum number of appliances (given the same wattage) they can hold before any new appliances have no power. This is different to how it used to work where all appliances shared power, but only because we wanted to get this feature done rapidly (as it was a rewrite which we don’t exactly have much time for). We will, however, later tweak this so appliances share power on a network, as that leads to more intuition, and also cool things like lights not having power and flickering/losing their light radius etc.

In my efforts, I also added a new way of producing power. A renewable energy source in fact! Solar energy!

Neat stuff! Their energy output varies on the time of day, as expected. When we start working on a weather system post-alpha, it’ll additionally get affected by cloud cover. Batteries and lights still operate the same as they used to, so not worth a mention here.

New Fluid System #

Pipes have had a total revamp too. Spritewise the pipes look a lot more pleasing to the eye. Below is the basic setup for sourcing water. A water well and a pipeline leading from it.

A water well is all that is needed to source water. Again, very simple! This is in contrast to the mess of pipes and the terrible water purification plant that was needed prior.

Phew! Glad that’s gone! As for the different functions you can add to your pipelines, I reimplemented pumps and fluid tanks and added a new object: boilers. Which you can see below.

As for how pipes work generally, fluid in pipes is no longer accurate. Before pipes were used to hold discrete measurements in litres. Now pipes either have fluid or don’t. The fluids within the pipes transfer to each other instantly every tick. Pipes then have a pressure value that decreases from a source object until it is 0, giving pipes a flow range. That’s it. There are a few other things like pressure decreasing passibely, along with temperature, but these are just all addons to the basic pressure flow system Funnily enough both of these refactors are back to how we originally planned to implement things, so we sort of regressed in the design once we started implementing them. A sort of scope creep perhaps?

Facility Mainlines #

With the changes to these two systems and a suggestion from our discord server, I went ahead and added “mainlines” which are a power cable line and fluid pipeline that travel along the road, giving you access to power and water from the “national grid”. Starting out, this is no biggie, but as you start to contain more frightening anomalies it can quickly become a huge hazard to be connected to the mainlines, so you can imagine a grant called “Disconnect from the Grid” or something. Right now there no no major downsides to using the mainlines, but eventually, when we get onto adding storyteller events, there’ll be events like power cuts, and such that will make you question why you have been relying on the mainline so much.

Below is an example of how you can use the power line to extract water from the pipeline. We’ll have to balance pumps a bit since right now they output max pressure no matter what, but we’ll likely want to change it to a multiplier instead.

That covers all the important stuff. I could go into more detail about these 2 systems (I didn’t even get onto drains and outlets), but to spare the length of this blog, we’ll have to leave it for you to find out when the game comes out!

Changes to Generation #

In my quest to improve everything about the game, I have been improving everything about this game. Shocker I know.

Underground floors now have a new shader which makes the game look a lot more polished. I love shaders!

Lakes are also now actually large holes in the ground filled with water, instead of fake painted bits of water. Which makes things feel a lot more cohesive, and opens up interesting exploits with the fluid pipe system.

Deliveries #

Apart from the polishing and design tightening process has brought us onto Deliveries. I’m glad to say we finally have a sprite for the delivery truck, which has been in placeholder territory for far too long now. As for design changes to deliveries, items are now delivered in boxes, which get taken to delivery regions and unpacked. This speeds up the process of getting deliveries to your site and stops haulers from dancing across the road taking years to get everything onto the site. Neat stuff. The video below highlights this feature.

As for other changes, I have made some to the delivery store. It now shows a grid of items, and upon clicking opens up to the rest of the store. This is just a small change which makes the whole thing a lot more useable. But nothing much else to see here.

We also introduced some new resources to the building, with more to come. In the image below you’ll see brick, wire, wooden logs and cement.

Small changes #

There have also been various small changes, too many to list here. But the ones I thought are worth mentioning:

Regions now show a little icon when the requirements aren’t met.

Regions inside enclosed rooms now check for whether they have a roof (i.e. are sealed) and give a little warning if not.

The grant menu has also gone through some changes. We practically didn’t have a menu before, but now there’s… something!

State of Development #

I’ve honestly lost a bit of steam with this blog post. Writing it in the late hours of the night. I spend so many hours working on the game, so summoning the energy to write this blog is a lot harder than it used to be. However the best thing is that the game is making progress, with all the visual things I have shown, there are ten times more bugs and small tweaks I’ve made over the past weeks that aren’t blog-worthy but all cumulate into a better lay experience. Hopefully, something we validate soon.

In terms of the state of development, we are doing pretty well.

We have almost finished sorting out the second interaction on all the facility-building aspects of the design, which is arguably the longer side of things. We expect the game to be playable, and in an alpha state in a month, but obviously, delays happen. Game development is a windy road after all. But we’ll see how things play out. To save my sanity, the blog post must end!

Case Closed #

Hopefully, you liked the progress we made, the next month of progress will be even more drastic we hope. Anyways, filing this case file away…

Case Closed.
The Team
Plasmarc Studios