How does the V-Slice input system work? #7221
-
|
I'm trying to wrap my head around the whole input system thing because I wanna make an fnf engine (just for learning purposes). Could someone explain to me how it works? I know someone asked the same question in 2022, but the game (as well as the input system) has changed since then so that's why I'm asking. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Yeah I'll try to explain it as best as I can. I'll assume you have basic programming knowledge, whether it's Haxe or something else. No I didn't AI generate this stuff. This is using my knowledge of the game. Hit WindowsFNF loops through each note and determines whether it can be pressed at that time using hit windows. I believe the number the game uses for this is 160, but you can adjust that how you like it. We'll also call this number I'll try my best to explain a very basic hit window system. var hitStart:Float = noteTime - hitWindowMS;
var hitEnd:Float = noteTime + hitWindowMS;
// Hell yeah Jigsaw you the goat!
// Early enough where the note can be hit
if (songPosition >= hitStart) note.mayHit = true;
// Oh hell nah Jigsaw you tweakin'
// Late enough where the note cannot be hit (it's too late)
if (songPosition >= hitEnd) note.tooLate = true;InputNotes are checked by direction, so the notes are checked using an array that looks like this The game loops through each note that can be hit during that time and stores them within directionNotes. Internally, it would something like Then the game loops through those directions and checks the very first note for each of them (this is why sorting the notes is important). for (direction in directionNotes)
{
// Direction lacks a note
if (direction[0] == null)
{
// Ghost missing
// Probably not necessarily how FNF handles ghost missing, but it works
// Try and figure out how YOU can retrieve the note direction
if (pressedDirection)
{
ghostMiss(noteDirection);
}
}
// Skip the note if its direction key wasn't pressed
if (!pressedDirection) continue;
// This can be named anything really (goodNoteHit, playerNoteHit, etc.)
hitNote(direction[0]);
}Well I tried. |
Beta Was this translation helpful? Give feedback.
Yeah I'll try to explain it as best as I can. I'll assume you have basic programming knowledge, whether it's Haxe or something else. No I didn't AI generate this stuff. This is using my knowledge of the game.
Hit Windows
FNF loops through each note and determines whether it can be pressed at that time using hit windows. I believe the number the game uses for this is 160, but you can adjust that how you like it. We'll also call this number
hitWindowMS.I'll try my best to explain a very basic hit window system.