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

[ENHANCEMENT + BUGFIX] soft codable visualizers + polymod download fix #2994

Closed
wants to merge 6 commits into from

Conversation

MidyGamy
Copy link

@MidyGamy MidyGamy commented Jul 10, 2024

This make visualize soft modable so nene.hxc now use it (making ABotVis.hx useless)

It also bring some other bug fixes related to the visualizer during the countdown, the shader un phillyStreets and missplaced offset for nene

Should be paired with FunkinCrew/funkVis#7 for better results (and it will fix that last bar on Abot)

@MidyGamy MidyGamy changed the title soft codable visualizers + polymod download fix [ENHANCEMENT + BUGFIX] soft codable visualizers + polymod download fix Jul 10, 2024
@EliteMasterEric EliteMasterEric added status: pending triage The bug or PR has not been reviewed yet. mods Issue is related to the use of mods. status: reviewing internally This PR is under internal review and quality assurance testing type: optimization Involves a performance issue or a bug which causes lag. large A large pull request with more than 100 changes and removed status: pending triage The bug or PR has not been reviewed yet. labels Jul 10, 2024
@MidyGamy
Copy link
Author

What does the "large" label means?

@MidyGamy
Copy link
Author

What does the "large" label means?

Nvm i know now

@MidyGamy
Copy link
Author

Btw, you might wanna see
FunkinCrew/funkVis#7
It complement well with this PR

@MidyGamy MidyGamy closed this Jul 14, 2024
@MidyGamy MidyGamy reopened this Jul 14, 2024
@MidyGamy
Copy link
Author

yeah, also with that pull request but you are already reviewing it...

Copy link
Contributor

@AbnormalPoof AbnormalPoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good and works well, but my attention is caught in nene.hxc, this is something I encountered during testing:

Line 385:

    #if desktop
    // On desktop it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5
    // So we want to manually change it!
    analyzer.fftN = 256;
    #end

This code will likely never run since #if desktop is a condition used at compilation, HScript interprets code instead of actually compiling it. This doesn't throw a syntax error, but it doesn't seem to detect if it's running on desktop, so the visualizer in WeekEnd 1 is different as a result.

A solution I figured out is using PlatformUtil to get the host platform:

import funkin.util.PlatformUtil;
import funkin.util.HostPlatform;

var platform:HostPlatform = PlatformUtil.detectHostPlatform();

if (platform != HostPlatform.HTML5) {
	// On desktop it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5
	// So we want to manually change it!
	analyzer.fftN = 256;
}

This makes the visualizer look how it was before!

(Side note: Since ABot is now softcoded, ABotVis.hx is redundant and should probably be removed.)

@MidyGamy
Copy link
Author

MidyGamy commented Aug 5, 2024

ok let me do it

@MidyGamy
Copy link
Author

MidyGamy commented Aug 5, 2024

Ok done

@MidyGamy
Copy link
Author

Well the 2 mentioned pull requests of funkVis have been merged... now waiting to see if this one will be accepted

@MidyGamy MidyGamy deleted the branch FunkinCrew:develop August 20, 2024 20:15
@MidyGamy MidyGamy closed this Aug 20, 2024
@MidyGamy MidyGamy deleted the main branch August 20, 2024 20:15
@MidyGamy MidyGamy restored the main branch August 20, 2024 20:16
@MidyGamy MidyGamy deleted the main branch August 20, 2024 20:19
@MidyGamy MidyGamy restored the main branch August 20, 2024 20:19
@MidyGamy MidyGamy reopened this Aug 20, 2024
@MidyGamy
Copy link
Author

help, how do I transfer it to another branch of mine?

@moxie-coder
Copy link

help, how do I transfer it to another branch of mine?

simply hit the edit button, and then you can change branches
IMG_2556

@MidyGamy
Copy link
Author

help, how do I transfer it to another branch of mine?

simply hit the edit button, and then you can change branches IMG_2556

image
No I only can change the branch I want to merge into, not the branch I want to use

@moxie-coder
Copy link

help, how do I transfer it to another branch of mine?

simply hit the edit button, and then you can change branches IMG_2556

image No I only can change the branch I want to merge into, not the branch I want to use

you have to make an new PR then

@MidyGamy
Copy link
Author

Or Ill just wait until it's merged or denied...

@moxie-coder
Copy link

Or Ill just wait until it's merged or denied...

you can easily close it yourself
IMG_2576

@MidyGamy
Copy link
Author

Yeah I tried to edit nene.hxc to render the visualizers with cutscenes musics... And for some reasons I get a null object reference when calling the analyzer.getLevels()...

