So I have put it off long enough, due to fixing and improving existing things, but the ongoing clamour from the user-base to include these features into Production Line (which for new readers, is my PC car-factory tycoon game), means that I needed to give in and stasrt work on getting it into the game, which is what I’ve done for the last few days.
The design basically comes down to defining each car as being one of three types, based on what people generally refer to as the ‘power-train’. A car is either ICE (internal combustion engine (diesel/petrol), Electric or Hybrid. This is simple enough, and I can work this out from a cars design simply by seeing if certain mutually-exclusive features have been added, for example ‘hybrid power-train’. Any car that is not explicitly hybrid or electric is assumed to be ICE. (This system also allows support for me to at some later stage maybe implement diesel/petrol as two distinctly different technologies.
The slight complexity comes from the fact that for the first time in the design of the simulation, this has to be applied to each CAR, not each design. This is because you can (and players do) change the features of a car design while cars are actively being produced. Its no good changing car type A from ICE to electric when 33 cars of that design have already skipped battery installs and have fuel tanks and radiators…
So thats the first obstacle I had to get over. the second one is to add new power-train-specific support to each production slot. For example, the ‘fit fuel tank’ slot will now fix a battery instead if the car at that slot happens to be a hybrid or electric car (and each of those their own battery size). There also is now support for entirely skipping a slot if the task its performing is irrelevant, which in the case of radiators and pure-electric cars is indeed the case (also exhausts).
So those are the big code changes that have been needed, along with support (with backwards compatibility) for saving and loading the power-train type of each car currently in the game. The other steps are relatively simple, in that they involve setting up new research, new unlockable upgrades and the applicable car features for Hybrid power-train, Electric power-train, and Large Battery support. (Electric cars will initially default to small batteries, with large ones being a researchable option). I also needed to add new resources for electric motors, and 3 different battery types, plus a composite resource for a hybrid power-train. That gives me ‘basic’ support for a choice between ICE, Hybrid and Electric . From then on, in future updates, I can introduce slots to manufacture those components, such as make battery, make electric motor etc, and maybe some researchable techs for higher power-density batteries etc. Thats all in the future.
For now it just feels good to know I’ll have this new tech in the game in a few days time.
In the meantime I am off to Indiecade Paris where I will be giving my down-to-earth honest talk called ‘how not to go bankrupt’.
Oh and by the way, if you are a steam customer, or a direct-bought customer with a steam key (which comes with every order), you might be interested to know that we now have cool Steam Trading cards available for the game.
Oh…and last thing, the steam Halloween sale is on, with a ton of cool positech bargains. Production Line is NOT discounted, nor will it be in any other sales this year, but you can buy it from the link below for $17.99 :D