PSOBB Addon Plugin (Lua UI addons)

Is it possible to get the shape primitives for imgui implemented and accessible via lua in the addon base (aka dinput8.xxx)? Using the currently available-to-lua imgui method imgui.BeginChild("NAME",boxSizeX,boxSizey,drawBorder==true)) I get fairly large frame drops after drawing more than ~20 rectangles. More than ~2-3 fps drop from 30 and the game feels like playing without an h/battle or v101.

without drawing:
View attachment 23303
vs.
View attachment 23304

Even running all the item filtering,sorting, x/y position calculations, ect, ect the biggest frame drop is on "render".

I would like to be able to more efficiently draw shapes such as a square around item drops or enemies for an addon I'm working on that can be found here:

Check out this github link for an example of the relevant methods in imgui, which I'm hoping may solve my fps issue:
Started adding this to my local copy of my fork. I'll do some light sanity testing and push them to github in a day or two when I have time to test some more. Plain AddRect() is in the top right window (realized it's hard to see because I was making things blue after I finished checking the window).

1731891475993.png
Basically they need a window to render to, so you could create one imgui window that covers the entire screen, make it transparent, NoInputs, etc like you're already doing, and then render all of the primitives directly to it.

Would you be willing to quickly test if they fix the performance issue once I push the changes? You'll need to build the plugin from source. If they work fine, I can ask Soly to do a new release with these changes (this would also include my 2022 fix for 'white addons' at main menu and disappearing ingame in dark rooms).

There is a "require_version" function in the plugin's pso table. You can check if pso.require_version is nil or if pso.require_version(<whatever the next version is>) returns false to know if someone needs to update their addon plugin, in case you want to support the old way or tell people to upgrade.
 
Last edited:
Started adding this to my local copy of my fork. I'll do some light sanity testing and push them to github in a day or two when I have time to test some more. Plain AddRect() is in the top right window (realized it's hard to see because I was making things blue after I finished checking the window).

View attachment 23369
Basically they need a window to render to, so you could create one imgui window that covers the entire screen, make it transparent, NoInputs, etc like you're already doing, and then render all of the primitives directly to it.

Would you be willing to quickly test if they fix the performance issue once I push the changes? You'll need to build the plugin from source. If they work fine, I can ask Soly to do a new release with these changes (this would also include my 2022 fix for 'white addons' at main menu and disappearing ingame in dark rooms).

There is a "require_version" function in the plugin's pso table. You can check if pso.require_version is nil or if pso.require_version(<whatever the next version is>) returns false to know if someone needs to update their addon plugin, in case you want to support the old way or tell people to upgrade.
absolutely, I can test it. Just ensure the build instructions are half decent if its anything more fragile than make build I can even look into using github actions to build for free on push or release tag. Also, as a feature request, would you include loading a texture/image? the addons could really benefit from loading little icons for sectionid, resta, s/d j/z, ect,ect. Its something I know the og imgui can do.
 
absolutely, I can test it. Just ensure the build instructions are half decent if its anything more fragile than make build I can even look into using github actions to build for free on push or release tag. Also, as a feature request, would you include loading a texture/image? the addons could really benefit from loading little icons for sectionid, resta, s/d j/z, ect,ect. Its something I know the og imgui can do.
My fork of the base plugin is here. It's only a few commits ahead of Soly's repo so checking out what changed should be pretty straightforward.

It should 'just work' if you try to build it via Visual Studio 2022. Just open the solution file and select Build>Build Solution. Make sure you compile Release because Debug build of ImGui code is pretty slow.

My example addon is here:

Regarding the image stuff, my knowledge of D3D8 is pretty bad and I don't think I have or want to spend the time to figure that out now. It seems like there's already an export in the Lua imgui table for AddImage, so presumably adding a way to load an image into a texture and give a unique ID back to Lua would suffice? Although I'm not sure if the plugin's implementation of RenderDrawLists() can handle it.

The addon plugin was originally created by HybridEidolon back in 2016. Soly and I are maintainers of a fork because we each made our own forks in 2018 and then fixed a bunch of issues in 2020. But yeah, there's a bunch of stuff that I don't really know in it because I didn't develop it /shrug
 
1731987614582.png

My fork of the base plugin is here. It's only a few commits ahead of Soly's repo so checking out what changed should be pretty straightforward.

It should 'just work' if you try to build it via Visual Studio 2022. Just open the solution file and select Build>Build Solution. Make sure you compile Release because Debug build of ImGui code is pretty slow.

My example addon is here:

Regarding the image stuff, my knowledge of D3D8 is pretty bad and I don't think I have or want to spend the time to figure that out now. It seems like there's already an export in the Lua imgui table for AddImage, so presumably adding a way to load an image into a texture and give a unique ID back to Lua would suffice? Although I'm not sure if the plugin's implementation of RenderDrawLists() can handle it.

The addon plugin was originally created by HybridEidolon back in 2016. Soly and I are maintainers of a fork because we each made our own forks in 2018 and then fixed a bunch of issues in 2020. But yeah, there's a bunch of stuff that I don't really know in it because I didn't develop it /shrug

Looks like it works
 
But does it fix the performance problems? I assume it does so maybe I'll just ask Soly to do a release anyway.
I haven't rewritten the dropbox tracker addon to make shape primitive calls, so when I do will post here, but adding those methods for use in lua can't hurt anything :cool:
 
On the Global Flags Reader. I only have very few where you can check and see if you got the item/weapon on that character. I made a list where you only get the item once per character. I made * meaning its already on the Global Flag Reader.

Cell of Mag 502 (AOL CUP -Sunset Base-)*
God Hand/Suppressed Gun/Technical Crozier (Soul of a Blacksmith)
Soul Eater/Ragol Ring (Series of Solo Quest)
Orotiagito (Seek my Master)
Anti-Dark Ring (Tyrell's Ego)
Black Ring (Towards the Future)
Purple Ring (Towards the Future)
White Ring (Labrynthine Trial)

Blue Ring (Beach Laughter)
Green Ring (Respective Tomorrow)
Samurai Armor (To The Deepest Blue -MA4 Venue-)*
Friend Ring (To The Deepest Blue -MA4 Venue-)*
Photon Crystal (To The Deepest Blue -MA4 Venue-)*
Girasole (To The Deepest Blue -MA4 Venue-)*
Black Gear (Singing by the Beach)

Two Kamui (Clairs Deal 5)
Racket (New Mop-Up Operation 1)
Tree Clippers (New Mop-Up Operation 2)
Synthesizer (New Mop-Up Operation 3)
Shichishito (New Mop-Up Operation 4)
Dirty Lifejacket (New Mop-Up Operation 5)

I dont know if the Global Flag is updated and I simply couldn't find it

(I may be missing a few things on the list)
 
Last edited:
Back
Top