Author Topic: Tube Handling  (Read 6477 times)

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Tube Handling
« on: June 19, 2016, 02:32:21 PM »
This is a question that's been bugging me for awhile -- Tubes. Are the full on structures? Should they have a cost for building? A recycling value? Should they deteriorate over time and potentially fail like any other structure?

Any thoughts on this would be appreciated.

Offline nolongerinuse

  • Newbie
  • *
  • Posts: 25
Re: Tube Handling
« Reply #1 on: June 21, 2016, 05:22:43 AM »
In the original, tubes are very cheap, if not free, if I remember correctly; you could almost always build some. Free tubes would be odd, but I'd think the cost should be very low (just a few common materials). Destroying the tubes should give back most of the resources, though; then the player is encouraged to experiment with different layouts (or, at the very least, not punished for playing around).

Was deterioration of structures in the original? How did that work? I seem to remember only the Hot Lab would explode at random, and the structures associated with the lander destroying themselves after a while, I'm not sure if there was any mechanic behind it.

Tubes (and other stuff) requiring some maintenance would be a nice addition, and this could possibly be the job of the DIRT; low maintenance lowers efficiency of buildings and/or increases energy usage, with risk of catastrophic failure (such as a tube breaking and some poppets dying after being blown out to the sands) becoming significantly greater. Also, a tube breaking could 'disconnect' structures from the colony, making them a lot harder if not impossible to access, which lowers their effectiveness.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #2 on: June 21, 2016, 10:01:50 AM »
Welp, Hooman and I have been chatting about that recently so I'll post my thoughts on building deterioration:

Quote from: leeor_net
What we're talking about here was never implemented in any form in Outpost 1... certain buildings would randomly explode (tokamak, hot lab, etc.) but the idea of aging structures was never really present. Some structures had a preset time where they would just go into a destroyed state (like the SEED lander, other landers) but otherwise as long as you had resources during the turn your buildings would operate indefinitely. SirBomber could provide better details of this because there is a 'Breakdown Factor' for each building, a value I never understood and if a building -did- break down there was really no way to determine it, at least not one that I ever found (the UI for the game was awful).

In the original, tubes were free as they are now. But they are implemented as structures because, well, let's face it, if we're building a real colony tubes are as much a structure as anything else. They serve a vital purpose -- they connect structures together not just as walkways but also serve as energy and water conduits as well as atmosphere/air pumping. They also act as an easy way to get out of a colony and can prevent entire colony depressurization should there be a breach (effectively acting as an air lock).

Quote from: leeor_net
As for deterioration, that's something I've been wondering about how to handle. Obviously some structures should deteriorate faster -- e.g., surface structures will always deteriorate faster than underground structures... but a factory will deteriorate faster than a warehouse or storage tanks just like a hot lab or fusion reactor would deteriorate faster than a factory. That's something that would happen during the incrementAge() function (need to come up with a better name because I want to keep an age factor so players can still see how old a building is but it does or will do much more than that -- it will also update current repair status and other bits of age/maintenance logic... which tells me it should be broken up into separate functions but I digress).

One thing I haven't considered is exactly how to handle deterioration and maintenance. Every turn most structures have some sort of resource requirements. Why would a warehouse need 1 common metal resource each turn? I assume in Outpost these requirements represented what was necessary to operate and maintain a building. It's a fairly simple setup but would then lead to other questions such as if requirements weren't met, only then do buildings begin to deteriorate or do they just go disabled as I currently have it?

It's a complex problem that affects a lot of variables and dynamics in the game play. Tubes could be free as they were in the original, but then you kind of lose a bit of realism. Ultimately I think they should have a minimal cost (5 common metal, 1 common mineral, 1 rare metal).

I'm also thinking that recycling costs shouldn't be arbitrary but say 90% (possibly variable based on difficulty?) of the original cost of the structure (which means in practice since we're working with Int's and not Float's you're getting back 4 common metals for every tube you demolish). This accomplishes two things -- one, eliminates arbitrary recycling values and removes an object from the Structure definition in the code.

And this just turned back into novel. These are complex concepts we're talking about so I suppose it comes as no surprise that posts get really big really quick.

Thank you for weighing in -- it helps to have others to bounce ideas off of and help to refine gameplay mechanics. I'm not sure I could do it all myself.

Offline nolongerinuse

  • Newbie
  • *
  • Posts: 25
Re: Tube Handling
« Reply #3 on: June 22, 2016, 05:49:18 AM »
Ooh, I like the percentage recycling value changing as difficulty changes! It'll punish players for choosing a high difficulty, but still allow non-diehards to faff about with colony design.

It's a fairly simple setup but would then lead to other questions such as if requirements weren't met, only then do buildings begin to deteriorate or do they just go disabled as I currently have it?
If I understand, it'd kinda look like something like this:
  • A structure's status starting at about a 100.
  • Every turn resources are gathered; that's the 1 common metal for the warehouse (which I imagine is the light bulb)
  • If those resources are not available, the status decreases a bit; for the warehouse, let's say 1 point. For the tokamak, let's say 25 points.
  • If this value hits/surpasses zero, then the structure enters its 'defective' state
The 'defective state' should differ per structure, as you already said; a warehouse might be deactivated meaning the stuff inside couldn't be accessed anymore (i.e.: the door is stuck), while
the tokamak explodes violently. Storage tanks might leak a bit, while the underground rec' facility starts making people unhappy because the pee in the pool isn't filtered out properly. Maybe the energy costs could also increase as the structure loses points?
Keeping the number of points lost per turn as a constant per building should be sufficient, especially if you factor in the amount of resources available; if a building deteriorates by 10, requires 2 common metals, and only 1 common metal is available, it'd deteriorate by 5. This should introduce enough variation.

should have a minimal cost (5 common metal, 1 common mineral, 1 rare metal).
Have you done some initial balancing for the materials, or do you have some kind of reference point?

I'm also thinking that recycling costs shouldn't be arbitrary but say 90% (possibly variable based on difficulty?) of the original cost of the structure (which means in practice since we're working with Int's and not Float's you're getting back 4 common metals for every tube you demolish).
When applying percentage discounts (due to research or whatever) using ints has the risk of getting stuck; a 25% discount will never get 2 to 1, even if it's applied ten times. I don't think memory is an issue here; the game won't (shouldn't?) have millions of values in memory at the same time anyway. Alternatively, an int goes from -32k to 32k, while that isn't always required; if a value from 0 to 100 is required, then the range of the int can be moved to the range required, which allows for accuracy while not increasing the memory footprint. I've seen it being done with single-byte variables that needed to go from 0 to 100, where every step was, according to the comments in the script, "a bit less than half or something".

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #4 on: June 22, 2016, 01:37:57 PM »
Quote from: vomov
Alternatively, an int goes from -32k to 32k

You're thinking of 16bit int's, something you have to specify in a modern IDE. Generally speaking compilers default to 32bit ints and some may even default to 64bit. For the purposes of OutpostHD and its build environment with Visual Studio 2014, we can assume a 32bit size which yields -2,147,483,647 to 2,147,483,647. Anyway, it's unimportant because we're very unlikely to see such numbers.

Quote from: vomov
If a value from 0 to 100 is required, then the range of the int can be moved to the range required, which allows for accuracy while not increasing the memory footprint. I've seen it being done with single-byte variables that needed to go from 0 to 100

Not going to get into clever coding like this. We're not working on machines with very limited memory like embedded devices or old 386DX's with 512KB RAM. ;)

Quote from: vomov
Have you done some initial balancing for the materials, or do you have some kind of reference point?

No. These are arbitrary values. My reasoning behind it is: Common Metals used to construct the super structure, common minerals to build the seals and any glass that may be present as well as conduits, etc, and rare metals for things like wiring and electronics (gold, silver, etc.). As far as balancing, this is something that would need to be tested.

Quote from: vomov
If I understand, it'd kinda look like something like this:
  • A structure's status starting at about a 100.
  • Every turn resources are gathered; that's the 1 common metal for the warehouse (which I imagine is the light bulb)
  • If those resources are not available, the status decreases a bit; for the warehouse, let's say 1 point. For the tokamak, let's say 25 points.
  • If this value hits/surpasses zero, then the structure enters its 'defective' state

This is the general idea, yes. I like your suggestion that the deterioration rate could be slowed down if they got most of their resources instead of all of it -- will have to think about how to handle that logic.

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Re: Tube Handling
« Reply #5 on: June 22, 2016, 03:37:45 PM »
Stop spoiling people, leeor.  There shouldn't be any tubes at all.  Colonists can just hold their breath as they run between buildings.

So as I recall, in OP1 tubes were required - as in, you couldn't build a structure next to a structure (unless you were the AI of course), new construction had to be placed next to a tube.  If you're going to go this route, I would make tubes free or very very cheap.  If you're just going to use them as a convenient way to spread structures out, then sure, give them a build cost.  But let's be reasonable here - a tube is really only there to keep the air in.  If a tube breaks, the solution would almost certainly be to slap some duct tape over the hole and move on.  There's no need to track its condition or make it degrade over time.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #6 on: June 22, 2016, 10:58:47 PM »
Quote from: Sirbomber
So as I recall, in OP1 tubes were required - as in, you couldn't build a structure next to a structure (unless you were the AI of course), new construction had to be placed next to a tube.

Welp, the ruleset I came up with does require that all structures except for a select few that's don't require direct connections.

Quote from: Sirbomber
Stop spoiling people, leeor.  There shouldn't be any tubes at all.  Colonists can just hold their breath as they run between buildings.

