@ -2322,43 +2322,6 @@ void AiL::InitializeLevels(){
backdrop . Load ( " backdrop_directory " _S + DATA [ " Backdrops " ] [ key ] . GetString ( ) , nullptr , false , false ) ;
}
if ( " display_spawn_report " _I ) {
for ( auto & [ map , data ] : MAP_DATA ) {
std : : map < std : : string , long > monsterCounts ;
for ( auto & [ key , value ] : MAP_DATA [ map ] . SpawnerData ) {
SpawnerTag & spawnData = MAP_DATA [ map ] . SpawnerData [ key ] ;
vf2d spawnerRadius = vf2d { spawnData . ObjectData . GetFloat ( " width " ) , spawnData . ObjectData . GetFloat ( " height " ) } / 2 ;
for ( XMLTag & monster : spawnData . monsters ) {
std : : string monsterName = monster . GetString ( " value " ) ;
monsterCounts [ monsterName ] + + ;
}
}
std : : cout < < " Spawns Report for " < < map < < " : " < < std : : endl ;
for ( auto & [ monster , count ] : monsterCounts ) {
std : : cout < < " \t " < < count < < " x " < < monster < < std : : endl ;
}
std : : map < ItemInfo * , long > totalDrops ;
std : : cout < < " Monte Carlo Test: 1 million tries: " < < std : : endl ;
for ( int i = 0 ; i < 1000000 ; i + + ) {
//Try to kill every single monster and see what drops.
for ( auto & [ monster , count ] : monsterCounts ) {
Monster m = Monster { { 0 , 0 } , MONSTER_DATA [ monster ] } ;
for ( int j = 0 ; j < count ; j + + ) {
auto drops = m . SpawnDrops ( ) ;
for ( auto & [ itemInfo , count ] : drops ) {
totalDrops [ itemInfo ] + = count ;
}
}
}
}
std : : cout < < " Average: " < < std : : endl ;
for ( auto & [ itemInfo , count ] : totalDrops ) {
std : : cout < < " \t " < < itemInfo - > Name ( ) < < " x " < < ( count / 1000000l ) ;
}
}
}
Test : : RunMapTests ( ) ;
}
@ -2644,6 +2607,46 @@ void AiL::ValidateGameStatus(){
if ( EnvironmentalAudio : : SOUND_DATA . find ( audio . audioName ) = = EnvironmentalAudio : : SOUND_DATA . end ( ) ) ERR ( std : : format ( " WARNING! Could not find environmental audio data {} for Map {}. Check audio/environmentalaudio.txt configuration! " , audio . audioName , map . name ) ) ;
}
}
# pragma region Map Spawn Statistics
if ( " display_spawn_report " _I ) {
for ( auto & [ map , data ] : MAP_DATA ) {
std : : map < std : : string , long > monsterCounts ;
for ( auto & [ key , value ] : MAP_DATA [ map ] . SpawnerData ) {
SpawnerTag & spawnData = MAP_DATA [ map ] . SpawnerData [ key ] ;
vf2d spawnerRadius = vf2d { spawnData . ObjectData . GetFloat ( " width " ) , spawnData . ObjectData . GetFloat ( " height " ) } / 2 ;
for ( XMLTag & monster : spawnData . monsters ) {
std : : string monsterName = monster . GetString ( " value " ) ;
monsterCounts [ monsterName ] + + ;
}
}
std : : cout < < " Spawns Report for " < < map < < " : " < < std : : endl ;
for ( auto & [ monster , count ] : monsterCounts ) {
std : : cout < < " \t " < < count < < " x " < < monster < < std : : endl ;
}
std : : map < ItemInfo * , long > totalDrops ;
std : : cout < < " Monte Carlo Test: 100000 tries: " < < std : : endl ;
for ( int i = 0 ; i < 100000 ; i + + ) {
//Try to kill every single monster and see what drops.
for ( auto & [ monster , count ] : monsterCounts ) {
Monster m = Monster { { 0 , 0 } , MONSTER_DATA [ monster ] } ;
for ( int j = 0 ; j < count ; j + + ) {
auto drops = m . SpawnDrops ( ) ;
for ( auto & [ itemInfo , count ] : drops ) {
totalDrops [ itemInfo ] + = count ;
}
ItemDrop : : drops . clear ( ) ; //Since we're testing clear the drop list...
}
}
}
std : : cout < < " Average: " < < std : : endl ;
for ( auto & [ itemInfo , count ] : totalDrops ) {
std : : cout < < " \t " < < itemInfo - > Name ( ) < < " x " < < std : : format ( " {:.3} " , count / 100000. ) < < std : : endl ;
}
}
}
# pragma endregion
}
void AiL : : RenderVersionInfo ( ) {