Saving no longer saves logs of running scripts. Some more hacking augmentation nerfs. Reduced thread RAM cost multiplier from 1.02 to 1.01

This commit is contained in:
Daniel Xie 2017-06-18 04:31:14 -05:00
parent dc39b941dc
commit c2aa8d8110
6 changed files with 32 additions and 18 deletions

@ -472,7 +472,7 @@ initAugmentations = function() {
"This augmentation:<br>" + "This augmentation:<br>" +
"Increases the player's hacking speed by 3%<br>" + "Increases the player's hacking speed by 3%<br>" +
"Increases the player's hacking skill by 8%<br>" + "Increases the player's hacking skill by 8%<br>" +
"Increases the player's hacking experience gain rate by 12%"); "Increases the player's hacking experience gain rate by 10%");
EnhancedMyelinSheathing.addToFactions(["Fulcrum Secret Technologies", "BitRunners", "The Black Hand"]); EnhancedMyelinSheathing.addToFactions(["Fulcrum Secret Technologies", "BitRunners", "The Black Hand"]);
if (augmentationExists(AugmentationNames.EnhancedMyelinSheathing)) { if (augmentationExists(AugmentationNames.EnhancedMyelinSheathing)) {
EnhancedMyelinSheathing.owned = Augmentations[AugmentationNames.EnhancedMyelinSheathing].owned; EnhancedMyelinSheathing.owned = Augmentations[AugmentationNames.EnhancedMyelinSheathing].owned;
@ -509,7 +509,7 @@ initAugmentations = function() {
DataJack.setInfo("A brain implant that provides an interface for direct, wireless communication between a computer's main " + DataJack.setInfo("A brain implant that provides an interface for direct, wireless communication between a computer's main " +
"memory and the mind. This implant allows the user to not only access a computer's memory, but also alter " + "memory and the mind. This implant allows the user to not only access a computer's memory, but also alter " +
"and delete it.<br><br>" + "and delete it.<br><br>" +
"This augmentation increases the amount of money the player gains from hacking by 30%"); "This augmentation increases the amount of money the player gains from hacking by 25%");
DataJack.addToFactions(["BitRunners", "The Black Hand", "NiteSec", "Chongqing", "New Tokyo"]); DataJack.addToFactions(["BitRunners", "The Black Hand", "NiteSec", "Chongqing", "New Tokyo"]);
if (augmentationExists(AugmentationNames.DataJack)) { if (augmentationExists(AugmentationNames.DataJack)) {
DataJack.owned = Augmentations[AugmentationNames.DataJack].owned; DataJack.owned = Augmentations[AugmentationNames.DataJack].owned;
@ -561,7 +561,7 @@ initAugmentations = function() {
"Increases the player's hacking speed by 5%<br>" + "Increases the player's hacking speed by 5%<br>" +
"Increases the amount of money the player gains from hacking by 30%<br>" + "Increases the amount of money the player gains from hacking by 30%<br>" +
"Increases the player's chance of successfully performing a hack by 5%<br>" + "Increases the player's chance of successfully performing a hack by 5%<br>" +
"Increases the player's hacking experience gain rate by 20%<br>" + "Increases the player's hacking experience gain rate by 15%<br>" +
"Increases the player's hacking skill by 8%"); "Increases the player's hacking skill by 8%");
ENMCoreV2.addToFactions(["BitRunners", "ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", ENMCoreV2.addToFactions(["BitRunners", "ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO",
"Blade Industries", "OmniTek Incorporated", "KuaiGong International"]); "Blade Industries", "OmniTek Incorporated", "KuaiGong International"]);
@ -580,7 +580,7 @@ initAugmentations = function() {
"Increases the player's hacking speed by 5%<br>" + "Increases the player's hacking speed by 5%<br>" +
"Increases the amount of money the player gains from hacking by 40%<br>" + "Increases the amount of money the player gains from hacking by 40%<br>" +
"Increases the player's chance of successfully performing a hack by 10%<br>" + "Increases the player's chance of successfully performing a hack by 10%<br>" +
"Increases the player's hacking experience gain rate by 35%<br>" + "Increases the player's hacking experience gain rate by 25%<br>" +
"Increases the player's hacking skill by 10%"); "Increases the player's hacking skill by 10%");
ENMCoreV3.addToFactions(["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", ENMCoreV3.addToFactions(["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO",
"Daedalus", "The Covenant", "Illuminati"]); "Daedalus", "The Covenant", "Illuminati"]);
@ -626,7 +626,7 @@ initAugmentations = function() {
"This augmentation:<br>" + "This augmentation:<br>" +
"Increases the player's hacking speed by 2%<br>" + "Increases the player's hacking speed by 2%<br>" +
"Increases the player's chance of successfully performing a hack by 10%<br>" + "Increases the player's chance of successfully performing a hack by 10%<br>" +
"Increases the player's hacking experience gain rate by 20%"); "Increases the player's hacking experience gain rate by 12%");
Neuralstimulator.addToFactions(["The Black Hand", "Chongqing", "Sector-12", "New Tokyo", "Aevum", Neuralstimulator.addToFactions(["The Black Hand", "Chongqing", "Sector-12", "New Tokyo", "Aevum",
"Ishima", "Volhaven", "Bachman & Associates", "Clarke Incorporated", "Ishima", "Volhaven", "Bachman & Associates", "Clarke Incorporated",
"Four Sigma"]); "Four Sigma"]);
@ -742,7 +742,7 @@ initAugmentations = function() {
"to enhance the production and capabilities of its neural stem cells. <br><br>" + "to enhance the production and capabilities of its neural stem cells. <br><br>" +
"This augmentation: <br>" + "This augmentation: <br>" +
"Increases the player's hacking skill by 15%<br>" + "Increases the player's hacking skill by 15%<br>" +
"Increases the player's hacking experience gain rate by 20%<br>"+ "Increases the player's hacking experience gain rate by 10%<br>"+
"Increases the player's hacking speed by 3%"); "Increases the player's hacking speed by 3%");
NeuronalDensification.addToFactions(["Clarke Incorporated"]); NeuronalDensification.addToFactions(["Clarke Incorporated"]);
if (augmentationExists(AugmentationNames.NeuronalDensification)) { if (augmentationExists(AugmentationNames.NeuronalDensification)) {
@ -1550,7 +1550,7 @@ applyAugmentation = function(aug, reapply=false) {
break; break;
case AugmentationNames.EnhancedMyelinSheathing: //Med level case AugmentationNames.EnhancedMyelinSheathing: //Med level
Player.hacking_speed_mult *= 1.03; Player.hacking_speed_mult *= 1.03;
Player.hacking_exp_mult *= 1.12; Player.hacking_exp_mult *= 1.1;
Player.hacking_mult *= 1.08; Player.hacking_mult *= 1.08;
break; break;
case AugmentationNames.SynapticEnhancement: //Low Level case AugmentationNames.SynapticEnhancement: //Low Level
@ -1560,7 +1560,7 @@ applyAugmentation = function(aug, reapply=false) {
Player.hacking_exp_mult *= 1.25; Player.hacking_exp_mult *= 1.25;
break; break;
case AugmentationNames.DataJack: //Med low level case AugmentationNames.DataJack: //Med low level
Player.hacking_money_mult *= 1.3; Player.hacking_money_mult *= 1.25;
break; break;
case AugmentationNames.ENM: //Medium level case AugmentationNames.ENM: //Medium level
Player.hacking_mult *= 1.08; Player.hacking_mult *= 1.08;
@ -1576,14 +1576,14 @@ applyAugmentation = function(aug, reapply=false) {
Player.hacking_speed_mult *= 1.05; Player.hacking_speed_mult *= 1.05;
Player.hacking_money_mult *= 1.3; Player.hacking_money_mult *= 1.3;
Player.hacking_chance_mult *= 1.05; Player.hacking_chance_mult *= 1.05;
Player.hacking_exp_mult *= 1.2; Player.hacking_exp_mult *= 1.15;
Player.hacking_mult *= 1.08; Player.hacking_mult *= 1.08;
break; break;
case AugmentationNames.ENMCoreV3: //High level case AugmentationNames.ENMCoreV3: //High level
Player.hacking_speed_mult *= 1.05; Player.hacking_speed_mult *= 1.05;
Player.hacking_money_mult *= 1.4; Player.hacking_money_mult *= 1.4;
Player.hacking_chance_mult *= 1.1; Player.hacking_chance_mult *= 1.1;
Player.hacking_exp_mult *= 1.35; Player.hacking_exp_mult *= 1.25;
Player.hacking_mult *= 1.1; Player.hacking_mult *= 1.1;
break; break;
case AugmentationNames.ENMAnalyzeEngine: //High level case AugmentationNames.ENMAnalyzeEngine: //High level
@ -1596,7 +1596,7 @@ applyAugmentation = function(aug, reapply=false) {
case AugmentationNames.Neuralstimulator: //Medium Level case AugmentationNames.Neuralstimulator: //Medium Level
Player.hacking_speed_mult *= 1.02; Player.hacking_speed_mult *= 1.02;
Player.hacking_chance_mult *= 1.1; Player.hacking_chance_mult *= 1.1;
Player.hacking_exp_mult *= 1.2; Player.hacking_exp_mult *= 1.12;
break; break;
case AugmentationNames.NeuralAccelerator: case AugmentationNames.NeuralAccelerator:
Player.hacking_mult *= 1.1; Player.hacking_mult *= 1.1;
@ -1629,7 +1629,7 @@ applyAugmentation = function(aug, reapply=false) {
break; break;
case AugmentationNames.NeuronalDensification: case AugmentationNames.NeuronalDensification:
Player.hacking_mult *= 1.15; Player.hacking_mult *= 1.15;
Player.hacking_exp_mult *= 1.2; Player.hacking_exp_mult *= 1.1;
Player.hacking_speed_mult *= 1.03; Player.hacking_speed_mult *= 1.03;
break; break;

@ -281,7 +281,7 @@ CONSTANTS = {
"yield $50,000. <br><br> " + "yield $50,000. <br><br> " +
"Each additional thread to a script will slightly increase the RAM usage for that thread. The total cost of running a script with " + "Each additional thread to a script will slightly increase the RAM usage for that thread. The total cost of running a script with " +
"n threads can be calculated with: <br>" + "n threads can be calculated with: <br>" +
"base cost * n * (1.02 ^ n) <br>" + "base cost * n * (1.01 ^ n) <br>" +
"where the base cost is the amount of RAM required to run the script with a single thread. In the terminal, you can run the " + "where the base cost is the amount of RAM required to run the script with a single thread. In the terminal, you can run the " +
"'mem [scriptname] -t n' command to see how much RAM a script requires with n threads. <br><br>" + "'mem [scriptname] -t n' command to see how much RAM a script requires with n threads. <br><br>" +
"Every method for running a script has an option for making it multihreaded. To run a script with " + "Every method for running a script has an option for making it multihreaded. To run a script with " +
@ -654,6 +654,7 @@ CONSTANTS = {
"-grow() and weaken() now give hacking experience based on the server's base security level, rather than a flat exp amount<br>" + "-grow() and weaken() now give hacking experience based on the server's base security level, rather than a flat exp amount<br>" +
"-Slightly reduced amount of exp gained from hack(), weaken(), and grow()<br>" + "-Slightly reduced amount of exp gained from hack(), weaken(), and grow()<br>" +
"-Rebalanced formulas that determine crime success<br>" + "-Rebalanced formulas that determine crime success<br>" +
"-Reduced RAM cost for multithreading a script. The RAM multiplier for each thread was reduced from 1.02 to 1.01<br>"
"v0.21.1<br>" + "v0.21.1<br>" +
"-IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that! <br>" + "-IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that! <br>" +
"-Autocompletion for aliases - courtesy of Github user LTCNugget<br><br>" + "-Autocompletion for aliases - courtesy of Github user LTCNugget<br><br>" +

@ -971,7 +971,7 @@ function runScriptFromScript(server, scriptname, args, workerScript, threads=1)
//Check for admin rights and that there is enough RAM availble to run //Check for admin rights and that there is enough RAM availble to run
var script = server.scripts[i]; var script = server.scripts[i];
var ramUsage = script.ramUsage; var ramUsage = script.ramUsage;
ramUsage = ramUsage * threads * Math.pow(1.02, threads-1); ramUsage = ramUsage * threads * Math.pow(1.01, threads-1);
var ramAvailable = server.maxRam - server.ramUsed; var ramAvailable = server.maxRam - server.ramUsed;
if (server.hasAdminRights == false) { if (server.hasAdminRights == false) {

@ -142,7 +142,7 @@ function addWorkerScript(runningScriptObj, server) {
} else { } else {
runningScriptObj.threads = 1; runningScriptObj.threads = 1;
} }
var ramUsage = runningScriptObj.scriptRef.ramUsage * threads * Math.pow(1.02, threads-1); var ramUsage = runningScriptObj.scriptRef.ramUsage * threads * Math.pow(1.01, threads-1);
server.ramUsed += ramUsage; server.ramUsed += ramUsage;
//Create the WorkerScript //Create the WorkerScript

@ -17,7 +17,20 @@ function BitburnerSaveObject() {
BitburnerSaveObject.prototype.saveGame = function() { BitburnerSaveObject.prototype.saveGame = function() {
this.PlayerSave = JSON.stringify(Player); this.PlayerSave = JSON.stringify(Player);
this.AllServersSave = JSON.stringify(AllServers);
//Delete all logs from all running scripts
TempAllServers = jQuery.extend(true, {}, AllServers); //Deep copy
for (var ip in TempAllServers) {
var server = TempAllServers[ip];
if (server == null) {continue;}
for (var i = 0; i < server.runningScripts.length; ++i) {
var runningScriptObj = server.runningScripts[i];
runningScriptObj.logs.length = 0;
runningScriptObj.logs = [];
}
}
this.AllServersSave = JSON.stringify(TempAllServers);
this.CompaniesSave = JSON.stringify(Companies); this.CompaniesSave = JSON.stringify(Companies);
this.FactionsSave = JSON.stringify(Factions); this.FactionsSave = JSON.stringify(Factions);
this.SpecialServerIpsSave = JSON.stringify(SpecialServerIps); this.SpecialServerIpsSave = JSON.stringify(SpecialServerIps);

@ -789,7 +789,7 @@ var Terminal = {
for (var i = 0; i < currServ.scripts.length; ++i) { for (var i = 0; i < currServ.scripts.length; ++i) {
if (scriptName == currServ.scripts[i].filename) { if (scriptName == currServ.scripts[i].filename) {
var scriptBaseRamUsage = currServ.scripts[i].ramUsage; var scriptBaseRamUsage = currServ.scripts[i].ramUsage;
var ramUsage = scriptBaseRamUsage * numThreads * Math.pow(1.02, numThreads-1); var ramUsage = scriptBaseRamUsage * numThreads * Math.pow(1.01, numThreads-1);
post("This script requires " + formatNumber(ramUsage, 2) + "GB of RAM to run for " + numThreads + " thread(s)"); post("This script requires " + formatNumber(ramUsage, 2) + "GB of RAM to run for " + numThreads + " thread(s)");
return; return;
@ -1303,7 +1303,7 @@ var Terminal = {
if (server.scripts[i].filename == scriptName) { if (server.scripts[i].filename == scriptName) {
//Check for admin rights and that there is enough RAM availble to run //Check for admin rights and that there is enough RAM availble to run
var script = server.scripts[i]; var script = server.scripts[i];
var ramUsage = script.ramUsage * numThreads * Math.pow(1.02, numThreads-1); var ramUsage = script.ramUsage * numThreads * Math.pow(1.01, numThreads-1);
var ramAvailable = server.maxRam - server.ramUsed; var ramAvailable = server.maxRam - server.ramUsed;
if (server.hasAdminRights == false) { if (server.hasAdminRights == false) {