Bitburner

Bitburner

View Stats:
Help Optimizing for Maximal Income
How to Optimize
At this point, I have 25 servers each with 1024gb of RAM. I have them all running the same script which is attacking the crush-fitness server. The script I used is a lightly modified version of the beginner's guide script called early-hack-template.script. The script can be found at https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html

What do People do With Their Servers?
I want to see how other people set up their servers and how profitable it is. I know that having 25 servers running the same script each with 384 threads is not optimal. I know that! It is an extremely inconsistent way to generate income and hacking experience. I just wanted to see what other people did to maximize their profits.

I know I am a Nub
Go ahead and roast me!
< >
Showing 1-15 of 20 comments
Happyscientist Feb 1, 2023 @ 6:40pm 
I find that attacking many lower level servers often works better than attacking one higher level server.
Zac Starfire Feb 4, 2023 @ 9:20am 
For max money, you want to get the stock market going:

https://steamcommunity.com/sharedfiles/filedetails/?id=2860330999

With the stock market you can easily make 1q +

With 25 servers, you can create a server farm to make max hacking xp or use them to share to factions for reputation later, so basically make xp with hacking, then once you have enough money, invest in the stock market.
Last edited by Zac Starfire; Feb 4, 2023 @ 9:42am
Bugs Bunny Feb 8, 2023 @ 11:26am 
So there's 2 things that are absolutely crucial if you want to maximize your income on your first playthrough. The first one is that the doc example script actually scales backwards, the further ahead in the game you get, the worst it gets because of how it's designed, so you want to address the issues it has. The biggest issue is the fact it doesn't throttle/limit hack threads, so as you get more ram, it hacks a bigger percentage and this increases the grow requirements logarithmically, which soon enough makes it very inefficient ram-wise.

The second thing is that you need to understand ram in this game is your most important resource and maximizing it ASAP is going to make everything much easier. 1024gb servers are tiny, using script functions you can get them to 1PB each, so focus on doing that.

Obviously, the doc example script isn't going to make use of that ram efficiently, so you need to come up with a hacking script that uses that ram better. A natural evolution from the doc example is to isolate hack/grow/weaken in their own mini-script and also calculate how much hack threads you need to remove X% of money and how many grow threads you need to grow back to fuil. Have ONE script per target that manages those hack/grow/weakens in a loop, starting only as many threads as needed to do the job (cancel security, hack x% or grow back to full). Limit your hack % to like 75% of the money and if there's ram left, start it against more target.

Most of the time using all your ram against ONE target is best.
aerouge Feb 16, 2023 @ 5:46am 
@thechuckingnoob

Hey since I am currently pondering the same thing. I'll write down some thoughts

Deicide already gave you too much of an answere if you ask me... haveing a "RAM-Manager" to orchestrate your servers to drain the whole web at maximum efficiency sure is a great goal for this aspect of the game.

But where you are at an important middlestep sets in. When you are running all your ressources against a single target one has to answer the questiion: "What is the juiciest server in the web (and how do I hack it so it doesnt run dry)".

Identifying that server that is the best target for a single hack/weaken/grow script requires one to get all the informations available about a server (in this regard) rolled into a single number.

Checking the relevant numbers (unless I missed one):
Goes like this:

var ma = getServerMoneyAvailable(v_Server);
var mm = getServerMaxMoney(v_Server);
var msl =getServerMinSecurityLevel(v_Server);
var sl = getServerSecurityLevel(v_Server);
var mg = getServerGrowth(v_Server);
var mgt = getGrowTime(v_Server);
var ht = getHackTime(v_Server);
var wt = getWeakenTime(v_Server);

Now how do we calculate a servers "juicyness" with this?

I'll write down my train of thought... if you want to skip ahead, go to the TL;DR.

Idea 1:
The server with MaxMoney is the best target. Since hack and grow both work in percentages MaxMoney is the most important stat. Still... a server with 1 Credit in it will take considerably longer to grow to 90% of it's max than one thats already halfway there. But lets neglect this for the moment (but keep it in the back of our head for future optimisation)

Having Max 1bn on a server with a 1% Growth (1mio / growth) makes it a better target than a server with Max 1Mio and 10% Growth (100k / growth. Lets not take current cash into this consideration because growing that to 90% of the Maxserver is just a question of time.
soo

Idea 2:
Since the growth(%growththread) is the next important stat our formula is;
MaxMoney * ServerGrowth
... but waaiit.. grow time is important since taking 10 seconds to grow a server by 1 mil is better than 100 seconds to grow a server by 2 mil...
soo

Idea 3
(MaxMoney * ServerGrowth) / GrowthTime
Yeah ... thats the stuff... a nice juicy server where we can baloon the cash in no-time ... but uhm we want to get the money out of it as well...
sooo

Idea 4
Hacktime... we need that in our formula
((MaxMoney * ServerGrowth) / GrowthTime) / Hacktime
Thats our golden formula ... eeexcept .. we need to occasionally weaken the system as well ... ugh ...and since security grows upon hacking and weakening the system we need to somehow factor in the ammount of time it takes to to grow the security of the server by 1 and compare that to the time it takes to weaken the server by one ... and yeah if we manage that we will get the best server ... oh but we need avoid draining a server to zero and ... ugh :-D

TL;DR
Okay for now my formula to calculate a servers "Juicyness" is:
((MaxMoney * ServerGrowth) / GrowthTime) / Hacktime

This does still ignore the weakening times and ignores the startingcapital in favor of a better final output but still if someone wishes to improve on the formula or finds flaws within my logic, feel welcome to discuss my aproach :-)
Last edited by aerouge; Feb 16, 2023 @ 6:03am
Zac Starfire Feb 16, 2023 @ 6:21am 
@aerouge You don't have to make it too complicated. There is only a total of about 50 servers out there (or less, I forget) that can be hacked. So it really depends on how many servers you have available to perform attacks, so you want to attack the richest servers, simple as that. You also will not make much money off hacking servers - you need to make money off the Stock Market or corporations (once your in that bitnode) to pay for implants that can cost as much as +1q. Hacking servers is mostly to make the xp levels or reputation for access to implants - you will need to get the the back-end servers and defeat the bitnode your in - you will need a lot of hacking xp to accomplish that.

https://steamcommunity.com/sharedfiles/filedetails/?id=2860828429
Last edited by Zac Starfire; Feb 16, 2023 @ 6:26am
aerouge Feb 16, 2023 @ 6:29am 
@Zac dont get me wrong... I appreaciate your input ... still I play this game for the hacking challenges I set myself ... not to finish it as fast as possible.

I am fully aware that hacking servers isnt the optimal aproach for makeing money... yet I still want to hack servers in an optimal way. Finding the best servers to focus on is a step on that road.
Bugs Bunny Feb 16, 2023 @ 6:44am 
Short answer to finding the best server is this:

1. Filter out servers that have a hacking level requirement above half your own level
2. Sort the rest by maxMoney / minSecurity

In order to do better than this, you will need formulas.exe to add hackChance, which allows you to remove the "half your hacking level" check, so basically:

weight= maxMoney / weakenTime * hackChanceAtMinSecurity

To be better still, you'll need to use formulas.exe to simulate your hacking algorithm to pick the best server.

There's also hacking percentage which comes into play (how much a hack removes from the server at once). This will affect how much ram you are using and can have a dramatic effect on income if your grow requirements are too big for your ram and force you into multiple grow/weaken cycles to bring the server back to a hackable state.
Zac Starfire Feb 16, 2023 @ 6:45am 
Ya, in the beginning you can become obsessed with script efficiency, but after your first bitnode, you realize it boils down to taking down bitnodes as quickly as possible, so you can gain the benefits and repeat. It comes down to automation scripts because the game becomes very repetitious. Some bitnodes aren't much different from the bitnode you just came from - you just basically start over with new benefits from the source file you just obtained. There are bitnodes more complex just as corps and gang, but it just a repeat of what you've just done.
So the key is automation, not really efficiency - get through the bitnode as quick as possible, get the benefit of defeating the node (source files) and move on to more interesting bitnodes. There are 13 bitnodes, so get through them to get to more interesting content.

All you need is simple scripts to accomplish the job and a method of automating them, so that your just executing commands to start scripts and waiting until you have the money for needed implants - because you will repeat it many times every time you enter a new bitnode.

You also don't need all the implants either, just what is required to get through the bitnode. Sometimes it just hacking xp, sometime is charisma for corporations or gangs - it all depends on the bitnode your in and many of them don't have much to do - just repeat what you have already done many times.
Zac Starfire Feb 16, 2023 @ 6:55am 
@Deicide in my hacking guide, I provide a script that crawls the network and lists the servers by money or hacking level. I recommend this for identifying what servers to do next.

You will also need a automated infiltration script so you can infiltrate many times for the high reputation you will need to quickly get the nessesary implants for that bitnode.

I've been working on a guide with all the scripts you need to defeat a bitnode - guess maybe I'll complete it soon.

https://steamcommunity.com/sharedfiles/filedetails/?id=2874771586
Last edited by Zac Starfire; Feb 16, 2023 @ 6:56am
Bugs Bunny Feb 16, 2023 @ 7:04am 
Automated infiltration is just plain cheating though, but it's a solo game so go all out if that's your thing. Infiltration rewards are way too good, they're balanced towards doing them manually.

You can finish a bitnode in 12 minutes with automated infiltration.
Last edited by Bugs Bunny; Feb 16, 2023 @ 7:04am
aerouge Feb 16, 2023 @ 2:57pm 
Originally posted by 𓅂 Zac Starfire 𓅂:
All you need is simple scripts to accomplish the job and a method of automating them, so that your just executing commands to start scripts and waiting until you have the money for needed implants - because you will repeat it many times every time you enter a new bitnode.

See and this is where I want to play differently. I enjoy perfecting my scripts. Automating a script is effingly easy ... one of the first scripts I wrote maps the network, writes a neat litle txt file with all servers and hacks all that are currently achievable, spreads my weaken/grow/hack script ... and that only took me a few minutes.

Same with maxing Hacknet-Nodes, Upgradeing servers ... all that baselevel is automated with a central config that sets my current RAM level for private servers and hacknet-node number (since around the 20th node it becomes cheaper to max-upgrade then vs. buying more the node number is the only thing relevant in regards to hacknetnodes) ... and it's all so trivial.

Now figureing out a mechanic to identify the best server for hacking, or to manage timing the entirety of my botnet to work the same server without draining it ... that's an intresting thing to do in my book since it requires a litle brainusage.

Sure I could skip this step and advance straight for stockmarketing and other shenanigans but where is the fun in games if you dont ocassionally stop to smell the flowers instead of rushing things?

Or do as Deicide wrote and develop a RAM-Manager that calculates the ammount of threads it takes to perfectly grow/weaken/hack a server ... the API gives these tools and it seems actually easier to simply write that manager and shotgun-hack the net in a revolving fashion. But since I have a clear idea on how to do that and just need to implement it I am less inclined to do this than perfectly find the jucyiest server on the web und work that :-D

Btw @Deicide... are the server stats randomized? I wondred because I find the growthrate of n00dles to be suspiciously high for RNG (more like a training-server that is hard to actually ♥♥♥♥ up) :-D
Bugs Bunny Feb 16, 2023 @ 3:56pm 
Originally posted by aerouge:
Btw @Deicide... are the server stats randomized? I wondred because I find the growthrate of n00dles to be suspiciously high for RNG (more like a training-server that is hard to actually ♥♥♥♥ up) :-D

Base level servers are fixed on all values (I should say relatively, since in endgame some multipliers will alter them, but they are still fixed for a playthrough).

