mynarco
mynarco
CC#
Created by mynarco on 7/27/2024 in #help
Optimize Search Algorithm to find Most dense part in rhythm game map.
Hello, so i am struggling with a logic problem, i am writing a 3d rhythm game where notes approach at you(a rewrite for this game https://www.youtube.com/watch?v=t40kkLAAvtk) I need to be able to calculate the MAX amount of notes that will be rendered at a time so i can just create a statically sized array for instances to render to optimize now the 2 things i am working with are an approach time, hitwindow, and each notes time to get the max lifetime of a note i just need to add approach time to hitwindow so now i have a notes lifetime and each notes specific time into the song so i have written out a solution, now i need to optimize it, there is absolutely NO room for error as this is determining the amount of memory to allocate for notes
public int CalculateMaxInstanceCount() {
float lifetime = Global.Settings.Note.ApproachTime + NoteObject.HitWindow;
int max = 0;
for(int i = 0; i < OrderedNotes.Length; i++) {
int count = 0;
for(int j = i; j < OrderedNotes.Length; j++) {
if(OrderedNotes[j].Time > OrderedNotes[i].Time + lifetime) break;
count++;
}
if(count > max) max = count;
}
return max;
}
public int CalculateMaxInstanceCount() {
float lifetime = Global.Settings.Note.ApproachTime + NoteObject.HitWindow;
int max = 0;
for(int i = 0; i < OrderedNotes.Length; i++) {
int count = 0;
for(int j = i; j < OrderedNotes.Length; j++) {
if(OrderedNotes[j].Time > OrderedNotes[i].Time + lifetime) break;
count++;
}
if(count > max) max = count;
}
return max;
}
4 replies
CC#
Created by mynarco on 7/26/2024 in #help
Raw mouse input from a win32 hwnd.
Hello, i am writing a game with raylib, but the mouse input is inconsistant and pretty terrible so i wanted to know of any ways(im fine with any deps) to get raw mouse input. all i really need to recieve is the mouse coordinates. It needs to be precise and fast
30 replies
CC#
Created by mynarco on 5/7/2024 in #help
Cannot find RemoteCertificateValidationCallback in ClientWebSocketOptions
Hello i am trying to bypass ssl certs by setting RemoteCertificateValidationCallback in the websocket options but they dont exist?
Socket = new ClientWebSocket();
Socket.Options.RemoteCertificateValidationCallback = delegate { return true; };
Socket = new ClientWebSocket();
Socket.Options.RemoteCertificateValidationCallback = delegate { return true; };
error:
'ClientWebSocketOptions' does not contain a definition for 'RemoteCertificateValidationCallback' and no accessible extension method 'RemoteCertificateValidationCallback' accepting a first argument of type 'ClientWebSocketOptions' could be found (are you missing a using directive or an assembly reference?)
'ClientWebSocketOptions' does not contain a definition for 'RemoteCertificateValidationCallback' and no accessible extension method 'RemoteCertificateValidationCallback' accepting a first argument of type 'ClientWebSocketOptions' could be found (are you missing a using directive or an assembly reference?)
msdn article: https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocketoptions.remotecertificatevalidationcallback?view=net-8.0#system-net-websockets-clientwebsocketoptions-remotecertificatevalidationcallback
33 replies