Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Multiple In-Game overlays #60

Open
C0D3-M4513R opened this issue Mar 22, 2021 · 4 comments
Open

[Feature] Multiple In-Game overlays #60

C0D3-M4513R opened this issue Mar 22, 2021 · 4 comments

Comments

@C0D3-M4513R
Copy link
Contributor

Idea

Add support to add multiple In-Game overlays.
This could be beneficial, to have a regular pp counter, like you normally would, and have a few, select statistics displayed, via simple Name: Value formatting.
eg. UR on the top right of osu! and Simplistic on the topp left.

Config

In the config, you could allow to have multiple sections of [GameOverlay] in the (regex) format of [GameOverlay[[:digit:]]*?]. Then only the part, that actually reads the config needs to change, as now there are just 2 Counter Objects instead of one (if that is, how the programm is structured).

@C0D3-M4513R
Copy link
Contributor Author

C0D3-M4513R commented Mar 22, 2021

Ok, so I had a quick look at https://www.github.com/l3lackShark/config. I found, that the way, that I laid out here will not work. Instead I propose, to just add a Number, after each overlay* property, like follows:

overlayURL0 = http://localhost:24050/Simplistic
overlayWidth0 = 650
overlayHeight0 = 150
overlayOffsetX0 =0
overlayOffsetY0 =5
overlayScale0 =10

Of course, this requires, that there is a overlay entry, from 0-n, because otherwise it will end up getting messy.
Everything would be easier, if the config was in json/xml/yml. Then we could just have this be an Array.

Or how about overlay[n].{URL,Width,Height,OffsetX,OffsetY,Scale} (Also possibly keep #62 in mind?)
This would require more logic on [ and . , or one could just implement a comment, via any char combo (# and ; come to mind) and prefix the [Header] Sections with comments.

@l3lackShark
Copy link
Owner

This will require a lot of changes on the c++ side of things. I'm not even sure if it's a good idea to have two instances of the browser (possible huge performance drop). Will check if it's reliable at some point.

@C0D3-M4513R
Copy link
Contributor Author

C0D3-M4513R commented Mar 23, 2021

I am talking about potentially a lot more instances, than two. I mean, like a scaleable solution.

  • Why is it so expensive to run a browser?
  • Is it the way, that javascript get's the updates?
  • Is it, that there is just too much data flowing from gosumemory to the browser via websockets?
  1. Maybe one could just send changes, after an initial sync, with a new ws client? Like an initial "Hello, I'm a new client!", with a full response. Is there a better way to implement real time sync? What is expensive about the browser? or is it just the way, that the browser works?
  2. Or maybe we could Repeated code static#21 simplify the individual modules to a point, where all one has to do is add one line of js code, to add a overlay? Something like:
var socket = undefined;
var modulesJsCallbacks = [];
function getdatastuff(callback){
    if (socket) socket=initws()
    switch(wseventtype){
        case "resize":
            handleRezise()
            break
        case "move":
           handleMove()
           break;
        case "partialTransfer":
           handlePartialTransfer(callback)
           break;
        case "fullTransfer":
           handleFullTransfer(callback)
           break;
        case "addModule":
           handleLoadModule()
           break;
        case "rmModule":
           handleUnloadModule()
           break;
    }
}
getdatastuff((data)=>{
    modulesJsCallbacks.forEach((i)=>i(data))
}

Then one could containerize (div elements?) the individual counters. The individual counters could still be moved via CSS, but the positioning will have to happen as a websocket event. The Module offset could still be stored via the config, but the first thing, that would have to happen is a move and resize event for all loaded modules.
The div's for the individual modules would then be identified, by an identifier. For starters we could either use the Module name, which would restrict the possible modules to one per module, or we could use a numeric id.
The upsides would be a solution, which could accomidate all Modules in a single browser instance.

@l3lackShark
Copy link
Owner

l3lackShark commented Mar 29, 2021

  • Why is it so expensive to run a browser?

The biggest issue is the legacy opengl calls we use to draw the overlay. The more pixels you have to push the worsen it becomes. This is probably fine with a couple of small overlays, but then again, c++ side of things also need a huge change to add support for that. The ideal solution would be switching to PBOs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants