Better warning system

Better warning system

Requests for features in the spring code.

Moderator: Moderators

User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Better warning system

Post by Jools »

Is the warning when unit is attacked handled engineside or modside?

It is a bit annoying: when for example one scout is attacking your windmills or tidals outside your screen, the warning will repeat for a long time. It would be nice if the system could be made 'adaptive' so that it doesn't repeat stupid warnigns like that. Maybe only alert once per unit type in vicinity.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Better warning system

Post by knorke »

"%s is being attacked" in Sim\Units\Unit.cpp
so it is engine side.

if/which warning is given is decided on when last warning was given and if the event was in view of the player and if unit was a commander.

imo could be something game side...

/edit
seems my local copy was old.
It is no longer in engine? At least not in DoDamage function and searching for "being attacked" does not find results.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Better warning system

Post by Jools »

knorke wrote: if/which warning is given is decided on when last warning was given and if the event was in view of the player and if unit was a commander.
Vous êtez content avec ca? (Are we happy with this?)

I would say no, it needs to be better than that. Maybe one warning per type of unit per 5 mins or something, even that would be much better.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Better warning system

Post by smoth »

move it to a gadget and get it out of spring.

any reason this alert has to be part of the engine?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Better warning system

Post by Jools »

Well, one reason is that the engine handles unit motion so why not handle also warning.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Better warning system

Post by zwzsg »

I know there are movewarnings and buildwarnings settings, so I tried to put AttackWarnings=0 in my springsettings.cfg but it appeared to be without effect.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Better warning system

Post by smoth »

The unit under attack is much easier to luaify that the entire unit behavior code.. That is why I suggested it, i didn't think about that annoy unit is stuck spam :(.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Better warning system

Post by Jools »

Werll, i don't really care where it is handled, I just thought it easier to correct it once in the engine than many times for each mod.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Better warning system

Post by knorke »

Jools wrote:Werll, i don't really care where it is handled, I just thought it easier to correct it once in the engine than many times for each mod.
if it is modside, eventually somebody will make a wudget and everybody else can c&p it, like healthbars etc.
And if a game needs something special it is easier to adjust.
(doesnt zeroK already have attack-warning/voices widget)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Better warning system

Post by smoth »

Honestly dunno knorke.

Mostly it is like the scoring stuff on a long list of shit I plan on replacing.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Better warning system

Post by hoijui »

i though, Lua-ifying an engine C++ thing generally means, you remove it in the engine C++ code, rewrite it as lua, and ship that lua with the engine (with the option for games to override it). if nobody objects, which would probably be the case here, then the default behavior can be changed in the engine supplied Lua already.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Better warning system

Post by smoth »

I don't object but who would code it?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Better warning system

Post by AF »

Is this not a blatantly trivial thing to do? The only C++ knowledge necessary being the delete key on a keyboard, and a 3 line lua widget/gadget, ( one line to print to console, 2 for the function handling the unitdamaged )
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Better warning system

Post by knorke »

this is the commit where the warning got removed:
https://github.com/spring/spring/commit ... 58f02b0ecf
That also shows the excact formula used, if somebody wants to replicate it with Lua.
Quick, somebody do it! (i wont) It is easy and might be included in the engine with means epic epenoid++
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Better warning system

Post by CarRepairer »

I object to any more widgets being included with the engine and the existing ones should be removed. AIs too.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Better warning system

Post by smoth »

CarRepairer wrote:I object to any more widgets being included with the engine and the existing ones should be removed. AIs too.
But I said gadget.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Better warning system

Post by knorke »

widgets are already moved to some examples folder:
http://springrts.com/mantis/view.php?id=2537
but yes, dont want more default widgets/gadgets in engine.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Better warning system

Post by smoth »

I think saying that is bad.

Gadgets may be needed to extend functionality or supplant engine functionality.

By taking a hard stance that you want 0 new widgets and gadgets you create a situation where games become mor and more divergent.

You create a situation where engine devs may begin to freely strip out features offering no replacement.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Better warning system

Post by AF »

"Want 0 widgets" is not the same as "there will be 0 widgets". The engine should only contain the common denominating features needed for every game, and those that are only possible in the engine or better served being placed in the engine. Ofcourse this happens when there is demand for control by someone or a development need, rather than just for the sake of it.

For example I would be fine with nanospray being separated out, so long as a lua alternative was offered for those still wanting it.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Better warning system

Post by Jools »

I think OTA has a logic where only the first unit of similar type trigers a warning when attacked, so if you send 15 stumpies or build 150 windmills, you only get the warning once when they are under attack.

My experience is that people just press F5 when this happens in spring, and that's not good. But I also think that there will be some variation among people's preferences, so maybe this should be an UI option.

It's interesting to see how the discussion centers on the coding of this function instead of the user experience. You are such nerds. This is why Nokia went badly and Apple went well. It's always about people!
Post Reply

Return to “Feature Requests”