-
Notifications
You must be signed in to change notification settings - Fork 4
The Basics
Funkin' View currently supports the following targets:
lime test windows
lime test linux
lime test android // not supported yet unless compiled
lime test hl // supported on both windows and linux
(taking inspiration from lime's "supported targets" section all the way at the end)
Optimizations that were ingrained into this "wholesome" fnf rewrite (listed in alphabetical order) is:
-
Frustum Note Culling: Obvious, simply cuts out rendering for anything out of its boundaries. Used for the notes and sustains by the
bottomandtopin the note spawner class. -
Object Occlusion + Visual Accuracy: If a certain object overlaps one another, cancel that object and make that other object's pixels have doubled its alpha. Used for the notes.
-
Memory Mapping: Stores your file temporarily in kernel level instead of dumping it all onto your RAM. Used for the chart file's internal code. This in reality is already fast but only a bit slower than reading in raw RAM considering how often you read it. (You usually have a 1mb buffer anyway)
-
Object Pooling: Also obvious, but simply reuses a dead object. Used for the freeplay selection text and icon stuff, and notes and sustains.
-
Static Buffer and Program cache: Just there for a bit of muddiness in the code's structure but helps improve loading times excellently! Used in every single menu you can think of in Funkin' View.
-
Subtextures: Simple. Just clip a certain part of the image and have it present a sprite animation. Heavily used in sparrow atlas, and even simple stuff such as the icon grid, the note spritesheets, the pause menu sheet, etc etc. you name it.
-
Animate Atlas: A complicated at first symbol-driven animation format optimized for VRAM in exchange for rendering efficiency. Used for characters and even the GF character herself, considering it was even needed.
-
Audio System: Utilizes 2 sliding PCM windows, for smooth efficient playback across formats with threaded decoding, further accelerated by SSE2 (built into all x86-64 cpu's that have ever existed: gold mine). Background Music & SFX systems utilize a standard caching system in them. Finally, its dedicated optimized version of stb_vorbis that exclusively optimizes playback for performance, which is what 95% of all fnf mods use for music nowadays.
And that was all Funkin' View has to offer!
...and the fact that peote-view is literally an opengl wrapper that has most of its rendering optimization tricks built-in for you.
PS. Windows Developers are geniuses like what logic made them think "oh, we should do this "memory-mapping" idea for performance-critical applications".
Hashlink 1.15 (located at hashlinkBuildXmls/hl)
First, install Visual Studio 2022 from: https://aka.ms/vs/17/release/vs_community.exe (yes it is safe, it is an oficial Microsoft download)
Then, in the setup, check "Desktop Development with C++", and in installation details, check Windows 10 SDK (10.0.19041.0) and "MSVC v143 - VS 2022 C++ x64/x86 build tools"
Install Haxe from: https://haxe.org, then open a terminal and do haxelib setup C:\haxelib then install these haxelibs:
haxelib git lime https://github.com/SomeGuyWhoLovesCoding/lime
Then do haxelib dev C:\haxelib\lime\git
THEN do haxelib run lime setup and if it says a library is missing, install it doing haxelib install [library name]
Then lime rebuild tools
And once that finishes,lime rebuild windows, and if it says a library is missing, install it doing haxelib install [library name]
Peote-view (fork) - haxelib git peote-view_funkinview https://github.com/SomeGuyWhoLovesCoding/peote-view.git
HXCPP (fork) - haxelib git hxcpp https://github.com/SomeGuyWhoLovesCoding/hxcpp-sgwlfnf.git
Format - haxelib install format (This one is also used in peote-view for TextureData.fromFormatPNG)
Input2Action - haxelib install input2action (will install 2 dependencies)
CustomTitleBar - haxelib git customtitlebar https://github.com/SomeGuyWhoLovesCoding/customtitlebar.git
Download the ZIP by going to "Code" and then "Download ZIP"
Extract the ZIP, and then go into the extracted folder.
Open a terminal in the extracted folder by going to the path bar and typing "cmd"
Then, once in the terminal, do lime test windows and wait.
With that, the engine should be built at [path where you extracted the ZIP]/bin/Windows/bin
Linux (DEBIAN/UBUNTU)
Run the file named setup-linux.bash.
And you're all set up!
Just run lime test cpp and it works!
If you want to compile the hl extern code you just modified, or you just want to set up hashlink compilation, do these two steps:
-
(not required)
lime setup hland copy your path (withhashlinkBuildXmls/hl) to the path before pressing enter. -
Run the build.xml's in "hashlinkBuildXmls" folder at the root source directory.
Then, go to https://github.com/Blossomical/customtitlebar#hashlink-setup for instructions on how to build the library to hdll.
(Since you're at funkin' view, locate the haxelib and check out the hdll at {customtitlebar:haxelib}/titlebar/native/hdlls. Copy that over to the repo's hdlls folder, if you dare to edit the haxelib's externs which must change both hxcpp and hl if you want cross compatibility.)
And then, run haxelib run hxcpp hashlinkBuildXmls/chartFileBuild.xml and haxelib run hxcpp hashlinkBuildXmls/miniaudioBuild.xml if you ever choose to ever edit the hl version of the externs listed on the source code.
Then, you just lime test hl and everything runs good!
...but except if you want to switch your hl version you have to recompile all the xml's...isn't that required...? Yes. It is required.
- SomeGuyWhoLikesCoding
(AKA SomeGuyWhoLikesFNF, VeryExcited, 0x1DFA7D (someguywhouhhhhh), SomethingIsItchy, FelixTheCat, or simply Jeremiah):
: Owner, Maintainer, and Programmer
- .cabfile
: Programmer (Original ffmpeg render method)
- Halfwat
(AKA jobf)
: Tester (Helped me learn how peote-view works, wrote the sprite clipping sample for peote-view, and more.)
- Semmi
(AKA Semmis, maitag, or simply Sylvio Sell)
: Peote-view (Wrote peote-view, and wrote the slices shader sample for the sustain note.)
- Cobalt
(AKA ccolbaltdev)
: Alphabet Original tweaks of the Alphabet in freeplay menu
- Blossimical
: Helper (Wrote the customtitlebar haxelib tool. For real, seriously, not joking, I've been waiting for this moment for long enough.)
- SIG7Pro
: Helper (reorganized stuff and stuff)
- MichiHax
: Person who literally rewrote the whole setup part. Thank you.
Q1. Funkin' View's codebase is very hard to understand.
A1. I mean, what did you expect? It's written in a very low level programming language and I recommend that you learn it before digging around the repository.
Q2. Why do you use static variables for the program and buffer? Isn't that like, unclean?
A2. I use static variables to cache the memory inside the app before it was closed.
- Explanation: It's obvious. Look in a class on the "structures" package.
Q3. My game won't open when compiling with -D FV_PROFILE. What should I do?
A3. This is a normal issue I've experienced from hxcpp's tracy profiler implementation, so for now, you can delete the haxe and obj folders and try again.
But on one condition... You will most likely misuse the optimization techniques in your own game or overcomplicate them.
Please don't read this it's a joke I cocked up early in the wiki
Hello sidebar test.