Skip to content

Commit

Permalink
msTiming and other minor fixes & additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nennneko5787 committed Oct 15, 2022
1 parent 971d5fb commit 9177b98
Show file tree
Hide file tree
Showing 11 changed files with 255 additions and 133 deletions.
182 changes: 78 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,78 @@
# Friday Night Funkin' - Psych Engine
Engine originally used on [Mind Games Mod](https://gamebanana.com/mods/301107), intended to be a fix for the vanilla version's many issues while keeping the casual play aspect of it. Also aiming to be an easier alternative to newbie coders.

## Installation:
You must have [the most up-to-date version of Haxe](https://haxe.org/download/), seriously, stop using 4.1.5, it misses some stuff.

Follow a Friday Night Funkin' source code compilation tutorial, after this you will need to install LuaJIT.

To install LuaJIT do this: `haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit` on a Command prompt/PowerShell

...Or if you don't want your mod to be able to run .lua scripts, delete the "LUA_ALLOWED" line on Project.xml


If you get an error about StatePointer when using Lua, run `haxelib remove linc_luajit` into Command Prompt/PowerShell, then re-install linc_luajit.

If you want video support on your mod, simply do `haxelib install hxCodec` on a Command prompt/PowerShell

otherwise, you can delete the "VIDEOS_ALLOWED" Line on Project.xml

## Credits:
* Shadow Mario - Programmer
* RiverOaken - Artist
* Yoshubs - Assistant Programmer

### Special Thanks
* bbpanzu - Ex-Programmer
* shubs - New Input System
* SqirraRNG - Crash Handler and Base code for Chart Editor's Waveform
* KadeDev - Fixed some cool stuff on Chart Editor and other PRs
* iFlicky - Composer of Psync and Tea Time, also made the Dialogue Sounds
* PolybiusProxy - .MP4 Video Loader Library (hxCodec)
* Keoiki - Note Splash Animations
* Smokey - Sprite Atlas Support
* Nebula the Zorua - LUA JIT Fork and some Lua reworks
_____________________________________

# Features

## Attractive animated dialogue boxes:

![](https://user-images.githubusercontent.com/44785097/127706669-71cd5cdb-5c2a-4ecc-871b-98a276ae8070.gif)


## Mod Support
* Probably one of the main points of this engine, you can code in .lua files outside of the source code, making your own weeks without even messing with the source!
* Comes with a Mod Organizing/Disabling Menu.


## Atleast one change to every week:
### Week 1:
* New Dad Left sing sprite
* Unused stage lights are now used
### Week 2:
* Both BF and Skid & Pump does "Hey!" animations
* Thunders does a quick light flash and zooms the camera in slightly
* Added a quick transition/cutscene to Monster
### Week 3:
* BF does "Hey!" during Philly Nice
* Blammed has a cool new colors flash during that sick part of the song
### Week 4:
* Better hair physics for Mom/Boyfriend (Maybe even slightly better than Week 7's :eyes:)
* Henchmen die during all songs. Yeah :(
### Week 5:
* Bottom Boppers and GF does "Hey!" animations during Cocoa and Eggnog
* On Winter Horrorland, GF bops her head slower in some parts of the song.
### Week 6:
* On Thorns, the HUD is hidden during the cutscene
* Also there's the Background girls being spooky during the "Hey!" parts of the Instrumental

## Cool new Chart Editor changes and countless bug fixes
![](https://github.com/ShadowMario/FNF-PsychEngine/blob/main/docs/img/chart.png?raw=true)
* You can now chart "Event" notes, which are bookmarks that trigger specific actions that usually were hardcoded on the vanilla version of the game.
* Your song's BPM can now have decimal values
* You can manually adjust a Note's strum time if you're really going for milisecond precision
* You can change a note's type on the Editor, it comes with two example types:
* Alt Animation: Forces an alt animation to play, useful for songs like Ugh/Stress
* Hey: Forces a "Hey" animation instead of the base Sing animation, if Boyfriend hits this note, Girlfriend will do a "Hey!" too.

## Multiple editors to assist you in making your own Mod
![Screenshot_3](https://user-images.githubusercontent.com/44785097/144629914-1fe55999-2f18-4cc1-bc70-afe616d74ae5.png)
* Working both for Source code modding and Downloaded builds!

## Story mode menu rework:
![](https://i.imgur.com/UB2EKpV.png)
* Added a different BG to every song (less Tutorial)
* All menu characters are now in individual spritesheets, makes modding it easier.

## Credits menu
![Screenshot_1](https://user-images.githubusercontent.com/44785097/144632635-f263fb22-b879-4d6b-96d6-865e9562b907.png)
* You can add a head icon, name, description and a Redirect link for when the player presses Enter while the item is currently selected.

## Awards/Achievements
* The engine comes with 16 example achievements that you can mess with and learn how it works (Check Achievements.hx and search for "checkForAchievement" on PlayState.hx)

## Options menu:
* You can change Note colors, Delay and Combo Offset, Controls and Preferences there.
* On Preferences you can toggle Downscroll, Middlescroll, Anti-Aliasing, Framerate, Low Quality, Note Splashes, Flashing Lights, etc.

## Other gameplay features:
* When the enemy hits a note, their strum note also glows.
* Lag doesn't impact the camera movement and player icon scaling anymore.
* Some stuff based on Week 7's changes has been put in (Background colors on Freeplay, Note splashes)
* You can reset your Score on Freeplay/Story Mode by pressing Reset button.
* You can listen to a song or adjust Scroll Speed/Damage taken/etc. on Freeplay by pressing Space.
Note: This document uses the DeepL translation and the text may be incorrect.
# Friday Night Funkin' - nekoEngine
A mod that has only the good features of Kade Engine, Psych Engine and Leather Engine (or maybe not).
This mod is a Psych Engine fork.

## Build nekoEngine:
You must have [the most up-to-date version of Haxe](https://haxe.org/download/), seriously, stop using 4.1.5, it misses some stuff.

To build nekoEngine, execute the following command at the prompt/PowerShell.
<pre>
haxelib install lime
haxelib install openfl
haxelib install flixel
haxelib install flixel-addons
haxelib install flixel-ui
haxelib install hscript
haxelib install newgrounds
haxelib run lime setup
haxelib install flixel-tools
haxelib run flixel-tools setup
haxelib git polymod https://github.com/larsiusprime/polymod.git
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit
haxelib install hxCodec
haxelib install hxcpp
</pre>
At the moment, you can optionally fix the transition bug in songs with zoomed-out cameras.
<pre>
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
</pre>
Once all of these are installed, build using the following command in the root folder of the project
### Windows
To build the Windows version, download the Visual Studio 2019 installer [here](https://download.visualstudio.microsoft.com/download/pr/3105fcfe-e771-41d6-9a1c-fc971e7d03a7/8eb13958dc429a6e6f7e0d6704d43a55f18d02a253608351b6bf6723ffdaf24e/vs_Community.exe), run the installer, go to the individual components tab and and select the following items

* MSVC v142 - VS 2019 C++ x64/x86 build tools
* Windows SDK (10.0.17763.0)

<pre>
lime build windows
</pre>
If you want to build a release version, use the following command
<pre>
lime build windows -release
</pre>
If you want to build the 32-bit version, add the following arguments to the command
<pre>
-32 -D 32bits
</pre>
### Mac
<pre>
lime build mac
</pre>
If you want to build a release version, use the following command
<pre>
lime build mac -release
</pre>
### Linux
<pre>
lime build linux
</pre>
If you want to build a release version, use the following command
<pre>
lime build linux -release
</pre>
### HTML
<pre>
lime test html5 -release
</pre>
## Features
You can use all the features of the Psych Engine and some of the following
* Timing display (in milliseconds) when a note is hit
* Automatic playback of songs in the free play menu (must be enabled in the settings)
* Japanese language support
* Support for Psych Engine mods
## Items to be added in the future
* Fixed display of milliseconds when a note is hit.
* Fixed support for 1~21 key notation
* Make it possible to hit opponent's notes
2 changes: 1 addition & 1 deletion gitVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.0.2
6 changes: 6 additions & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class ClientPrefs {
public static var defaultKeys:Map<String, Array<FlxKey>> = null;

public static var freeplayAutoPlaySong:Bool = false;
public static var msTiming:Bool = true;

public static function loadDefaultKeys() {
defaultKeys = keyBinds.copy();
Expand Down Expand Up @@ -141,6 +142,7 @@ class ClientPrefs {
FlxG.save.data.comboStacking = comboStacking;
FlxG.save.data.language = language;
FlxG.save.data.freeplayAutoPlaySong = freeplayAutoPlaySong;
FlxG.save.data.msTiming = msTiming;

FlxG.save.flush();

Expand Down Expand Up @@ -306,6 +308,10 @@ class ClientPrefs {
{
freeplayAutoPlaySong = FlxG.save.data.freeplayAutoPlaySong;
}
if (FlxG.save.data.msTiming != null)
{
msTiming = FlxG.save.data.msTiming;
}
}

inline public static function getGameplaySetting(name:String, defaultValue:Dynamic):Dynamic {
Expand Down
6 changes: 4 additions & 2 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ class FreeplayState extends MusicBeatState
}

FlxG.sound.music.volume = 0;

destroyFreeplayVocals();

if (ClientPrefs.freeplayAutoPlaySong){
destroyFreeplayVocals();
}
}
else if(controls.RESET)
{
Expand Down
7 changes: 7 additions & 0 deletions source/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import hscript.Interp;
import hscript.Expr;
#end

import flash.system.System; //Funkin_End(Lua)

#if desktop
import Discord;
#end
Expand Down Expand Up @@ -2755,6 +2757,11 @@ class FunkinLua {
return list;
});

Lua_helper.add_callback(lua, "funkin_end", function() {
System.exit(0);
return;
});

call('onCreate', []);
#end
}
Expand Down
2 changes: 1 addition & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Main extends Sprite
}
}

errMsg += "\nUncaught Error: " + e.error + "\nPlease report this error to the GitHub page: https://github.com/ShadowMario/FNF-PsychEngine\n\n> Crash Handler written by: sqirra-rng";
errMsg += "\nUncaught Error: " + e.error + "\nPlease report this error to the GitHub page: https://github.com/nennneko5787/FNF-nekoEngine\n\n> Crash Handler written by: sqirra-rng";

if (!FileSystem.exists("./crash/"))
FileSystem.createDirectory("./crash/");
Expand Down
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using StringTools;

class MainMenuState extends MusicBeatState
{
public static var nekoEngineVersion:String = '0.0.1'; //This is also used for Discord RPC
public static var nekoEngineVersion:String = '0.0.2'; //This is also used for Discord RPC
public static var psychEngineVersion:String = '0.6.2'; //This is also used for Discord RPC
public static var curSelected:Int = 0;

Expand Down
63 changes: 53 additions & 10 deletions source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ class PauseSubState extends MusicBeatSubstate
var grpMenuShit:FlxTypedGroup<Alphabet>;

var menuItems:Array<String> = [];
var menuItemsOG:Array<String> = ['Resume', 'Restart Song', 'Change Difficulty', 'Exit to menu'];
var menuItemsOG:Array<String> = ['Resume', 'Restart Song', 'Change Difficulty', 'GamePlay Options', 'Exit to menu'];
var difficultyChoices = [];
var gameplayOptions:Array<String> = ['Instakill on Miss', 'Practice Mode', 'Botplay'];
var curSelected:Int = 0;

var pauseMusic:FlxSound;
var instakillText:FlxText;
var botplayText:FlxText;
var practiceText:FlxText;
var skipTimeText:FlxText;
var skipTimeTracker:Alphabet;
Expand All @@ -49,8 +52,8 @@ class PauseSubState extends MusicBeatSubstate
menuItemsOG.insert(3, 'Skip Time');
}
menuItemsOG.insert(3 + num, 'End Song');
menuItemsOG.insert(4 + num, 'Toggle Practice Mode');
menuItemsOG.insert(5 + num, 'Toggle Botplay');
//menuItemsOG.insert(4 + num, 'Toggle Practice Mode');
//menuItemsOG.insert(5 + num, 'Toggle Botplay');
}
menuItems = menuItemsOG;

Expand All @@ -60,6 +63,7 @@ class PauseSubState extends MusicBeatSubstate
}
difficultyChoices.push('BACK');

gameplayOptions.push('BACK');

pauseMusic = new FlxSound();
if(songName != null) {
Expand Down Expand Up @@ -98,14 +102,30 @@ class PauseSubState extends MusicBeatSubstate
blueballedTxt.updateHitbox();
add(blueballedTxt);

practiceText = new FlxText(20, 15 + 101, 0, "PRACTICE MODE", 32);
instakillText = new FlxText(20, 15 + 101, 0, "INSTANT ON KILL", 32);
instakillText.scrollFactor.set();
instakillText.setFormat(Paths.font('vcr.ttf'), 32);
instakillText.x = FlxG.width - (instakillText.width + 20);
instakillText.updateHitbox();
instakillText.visible = PlayState.instance.instakillOnMiss;
add(instakillText);

practiceText = new FlxText(20, 15 + 133, 0, "PRACTICE MODE", 32);
practiceText.scrollFactor.set();
practiceText.setFormat(Paths.font('vcr.ttf'), 32);
practiceText.x = FlxG.width - (practiceText.width + 20);
practiceText.updateHitbox();
practiceText.visible = PlayState.instance.practiceMode;
add(practiceText);

botplayText = new FlxText(20, 15 + 165, 0, "BOTPLAY", 32);
botplayText.scrollFactor.set();
botplayText.setFormat(Paths.font('vcr.ttf'), 32);
botplayText.x = FlxG.width - (botplayText.width + 20);
botplayText.updateHitbox();
botplayText.visible = PlayState.instance.cpuControlled;
add(botplayText);

var chartingText:FlxText = new FlxText(20, 15 + 101, 0, "CHARTING MODE", 32);
chartingText.scrollFactor.set();
chartingText.setFormat(Paths.font('vcr.ttf'), 32);
Expand Down Expand Up @@ -210,6 +230,29 @@ class PauseSubState extends MusicBeatSubstate
regenMenu();
}

if (menuItems == gameplayOptions)
{
switch (daSelected)
{
case 'Instakill on Miss':
PlayState.instance.instakillOnMiss = !PlayState.instance.instakillOnMiss;
PlayState.changedDifficulty = true;
instakillText.visible = PlayState.instance.instakillOnMiss;
case 'Practice Mode':
PlayState.instance.practiceMode = !PlayState.instance.practiceMode;
PlayState.changedDifficulty = true;
practiceText.visible = PlayState.instance.practiceMode;
case 'Botplay':
PlayState.instance.cpuControlled = !PlayState.instance.cpuControlled;
PlayState.changedDifficulty = true;
botplayText.visible = PlayState.instance.cpuControlled;
case 'BACK':
menuItems = menuItemsOG;
deleteSkipTimeText();
regenMenu();
}
}

switch (daSelected)
{
case "Resume":
Expand All @@ -218,10 +261,12 @@ class PauseSubState extends MusicBeatSubstate
menuItems = difficultyChoices;
deleteSkipTimeText();
regenMenu();
/*
case 'Toggle Practice Mode':
PlayState.instance.practiceMode = !PlayState.instance.practiceMode;
PlayState.changedDifficulty = true;
practiceText.visible = PlayState.instance.practiceMode;
*/
case "Restart Song":
restartSong();
case "Leave Charting Mode":
Expand All @@ -245,12 +290,10 @@ class PauseSubState extends MusicBeatSubstate
case "End Song":
close();
PlayState.instance.finishSong(true);
case 'Toggle Botplay':
PlayState.instance.cpuControlled = !PlayState.instance.cpuControlled;
PlayState.changedDifficulty = true;
PlayState.instance.botplayTxt.visible = PlayState.instance.cpuControlled;
PlayState.instance.botplayTxt.alpha = 1;
PlayState.instance.botplaySine = 0;
case 'GamePlay Options':
menuItems = gameplayOptions;
deleteSkipTimeText();
regenMenu();
case "Exit to menu":
PlayState.deathCounter = 0;
PlayState.seenCutscene = false;
Expand Down
Loading

0 comments on commit 9177b98

Please sign in to comment.