FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

#79 - [Tweak] Overcharge Shield versus PDS Effect (Added)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Drop Shock Forum Index -> Player Council - Closed Tickets
View previous topic :: View next topic  
Author Message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Fri Mar 08, 2013 2:08 pm    Post subject: #79 - [Tweak] Overcharge Shield versus PDS Effect (Added) Reply with quote

Git: https://sourceforge.net/p/dropshock/tickets/79/

Approved, 5 votes.

Basicly what this tweak is for is to the order in which Shield Actis and the SYM Acti/PDS Effect takes place. Current as it is, if you use say the PS+'s Sector Boost acti, you'll have to go through the regen before you reach the PDS' effect thus if you have 50 Shield Unit increased to 100, it would get set back to 50 before you take the hit from the PDS. The following allows for Overcharged Shields to circumvent the shields getting set back to normal till after the PDS takes effect.

Code:

if ($unit["is_powered"] == "Y") {
if ($unit["i_shields"] < $unit["i_shields_max"]) {
$overShield = False;
if (isset($ae_shield_regen[($unit["c_sector"])][($userdata[($unit["i_owner"])]["i_faction"])])) { $shield_bonus = $ae_shield_regen[($unit["c_sector"])][($userdata[($unit["i_owner"])]["i_faction"])]; }
else {$shield_bonus = 0;}
$unit["i_shields"] += round($unit["i_shields_max"] * ($unit["i_shields_regen"] + $shield_bonus) * .01);
if ($unit["i_shields"] > $unit["i_shields_max"]) {$unit["i_shields"] = $unit["i_shields_max"];}
} else {$overShield = True;}
}

<<PDS CODE>>

if (($unit["i_shields"] != $unit["i_shields_max"]) AND ($unit["is_powered"] == "Y") AND ($overShield == True)) {
if (isset($ae_shield_regen[($unit["c_sector"])][($userdata[($unit["i_owner"])]["i_faction"])])) { $shield_bonus = $ae_shield_regen[($unit["c_sector"])][($userdata[($unit["i_owner"])]["i_faction"])]; }
else {$shield_bonus = 0;}
$unit["i_shields"] += round($unit["i_shields_max"] * ($unit["i_shields_regen"] + $shield_bonus) * .01);
if ($unit["i_shields"] > $unit["i_shields_max"]) {$unit["i_shields"] = $unit["i_shields_max"];}
}


So it checks to see if shield are lower than max shields if they are do normal regen. If they are above max shields then they are declared $overShield and then their regen code (after they are checked to see if they are still alive) is actually placed after the PDS. Units that have Full Shields will not get a second regen.

I will commit and push a code when I get home.
_________________
The person who will go to great lengths to fight boredom...


Last edited by Vanoi on Tue Mar 12, 2013 8:11 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Slayer_666
Council Member


Joined: 20 Dec 2012
Posts: 226

PostPosted: Fri Mar 08, 2013 2:26 pm    Post subject: Reply with quote

Support.

Slayer
Back to top
View user's profile Send private message
Dark Leth
Council Member


Joined: 05 Jul 2005
Posts: 1498

PostPosted: Fri Mar 08, 2013 11:13 pm    Post subject: Reply with quote

This appears sensible - unless I'm missing something.

Tentative support.
Back to top
View user's profile Send private message
Walterohdim
Site Admin


Joined: 15 Jun 2006
Posts: 1629
Location: Somewhere with lots of doors

PostPosted: Sat Mar 09, 2013 7:25 am    Post subject: Reply with quote

This sounds like a needed order of operations fix.


Yes


Walterohdim
_________________
Wannabee historian of Tinywarz. Through the building of myth we will build community. M. Scott Peck

Back to top
View user's profile Send private message Visit poster's website
krisjaniz
Mentor


Joined: 17 May 2009
Posts: 471

PostPosted: Sat Mar 09, 2013 5:53 pm    Post subject: Reply with quote

This seems like a weird way to go about it, can you explain why it is done like that? Confused here.
_________________
Back to top
View user's profile Send private message
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Sun Mar 10, 2013 9:40 am    Post subject: Reply with quote

This sounds like a confusing one-off:

If an effect boosts Shield Regen, then it should *just* effect shield regeneration, that happens in a certain point in the code. Adding code so it has it provides some other advantage in certain cases (e.g. PDS) doesn't make sense.

If you want a PS+ to assist against point defense, change the PS+ ability from shield regen to a sector-wide Shield Acti for all friendly units. Then process_turn works with what you're trying to do, instead of trying to twist the flow of process_turn into something else.

_f
_________________

Back to top
View user's profile Send private message
Slayer_666
Council Member


Joined: 20 Dec 2012
Posts: 226

PostPosted: Sun Mar 10, 2013 10:04 am    Post subject: Reply with quote

The PS does do that already. The reason this arose is that you overcharge your shields and then either get hit by the PDS or scrapyard melas AOE sector magnetise effect and the extra temporary 50 shields don't tank the damage. It should because the ability says it overcharges BEFORE combat. If the PDS is before combat surely all we need to do is slot the PS before the PDS / EMP scrapyard ability and it would be fine?


Slayer
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Sun Mar 10, 2013 10:44 am    Post subject: Reply with quote

Basicly what's happening is that the shield get boost from the PS+ (straight 50 shield) then the shield regen takes place and reduces it back to whatever it was so you'll never get to block the effects of the PDS.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Sun Mar 10, 2013 1:08 pm    Post subject: Reply with quote

On second look there's no way to approach this without getting into a one-off.

Also, if implemented as described, what about EMP damage? Also, why do only PS+s get this bonus and not units that activate a Shield Acti? This is getting into "this works this way but not for that which is basically the same thing, but only in this case and not some other one"-territory that people hate.

