-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for ns.hack(), ns.weaken() and ns.grow() #1742
Comments
A simpler and more on-brand change might be to include an example call to The actual formula for hack, grow, and weaken includes multiple spoilers that the player does not discover until they are out of the midgame and know The Truth, and it would be hard to communicate said formula while being cagey about those aspects. The code is completely open, though, so players can absolutely look up those formulae and re-implement it in their script or whatnot if they wanted. Looking through the source code is encouraged in this game! |
I agree with ficocelliguy. In most cases, I'm all for adding more documentation. Nonetheless, in this case, knowing the specific formulas is not as beneficial as you think:
[1] [2] [3]
|
In addition to what catlover said, I will add a comment about this:
The answer is "it's complicated." I know this stuff really well, and I still get parts of it wrong sometimes. Each of the functions (hack(), weaken() and grow()) has subtle differences between them, some that matter a lot, some that don't, and some that matter only in edge cases. I could write pages on these subtleties (and other people have), and in the end I (as a player) would not trust what anyone wrote about the matter (not even me) - I would go to the source. It is the only way to be sure for details as complicated as this. This is both the benefit and curse of being an open-source game: We can say that the source is the ultimate answer, but it's a response that should be used sparingly. |
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:
For ns.weaken(), changes needed are:
For ns.grow(), changes needed are:
The text was updated successfully, but these errors were encountered: