Skip to content

Commit

Permalink
Merge branch 'master' into wod
Browse files Browse the repository at this point in the history
Conflicts:
	engine/report/sc_report_html_player.cpp
	engine/sc_thread.cpp
  • Loading branch information
scamille committed Apr 18, 2014
2 parents e4e9b06 + d251e69 commit cee479a
Show file tree
Hide file tree
Showing 56 changed files with 5,023 additions and 4,997 deletions.
598 changes: 299 additions & 299 deletions CMakeLists.txt.old

Large diffs are not rendered by default.

1,348 changes: 674 additions & 674 deletions COPYING

Large diffs are not rendered by default.

136 changes: 68 additions & 68 deletions dbc_extract/autoextract.bat
@@ -1,69 +1,69 @@
@echo off

setlocal enabledelayedexpansion
set LANG=enUS

set PTR=
if not %1 == ptr goto start
set PTR= ptr
shift

:start
set INPATH_A=%~f1\Data
set INPATH_B=%~f1\Data\%LANG%
set OUTPATH=%~f2

if exist "%INPATH_A%" goto pathb
echo Error: Unable to find WoW path! %INPATH_A%
echo.
goto usage

:pathb
if exist "%INPATH_B%" goto next
echo Error: Unable to find WoW path! %INPATH_B%
echo.
goto usage

:next
if exist "%OUTPATH%" goto okay
echo Error: Unable to find output path!
echo.
goto usage

:okay
set FILES=misc.MPQ
for %%f in ("%INPATH_A%\wow-update-base*.MPQ") do (
set FILES=!FILES! %%~nf.MPQ
)
set BUILD=%FILES:~-9,5%

echo cd "%INPATH_A%" > tmp1.mopaq
echo op %FILES% >> tmp1.mopaq
echo e misc.MPQ DBFilesClient\* "%OUTPATH%\%BUILD%" /fp >> tmp1.mopaq

set FILES=locale-%LANG%.MPQ
for %%f in ("%INPATH_B%\wow-update-%LANG%*.MPQ") do (
set FILES=!FILES! %%~nf.MPQ
)
set BUILD=%FILES:~-9,5%

echo cd "%INPATH_B%" > tmp2.mopaq
echo op %FILES% >> tmp2.mopaq
echo e locale-%LANG%.MPQ DBFilesClient\* "%OUTPATH%\%BUILD%" /fp >> tmp2.mopaq

mkdir "%OUTPATH%\%BUILD%"
MPQEditor.exe /console tmp1.mopaq
del tmp1.mopaq
MPQEditor.exe /console tmp2.mopaq
del tmp2.mopaq

echo Generating...
generate.bat%PTR% %BUILD% "%OUTPATH%"

goto end

:usage
echo Usage: autoextract.bat [ptr] wowpath outpath

:end
@echo off

setlocal enabledelayedexpansion
set LANG=enUS

set PTR=
if not %1 == ptr goto start
set PTR= ptr
shift

:start
set INPATH_A=%~f1\Data
set INPATH_B=%~f1\Data\%LANG%
set OUTPATH=%~f2

if exist "%INPATH_A%" goto pathb
echo Error: Unable to find WoW path! %INPATH_A%
echo.
goto usage

:pathb
if exist "%INPATH_B%" goto next
echo Error: Unable to find WoW path! %INPATH_B%
echo.
goto usage

:next
if exist "%OUTPATH%" goto okay
echo Error: Unable to find output path!
echo.
goto usage

:okay
set FILES=misc.MPQ
for %%f in ("%INPATH_A%\wow-update-base*.MPQ") do (
set FILES=!FILES! %%~nf.MPQ
)
set BUILD=%FILES:~-9,5%

echo cd "%INPATH_A%" > tmp1.mopaq
echo op %FILES% >> tmp1.mopaq
echo e misc.MPQ DBFilesClient\* "%OUTPATH%\%BUILD%" /fp >> tmp1.mopaq

