diff calc adjustments + stolen assets from fps plus
This commit is contained in:
parent
eb33e85b65
commit
3e9d05d82f
1
assets/preload/data/test/test.json
Normal file
1
assets/preload/data/test/test.json
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 692 KiB |
@ -1,92 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextureAtlas imagePath="NOTE_assets.png">
|
||||
<!-- Created with Adobe Animate version 21.0.0.35450 -->
|
||||
<!-- Created with Adobe Animate version 21.0.7.42652 -->
|
||||
<!-- http://www.adobe.com/products/animate.html -->
|
||||
<SubTexture name="arrow static instance 10000" x="488" y="238" width="155" height="158"/>
|
||||
<SubTexture name="arrow static instance 20000" x="647" y="238" width="157" height="155"/>
|
||||
<SubTexture name="arrow static instance 30000" x="808" y="238" width="155" height="157"/>
|
||||
<SubTexture name="arrow static instance 40000" x="323" y="240" width="157" height="154"/>
|
||||
<SubTexture name="blue hold end instance 10000" x="1062" y="452" width="51" height="64"/>
|
||||
<SubTexture name="blue hold piece instance 10000" x="1282" y="457" width="51" height="44"/>
|
||||
<SubTexture name="blue instance 10000" x="0" y="240" width="158" height="154"/>
|
||||
<SubTexture name="down confirm instance 10000" x="0" y="0" width="240" height="236"/>
|
||||
<SubTexture name="down confirm instance 10001" x="244" y="0" width="240" height="236"/>
|
||||
<SubTexture name="down confirm instance 10002" x="1206" y="235" width="221" height="218" frameX="-6" frameY="-12" frameWidth="240" frameHeight="236"/>
|
||||
<SubTexture name="down confirm instance 10003" x="1206" y="235" width="221" height="218" frameX="-6" frameY="-12" frameWidth="240" frameHeight="236"/>
|
||||
<SubTexture name="down press instance 10000" x="805" y="399" width="143" height="139" frameX="-4" frameY="-3" frameWidth="150" frameHeight="146"/>
|
||||
<SubTexture name="down press instance 10001" x="805" y="399" width="143" height="139" frameX="-4" frameY="-3" frameWidth="150" frameHeight="146"/>
|
||||
<SubTexture name="down press instance 10002" x="1898" y="0" width="150" height="146"/>
|
||||
<SubTexture name="down press instance 10003" x="1898" y="0" width="150" height="146"/>
|
||||
<SubTexture name="green hold end instance 10000" x="1007" y="452" width="51" height="64"/>
|
||||
<SubTexture name="green hold piece instance 10000" x="1227" y="457" width="51" height="44"/>
|
||||
<SubTexture name="green instance 10000" x="162" y="240" width="157" height="154"/>
|
||||
<SubTexture name="left confirm instance 10000" x="972" y="0" width="230" height="232"/>
|
||||
<SubTexture name="left confirm instance 10001" x="1438" y="233" width="220" height="222" frameX="-5" frameY="-5" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left confirm instance 10002" x="1438" y="0" width="227" height="229" frameX="-2" frameY="-1" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left confirm instance 10003" x="1438" y="0" width="227" height="229" frameX="-2" frameY="-1" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left press instance 10000" x="1898" y="449" width="139" height="142" frameX="-4" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press instance 10001" x="1898" y="449" width="139" height="142" frameX="-4" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press instance 10002" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10003" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10004" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10005" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10006" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10007" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10008" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10009" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10010" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10011" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10012" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10013" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10014" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10015" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10016" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10017" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10018" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10019" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="pruple end hold instance 10000" x="1117" y="452" width="51" height="64"/>
|
||||
<SubTexture name="purple hold piece instance 10000" x="1337" y="457" width="51" height="44"/>
|
||||
<SubTexture name="purple instance 10000" x="0" y="398" width="154" height="157"/>
|
||||
<SubTexture name="red hold end instance 10000" x="952" y="452" width="51" height="64"/>
|
||||
<SubTexture name="red hold piece instance 10000" x="1172" y="457" width="51" height="44"/>
|
||||
<SubTexture name="red instance 10000" x="647" y="397" width="154" height="157"/>
|
||||
<SubTexture name="right confirm instance 10000" x="1669" y="0" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="right confirm instance 10001" x="1669" y="232" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="right confirm instance 10002" x="1206" y="0" width="228" height="231"/>
|
||||
<SubTexture name="right confirm instance 10003" x="1206" y="0" width="228" height="231"/>
|
||||
<SubTexture name="right press instance 10000" x="469" y="400" width="139" height="142" frameX="-3" frameY="-7" frameWidth="149" frameHeight="152"/>
|
||||
<SubTexture name="right press instance 10001" x="469" y="400" width="139" height="142" frameX="-3" frameY="-7" frameWidth="149" frameHeight="152"/>
|
||||
<SubTexture name="right press instance 10002" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10003" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10004" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10005" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10006" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10007" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10008" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10009" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10010" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10011" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10012" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10013" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10014" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10015" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10016" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10017" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10018" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10019" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10020" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10021" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10022" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10023" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10024" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10025" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10026" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="up confirm instance 10000" x="488" y="0" width="238" height="234"/>
|
||||
<SubTexture name="up confirm instance 10001" x="730" y="0" width="238" height="234"/>
|
||||
<SubTexture name="up confirm instance 10002" x="972" y="236" width="216" height="212" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up confirm instance 10003" x="972" y="236" width="216" height="212" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up press instance 10000" x="1898" y="303" width="144" height="142" frameX="-6" frameY="-4" frameWidth="154" frameHeight="151"/>
|
||||
<SubTexture name="up press instance 10001" x="1898" y="303" width="144" height="142" frameX="-6" frameY="-4" frameWidth="154" frameHeight="151"/>
|
||||
<SubTexture name="up press instance 10002" x="158" y="398" width="154" height="151"/>
|
||||
<SubTexture name="up press instance 10003" x="158" y="398" width="154" height="151"/>
|
||||
</TextureAtlas>
|
||||
<SubTexture name="Blue Active0000" x="5" y="5" width="157" height="154"/>
|
||||
<SubTexture name="Green Active0000" x="172" y="5" width="157" height="154"/>
|
||||
<SubTexture name="Purple Active0000" x="339" y="5" width="154" height="157"/>
|
||||
<SubTexture name="Red Active0000" x="503" y="5" width="154" height="157"/>
|
||||
<SubTexture name="arrowDOWN0000" x="1809" y="5" width="157" height="154"/>
|
||||
<SubTexture name="arrowLEFT0000" x="5" y="172" width="155" height="156"/>
|
||||
<SubTexture name="arrowRIGHT0000" x="170" y="172" width="154" height="157"/>
|
||||
<SubTexture name="arrowUP0000" x="334" y="172" width="157" height="154"/>
|
||||
<SubTexture name="blue0000" x="667" y="5" width="157" height="154"/>
|
||||
<SubTexture name="blue hold end0000" x="834" y="5" width="50" height="64"/>
|
||||
<SubTexture name="blue hold piece0000" x="894" y="5" width="50" height="44"/>
|
||||
<SubTexture name="down confirm0000" x="501" y="172" width="244" height="240"/>
|
||||
<SubTexture name="down confirm0001" x="755" y="172" width="244" height="240"/>
|
||||
<SubTexture name="down confirm0002" x="1009" y="172" width="214" height="210" frameX="-15" frameY="-15" frameWidth="244" frameHeight="240"/>
|
||||
<SubTexture name="down press0000" x="1233" y="172" width="142" height="140" frameX="-4" frameY="-2" frameWidth="149" frameHeight="146"/>
|
||||
<SubTexture name="down press0001" x="1233" y="172" width="142" height="140" frameX="-4" frameY="-2" frameWidth="149" frameHeight="146"/>
|
||||
<SubTexture name="down press0002" x="1385" y="172" width="149" height="146"/>
|
||||
<SubTexture name="green0000" x="954" y="5" width="157" height="154"/>
|
||||
<SubTexture name="green hold end0000" x="1121" y="5" width="50" height="64"/>
|
||||
<SubTexture name="green hold piece0000" x="1181" y="5" width="50" height="44"/>
|
||||
<SubTexture name="left confirm0000" x="1544" y="172" width="231" height="235"/>
|
||||
<SubTexture name="left confirm0001" x="1785" y="172" width="231" height="235"/>
|
||||
<SubTexture name="left confirm0002" x="5" y="422" width="210" height="214" frameX="-11" frameY="-12" frameWidth="231" frameHeight="235"/>
|
||||
<SubTexture name="left press0000" x="225" y="422" width="140" height="142" frameX="-3" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press0001" x="225" y="422" width="140" height="142" frameX="-3" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press0002" x="375" y="422" width="146" height="149"/>
|
||||
<SubTexture name="pruple end hold0000" x="1241" y="5" width="50" height="64"/>
|
||||
<SubTexture name="purple0000" x="1301" y="5" width="154" height="157"/>
|
||||
<SubTexture name="purple hold piece0000" x="1465" y="5" width="50" height="44"/>
|
||||
<SubTexture name="red0000" x="1525" y="5" width="154" height="157"/>
|
||||
<SubTexture name="red hold end0000" x="1689" y="5" width="50" height="64"/>
|
||||
<SubTexture name="red hold piece0000" x="1749" y="5" width="50" height="44"/>
|
||||
<SubTexture name="right confirm0000" x="531" y="422" width="237" height="241"/>
|
||||
<SubTexture name="right confirm0001" x="778" y="422" width="237" height="241"/>
|
||||
<SubTexture name="right confirm0002" x="1025" y="422" width="210" height="214" frameX="-13" frameY="-14" frameWidth="237" frameHeight="241"/>
|
||||
<SubTexture name="right press0000" x="1245" y="422" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
|
||||
<SubTexture name="right press0001" x="1245" y="422" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
|
||||
<SubTexture name="right press0002" x="1393" y="422" width="148" height="151"/>
|
||||
<SubTexture name="up confirm0000" x="1551" y="422" width="238" height="234"/>
|
||||
<SubTexture name="up confirm0001" x="1799" y="422" width="238" height="234"/>
|
||||
<SubTexture name="up confirm0002" x="5" y="673" width="212" height="209" frameX="-13" frameY="-12" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up press0000" x="227" y="673" width="144" height="141" frameX="-5" frameY="-4" frameWidth="153" frameHeight="150"/>
|
||||
<SubTexture name="up press0001" x="227" y="673" width="144" height="141" frameX="-5" frameY="-4" frameWidth="153" frameHeight="150"/>
|
||||
<SubTexture name="up press0002" x="381" y="673" width="153" height="150"/>
|
||||
</TextureAtlas>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -32,51 +32,99 @@ class DiffCalc
|
||||
gottaHitNote = !i.mustHitSection;
|
||||
|
||||
if (gottaHitNote)
|
||||
cleanedNotes.push(new SmallNote(ii[0],ii[1]));
|
||||
cleanedNotes.push(new SmallNote(ii[0],Math.floor(Math.abs(ii[1]))));
|
||||
}
|
||||
}
|
||||
|
||||
var handOne:Array<SmallNote> = [];
|
||||
var handTwo:Array<SmallNote> = [];
|
||||
|
||||
cleanedNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
|
||||
|
||||
var firstNoteTime = cleanedNotes[0].strumTime;
|
||||
|
||||
// normalize the notes
|
||||
|
||||
for(i in cleanedNotes)
|
||||
{
|
||||
i.strumTime = (i.strumTime - firstNoteTime) * 2;
|
||||
}
|
||||
|
||||
for (i in cleanedNotes)
|
||||
{
|
||||
switch(i.noteData)
|
||||
{
|
||||
case 0:
|
||||
handOne.push(i);
|
||||
case 1:
|
||||
handTwo.push(i);
|
||||
case 2:
|
||||
handTwo.push(i);
|
||||
case 3:
|
||||
handOne.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// length in segments of the song
|
||||
var length = ((cleanedNotes[cleanedNotes.length - 1].strumTime / 1000) / 0.5);
|
||||
|
||||
// hackey way of creating a array with a length
|
||||
var segments:Array<Int> = new_Array(1,Std.int(length));
|
||||
|
||||
var segmentsOne:Array<Int> = new_Array(1,Std.int(length));
|
||||
var segmentsTwo:Array<Int> = new_Array(1,Std.int(length));
|
||||
|
||||
// algo loop
|
||||
for(i in cleanedNotes)
|
||||
for(i in handOne)
|
||||
{
|
||||
var index = Std.int(((i.strumTime / 1000)));
|
||||
if (index + 1 > segments.length)
|
||||
if (index + 1 > segmentsOne.length)
|
||||
continue;
|
||||
segments[index] = segments[index] + 1;
|
||||
segmentsOne[index] = segmentsOne[index] + 1;
|
||||
}
|
||||
|
||||
for(i in handTwo)
|
||||
{
|
||||
var index = Std.int(((i.strumTime / 1000)));
|
||||
if (index + 1 > segmentsTwo.length)
|
||||
continue;
|
||||
segmentsTwo[index] = segmentsTwo[index] + 1;
|
||||
}
|
||||
|
||||
// get the average of all of the segments
|
||||
var sum:Float = 0;
|
||||
var sumOne:Float = 0;
|
||||
var sumTwo:Float = 0;
|
||||
|
||||
var newLength = segments.length;
|
||||
|
||||
for (i in segments)
|
||||
var lone = segmentsOne.length;
|
||||
var ltwo = segmentsOne.length;
|
||||
|
||||
for (i in segmentsOne)
|
||||
{
|
||||
if (i == 0) // remove empty/breaks
|
||||
{
|
||||
newLength--;
|
||||
lone--;
|
||||
continue;
|
||||
}
|
||||
//trace(i);
|
||||
sum += i / .5; // half it because otherwise instead of nps its just fucking notes per half second which is dumb and stupid
|
||||
sumOne += i / .5; // half it because otherwise instead of nps its just fucking notes per half second which is dumb and stupid
|
||||
}
|
||||
return HelperFunctions.truncateFloat(sum / newLength,2);
|
||||
|
||||
for (i in segmentsTwo)
|
||||
{
|
||||
if (i == 0) // remove empty/breaks
|
||||
{
|
||||
ltwo--;
|
||||
continue;
|
||||
}
|
||||
//trace(i);
|
||||
sumTwo += i / .5; // half it because otherwise instead of nps its just fucking notes per half second which is dumb and stupid
|
||||
}
|
||||
|
||||
|
||||
var handOneAvg = sumOne / lone;
|
||||
var handTwoAvg = sumTwo / ltwo;
|
||||
|
||||
return HelperFunctions.truncateFloat(handOneAvg > handTwoAvg ? handOneAvg : handTwoAvg,2);
|
||||
}
|
||||
|
||||
static public function new_Array<T>( ArrayType:T, Length:Int ):Array<T> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user