Shield magic...

Shield magic...

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
Orakio
Posts: 119
Joined: 25 Aug 2006, 16:41

Shield magic...

Post by Orakio »

Recently, I some how got to talking about personal shields.

In FF I would really like to see more use of shields, generally around ships which is something I was working on a while ago, heard about mad ff and decided to stop and see where that went. Recently talking about mad FF I gather they want ships to have personal shields.

I think a simple way to do this might be to make the object s3o, copy the main body parts of the ship, keep their position but make them larger, simply, smooth and make holes, apply a texture to them that is semi transparent (if spring supports alpha channel textures). PErhaps with cob or lua you can do make object invisible/visible or whatever and have some kind of on hit event. This might be successful to a degree but is a huge kludge.

Anyway, I've noticed that the shields when used on a flying unit appear to work fine and are spherical not semi. I'm confused as to the lack of mobile shields in TAspring as they appear to work ok.

So for personal shields is there a way to make shields eliptical. Ideally with an x, y and z radius which would rotate with the unit. Primarily to fit the unit well.

Also can shields defend against area damage? Or something like a nuke?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Shield magic...

Post by Peet »

Orakio wrote: I'm confused as to the lack of mobile shields in TAspring as they appear to work ok.
You're playing the wrong mods.

Shields shaped like the unit would be most feasible with lua rendering, triggered through luacob by hitbyweapon(), which would also handle the damage control.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Re: Shield magic...

Post by Saktoth »

CA has mobile shields.

Spring does not support alpha channels and such shields as you describe them would be purely visual.

Ive toyed with the idea of a mod that puts shields on almost everything, relying on a energy income for both weapons and shields. I was stopped by certain bugs with shields though (notably, not being able to displace their location properly).
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Shield magic...

Post by zwzsg »

Spring does not support alpha channels
What about:
from changelog.txt
- Introduces the COB get/set variable 103, ALPHA_THRESHOLD. It ranges from 0-255 and changes the glAlphaFunc to use that alpha value as its minimum.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Re: Shield magic...

Post by Snipawolf »

That is a very gritty effect.

Imagine me ripping a model and its faces into tiny shreds. Now, imagine a few shreds showing per percent higher that it goes.

Nothing like actual transparency.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Shield magic...

Post by rattle »

ALPHA_THRESHOLD is for alpha test. ALPHA_THRESHOLD = 23 means that everything with an alpha value <= 23 will be invisible.

Bilinear filtering causes a lot of bleeding here too by the way, i.e. your "holes" may grow the higher ALPHA_THRESHOLD is set.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Shield magic...

Post by KDR_11k »

Small shields don't work too well because of Spring's collision code. For personal shields you should use HitByWeaponId and a custom effect, i.e. just reduce the damage the unit takes while the shield is active. How you render that effect is up to you.
Orakio
Posts: 119
Joined: 25 Aug 2006, 16:41

Re: Shield magic...

Post by Orakio »

So sounds to me mostly pointless, better to have a unit that shrouds near by units?

Using hitbyweapon also sounds like a kludge. With that, might as well just increase the hp or use armour instead.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Shield magic...

Post by KDR_11k »

Well, yeah, personal shields are nothing else but HP. The difference is usually that shields have different damage properties (e.g. shoot a Dune shield with a laser...) and recharge behaviour.
User avatar
kiki
Posts: 859
Joined: 05 Nov 2007, 03:06

Re: Shield magic...

Post by kiki »

ca has mobile shields? It has been too long since I played ca i guess
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Shield magic...

Post by Pressure Line »

KDR_11k wrote:e.g. shoot a Dune shield with a laser...
i love pseudo-thermonuclear explosions
User avatar
Tired
Posts: 302
Joined: 14 Nov 2005, 07:19

Re: Shield magic...

Post by Tired »

Talon race by TRO has tanks with personal shields that're purely cob. Seem to work pretty well in Spring.
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Re: Shield magic...

Post by Fanger »

Other issues with shields are the manner in which they function, which is currently constant charge.. you cant make a shield that easily does a start at full, gets taken down, stays down for X time then either comes back at Full, or charges from X number... all you can do is X max shield HP and recharge rate and then the shield is always charging.. I find the lack of shield charging options annoying..
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Shield magic...

Post by Pxtl »

Fanger wrote:Other issues with shields are the manner in which they function, which is currently constant charge.. you cant make a shield that easily does a start at full, gets taken down, stays down for X time then either comes back at Full, or charges from X number... all you can do is X max shield HP and recharge rate and then the shield is always charging.. I find the lack of shield charging options annoying..
If the shield is always charging, then how can it ever truly be "down"? I mean, when the shield hits zero, wouldn't it charge back to some infinitesimal amount that is still enough to block the first shot that hits it that frame? I've never actually overwhelmed a shield - usually just taken out the generator or hit somewhere else or something.
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Re: Shield magic...

Post by Fanger »

Thats what im saying Pxtl.. I want a shield that does this:

Starts at X number and takes hits until reduced to 0

Goes down for Y amount of time (during which it blocks nothing and is at 0 permanently)

Comes back online at either X number or 10-15-30% of X and charges to max..

We cant do that, because shields are ALWAYS charging so we get either starts at X number or charges to X number, and consistantly trys to get to that number no matter what.. hence Not ever going "down"

This is why I dont use shields because I cannot make them behave the way I want..
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Shield magic...

Post by KDR_11k »

Pxtl wrote:
Fanger wrote:Other issues with shields are the manner in which they function, which is currently constant charge.. you cant make a shield that easily does a start at full, gets taken down, stays down for X time then either comes back at Full, or charges from X number... all you can do is X max shield HP and recharge rate and then the shield is always charging.. I find the lack of shield charging options annoying..
If the shield is always charging, then how can it ever truly be "down"? I mean, when the shield hits zero, wouldn't it charge back to some infinitesimal amount that is still enough to block the first shot that hits it that frame? I've never actually overwhelmed a shield - usually just taken out the generator or hit somewhere else or something.
A shot can't be blocked with just any charge, a hard shield needs a charge equal or greater than the shot's default damage.

EDIT: Added shieldRechargeDelay tag in SVN, the shield won't charge for this long after it has been hit. Applies to any hit, not just shots that leave the shield drained.
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Re: Shield magic...

Post by Fanger »

so any hit delays the recharge, or just once it hits 0..?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Shield magic...

Post by KDR_11k »

Any hit, shields never hit 0 (they can't block shots with damage > their power). I expect it to primarily get used to prevent shield charging from acting as additional hitpoints.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Shield magic...

Post by Pxtl »

Ahhh. I see it now.

Think money, with a constant inflow. You can't buy what you can't afford, you don't pay for what you don't buy. The shield absorbs every hit that is below its level (which, in turn, reduce its level equal to damage) and ignores every projectile that is above its level. The recharge is constant and ceaseless - because the shots stronger than the shield are ignored, it will build up enough energy to stop a hit - after which the hit will knock it back below threshold. So "shield-stalling" means that the shield will only stop one in N shots, where N is the number of impacts that occur in the time it takes to regenerate the shield to a level that is equal to the damage dealt by the projectile.

This also has some other nice ramifications - a shield that is stalling against low-strength levels will be utterly ineffective against high-strength attacks, but not vice-versa. For example, consider nukes. Lets say our shield could withstand a single nuke-hit - you hit it. A second nuke would pass through the shield, but a smaller artillery shell will still get stopped.

If a shield has a max level that is below the strength of a given weapon, it will _never_ stop the weapon.

That system is actually really clever. Still, it would be nice if it was more customizable (like being able to use the system Fanger describes).

You'd probably need some "shield threshold multiplier" to disable the weapon ignoring functionality of the shield and allowing the shield to hit "zero" and thus be Fanger-Disabled.
Post Reply

Return to “Game Development”