User:Illviljan: Difference between revisions
>Illviljan No edit summary |
>Illviljan No edit summary |
||
Line 1: | Line 1: | ||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! Matlab scripts | |||
|- | |||
| | | | ||
Copy scripts from the Edit page. | |||
| | |||
| | |||
{ | {| class="wikitable mw-collapsible mw-collapsed" | ||
! Experience Penalty | |||
|- | |||
| | |||
%% Experience Penalty | |||
% The player also suffers a penalty to XP if the player is too far above | |||
% or below the monster's level. | |||
home, clear all, close all | |||
%% Input | |||
PlayerLevel = 1:100; | |||
MonsterLevel = 1:85; | |||
%% Calculations | |||
% Create a repeated matrix: | |||
mPlayerLevel = repmat(PlayerLevel, length(MonsterLevel), 1); | |||
mMonsterLevel = repmat(MonsterLevel, length(PlayerLevel), 1)'; | |||
* | |||
** | % Minimum amount of experience penalty: | ||
minEXPMulti = 0.01; | |||
* | % There's a safe zone between player level and monster level where no | ||
* | % experience penalty is applied: | ||
SafeZone = floor(3 + mPlayerLevel/16); | |||
% Any additional level difference in excess of this safe range is the | |||
% effective level difference: | |||
EffectiveDifference = max(abs(mPlayerLevel - mMonsterLevel) - SafeZone, 0); | |||
% If the effective difference is negative that implies the player is inside | |||
% the safe zone. Therefore only values =>0 are relevant. | |||
% If the player level is outside the safe zone a multiplier on monsters | |||
% experience takes effect, reducing the amount by: | |||
XPMultiplier = max(((mPlayerLevel + 5) ./ ... | |||
(mPlayerLevel + 5 + EffectiveDifference.^2.5)).^1.5, minEXPMulti); | |||
%% Contour plot | |||
figure | |||
[C,h] = contourf(mPlayerLevel,mMonsterLevel,XPMultiplier); | |||
ticks = 5; | |||
set(gca,'XTick',0:ticks:PlayerLevel(end)); | |||
set(gca,'YTick',0:ticks:MonsterLevel(end)); | |||
h = colorbar; | |||
h.Limits = [0.01 1]; | |||
grid minor | |||
shading interp | |||
title('Experience Penalty') | |||
xlabel('Player Level') | |||
ylabel('Monster Level') | |||
% zlabel('Experience efficiency') | |||
ylabel(h,'Experience Efficiency'); | |||
%% Party play | |||
% Parties with different character levels will gain different amount of | |||
% experience according to: | |||
PercentualShare = (PlayerLevel + 10).^2.71 ./ sum((PlayerLevel + 10).^2.71,2); | |||
|} | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! Chance to hit and avoid attacks | |||
|- | |||
| | |||
%% Chance to hit and avoid attacks. | |||
close all, clear all, home | |||
set(0,'DefaultFigureWindowStyle', 'docked'); | |||
% Sources: | |||
% http://pathofexile.gamepedia.com/Evasion | |||
% http://pathofexile.gamepedia.com/Accuracy | |||
%% Input | |||
step = 100; | |||
evasionRating = linspace(0, 50000, step); | |||
attackerAccuracy = linspace(0, 4000, step); | |||
chanceToDodge = 0; | |||
%% Calculations | |||
% Create a Mesh grid to be able to do contour plots: | |||
[evasionRatingMesh, attackerAccuracyMesh] = meshgrid(evasionRating, attackerAccuracy); | |||
% Chance to hit is a function if accuracy and evasion rating: | |||
chanceToHit = min(max( attackerAccuracyMesh ./ (attackerAccuracyMesh + (evasionRatingMesh/4).^0.8), 0.05) , 0.95); | |||
% Chance to avoid hits | |||
chanceToAvoidHit = 1 - chanceToHit*(1-chanceToDodge); | |||
%% Contour plot | |||
% Chance to avoid hit contour plot | |||
figure | |||
[C,h] = contourf(evasionRatingMesh,attackerAccuracyMesh,chanceToAvoidHit*100); | |||
clabel(C,h,'labelspacing',200) | |||
% clabel(C,h,'manual') | |||
colormap(cool) | |||
h = colorbar; | |||
h.Limits = [5 95]; | |||
grid minor | |||
shading interp | |||
title('Chance to avoid enemy attacks') | |||
xlabel('Defender''s Evasion Rating') | |||
ylabel('Attacker''s Accuracy Rating') | |||
ylabel(h,'Chance to avoid hit [%]'); | |||
% Chance to hit contour plot | |||
figure | |||
[C,h] = contourf(attackerAccuracyMesh,evasionRatingMesh, chanceToHit*100); | |||
clabel(C,h,'labelspacing',700) | |||
colormap(cool) | |||
h = colorbar; | |||
h.Limits = [5 95]; | |||
grid minor | |||
shading interp | |||
title('Chance to hit enemy') | |||
xlabel('Attacker''s Accuracy Rating') | |||
ylabel('Defender''s Evasion Rating') | |||
% zlabel('Experience efficiency') | |||
ylabel(h,'Chance to hit [%]'); | |||
|} | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! Armour Reduction | |||
|- | |||
| | |||
%% Armour Reduction | |||
close all, clear all, home | |||
% Sources: | |||
% http://pathofexile.gamepedia.com/Armour | |||
%% Input | |||
step = 100; | |||
Armour = linspace(0, 50000, step); | |||
Damage = linspace(0, 10000, step); | |||
%% Calculations | |||
% Create a Mesh grid to be able to do contour plots: | |||
[ArmourMesh, DamageMesh] = meshgrid(Armour, Damage); | |||
Damage_Reduction_FactorMesh = ArmourMesh ./ (ArmourMesh + 10 * DamageMesh); | |||
%% Contour plot | |||
figure | |||
[C,h] = contour(ArmourMesh,Damage_Reduction_FactorMesh*100,DamageMesh, ... | |||
[100:200:600, 1000:500:2000, 3000:1000:6000, 8000:2000:10000]); | |||
clabel(C,h, 'labelspacing',700); | |||
clabel(C,h,'manual') | |||
colormap(copper) | |||
h = colorbar; | |||
% h.Limits = [0.01 1]; | |||
grid minor | |||
shading interp | |||
ylim([0 90]) | |||
title('Damage Reduction') | |||
xlabel('Armour Rating') | |||
ylabel('Damage Reduction Factor [%]') | |||
ylabel(h,'Raw Damage'); | |||
|} | |||
|} |
Revision as of 18:23, 17 November 2015
Matlab scripts | ||||||
---|---|---|---|---|---|---|
Copy scripts from the Edit page.
|