Page 1 of 2
simple starcraft-esque shields
Posted: 02 Dec 2009, 14:11
by 1v0ry_k1ng
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.
Re: Better shields
Posted: 02 Dec 2009, 14:54
by hoijui
*obsolete*
Re: Better shields
Posted: 02 Dec 2009, 15:54
by KDR_11k
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.
Re: simple starcraft-esque shields
Posted: 02 Dec 2009, 16:06
by 1v0ry_k1ng
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
Posted: 02 Dec 2009, 16:58
by CarRepairer
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.
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.
Re: simple starcraft-esque shields
Posted: 02 Dec 2009, 17:13
by KDR_11k
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.
Re: simple starcraft-esque shields
Posted: 02 Dec 2009, 19:04
by 1v0ry_k1ng
this is super duper trivial to make in LuaRules
how trivial exactly? bearing in mind you gents are the cutting edge of lua, consider the less capable

Re: simple starcraft-esque shields
Posted: 02 Dec 2009, 19:23
by CarRepairer
1v0ry_k1ng wrote:this is super duper trivial to make in LuaRules
how trivial exactly? bearing in mind you gents are the cutting edge of lua, consider the less capable

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.
Re: simple starcraft-esque shields
Posted: 02 Dec 2009, 20:45
by 1v0ry_k1ng
post the code

Re: simple starcraft-esque shields
Posted: 03 Dec 2009, 03:06
by Tribulex
its a race
Update: My code is bugged.

Re: simple starcraft-esque shields
Posted: 03 Dec 2009, 13:39
by KDR_11k
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
Posted: 03 Dec 2009, 14:40
by knorke
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
Re: simple starcraft-esque shields
Posted: 03 Dec 2009, 17:04
by 1v0ry_k1ng
an option to add a delay before the shield comes back online when reduced to 0 would be a good addition
Re: simple starcraft-esque shields
Posted: 03 Dec 2009, 17:24
by lurker
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.
Re: simple starcraft-esque shields
Posted: 04 Dec 2009, 00:32
by knorke
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.
Re: simple starcraft-esque shields
Posted: 09 Dec 2009, 01:11
by 1v0ry_k1ng
the lack of LUA shield code in this thread suggests this would make a great engine feature
Re: simple starcraft-esque shields
Posted: 09 Dec 2009, 01:13
by Neddie
The lack of engine code in this thread suggests this would make an excellent gadget.
Re: simple starcraft-esque shields
Posted: 09 Dec 2009, 05:38
by Google_Frog
It really is ridiculously easy to implement with a gadget.
Re: simple starcraft-esque shields
Posted: 10 Dec 2009, 20:05
by 1v0ry_k1ng
and yet..
Re: simple starcraft-esque shields
Posted: 11 Dec 2009, 00:03
by Argh
...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.