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:
Chris Danford
2005-03-11 18:09:34 +00:00
parent 197e4a19cd
commit a3e0bacbd8
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
float fScrollSpeed = pPlayerState->m_CurrentPlayerOptions.m_fScrollSpeed;
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
* call to get the RNG rolling. */
+3 -3
View File
@@ -682,7 +682,7 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
//
// 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. */
bool bHaveRandom = false;
@@ -694,7 +694,7 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
if( bHaveRandom )
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.
//
/* 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;
if( m_bRandomize )
+3 -3
View File
@@ -61,7 +61,7 @@ GameState::GameState() :
ReloadCharacters();
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
FOREACH_PlayerNumber( p )
@@ -157,7 +157,7 @@ void GameState::Reset()
NOTESKIN->RefreshNoteSkinData( this->m_pCurGame );
m_iGameSeed = rand();
m_iRoundSeed = rand();
m_iStageSeed = rand();
m_pCurSong.Set( 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
// 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 &timestamp )
+1 -1
View File
@@ -67,7 +67,7 @@ public:
map<CString,CString> m_mapEnv;
/* 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 EnoughCreditsToJoin() const; // true if an unjoined player can join by pressint start
+1 -1
View File
@@ -786,7 +786,7 @@ static void GetTrackMapping( StepsType st, NoteDataUtil::TrackMapping tt, int Nu
int iOrig[MAX_NOTE_TRACKS];
memcpy( iOrig, iTakeFromTrack, sizeof(iOrig) );
int iShuffleSeed = GAMESTATE->m_iRoundSeed;
int iShuffleSeed = GAMESTATE->m_iStageSeed;
do {
RandomGen rnd( iShuffleSeed );
random_shuffle( &iTakeFromTrack[0], &iTakeFromTrack[NumTracks], rnd );