Makes sure they get their exercise huh?  :D

Quote from: Sirbomber
There's no need to track its condition or make it degrade over time.

Was hoping to hear something along this line. The rest of the discussion is good for other structures but I'll leave tubes as super cheap construction. Won't have much effect except in the very beginning as a potential bar toward build too fast or something like that. I dunno, it's very easy to change it so we can balance it later.

Offline nolongerinuse

  • Newbie
  • *
  • Posts: 25
Re: Tube Handling
« Reply #7 on: June 23, 2016, 06:37:18 AM »
Not going to get into clever coding like this. We're not working on machines with very limited memory like embedded devices or old 386DX's with 512KB RAM. ;)
Aw; I wanted to play it on the Arduino :)
I've got a bit of experience in memory-saving tricks, both from my work (in real life I sometimes work with datasets where the difference between single and double-precision is measured in tens of gigabytes), and from messing with the Arduino, of course.

My reasoning behind it is: Common Metals used to construct the super structure, common minerals to build the seals and any glass that may be present as well as conduits, etc, and rare metals for things like wiring and electronics (gold, silver, etc.). As far as balancing, this is something that would need to be tested.
Then we do have something more related to real-life instead of 'PrecA', and then the usage in buildings can be quite sensible. Do you have more numbers for structure requirements?

If a tube breaks, the solution would almost certainly be to slap some duct tape over the hole and move on.  There's no need to track its condition or make it degrade over time.
Also works on helmets.
Anyway, given enough materials a tube should last for quite some time. And when a pipe or wire breaks, it'll be the guy in the hab noticing the sewage coming back up, and going out to fix it anyway.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: Tube Handling
« Reply #8 on: June 24, 2016, 02:08:16 AM »
Duct tape should totally be a research topic. It'd be a real boon for maintenance. Duct tape can fix anything.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #9 on: June 24, 2016, 10:22:01 AM »
If the original developers can make silly manufacturing products, so can we. On that note, about building maintenance, I'm wondering if instead of raw resources, building maintenance requires "Building Maintenance Supplies". See separate new topic for this.

Anyway, I see Duct Tape as just another name for "Building Materials" so manufacturing it would just add to that pool.
« Last Edit: March 03, 2019, 08:05:41 PM by leeor_net »

Offline nolongerinuse

  • Newbie
  • *
  • Posts: 25
Re: Tube Handling
« Reply #10 on: June 24, 2016, 10:46:07 AM »
On the subject of 'silly products'; will those be implemented as they were, or will more sensible products be included?
I remember 'clothing' being a product, and humour like 'neuromancer games' is good, whoopie cushions, squirting flowers, and wax lips perhaps goes a bit too far.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #11 on: June 24, 2016, 11:51:58 AM »
I mention it in my original post -- these silly items won't really be there. You'll have the option of Clothing, Luxury Items and Medicines. Not sure if anything else belongs there as far as light industry is concerned.

Offline nolongerinuse

  • Newbie
  • *
  • Posts: 25
Re: Tube Handling
« Reply #12 on: June 24, 2016, 12:34:32 PM »
I mention it in my original post -- these silly items won't really be there.
Ah, didn't see that, sorry.

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #13 on: June 24, 2016, 02:51:34 PM »
No need to be sorry, it's a HUGE post, I don't expect everybody to read every word of it (or remember all of it) :) . Also I'm not pissy, if I came off that way I apologize.

Offline nolongerinuse

  • Newbie
  • *
  • Posts: 25
Re: Tube Handling
« Reply #14 on: June 24, 2016, 03:27:49 PM »
I hardly remember what I had for breakfast. Or was it dinner?
Don't worry, I didn't sense any negativity ;)

I've been thinking about the UG factories (I think I saw the term 'light industry' somewhere, which is nice, btw) and the possible products. Either it'll boil down to medicine, clothing and a collection of 'luxury goods', or a massive list of actual luxury goods. However, that means the UG factories have a rather short production list. Are there any other things that are on the list for UG factories?
(and if they're on the wiki or in a post somewhere, I'll :-X and spend the next few days reading everything on the forum  ;))

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: Tube Handling
« Reply #15 on: June 24, 2016, 03:39:44 PM »
Light Industry is how the UG Factory was referred to in the strategy guide -- basically manufacturing products that didn't generate a large amount of pollution (something the AG Factories did... which is why they were above ground).

It does make for a short list which is probably why they added all the extra stupid stuff to the list. I'm not sure what else we could throw in there. Electronic circuits could be manufactured there but most of that would fall under luxury (e.g., electronic devices for entertainment), other basic equipment, etc. I'd considered a supply chain type of deal but I think that would be far too in depth for this game -- Transport Tycoon Deluxe is good for that.

I'm open to ideas though.