If PDSes are that much of a problem: nerf their damage. This sounds like buffing one unit as a work around to another issue: if PDSes are the issue, take care of them (if PDSes aren't an issue why touch the PS+?) ... this seems very in-direct and hacky.

_f
_________________

Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Sun Mar 10, 2013 1:23 pm    Post subject: Reply with quote

The way I have it coded about it would apply for all acti that overcharge your shields and all AoE damage that happens after regen.

The problem isn't that PDS is too strong or weak, it's that all overcharge shield aren't working to block these AoE (EMP PDS etc.) because they technically happen after the Regen which negates the Overcharged Shields.

Like the SYM it takes deal 75 damage to all enemy units in the sector THIS TURN. Codewise it would happen after shield regen so it look at turn orders it would actually be at the beginning of the next turn. Allowing overcharged shields the ability to counter them seemed like the best scenario.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Sun Mar 10, 2013 5:30 pm    Post subject: Reply with quote

I can understand that but I'm still on the fence about this one ...

Guess I'll see how the voting turns-out, =)
_f
_________________

Back to top
View user's profile Send private message
krisjaniz
Mentor


Joined: 17 May 2009
Posts: 471

PostPosted: Mon Mar 11, 2013 6:04 am    Post subject: Re: #79 - [Tweak] Overcharge Shield versus PDS Effect Reply with quote

Anecdotally the PDS description says "All enemy units in same sector take 75 Damage (unreduceable, unavoidable) per turn" and we are looking for a solution to actually avoiding this damage. Laughing

The suggested solution is just the wrong way to go about it. You move recharge for units with 100% or more shields until after EMP/PDS and the collateral damage of that is that now high recharge units in dictor/pds range are always at 100% shields (if they don't get shot at). So with enough recharge you could sit inside PDS and not care about it at all because PDS and recharge now cancel each other out.

It's just the quirk of the PDS/EMP and where that is located in the turn order that is biting us in the ass again and again. If anything, PDS/EMP should be moved to the more appropriate location after the shield actis, then we would all be able to better make sense of it - that would of course create even more problems with maintaining the unreducable/unavoidable nature of it.

As it is, the change is not doing what it is advertising. It is advertising a fix for the PS+ acti not working for PDS/EMP when in reality it is doing something completely different - and there is no way to actually fix it in that place in code elegantly. I do see one hackish way of doing it - at that place in code we would need to use not only the actual health but also the health modifiers that are in play to actually and specifically be able to account for those when doing PDS/EMP and make sure PDS/EMP damage gets "reduced" by the proper amount.

Sorry Vanoi, the answer here is NAY unless you can prove me wrong (which I could be of course). As always my mind is open and I could easily be persuaded to change my position with actual logical arguments.
_________________
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Mon Mar 11, 2013 7:15 am    Post subject: Reply with quote

Kris, this is not about reducing PDS or boosting PS+... It's about the turn order.

Unit gets Overcharged Shields... this turn. (50)
PDS deals damage... this turn. (-50)
Net change would be 0.

What's currently happening is that you would actually get 50 damage 'cause of the following scenario.

Unit gets Overcharged Shields... this turn. (50)
Unit regen shields limiting it to the max (-50)
PDS deals damage... this turn. (-50)
Net change would be -50 HP.

The PDS clearly indictates that it would take effect each turn, what's happening is that it actually takes effect at the beginning of the next turn.

Note that if you moved PDS into where the Shield Actis are you'd fundamental changed the system as you can no longer jump out of the SYM sector before you take the damage.

PS+ was used as example this applied to all Overcharged Shields and all AoE effects.

PS. The code can be changed to have no regen instead for the overcharged units as the main problem is that it equalizes the shields during the first regen.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
krisjaniz
Mentor


Joined: 17 May 2009
Posts: 471

PostPosted: Mon Mar 11, 2013 7:47 am    Post subject: Reply with quote

Vanoi wrote:
Kris, this is not about reducing PDS or boosting PS+... It's about the turn order.

Unit gets Overcharged Shields... this turn. (50)
PDS deals damage... this turn. (-50)
Net change would be 0.

What's currently happening is that you would actually get 50 damage 'cause of the following scenario.

Unit gets Overcharged Shields... this turn. (50)
Unit regen shields limiting it to the max (-50)
PDS deals damage... this turn. (-50)
Net change would be -50 HP.

The PDS clearly indictates that it would take effect each turn, what's happening is that it actually takes effect at the beginning of the next turn.

Note that if you moved PDS into where the Shield Actis are you'd fundamental changed the system as you can no longer jump out of the SYM sector before you take the damage.

PS+ was used as example this applied to all Overcharged Shields and all AoE effects.

PS. The code can be changed to have no regen instead for the overcharged units as the main problem is that it equalizes the shields during the first regen.


Ok, don't move the PDS/EMP code, move the shield actis to after regen, before PDS/EMP. Either way, the suggested approach is creating a few scenarios where people won't know what the hell is happening because you are not dealing with shield overcharge as such, you are just exchanging one weird scenario for another.
_________________
Back to top
View user's profile Send private message
Vanoi
Site Admin


Joined: 25 Aug 2005
Posts: 1403
Location: Avoiding You (The Void)

PostPosted: Mon Mar 11, 2013 8:02 am    Post subject: Reply with quote

If you move the Shield Acti to where the PDS, then they would no longer effect combat for that turn... instead they would take effect next turn... That beats the point of an acti.

Like I said in my last post as well.... That regen for the second part can be removed... in fact that would probably be the better solution.
_________________
The person who will go to great lengths to fight boredom...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Player Council - Closed Tickets All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group