Reset the round seed so that the players get new shuffle patterns if they Back out of gameplay and play again
RoundSeed -> StageSeed
This commit is contained in:
@@ -89,7 +89,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
|
|||||||
float fScrollSpeed = pPlayerState->m_CurrentPlayerOptions.m_fScrollSpeed;
|
float fScrollSpeed = pPlayerState->m_CurrentPlayerOptions.m_fScrollSpeed;
|
||||||
if( pPlayerState->m_CurrentPlayerOptions.m_fRandomSpeed > 0 && !bAbsolute )
|
if( pPlayerState->m_CurrentPlayerOptions.m_fRandomSpeed > 0 && !bAbsolute )
|
||||||
{
|
{
|
||||||
int seed = GAMESTATE->m_iRoundSeed + ( BeatToNoteRow( fNoteBeat ) << 8 ) + (iCol * 100);
|
int seed = GAMESTATE->m_iStageSeed + ( BeatToNoteRow( fNoteBeat ) << 8 ) + (iCol * 100);
|
||||||
|
|
||||||
/* Temporary hack: the first call to RandomFloat isn't "random"; it takes an extra
|
/* Temporary hack: the first call to RandomFloat isn't "random"; it takes an extra
|
||||||
* call to get the RNG rolling. */
|
* call to get the RNG rolling. */
|
||||||
|
|||||||
@@ -682,7 +682,7 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
|
|||||||
//
|
//
|
||||||
// Check to see if the Trail cache is out of date
|
// Check to see if the Trail cache is out of date
|
||||||
//
|
//
|
||||||
if( m_iTrailCacheSeed != GAMESTATE->m_iRoundSeed )
|
if( m_iTrailCacheSeed != GAMESTATE->m_iStageSeed )
|
||||||
{
|
{
|
||||||
/* If we have any random entries (so that the seed matters), invalidate the cache. */
|
/* If we have any random entries (so that the seed matters), invalidate the cache. */
|
||||||
bool bHaveRandom = false;
|
bool bHaveRandom = false;
|
||||||
@@ -694,7 +694,7 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
|
|||||||
if( bHaveRandom )
|
if( bHaveRandom )
|
||||||
m_TrailCache.clear();
|
m_TrailCache.clear();
|
||||||
|
|
||||||
m_iTrailCacheSeed = GAMESTATE->m_iRoundSeed;
|
m_iTrailCacheSeed = GAMESTATE->m_iStageSeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -794,7 +794,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
// Construct a new Trail, add it to the cache, then return it.
|
// Construct a new Trail, add it to the cache, then return it.
|
||||||
//
|
//
|
||||||
/* Different seed for each course, but the same for the whole round: */
|
/* Different seed for each course, but the same for the whole round: */
|
||||||
RandomGen rnd( GAMESTATE->m_iRoundSeed + GetHashForString(m_sMainTitle) );
|
RandomGen rnd( GAMESTATE->m_iStageSeed + GetHashForString(m_sMainTitle) );
|
||||||
|
|
||||||
vector<CourseEntry> tmp_entries;
|
vector<CourseEntry> tmp_entries;
|
||||||
if( m_bRandomize )
|
if( m_bRandomize )
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ GameState::GameState() :
|
|||||||
ReloadCharacters();
|
ReloadCharacters();
|
||||||
|
|
||||||
m_iNumTimesThroughAttract = -1; // initial screen will bump this up to 0
|
m_iNumTimesThroughAttract = -1; // initial screen will bump this up to 0
|
||||||
m_iRoundSeed = m_iGameSeed = 0;
|
m_iStageSeed = m_iGameSeed = 0;
|
||||||
|
|
||||||
m_PlayMode = PLAY_MODE_INVALID; // used by IsPlayerEnabled before the first screen
|
m_PlayMode = PLAY_MODE_INVALID; // used by IsPlayerEnabled before the first screen
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
@@ -157,7 +157,7 @@ void GameState::Reset()
|
|||||||
NOTESKIN->RefreshNoteSkinData( this->m_pCurGame );
|
NOTESKIN->RefreshNoteSkinData( this->m_pCurGame );
|
||||||
|
|
||||||
m_iGameSeed = rand();
|
m_iGameSeed = rand();
|
||||||
m_iRoundSeed = rand();
|
m_iStageSeed = rand();
|
||||||
|
|
||||||
m_pCurSong.Set( NULL );
|
m_pCurSong.Set( NULL );
|
||||||
m_pPreferredSong = NULL;
|
m_pPreferredSong = NULL;
|
||||||
@@ -647,7 +647,7 @@ void GameState::ResetStageStatistics()
|
|||||||
|
|
||||||
// Reset the round seed. Do this here and not in FinishStage so that players
|
// Reset the round seed. Do this here and not in FinishStage so that players
|
||||||
// get new shuffle patterns if they Back out of gameplay and play again.
|
// get new shuffle patterns if they Back out of gameplay and play again.
|
||||||
GAMESTATE->m_iRoundSeed = rand();
|
GAMESTATE->m_iStageSeed = rand();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp )
|
void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp )
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
map<CString,CString> m_mapEnv;
|
map<CString,CString> m_mapEnv;
|
||||||
|
|
||||||
/* This is set to a random number per-game/round; it can be used for a random seed. */
|
/* This is set to a random number per-game/round; it can be used for a random seed. */
|
||||||
int m_iGameSeed, m_iRoundSeed;
|
int m_iGameSeed, m_iStageSeed;
|
||||||
|
|
||||||
bool PlayersCanJoin() const; // true if it's not too late for a player to join
|
bool PlayersCanJoin() const; // true if it's not too late for a player to join
|
||||||
bool EnoughCreditsToJoin() const; // true if an unjoined player can join by pressint start
|
bool EnoughCreditsToJoin() const; // true if an unjoined player can join by pressint start
|
||||||
|
|||||||
@@ -786,7 +786,7 @@ static void GetTrackMapping( StepsType st, NoteDataUtil::TrackMapping tt, int Nu
|
|||||||
int iOrig[MAX_NOTE_TRACKS];
|
int iOrig[MAX_NOTE_TRACKS];
|
||||||
memcpy( iOrig, iTakeFromTrack, sizeof(iOrig) );
|
memcpy( iOrig, iTakeFromTrack, sizeof(iOrig) );
|
||||||
|
|
||||||
int iShuffleSeed = GAMESTATE->m_iRoundSeed;
|
int iShuffleSeed = GAMESTATE->m_iStageSeed;
|
||||||
do {
|
do {
|
||||||
RandomGen rnd( iShuffleSeed );
|
RandomGen rnd( iShuffleSeed );
|
||||||
random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[NumTracks], rnd );
|
random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[NumTracks], rnd );
|
||||||
|
|||||||
Reference in New Issue
Block a user