From 6674d2a9a147607e9b619322558c1a5f84f032c3 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 20 Oct 2002 21:39:13 +0000 Subject: [PATCH] Fixed super shuffle generating impossible HoldNote patterns. --- stepmania/NEWS | 3 +- stepmania/TODO.chris | 1 + stepmania/src/NoteData.cpp | 80 +++++++++++++++++++++++--------------- stepmania/src/Player.cpp | 6 ++- 4 files changed, 55 insertions(+), 35 deletions(-) diff --git a/stepmania/NEWS b/stepmania/NEWS index 58184f0155..67c1ddfa13 100644 --- a/stepmania/NEWS +++ b/stepmania/NEWS @@ -28,7 +28,8 @@ CHANGE: AutoGen now only generated dance->pump and pump->dance to cut CHANGE: Texure cache disabled because of performance problems on low memory systems. If you have >= 128MB memory, you may want re-enable it by setting UnloadTextureDelaySeconds=1800. - +BUG FIX: Fixed super shuffle generating impossible HoldNote patterns + ------------------------CVS after 3.00 beta 6---------------- CHANGE: Missing a jump with the Oni life meter now subtracts only 1 life. CHANGE: Judge difficulty strictness increased slightly. diff --git a/stepmania/TODO.chris b/stepmania/TODO.chris index fd965a1d6d..60ad47a57a 100644 --- a/stepmania/TODO.chris +++ b/stepmania/TODO.chris @@ -2,6 +2,7 @@ Fix ///////////////////////// +super shuffle doesn't correctly handle holds (Ayla Part 2) There's a major Oni course bug (at least in Pump mode): diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 55d5feef76..1abcce07e6 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -566,6 +566,7 @@ void NoteData::Turn( PlayerOptions::TurnType tt ) } break; case PlayerOptions::TURN_SHUFFLE: + case PlayerOptions::TURN_SUPER_SHUFFLE: // use this code to shuffle the HoldNotes { CArray aiTracksLeftToMap; for( t=0; tCopyAll( &tempNoteData ); // copy note data from newData back into this + this->Convert2sAnd3sToHoldNotes(); + + + + if( tt == PlayerOptions::TURN_SUPER_SHUFFLE ) { - this->Convert2sAnd3sToHoldNotes(); // so we don't super-shuffle HoldNotes - for( int r=0; rGetLastRow(); r++ ) // foreach row - { - if( !this->IsRowEmpty(r) ) - { - // shuffle this row - CArray aiTracksLeftToMap; - for( t=0; tm_iNumTracks; + + // copy all HoldNotes before copying taps + for( int i=0; im_iNumHoldNotes; i++ ) + tempNoteData.AddHoldNote( this->m_HoldNotes[i] ); + + this->ConvertHoldNotesTo4s(); + + for( int r=0; r<=this->GetLastRow(); r++ ) // foreach row + { + if( this->IsRowEmpty(r) ) + continue; // no need to super shuffle this row + + // shuffle this row + CArray aiTracksThatCouldHaveTapNotes; + for( t=0; tm_iNumHoldNotes; i++ ) - { - HoldNote& hn = this->m_HoldNotes[i]; - HoldNote newHN = hn; - hn.m_iTrack = rand() % m_iNumTracks; - tempNoteData.AddHoldNote( newHN ); - } - } - this->CopyAll( &tempNoteData ); // copy note data from newData back into this - this->Convert2sAnd3sToHoldNotes(); + this->CopyAll( &tempNoteData ); // copy note data from newData back into this + } } void NoteData::MakeLittle() @@ -661,11 +674,14 @@ void NoteData::MakeLittle() * this to do this. -glenn * + * This code intentially leaves the '2' behind because a hold head is + * treated exactly like a tap note for scoring purposes. + */ void NoteData::Convert2sAnd3sToHoldNotes() { - // Any note will end a hold (not just a '3'). This makes parsing DWIs much easier, - // plus we don't want tap notes in the middle of a hold! + // Any note will end a hold (not just a '3'). This makes parsing DWIs much easier. + // Plus, allowing tap notes in the middle of a hold doesn't make sense! for( int col=0; col= TNS_GOOD); LOG->Trace("(%2d/%2d)Note offset: %f, Score: %i", m_iOffsetSample, SAMPLE_COUNT, fNoteOffset, score); - if (GAMESTATE->m_SongOptions.m_AutoAdjust == SongOptions::ADJUST_ON) { + if (GAMESTATE->m_SongOptions.m_AutoAdjust == SongOptions::ADJUST_ON) + { m_fOffset[m_iOffsetSample++] = fNoteOffset; - if (m_iOffsetSample >= SAMPLE_COUNT) { + if (m_iOffsetSample >= SAMPLE_COUNT) + { float stddev = 0.0f, mean = 0.0f; int i;