Page 1 of 1

Durability/damage system, starting

Posted: Sun Oct 04, 2015 12:34 pm
by joonicks
My thoughts about the beginning of a damage/durability system;

I think most of the code would fit inside the current lua framework.

First step would be to add stats to equipment in Equipment.lua

My suggestion is the following:

durability {
current = 0..100,000,000
--whatever the current durability of the module is, my thinking is that most equipment is sold in a used state, so to get factory new modules you would have to visit special starports and get them off bbs posts. choosing a high number (100million) by default to allow very fine-grained control of maintainance-state, even if you take 1 million durability off each hit. extra durable items could start off higher (200 million?)
lastservice =
--what current durability was last time maintainance or repairs were attempted. my thinking is that maintainance can never restore 100% of durability since last service, so that no matter how good you maintain your equipment, it will eventually decay.
original =
--whatever the durability was factory new, to compare to current to give a sense of how damaged the module is (may or may not be presented to the player). extra durable items might start off with original = 100mil and current = 200mil to hide the decay and make the module appear as strong quality. so, durability over 100% should be handled by any durability code.
complexity =
--how complex the module is, more complex means more skill/time is needed for repairs/maintainance and/or less durability retored each time repair/maintainance is attempted
}

ships themselves could have 2 durability stats, one for the ship itself, one for the on board computer, or the computer could be made into a module itself

Re: Durability/damage system, starting

Posted: Mon Oct 05, 2015 6:55 am
by joonicks
instead of starting at 200% original durability, I think it might be better to have a modifier stat which modifies each hit durability takes, so modifier < 1 would increase the lifespan and modifier >1 would accelerate the decay

Re: Durability/damage system, starting

Posted: Mon Oct 05, 2015 3:12 pm
by impaktor
Instead of your current, I would opt for a wear-and-tear parameter which is between 0..1, maybe call it condition,, which you just multiply with the equipments total "hit points" or "life" (which would be a constant for each equipment). That is to say, the condition parameter holds the state/condition of the equipment.

I.e. your current = damage * life

What's the difference between having an equipment with a lot of "life" (i.e. taking a long time to restore to full), and one with much "complexity"?

Also, I think players will want to be able to service or repair their equipment to 100% functionallity, at least in some way. Maybe crew only restores to 90%?

I prefer parameters in the range of 0..1, which gives a natural scale.

Re: Durability/damage system, starting

Posted: Mon Oct 05, 2015 4:30 pm
by bszlrd

Re: Durability/damage system, starting

Posted: Mon Oct 05, 2015 5:41 pm
by joonicks
ive always been more comfortable working with integers, 0..100,000,000 is the same for a computer as 0..1 but the former is stored as an integer and the latter as a float.
subtracting 1,000 to me seems to give more control than subtracting 0.00001, and with a modifier, 1,000 can easily turn into 900 (-10%) instead of 0.000009. for a computer its the same but for a human I think the integer approach gives better insights as to whats going on.

the variables would be adressed like myequipment.durability.current which for me implies that the variable holds the durability of the item right now, "condition" is a bit more ambiguous as to what it contains.

complexity would affect magnitudes of failures and repairs. perhaps only repairs, a more complex module would be more difficult to repair, take more time or require more skill

and I dont want the player to be able to restore the module to 100% durability. it may very well provide 100% function down to 25% durability or so before you see any negative effects, but if you allow a player to repair his modules to "factory new state" every time, the module will never decay and need replacement, which I think is one of the big ideas with durability, not just showing temporary damage from battle and such.

higher quality items would have better lifespans and require less of expensive maintainance to keep the equipment working flawlessly.
"made in china" items would be cheap, provide function, but quickly decay and require alot of expensive maintainance to keep in good working condition for longer periods.

remember the players ship might be moving around space for years and years of in game time.

Re: Durability/damage system, starting

Posted: Tue Oct 06, 2015 6:43 am
by Tichy
I like that approach. But there are special cases. I can think of software for the onboard computer: it could be bery complex, but it doesn't degrade with the passing of time and it couldn't be phisically damaged, unless the computer itself is damaged. To let it be damaged like any other equipment, It could be considered like a phisical module that you plug into your hardware, like a NES cardtige, but it would feel a bit retro :)

Re: Durability/damage system, starting

Posted: Tue Oct 06, 2015 11:59 am
by joonicks
yes that is also my mind, I just recently submitted a small patch to make the trade analyzer into a "software upgrade" that you cant uninstall and resell, in the durability system it would have the durability stats, it would just never decay, though the computer it runs on probably will

Re: Durability/damage system, starting

Posted: Tue Oct 06, 2015 12:11 pm
by Tichy
joonicks wrote:in the durability system it would have the durability stats, it would just never decay, though the computer it runs on probably will
In this case, there could be some kind of dependency tree: when something on which several equipment depends breaks, all depending items would be unusable, with a small chance to break themselves.