@AbnormalPoof
Copy link
Contributor

AbnormalPoof commented Aug 26, 2024

I think it's because FlxG.sound.music doesn't exist yet (as in, it's null) during the cutscene.

@MidyGamy
Copy link
Author

MidyGamy commented Aug 26, 2024

Im not using FlxG.sound.music + I coded a safe state in case the sound is inexistent...

@MidyGamy
Copy link
Author

image
image
Yeah verry helpful...

@MidyGamy
Copy link
Author

MidyGamy commented Aug 28, 2024

I found the problem, the visualizer only works with FlxG.sound.music
image

(and that would also explain why if vocals have different sample rate than the instrumental, it's offset and looks like it's read faster)

@MidyGamy
Copy link
Author

I DID IT!!!
https://x.com/i/status/1828892194180092169

@moxie-coder
Copy link

I DID IT!!! https://x.com/i/status/1828892194180092169

that's nice

@MidyGamy
Copy link
Author

time to make another push request in the funkin viz repo

@MidyGamy
Copy link
Author

Well waiting for FunkinCrew/funkVis#9 to be accepted before pushing the change

@MidyGamy
Copy link
Author

Working on separating the character sprite from the speaker sprite for 3 reasons:

  • reduce sprite sizes (especially gf, gf-car and pico in week 7)
  • make the speakers play the idle anim on beat regardless of the character anim
  • being able to swap easily between speakers (like I applied abot to gf very easily) of put the speakers without a character, or even put a custom character without having to re-export speakers

@AbnormalPoof
Copy link
Contributor

AbnormalPoof commented Aug 29, 2024

In my opinion, I think it’d be better to have something like that be a part of a separate PR so it’s easier for the maintainers to review.

I think Eric explains it better:
7B45B947-8488-46FC-BD19-4AEB33CE221D

Side note: I recommend re-adding this line in nene.hxc since it’s a feature added in 0.4.1:

animFrame = Math.round(animFrame * FlxG.sound.volume);

@MidyGamy
Copy link
Author

That was the idea

@MidyGamy
Copy link
Author

In my opinion, I think it’d be better to have something like that be a part of a separate PR so it’s easier for the maintainers to review.

I think Eric explains it better:
7B45B947-8488-46FC-BD19-4AEB33CE221D

Side note: I recommend re-adding this line in nene.hxc since it’s a feature added in 0.4.1:

animFrame = Math.round(animFrame * FlxG.sound.volume);

About the 0.4.1 I actually disabled it cause it doesn't make really sense to me that this thing react to the volume... 1st in fictional universe, they aren't affected by the volume, 2nd, (I don't know if it's the case for everyone) I often reduce the volume of the game cause it's way too strong, and I don't want the visualizers to be affected by it...

I think the best solution would be to add an option for it

@AbnormalPoof
Copy link
Contributor

Interesting…
@EliteMasterEric Thoughts?

@EliteMasterEric
Copy link
Member

@MidyGamy The reason it actually exists is because the audio data provided to the game on web scales with game volume, and since we wanted to maintain parity, we just applied a multiplier on desktop which approximates the effect. In practice, I've found that people tend to turn down the in-game volume a lot, and with that the visualizer look significantly worse on both platforms.

The proper solution is to figure out the root cause and make the web visualizer look more like desktop. Simply multiplying the levels didn't seem to work for me.

@EliteMasterEric EliteMasterEric added status: needs revision Cannot be approved because it is awaiting some work by the contributor. and removed status: reviewing internally This PR is under internal review and quality assurance testing labels Aug 31, 2024
@MidyGamy
Copy link
Author

MidyGamy commented Aug 31, 2024

Can't you just divide?
(I mean if it's automatically multiplied by the volume, and if you divide back, if like just multiplying by 1... It's just mathematics...)

@EliteMasterEric
Copy link
Member

Can't you just divide? (I mean if it's automatically multiplied by the volume, and if you divide back, if like just multiplying by 1... It's just mathematics...)

As mentioned, I tried simply dividing, but that didn't look accurate either. It'd take more experimenting to figure it out.

@MidyGamy
Copy link
Author

MidyGamy commented Sep 1, 2024

ok, and about the revision, what does it concern?

@EliteMasterEric EliteMasterEric changed the base branch from main to develop September 25, 2024 12:58
@MidyGamy MidyGamy closed this by deleting the head repository Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large A large pull request with more than 100 changes mods Issue is related to the use of mods. status: needs revision Cannot be approved because it is awaiting some work by the contributor. type: optimization Involves a performance issue or a bug which causes lag.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants