FreeOrion

Forums for the FreeOrion project
It is currently Wed May 22, 2013 6:56 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Ship / planetary shield concepts fundamentally different?
PostPosted: Wed Dec 21, 2011 10:56 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
Hi all,

I didn't know which of the sub-forums is the right one to post my question to, so I choose brainstorming because it has to do with game design/concepts/mechanics. This post actually isn't so much about about suggesting ideas, more to seek clarification.

It started when I noticed that the ship shield meters in the current builds don't regenerate. Ever. According to the 0.4 design pad the shield meter of ships should be set to max at the beginning of each game turn, so obviously this is some kind of bug or simply not implemented yet. After succeeding in providing fixes for a few minor bugs, I decided to look into this shield issue next. When I browsed through the code, trying to understand what's going on, finding out where the shield regeneration code should be, I naturally came across the code implementing the regeneration of planetary shields.

It was then that I realized something very obvious, that for reasons I can't really tell had been eluding me until then: ship shield meters and planetary shield meters seem to function fundamentally different. Let me explain what I mean:

As far as I understand the concept of meters, they represent a (abstracted) concept of some kind of structures / infrastructure /whatever or the effect created by some kind of structures / infrastructure / whatever. In the case of ship shield meters: these are the result or "effect" created by some kind of "infrastructure", in this case ship parts representing shield generators. The meter in this scenario does not represent the health/condition of the shield generators, but the actual strength of the shield. The shield generator ship parts determine the max shield meter value.

According to the way shields are designed to function in the game, the current shield meter value gets reduced when the shield suffers hits, and gets regenerated to max shield value at the beginning of each game turn. The max shield meter value gets reduced when the ship suffers damage, because according to current game design reduced ship current health meter translates to "damaged" ship, translates to "damaged" ship parts, translates to reduced ship part efficiency. Since the max shield meter value is determined by shield generator ship parts, "reduced ship part efficiency" in this case means reduced max shield strength. The max shield meter value gets regenerated when the ship gets "repaired", that is it's current health meter regenerates (up to max health meter value).

That's the way ship shields work in FO. The defining difference to the concept of "armor" is the ability to regenerate the shield each game turn to max without any kind of "repair", as long as the underlying "infrastructure" (shield generator ship parts) are functional. The concept of armor on the other side is fundamentally different: armor ship parts don't create a "shield" that is something distinguishable from the parts themselfes, the parts *are* the "shield". This is reflected by the way armor is designed to work in FO: armor ship parts simply add to the max health meter of the ship, effectivly making it more durable. Because of that, the extra health armor provides does not regenerate like shields, but has to be "repaired".

Now lets have a look at planetary shields: Like with ships, planetary shields are represented by a meter, which has a max meter value (max shield strength) and a current meter value (current shield strength, which might temporarily be lower because of enemy "bombardements"). But what exactly is represented by these values?

If we look at planetary meters in general, there is a clear pattern: planetary meters represent some kind of abstracted "structures" / "infrastructure" (mining facilities, industrial complexes, farms, troops, defence orbitals etc.). Max meter values represent the maximum extend to which a certain kind of "infrastructure" can be build up. The current meter values represent the extend to which a certain kind of "infrastructure" currently has been build up and can fulfill it's function.

So, according to this concept, in the case of planetary shields, the planetary shield meter would not be the actual "shield" generated by "shield generators", but the "shield generator infrastructure". And here we have a problem, if we wanted to implement planetary shield conceptually identical to ship shields: we would actually need two different meters: one representing the "shield generator infrastructure" (like the orbital meter represents the "orbital infrastructure" = amount of orbitals), and the other one the actual shield strength. Like it is with ship shields: shield generators != shield.

The way planetary shields are implemented now works this way: only one meter, max meter value is determined by techs you researched (simulating which kind of planetary shield generators you can "build"). Current meter value gets reduced by sufficiently powerful enemy fleets, and regenerates the same way as the other planetary meters. Assuming now that (like stated above), the shield meter represents the "shield generator infrastructure", "bombarding" the shield is directly translated to "damaging" the "shield generator infrastructure". This also fits with the way the current shield meter regenerates: the "infrastructure" has to be "rebuild" like the kinds of "infrastructure" represented by the other meters, if they are below max for whatever reason (changing focus, damage due to bombardement, raised max levels due to research of new techs etc.).

This kind of implementation more resembles a concept of "armor" than that of "shields", because of the lack of two distinct meters. The "shield infrastructure" is no longer distinguished from the actual shield, but the two are identical. Damage to the "protective layer" is damage to the "protective structure", as it is the case with "armor". With shields however, damage to the "protective layer" does not touch the "protective structure" (as long as the "protective layer" isn't "penetrated" of course).

Now, to be clear: I don't want to make a "realism" argument here. This has nothing to do with "realism", I just want to point out that a certain "game concept" ("shields"), which you would expect to work according to the same fundamental principles throughout the game, actually is implemented in two very different ways.

To come to the point finally: I just want clarification: is this difference intentional? Because I couldn't find any discussion dealing with this problem in the game design and brainstorming forums (I did find much discussion regarding shields and health concerning ships). But I've read only a fraction of all the threads, might have missed it, however, due to the sheer amount of text to dig through, I hope you'll forgive me if I've missed the relevant discussions ;)

Of course I can see valid reasons for handling ship shields and planetary shields in this two different ways it is now. Handling planetary shields exactly like ship shields would require two meters, and that would a) add complexity and b) would not be consistent with the way the other planetary meters work. The question is, would that add something to the game that's worth the trouble? Having planetary shields that actually act like some kind of "planetary armor" might be sufficient, if that is what we want.

I'm still a bit new to the project to have a quick answer to that, that's why I'm writing this posting.

If however it is desired that "shields" work the same way in all it's forms (ship, planets), then planetary shields need an overhaul.

Thoughts, comments, ideas?


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Fri Dec 23, 2011 7:27 pm 
Offline
Designer and Programmer
User avatar

Joined: Tue Aug 14, 2007 6:33 pm
Posts: 1772
Location: Orion
I don't think any explicit effort was made to make planetary shields identical to ship shields. In particular, the way we want to treat ships and planets is very different, i.e. planets are valuable and take a lot of effort to capture. This means that the idea of a relatively weak shield that gets regenerated every turn doesn't really work for planetary shields, since multi-turn sieges are expected to be the norm for stronger planets.

Another (less useful) way to think of it is that planetary shields are designed to stay functional at all costs, so the shield itself stays up until the power strain on the shield infrastructure becomes so great that the infrastructure itself is simply destroyed, whereas on a ship, this would cause severe damage to the ship itself, so the shields go down automatically once their damage threshold has been reached.

At any rate, since shields for ships play a vastly different role in shaping the game than do shields for planets, it makes sense IMO, to consider them separately and not worry too much about the fact that they work a bit differently from one another.

_________________
Warning: Antarans in dimensional portal are closer than they appear.


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Wed Dec 28, 2011 7:39 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
So basicly that means this difference is intentional - that's what I wanted to know. What you say makes absolutely sense to me. To get planetary shields to work like ship shields you'd have to resort to either two separate meters (overly complex and confusing) or have the planetary shield depend on a building on the planet (which means that you'd have to build this building on every colony, and that's not the way the building concept is intended in FO, as far as I understand).

I just wanted to be sure how things are intended to be, because I wanted to fix the issue that shields weren't regenerating at all in the current builds. And I wanted to know how far the implementation of ship shields should reflect planetary shields (because to find out how and where to put the code implementing that, I looked into the code for planetary shields). Well, as it turned out Geoff was faster ;)

I wonder why he set the shield regeneration to 1/turn though, because accordings to the 0.4 design pad ship shields should regenerate to full strength at the beginning of each turn... :?:


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Wed Dec 28, 2011 8:02 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
Vezzra wrote:
...I wanted to fix the issue that shields weren't regenerating at all in the current builds [but] Geoff was faster
They may not have been regenerating because the original plan might have been to have effects do the regenerating, rather than hard-coding as I added recently...
Quote:
I wonder why he set the shield regeneration to 1/turn though, because accordings to the 0.4 design pad ship shields should regenerate to full strength at the beginning of each turn... :?:
I decided that fully regenerating shields every turn would lead to (more) situations with endless battles every turn involving ships losing 1 or 2 shield and having them regenerate between turns. With just +1 / turn, this will occur less often.


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Wed Dec 28, 2011 9:43 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
Geoff the Medio wrote:
Vezzra wrote:
...I wanted to fix the issue that shields weren't regenerating at all in the current builds [but] Geoff was faster
They may not have been regenerating because the original plan might have been to have effects do the regenerating, rather than hard-coding as I added recently...