Past the base level, the maximum money, minimum security, required hacking level and maybe a few other details are picked from a range on each installation (each time you install augments, the weight of those servers will change some). It's not dramatic changes, typically the order of best to worse will be similar each run but RNG could bring a usually good server down and a usually bad server up enough to be significant.

In other words, a weighting function is always a good thing, since the rankings constantly change.

Also special note on the base servers, they are all a bit unique in their own ways. n00dles has an insanely high growth rate, making it perfect for testing stuff, but it's very bad at money because of it's very low max money. joesguns has a very high XP rate compared to all servers in game, so if you're after XP, this is the one to hit. foodnstuff is a deceptive little bastard, it's almost as easy as n00dles to hack with close to 10x the money so it looks like a ripe target to hit early, but it's growth rate is abysmal, so it requires A LOT of ram and time to prep/hack, totally not worth the effort IMHO... harakiri-sushi is the best $/sec server of the base lot, but it's XP rate is pretty meh.

Typically, I just hit joesguns off the bat. Sure it's a bit slow, but by the time it's prepped the XP alone brings me close to ready to hit phantasy and phantasy is almost always the best target for a very long range of hacking levels because it's minimum security is abnormally low for it's money rank.
Protoz Feb 17, 2023 @ 7:45am 
You got two arrays: one is your bought servers + home, the other [] are all the target servers. The hard part about matching one to the other is keeping track how much weak/grow/hack threads are assigned to a target so your 25 bought servers + home don't overkill weak/grow/hack.

Example: You have 3 servers 1gb each, 3gb total, but your target needs 4gbs of work, 2gb of weak 2gb of grow, so you need a way to figure out how to assign 2gb of weak to servers 1 & 2 and one 1gb of grow to server 3 while tracking that 1gb of grow as a remainder.

Scale this to 25 bought servers + home & ~50 some target servers while the above example takes fraction of a second to complete, then i think this would be the most optimal income script.
Bugs Bunny Feb 17, 2023 @ 8:16am 
Originally posted by Protoz:
You got two arrays: one is your bought servers + home, the other [] are all the target servers. The hard part about matching one to the other is keeping track how much weak/grow/hack threads are assigned to a target so your 25 bought servers + home don't overkill weak/grow/hack.

Example: You have 3 servers 1gb each, 3gb total, but your target needs 4gbs of work, 2gb of weak 2gb of grow, so you need a way to figure out how to assign 2gb of weak to servers 1 & 2 and one 1gb of grow to server 3 while tracking that 1gb of grow as a remainder.

Scale this to 25 bought servers + home & ~50 some target servers while the above example takes fraction of a second to complete, then i think this would be the most optimal income script.

It's significantly more complex than that because depending on the amount of ram you have, the optimal use of it can be 1, 2, 3, up to all servers targeted. There is absolutely no reason to target a second server if you aren't able to milk the top server (top not necessarily being the top money server, I'm talking about the best $/sec server given your current hacking level/augs/etc).

Most players hacking ability scales more or less linearly with their ram availability so in most cases, using all your ram against a single target is going to be the most profitable use of it.

Now if you're going to run weaken/grow/hack at the same time, you need some serious calculations/synchronization otherwise it's chaos and chaos doesn't win order order. You want to keep your server at minimum security and maximum cash with the least resources possible and hack every time the server is ready for it more or less. This is usually done with batching, but you can also have a less organized hacking script that works more like a load balancer or wavelength matching.. Your 3 operations have different run times so you can't just spam blocks of them and hope it'll all fall in line.
Zac Starfire Feb 17, 2023 @ 9:53am 
Originally posted by Deicide:
Automated infiltration is just plain cheating though,

“Cheating is often more efficient.”
- Jeri Ryan
< >
Showing 1-15 of 20 comments
Per page: 1530 50

Date Posted: Jan 30, 2023 @ 7:46pm
Posts: 20