set FILES=locale-%LANG%.MPQ
for %%f in ("%INPATH_B%\wow-update-%LANG%*.MPQ") do (
set FILES=!FILES! %%~nf.MPQ
)
set BUILD=%FILES:~-9,5%

echo cd "%INPATH_B%" > tmp2.mopaq
echo op %FILES% >> tmp2.mopaq
echo e locale-%LANG%.MPQ DBFilesClient\* "%OUTPATH%\%BUILD%" /fp >> tmp2.mopaq

mkdir "%OUTPATH%\%BUILD%"
MPQEditor.exe /console tmp1.mopaq
del tmp1.mopaq
MPQEditor.exe /console tmp2.mopaq
del tmp2.mopaq

echo Generating...
generate.bat%PTR% %BUILD% "%OUTPATH%"

goto end

:usage
echo Usage: autoextract.bat [ptr] wowpath outpath

:end
endlocal
3 changes: 0 additions & 3 deletions engine/class_modules/sc_druid.cpp
Expand Up @@ -6125,9 +6125,6 @@ void druid_t::init_scaling()
if ( specialization() == DRUID_FERAL )
scales_with[ STAT_SPIRIT ] = false;

if ( specialization() == DRUID_BALANCE )
scales_with[ STAT_SPIRIT ] = false;

if ( specialization() == DRUID_GUARDIAN )
{
scales_with[ STAT_WEAPON_DPS ] = false;
Expand Down
13 changes: 11 additions & 2 deletions engine/class_modules/sc_warlock.cpp
Expand Up @@ -6,8 +6,7 @@


/*TODO for 5.4:
Implement harvest_life talent: Increases Drain Life damage
Implement demonic breath talent
*/
namespace { // unnamed namespace
Expand Down Expand Up @@ -2363,6 +2362,16 @@ struct drain_life_t : public warlock_spell_t

consume_tick_resource( d );
}
virtual double action_multiplier() const
{
double am = warlock_spell_t::action_multiplier();

if ( p() -> talents.harvest_life -> ok() )
am *= 1.0 + p() -> talents.harvest_life -> effectN( 1 ).percent();

return am;
}

};

struct unstable_affliction_t : public warlock_spell_t
Expand Down
84 changes: 30 additions & 54 deletions engine/player/sc_player.cpp
Expand Up @@ -443,7 +443,7 @@ player_t::player_t( sim_t* s,
iteration_waiting_time( timespan_t::zero() ), iteration_executed_foreground_actions( 0 ),
rps_gain( 0 ), rps_loss( 0 ),

tmi_window( 6.0 ), new_tmi( 0 ), tmi_filter( 1.0 ),
tmi_window( 6.0 ),
collected_data( player_collected_data_t( name_str, *sim ) ),
vengeance( collected_data.vengeance_timeline ),
// Damage
Expand Down Expand Up @@ -847,9 +847,6 @@ void player_t::init_character_properties()

if ( sim -> tmi_window_global > 0 )
tmi_window = sim -> tmi_window_global;

new_tmi = sim -> new_tmi;
tmi_filter = sim -> tmi_filter;
}

void scale_challenge_mode( player_t& p, const rating_t& rating )
Expand Down Expand Up @@ -9616,6 +9613,7 @@ player_collected_data_t::player_collected_data_t( const std::string& player_name
absorb_taken( player_name + " Absorb Taken", s.statistics_level < 2 ),
deaths( player_name + " Deaths", s.statistics_level < 2 ),
theck_meloree_index( player_name + " Theck-Meloree Index", s.statistics_level < 1 ),
max_spike_amount( player_name + " Max Spike Value", s.statistics_level < 1 ),
resource_timelines(),
combat_end_resource( RESOURCE_MAX ),
stat_timelines(),
Expand Down Expand Up @@ -9718,6 +9716,7 @@ void player_collected_data_t::analyze( const player_t& p )
// Tank
deaths.analyze_all();
theck_meloree_index.analyze_all();
max_spike_amount.analyze_all();

for ( size_t i = 0; i < resource_timelines.size(); ++i )
{
Expand Down Expand Up @@ -9833,12 +9832,11 @@ void player_collected_data_t::collect_data( const player_t& p )
if ( ! p.is_enemy() ) // Boss TMI is irrelevant, causes problems in iteration #1
{
double tmi = 0; // TMI result
double max_spike = 0; // Maximum spike size
if ( f_length )
{
// define constants and variables
int window = std::floor( ( p.tmi_window ) / 1 + 0.5 ); // window size, bin time replaces 1 eventually
double w0 = 6; // normalized window size
double hdf = 3; // default health decade factor
int window = std::floor( ( p.tmi_window ) / 1.0 + 0.5 ); // window size, bin time replaces 1 eventually

// declare sliding average timeline
sc_timeline_t sliding_average_tl;
Expand All @@ -9850,65 +9848,43 @@ void player_collected_data_t::collect_data( const player_t& p )

// pull the data out of the normalized sliding average timeline
std::vector<double> weighted_value = sliding_average_normalized_tl.data();
max_spike = *std::max_element( weighted_value.begin(), weighted_value.end() );
max_spike *= window;

if ( p.new_tmi > 0 ) // new TMI implementation for testing
{
// define constants
double D = 10 * p.tmi_filter; // filtering strength
double c2 = std::exp( D );
double c1 = p.new_tmi * 5000 / D; // slope

for ( size_t j = 0, size = weighted_value.size(); j < size; j++ )
{
// normalize to the default window size (6-second window)
weighted_value[ j ] *= w0;

// calculate exponentially-weighted contribution of this data point
weighted_value[ j ] = std::exp( D * ( weighted_value[ j ] - 1 ) );

// add to the TMI total
tmi += weighted_value [ j ];
}

// normalize for fight length
tmi /= f_length;
// define constants
double D = 10; // filtering strength
double c2 = 450; // N_0, default fight length for normalization
double c1 = 100000 / D; // health scale factor, determines slope of plot

// constant multiplicative normalization factors
tmi *= c2;
tmi += 1;
tmi = std::log( tmi );
tmi *= c1;

}
else // old TMI
for ( size_t j = 0, size = weighted_value.size(); j < size; j++ )
{
// weighted_value is the moving average (i.e. 1-second), so multiplly by window size to get damage in "window" seconds
weighted_value[ j ] *= window;

for ( size_t j = 0, size = weighted_value.size(); j < size; j++ )
{
// normalize to the default window size (6-second window)
weighted_value[ j ] *= w0;

// calculate exponentially-weighted contribution of this data point
weighted_value[ j ] = std::exp( 10 * std::log( hdf ) * ( weighted_value[ j ] - 1 ) );
// calculate exponentially-weighted contribution of this data point using filter strength D
weighted_value[ j ] = std::exp( D * weighted_value[ j ] );

// add to the TMI total
tmi += weighted_value [ j ];
}

// normalize for fight length
tmi /= f_length;

// constant multiplicative normalization factors
// these are estimates at the moment - will be fine-tuned later
tmi *= 10000;
tmi *= std::pow( static_cast<double>( window ) , 2 ); // normalizes for window size
// add to the TMI total; strictly speaking this should be moved outside the for loop and turned into a sort() followed by a sum for numerical accuracy
tmi += weighted_value [ j ];
}

// multiply by vertical offset factor c2
tmi *= c2;
// normalize for fight length
tmi /= f_length;
// optional zero-bounding
// tmi += 1;
// take log of result
tmi = std::log( tmi );
// multiply by health decade scale factor
tmi *= c1;

// if an output file has been defined, write to it
print_tmi_debug_csv( &sliding_average_tl, &sliding_average_normalized_tl, weighted_value, p );
}
// normalize by fight length and add to TMI data array
theck_meloree_index.add( tmi );
max_spike_amount.add( max_spike );
}
else
theck_meloree_index.add( 0.0 );
Expand Down

0 comments on commit cee479a

Please sign in to comment.