Hm, I think basic or inherent properties/abilities of a game element like the ability of shields to regenerate should be hard-coded (unless there's a specific reason to give modders the possibility to make shields that aren't really shields) - at least that's the way I would do it. As you do for example with the damage dealt by weapons - in theory you could make it possible to do that with effects too...

Quote:
I decided that fully regenerating shields every turn would lead to (more) situations with endless battles every turn involving ships losing 1 or 2 shield and having them regenerate between turns. With just +1 / turn, this will occur less often.

Sounds reasonable. On the other hand, as far as I have seen there are techs that enable ships to repair themselfes, one tech allowing to regenerate 1 health/turn, the other one even allowing full repair at the beginning of each turn. Would not having these defeat the point of using shields at all, if they regenerate slower than the ship can repair itself? What if ships regenerate shields 1/turn when they have been in a battle, and if they haven't been in a battle do full regeneration? That would make more sense to me.


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Thu Dec 29, 2011 3:11 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
Vezzra wrote:
Hm, I think basic or inherent properties/abilities of a game element like the ability of shields to regenerate should be hard-coded (unless there's a specific reason to give modders the possibility to make shields that aren't really shields)
Not modders necessarily, but any content scripter. Whether shields can regenerate or not seems like a useful thing to make easily modifiable, in order to make things like techs that unlock shield regen, or localized regen from buildings. Likely we'd want to do that sort of thing anyway, so it would be somewhat awkard to have some of the regen inherent, and some from modifiable content.
Quote:
As you do for example with the damage dealt by weapons - in theory you could make it possible to do that with effects too...
Weapon strength ratings are implemented with effects.
Quote:
there are techs that enable ships to repair themselfes, one tech allowing to regenerate 1 health/turn, the other one even allowing full repair at the beginning of each turn. Would not having these defeat the point of using shields at all, if they regenerate slower than the ship can repair itself?
Ship repair generally requires that the ship be in a particular location, such as at a repair building, or within resupply range of the empire's planets. Also, shield repair boosting techs / buildings / etc. could be much easier / cheaper to get than remote repair.
Quote:
What if ships regenerate shields 1/turn when they have been in a battle, and if they haven't been in a battle do full regeneration? That would make more sense to me.
I considered full shield regen whenever a ship hasn't been in a battle recently, but decided +1/turn was easier to implement quickly.


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Fri Dec 30, 2011 4:57 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
Geoff the Medio wrote:
...Whether shields can regenerate or not seems like a useful thing to make easily modifiable, in order to make things like techs that unlock shield regen, or localized regen from buildings.

I can see where you want to go, and if you wanted to do shields (by "shields" I'm referring to ship shields, in this entire post) that way, that of course would make sense. However, I'm still not convinced that this kind of design for the game concept "shields" is an improvement over "shields" that have an inherent ability to regenerate, because the difference to the concept of "armor" is too small. With basic shields and armor there would be only a very small difference: just two distinct meters (shields and health), with shields being reduced before health, and only reduction of the health meter degrades ship performance. Regeneration would be identical unless you get shield regen techs, and even then, as soon as you get remote repair techs (like "damage control" that allow ships to repair themselves at any place), the only difference would be cost/speed of regen (so purely stats).

I think this two game elements should be more distinct than that. The ability of shields to regenerate to full strength between battles whereas armor needs to be repaired (that is health meter only regenerates at particular locations, or very slowly by means of some remote repair techs etc.) would make a significant distinction. To counterbalance the far superior power of shields, you can make shield techs much more expensive and harder to get, and/or the cost/strength ratio for armor much better than for shields.

The concepts you mentioned can still be employed - for advanced regeneration while in combat. So shields normally only regenerate between battles, but with advanced shield regen techs, special buildings present in a location etc. your ships get the ability to regenerate their shields during combat.

Quote:
...Weapon strength ratings are implemented with effects.

:?: They are? I'm not sure we're talking about the same thing. Weapon strength ratings are implemented via content script files, yes, but with effects? There are fixed named properties in ship_parts.txt that define the characteristics of weapon ship parts (damage, ROF, range). That's not what I meant. I was talking about manipulating the health meter of the ship affected by weapon damage via effectsgroup (SetMeter functions or something like that) - because that would be the equivalent to how shield regen would have to be done via effects (not that that could be done with the current implementation of the effect system, but you could extend it in a way so something like this could be done).

Quote:
Ship repair generally requires that the ship be in a particular location, such as at a repair building, or within resupply range of the empire's planets. Also, shield repair boosting techs / buildings / etc. could be much easier / cheaper to get than remote repair.

Still, as far as I understand it, this would result in differences purely in stats. However, I admit implementing shield regen purely via effects gives you way more flexibility. You could model the "shield" and "armor" concept as I described it, but allowing content scripters to model shields and armor radically different, if they are inclined to do so. Wouldn't it be an alternative to introduce a named property like "regenrate" (in addition to "capacity") for shield class ship parts? The characteristics of a shield ship part would thus be defined by this two properties, "capacity" and "regenrate" (this would also be more in line with the way weapons are implemented). Then provide some functions for effects that can modify these stats. I think that would reduce the complexity of the content scripts required to implement shield regeneration, wouldn't it?

However, this discussion deals with ideas and concepts, how shields should or could be done. That's something concerning game design. The main reason why I thought shields should regenerate to max (independent of how it's going to be implemented) was because the 0.4 design pad specifically states that it should be that way. Of course, being still a FO "freshie" :wink: I don't know how binding these documents are/how strictly you follow them when implementing the concepts laid out there.

Quote:
I considered full shield regen whenever a ship hasn't been in a battle recently, but decided +1/turn was easier to implement quickly.

Well, in that case I'm happy to make another (very small, but still) contribution to the project :D I posted a patch in the progamming forum.


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Fri Jan 06, 2012 11:39 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
Vezzra wrote:
Quote:
...Weapon strength ratings are implemented with effects.
:?: They are? I'm not sure we're talking about the same thing. Weapon strength ratings are implemented via content script files, yes, but with effects? There are fixed named properties in ship_parts.txt that define the characteristics of weapon ship parts (damage, ROF, range). That's not what I meant.
All those fixed named properties are implemented using effects. Writing "capacity = 1" in a part script actually creates an effect that sets that part's Capacity meter to 1.
Quote:
I was talking about manipulating the health meter of the ship affected by weapon damage via effectsgroup (SetMeter functions or something like that)
That's not how combat is presently planned to work; arbitrary effects won't be possible in combats.
Quote:
Wouldn't it be an alternative to introduce a named property like "regenrate" (in addition to "capacity") for shield class ship parts?
Yes.


Top
 Profile  
 
 Post subject: Re: Ship / planetary shield concepts fundamentally different
PostPosted: Sun Jan 15, 2012 11:53 am 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
Geoff the Medio wrote:
...All those fixed named properties are implemented using effects. Writing "capacity = 1" in a part script actually creates an effect that sets that part's Capacity meter to 1.

Oh, now I get what you mean. Well, that's different from what I was talking about:
Vezzra wrote:
I was talking about manipulating the health meter of the ship affected by weapon damage via effectsgroup (SetMeter functions or something like that)

Your reply:
Geoff the Medio wrote:
That's not how combat is presently planned to work; arbitrary effects won't be possible in combats.
is what I expected.

As this obviously also applies to shields, and we might want to have the possibility to offer (maybe just very slow, but nonetheless) in-combat regeneration of shields (through advanced techs), doing things this way:
Quote:
Quote:
Wouldn't it be an alternative to introduce a named property like "regenrate" (in addition to "capacity") for shield class ship parts?
Yes.
IMO seems to be how we should do it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group