Ally Resource Bars 1.84 Alpha 3 - Page 3

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.84 Alpha 2

Post by Manoa » 08 Nov 2015, 03:59

that's weird, for me it shows DrawScreen and less than 1%

the only function that gets executed constantly from gameframe is updatebars()
that function is the most heavily optimized in the entire code, I cannot see how that function could be the source of the performance leak

here is a test version, try it and tell me if you see any improvement, it contains a micro optimization where it saves 2 arithmetic operations by reusing a computation (it's replacing 4 arithmetic operations with 1 assignment and 1 arithmetic) (Alpha 3)
Attachments
gui_ally_res-1.84a3.lua
Ally Resource Bars 1.84 Alpha 3
(72.11 KiB) Downloaded 5 times
0 x

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

Re: Ally Resource Bars 1.84 Alpha 3

Post by Jools » 08 Nov 2015, 14:36

I think what I did was split the updating into two: update bars and update statistics. Because you don't really need to update both of these 30 times each second, right? And then it's possible to do the drawing with displaylists, but sometimes these do not make it actually better. I think it depends on the user's GPU.

Why don't you put the code in github and we can work on it together?
0 x

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

Re: Ally Resource Bars 1.84 Alpha 3

Post by Manoa » 08 Nov 2015, 15:13

yhe, good idee, my email is dead I can't recover my github for now

updateStatics() doesn't run every frame, only when necessary, it's not there the problem
0 x

Post Reply

Return to “Lua Scripts”

cron