Ally Resource Bars 1.84 Alpha 3 - Page 2

Ally Resource Bars 1.84 Alpha 3

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.82

Post by Manoa » 08 Dec 2011, 18:32

you mean like this ?
http://manoa.flnet.org:79/spring/183.png
be careful with it as I just took the Chili window example file and copied everything quickly, there may be some fancy new bugs

1.83 Alpha 2: fixed cpu hogging during window movement due to creating additional windows without fully deleting the old ones
Last edited by Manoa on 27 Apr 2013, 10:03, edited 1 time in total.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14601
Joined: 17 Nov 2005, 02:43

Re: Ally Resource Bars 1.83 Alpha 2

Post by Forboding Angel » 08 Dec 2011, 22:12

Wow, that looks awesome! Thanks!
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14601
Joined: 17 Nov 2005, 02:43

Re: Ally Resource Bars 1.83 Alpha 2

Post by Forboding Angel » 09 Dec 2011, 04:14

Code: Select all

[f=0005872] Ally Resource Bars: No allies, unloading
[f=0005872] Error in Shutdown()
[f=0005872] Error in Shutdown(): [string "LuaUI/Widgets/gui_ally_res-1.83a2.lua"]:350: attempt to get length of global 'windows' (a nil value)
[f=0005872] Removed widget: Ally Resource Bars 1.83 Alpha 2
latest version when my last remaining ally died. Also, should be moveable via tweakmode
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.83 alpha 3

Post by Manoa » 09 Dec 2011, 15:23

fixed, but the tweakmode thing I am not familiar with, not sure where to start, it could be a good idea to use it
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Ally Resource Bars 1.83 Alpha 3

Post by CarRepairer » 09 Dec 2011, 15:47

In the chili window add: tweakdraggable=true
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.83 Alpha 3

Post by Manoa » 09 Dec 2011, 16:04

that's.....not going to work, the chili window I create is based on other variables, if the chili window is moved the bars will still be drawn in the location before the window was moved.

unless there is a way to get the new location of the window after it was moved and pass that data to the bars

I'm thinking of adding mod compatibility so that the bars would adjust to the economy, I should find a way to detect the name of the active mod
0 x

User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Ally Resource Bars 1.83 Alpha 3

Post by CarRepairer » 09 Dec 2011, 17:53

Manoa wrote:that's.....not going to work, the chili window I create is based on other variables, if the chili window is moved the bars will still be drawn in the location before the window was moved.

unless there is a way to get the new location of the window after it was moved and pass that data to the bars
There is a way. You can use windowname.x and windowname.y. However we are coming to a fork in the road here...

You'd be adding a bunch of annoying redundant code where instead you can add chili's controls directly into the chili window, like progressbars and labels, instead of drawing them all yourself. This would make the widget only work in mods with chili, so we'd have two separate widgets going.

In fact there's already chili crudeplayerlist in zk which would be a great place to place these bars. For games like forb's evolution and zk that is the direction to take. For non chili, you might as well forget the silliness of moving your bar drawings around with a chili window.
Last edited by CarRepairer on 09 Dec 2011, 22:24, edited 1 time in total.
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.83 Alpha 3

Post by Manoa » 09 Dec 2011, 18:05

thanks, I will try those variables

actually I am not into making the widget only work in mods with chili, I only wanted to add some chili support
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.83 Beta 1

Post by Manoa » 27 Apr 2013, 10:09

first beta version of the 1.83 version, this brings some necessary fixes which I didn't attend for a long time:
  • tool tip mess is now fixed, now you can also choose where the tool tips be drawn
  • player names can also be placed of your choosing, left or right
  • CPU and Ping can now also be displayed
in Beta 2 and newer these updates are also supported in Chili
in Beta 3: fixed bug with first player reporting incorrect CPU %

known bug: may crash the game when using zerver's multithreaded spring with an ATI video card
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.84 Alpha 1

Post by Manoa » 07 May 2013, 14:47

first release of the 1.84 version:
  • display players ping and CPU on the right of the bars
  • convert many pairs/ipairs loops into simpler for loops for performance
caveats:
these changes are not yet supported in Chili mode, but hopefully will be in the future
for the moment Ping and CPU cannot be controlled on which side to be displayed, and it does not support the combinement of player names on right and ping and cpu display
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.84 Alpha 2

Post by Manoa » 08 May 2013, 04:40

second release of 1.84, Alpha 2:
  • fixed bug which crashed the plugin in player mode
  • fixed bug where there is a space between enemy player teams [player mode]
  • fixed missing code for drawing separators between enemy teams
but the caveats are still there xD
0 x

User avatar
Floris
Balanced Annihilation Developer
Posts: 599
Joined: 04 Jan 2011, 20:00

Re: Ally Resource Bars 1.84 Alpha 2

Post by Floris » 01 Dec 2014, 00:56

This widget seems really resource hungry.

At endgame I had 9 fps with it, and 16 fps without.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Ally Resource Bars 1.84 Alpha 2

Post by jK » 01 Dec 2014, 00:59

Floris wrote:This widget seems really resource hungry.

At endgame I had 9 fps with it, and 16 fps without.
FTL chili or not?
0 x

User avatar
Floris
Balanced Annihilation Developer
Posts: 599
Joined: 04 Jan 2011, 20:00

Re: Ally Resource Bars 1.84 Alpha 2

Post by Floris » 01 Dec 2014, 03:18

No chili, it was a BA game.
(but I guess this functionality has to be chilified at some point.)
Just for the record: the plain version included in BA has no performance issues.
0 x

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

Re: Ally Resource Bars 1.84 Alpha 2

Post by Jools » 02 Dec 2014, 11:00

The code in this widget is terrible, so it's hard to maintain. Maybe it would just be easier to redo the whole thing from scratch?
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Re: Ally Resource Bars 1.84 Alpha 2

Post by smoth » 02 Dec 2014, 11:54

if it is terrible code, yeah. It might be bloated etc. Just look for the functional bits to replace and then begin rewriting, if your code still is slow maybe you are using the wrong call?
0 x

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

Re: Ally Resource Bars 1.84 Alpha 2

Post by Jools » 02 Dec 2014, 12:40

I see it's been improved a lot in the latest version, with someone replacing constant teamlist calls with table values. I had some old version.

But it still uses global mouse coordinate variables instead of using IsAbove() callin. And it adjusts the height back and forth instead of putting the values in a table. Things like that are not good code in my opinion.

But those things are not likely to make is hungry.
0 x

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

Re: Ally Resource Bars 1.84 Alpha 2

Post by Jools » 03 Dec 2014, 13:45

How did you profile this widget?

I tested with two pfofiler widgets and they yield different results: There is one profiler that shows all callins, and there is one that shows just the most expensive one (same as gadget profiler).


name = "Profiler",
desc = "Shows the duration of widget callins",
author = "MelTraX",
date = "2007-10-09"

name = "WidgetProfiler",
desc = "",
author = "jK",
version = "2.0",
date = "2007,2008,2009"

For me the profiler that is named just 'Profiler' shows this widget as much more hungry than the other one.
0 x

Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Ally Resource Bars 1.84 Alpha 2

Post by Manoa » 05 Nov 2015, 13:33

Im sorry, but afther testing the plugin (1.84 A2) I couldn't find the performance leak you describe, even with everything turned on in the options the plugin uses only 175 micro in meltrax profiler (less than 20 micro with everything turned off), and it has no effect at all on the FPS, if this performance leak still exist in this version please say the conditions in which this hapens.

and don't forget that the original purpose of this plugin was to optimize the original BA version, my version should perform significantly faster than the original BA version

I couldn't find where to download the other profiler which shows my plugin as using more resource, I will keep looking
0 x

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

Re: Ally Resource Bars 1.84 Alpha 2

Post by Jools » 06 Nov 2015, 03:59

Here is a link to jk:s profiler, in BA:s repo: http://imolarpg.dyndns.org/trac/balates ... ofiler.lua

It uses a lot of fps in the GameFrame callin when nothing special happens, as you can see from this screenshot:

Image
0 x

Post Reply

Return to “Lua Scripts”