Description
I'm referring to the NS API documentation, which is here: https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.md
The documentation for ns.hack(), ns.weaken() and ns.grow() should include formulae for outcomes. I don't like that the documentation might only mention that "your hacking level and server security and some inherent factor of the server" play a role. It makes it difficult to anticipate problems with a hacking design you're thinking of which forces you to guess or tediously try to reverse engineer the formula yourself, and when things go wrong you don't have enough information to figure out why. It should also be clear in these formulae when each of these factors are checked (when the promise resolves, or when the function is called?)
Whilst getters such as getHackTime, getWeakenTime and getGrowTime exist, how these values are calculated is also something you need to know to design a good hacking system. You'll be asking questions like "what's the optimal way to grow a server to max money?" and without the formulae, you're going to have a hard time figuring that out because you can't easily figure out if two scripts with 50 threads each will be better than one with 100 threads. You can also be misled into thinking the getters factor in some inherent server factor.
For ns.hack(), changes needed are:
- Include formula for how much money will be stolen
- Convert the line "A successful hack() on a server will raise that server's security level by 0.002" to a formula to clarify whether this is per-thread or per-script.
- Include formula for how much hacking exp will be gained
- Include formula for how long it will take
For ns.weaken(), changes needed are:
- Convert line "This function lowers the security level of the target server by 0.05" to a formula which shows that the server will be weakened by 0.05 * number_of_threads
- Include formula for how much hacking exp will be gained
- Include formula for how long it will take
For ns.grow(), changes needed are:
- Include formula for the new server money after your operation completes
- Include formula for how much the server security will increase
- Include formula for how much hacking exp will be gained
- Include formula for how long it will take
Activity