simple starcraft-esque shields
Moderator: Moderators
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
simple starcraft-esque shields
option for Starcraft style shields- in effect, simply a second healthbar that absorbs damage first with none of the fx or physics our current sheilds have.
some simple options like once down, shield dosnt recover until x seconds would be helpful too. since it would just call a diffrent coloured healthbar above the first healthbar, it would be very easy to add to units.
could use a modified x-ray widget to show shield fx when up modside.
this would be seriously useful for EE, IW and any other mod that wants working personal shields.
some simple options like once down, shield dosnt recover until x seconds would be helpful too. since it would just call a diffrent coloured healthbar above the first healthbar, it would be very easy to add to units.
could use a modified x-ray widget to show shield fx when up modside.
this would be seriously useful for EE, IW and any other mod that wants working personal shields.
Last edited by 1v0ry_k1ng on 02 Dec 2009, 16:00, edited 1 time in total.
Re: Better shields
Trivial to Lua... Projectile intercepting shields aren't but personal shields that just absorb X damage before the HP take a dent is Lua territory.
There's a slight variation on shields in Micro Modules (the health bar must be emptied multiple times to kill a unit) that could work as a base.
There's a slight variation on shields in Micro Modules (the health bar must be emptied multiple times to kill a unit) that could work as a base.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: simple starcraft-esque shields
Ok, renamed topic. suggesting it as an engine addition because it is an addition that would be useful in a broad variety of mods, requires little in the way of graphics and makes it accessable to developers lacking LUA prowess (a fair proportion).
the problem with the current shields is that if the shield is small enough that it 100% only protects the unit possessing the shield- and not units even directly adjacent to the unit, especially ones with much smaller footprints, ie, infantry around a shielded tank- the shield does not stop projectiles in time and the unit takes damage. if the shield was literally just a second healthbar and the fx were mod-side or from a dummy regular spring sheild, none of the above difficulties would be an issue.
the problem with the current shields is that if the shield is small enough that it 100% only protects the unit possessing the shield- and not units even directly adjacent to the unit, especially ones with much smaller footprints, ie, infantry around a shielded tank- the shield does not stop projectiles in time and the unit takes damage. if the shield was literally just a second healthbar and the fx were mod-side or from a dummy regular spring sheild, none of the above difficulties would be an issue.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: simple starcraft-esque shields
You make a good point, but as KDR explained, this is super duper trivial to make in LuaRules. A gadget can be easily used in the broad variety of mods you refer to. Engine feature requests should be restricted to things that cannot or should not be done modside.1v0ry_k1ng wrote:Ok, renamed topic. suggesting it as an engine addition because it is an addition that would be useful in a broad variety of mods, requires little in the way of graphics and makes it accessable to developers lacking LUA prowess (a fair proportion).
the problem with the current shields is that if the shield is small enough that it 100% only protects the unit possessing the shield- and not units even directly adjacent to the unit, especially ones with much smaller footprints, ie, infantry around a shielded tank- the shield does not stop projectiles in time and the unit takes damage. if the shield was literally just a second healthbar and the fx were mod-side or from a dummy regular spring sheild, none of the above difficulties would be an issue.
Re: simple starcraft-esque shields
Additionally a mod will likely do some uncommon things with the shield, have it be more than just a second HP bar with a different regeneration rate. Stuff like making shield-piercing weapons or weapons that do more/less damage against shields, systems that increase the shield recharge speed or disable the shield for a few seconds, etc. An engine-side feature can only be influenced by whatever call-outs the designer thought of and will likely have some assumptions built in that will be wrong in some cases. A Lua shield could be changed whenever anything isn't right. You can make it select only against certain weapons, behave differently at different attack ranges, take more or less damage depending on various factors, let a percentage of the damage bleed through and many things we can't even think of right now.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: simple starcraft-esque shields
how trivial exactly? bearing in mind you gents are the cutting edge of lua, consider the less capablethis is super duper trivial to make in LuaRules

- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: simple starcraft-esque shields
So much so in fact that I think I'll make it myself. I want a unit in my new game to have a personal shield but the unit itself would have a very low Max HP. After hearing you speak of the problems of using a small shield that could pose a large problem to this design. Thanks for bringing it up.1v0ry_k1ng wrote:how trivial exactly? bearing in mind you gents are the cutting edge of lua, consider the less capablethis is super duper trivial to make in LuaRules
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: simple starcraft-esque shields
post the code 

Re: simple starcraft-esque shields
its a race
Update: My code is bugged.
Update: My code is bugged.

Re: simple starcraft-esque shields
Just store a shield strength for every unit, in UnitDamaged add the amount of damage the unit took (or the remaining shield strength) to its current HP if the shot is blocked and subtract it from the shield strength, use whatever recharge logic you want and add an indicator for the units.
Re: simple starcraft-esque shields
where would i put the recharge code?
Is there a callin function something like widget:Update() that gets called every "gametick"?
cant find it in the wiki
Is there a callin function something like widget:Update() that gets called every "gametick"?
cant find it in the wiki
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: simple starcraft-esque shields
an option to add a delay before the shield comes back online when reduced to 0 would be a good addition
Last edited by 1v0ry_k1ng on 03 Dec 2009, 17:26, edited 1 time in total.
Re: simple starcraft-esque shields
GameFrame
My suggestion for finding something like that is skimming through some luas with behaviour you think works the same way, or possibly reading through the callin list.
My suggestion for finding something like that is skimming through some luas with behaviour you think works the same way, or possibly reading through the callin list.
Re: simple starcraft-esque shields
thanks.
its actually listed on http://springrts.com/wiki/LuaCallinReturn
but this page is not found when searching for "callin" (wtf) so i didnt see it.
its actually listed on http://springrts.com/wiki/LuaCallinReturn
but this page is not found when searching for "callin" (wtf) so i didnt see it.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
Re: simple starcraft-esque shields
the lack of LUA shield code in this thread suggests this would make a great engine feature
Re: simple starcraft-esque shields
The lack of engine code in this thread suggests this would make an excellent gadget.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: simple starcraft-esque shields
It really is ridiculously easy to implement with a gadget.
Re: simple starcraft-esque shields
...you're too lazy to look up gadget:UnitPreDamaged, handle the shield behavior there, pass any resulting change in the shield's "energy state" to unsync, and write a simple piece of OpenGL.
It really is a trivial thing to do. I may get to it before I release P.U.R.E. 1.3, I was thinking about personal shields for the Wolfen, IDK yet.
It really is a trivial thing to do. I may get to it before I release P.U.R.E. 1.3, I was thinking about personal shields for the Wolfen, IDK yet.