mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 09:42:53 +02:00
DOC: Move all docs into en/ subdirectory (#1505)
* DOC: Move all docs into en/ subdirectory PR #1502 is working on adding a Chinese translation to the docs. In general, I encouraged this (in #1452) as a path towards getting useful translated content in the game without requiring a massive refactor/rearchitecting of everything. To support this, this takes the first step of moving our docs into an en/ subdirectory, so that other languages can live alongside. No effort is made at this time to support or select between alternate languages; this is a pure-rename refactor.
This commit is contained in:
@@ -0,0 +1,238 @@
|
||||
# Introduction
|
||||
|
||||
After a player destroys their first [BitNode](./bitnodes.md), they are usually overwhelmed and do not know which BitNode they should do next. Some BitNodes even have peculiarities that tend to catch newbies off guard and ruin their run.
|
||||
|
||||
At first, we need to make this clear: There is no "perfect" BitNode order. Everybody has their own preferred play style, so a good order for this player may be a bad order for other players. This is why this guide does not show a single specific order.
|
||||
|
||||
Doing BitNodes in chronological order (BN1->BN2->BN3->BN4->BN5->etc.) is a classic mistake. Don't do that.
|
||||
|
||||
# BitNode characteristic
|
||||
|
||||
With each BitNode, you need to consider:
|
||||
|
||||
- Does it unlock a new mechanic?
|
||||
- Is the new mechanic a new "gameplay" or a "utility" one (a mechanic that helps other mechanics)?
|
||||
- How does this new mechanic interact with other mechanics?
|
||||
- Are there peculiarities that I should know beforehand?
|
||||
- How harsh are the BitNode's multipliers?
|
||||
|
||||
Some BitNodes unlock new mechanics, while others improve or change original mechanics in BitNode 1. This is a very rough introduction:
|
||||
|
||||
- New gameplay:
|
||||
- Gang (BitNode 2): Simple and useful.
|
||||
- Corporation (BitNode 3): Extremely complicated, extremely powerful, and extremely fast.
|
||||
- Bladeburner (BitNode 6, BitNode7): Relatively simple, slow, and not be nerfed too much in most BitNodes.
|
||||
- Utility mechanics:
|
||||
- Singularity (BitNode 4): Automation APIs.
|
||||
- Intelligence (BitNode 5): Permanent stat that buffs many things and permanent access to `Formulas.exe`.
|
||||
- HackNet server (BitNode 9): Replace HackNet Node with HackNet Server. Buff many mechanics.
|
||||
- Sleeves + Grafting (BitNode 10): Help other mechanics.
|
||||
- Stanek's Gift (BitNode 13): Buff many mechanics.
|
||||
- Other:
|
||||
- BitNode 8: Enhance the stock market.
|
||||
- BitNode 11: It gives some rewards, but they are not very interesting.
|
||||
- BitNode 12: Grant free NeuroFlux Governor (NFG) based on the Source-File level.
|
||||
- BitNode 14: Enhance IPvGO.
|
||||
|
||||
Some mechanics synergize well with other mechanics. For example, in order to create a gang outside of BitNode 2, you need to "farm karma" (more about this later), and Sleeves can help you do it faster.
|
||||
|
||||
Some mechanics have peculiarities that you should know beforehand. For example, enabling territory clashes too soon will make the player lose all territory and ruin their gang.
|
||||
|
||||
All BitNodes have a unique set of multipliers that affect the difficulty of that BitNode. You can see these multipliers when choosing a BitNode in the BitVerse. [Source-File](./sourcefiles.md) 5 gives you access to these multipliers when you are already in a BitNode. Some BitNodes are much harder than others. It's recommended to unlock other Source-Files before trying to beat these hard BitNodes. Note that the "Difficulty" value of a BitNode in the BitVerse may be a bit misleading in some cases. Understanding the difficulty of a BitNode is much harder than just choosing between "easy", "normal" and "hard".
|
||||
|
||||
# BitNode analysis
|
||||
|
||||
## BitNode 1
|
||||
|
||||
This is the easiest BitNode, and its Source-File gives a very strong buff to most multipliers. You should repeat this BitNode to get its powerful buff.
|
||||
|
||||
## BitNode 2
|
||||
|
||||
This BitNode unlocks [Gang](./gang.md). Gang is a simple and useful mechanic.
|
||||
|
||||
- Its benefits do not reset when you install augmentations or soft reset.
|
||||
- Good income.
|
||||
- Give you access to most augmentations. If you are in BitNode 2, your Gang will offer The Red Pill. This is arguably the biggest benefit of Gang. Farming reputation with factions to get access to their augmentations is the most time-consuming thing of a run. With Gang, you have access to most augmentations, so you only need to join 1 more faction to get NFG.
|
||||
|
||||
In order to create a gang, you need to "farm karma". Committing crimes reduces your karma, and Gang is unlocked when your karma is less than or equal to 54000 (this is a constant in all BitNodes). Farming karma is very slow, and Sleeves (BitNode 10) speed it up tremendously. Sleeves are copies of yourself, and you can let them do many tasks. When you set them to "Commit Crime", their action also reduces your karma as if you do it yourself.
|
||||
|
||||
When you enter this BitNode, there are two things that you need to keep in mind:
|
||||
|
||||
- There is no karma requirement in BitNode 2, but creating a gang too soon is a mistake. Having an adequate income boosts the early stage of Gang significantly. Outside BitNode 2, this is not a problem. When you finish farming karma, you usually have a decent income.
|
||||
- Territory is important. Enabling territory clashes when your gang is still too weak is a serious mistake. You may lose all territory. On the other hand, enabling territory clashes too late is also bad. You need to find a balance here. In short, do it soon, but not too soon.
|
||||
|
||||
## BitNode 3
|
||||
|
||||
This BitNode unlocks [Corporation](./corporations.md). Corporation is one of the most controversial mechanics in Bitburner. As I said before, it's extremely complicated, extremely powerful, and extremely fast. If you have a good corporation script, you can ignore all other mechanics and speedrun most BitNodes. However, "having a good corporation script" is a serious challenge. Writing that "good script" may take days or weeks, assuming that you read the documentation carefully and have good advice from other experienced players (please join our [Discord](https://discord.gg/TFc3hKD) server and discuss there). If you try to do it blindly, Corporation is the worst mechanic.
|
||||
|
||||
If you want to try this mechanic, you must remember this advice: When in doubt, check the in-game documentation. Corporation has the most intensive documentation in Bitburner. Note that you do not have to read all of them in one go. I recommend that you read the first 4 sections. They are the most important sections for newbies. After that, you can read the following sections at your leisure.
|
||||
|
||||
## BitNode 4
|
||||
|
||||
This BitNode unlocks Singularity APIs in the `singularity` namespace (`ns.singularity`). Do you hate doing things manually (e.g., buying TOR, buying programs, connecting servers, installing backdoor)? These APIs let you do all of them programmatically.
|
||||
|
||||
If you use these APIs outside BitNode 4 and do not have Source-File 4.2 or Source-File 4.3, the RAM cost is multiplied by 4 or 16, respectively. This means that if you want to use this Source-File in other BitNodes, you have to complete this BitNode three times in one go. Otherwise, you will have to pay the massive RAM cost.
|
||||
|
||||
This BitNode's multipliers are a bit harsh, especially if you only have Source-File 1. Keep this in mind if you choose it as the second BitNode after completing BitNode 1.
|
||||
|
||||
## BitNode 5
|
||||
|
||||
This BitNode unlocks:
|
||||
|
||||
- [Intelligence](./intelligence.md): It's a permanent stat that buffs many things.
|
||||
- BitNode's multiplier data in UI and NS APIs.
|
||||
- Permanent access to `Formulas.exe`. Formulas APIs are useful for many mechanics, not just hacking. Having free access to them is a very good benefit.
|
||||
|
||||
Source-File 5 also buffs hacking-related multipliers. Hacking is a core mechanic, so it's always good to have higher hacking-related multipliers.
|
||||
|
||||
## BitNode 6 and BitNode 7
|
||||
|
||||
These BitNodes unlock [Bladeburner](./bladeburners.md). Bladeburner gives you an alternative way to destroy WD. In Bladeburner, you can do many actions (General, Contracts, Operations, Black Operations) to get money, experience, Bladeburner's rank, etc. You can destroy WD after completing the last Black Operation.
|
||||
|
||||
Bladeburner is a slow mechanic, but it's rarely nerfed in other BitNodes. Even when it's nerfed, the nerf is not too severe. This is why Bladeburner is a good choice in extremely hard BitNodes (e.g., BitNode 9, BitNode 13).
|
||||
|
||||
Both BitNodes grant Bladeburner access outside these BitNodes. The differences are:
|
||||
|
||||
- BitNode 6 does not have Bladeburner's penalty modifiers. Its Source-File buffs combat stats' multipliers.
|
||||
- BitNode 7 has Bladeburner's penalty modifiers. Its Source-File buffs Bladeburner's multipliers. Source-File 7.3 gives you free access to "The Blade's Simulacrum" augmentation. You will immediately receive this augmentation after joining the Bladeburner division.
|
||||
|
||||
When you are performing Bladeburner action, you cannot do other actions (working, committing crimes, etc.). It's a downside of Bladeburner. "The Blade's Simulacrum" augmentation removes this restriction by allowing you to perform Bladeburner actions and other actions at the same time.
|
||||
|
||||
This mechanic is time-gated by the slow generation speed of contracts/operations. Sleeves speed it up a lot.
|
||||
|
||||
You must be careful with chaos and Synthoid population. The UI shows you many hints about the effect of dangerous actions on chaos and Synthoid population. You should keep an eye on those hints. Generally, you must keep the chaos level low and not kill too much Synthoid population.
|
||||
|
||||
## BitNode 8
|
||||
|
||||
This BitNode unlocks 2 new features for the stock market: short stock and limit/stop order.
|
||||
|
||||
This is a very challenging BitNode. It disables most normal ways to earn money so that you have to use the stock market as your source of income. Before having access to 4S Market Data, finding good stocks to invest in is pretty hard. You need to have a good pre-4S stock market script; otherwise, it's a slow run. You should take a look at stock manipulation. Hacking does not give you money, but hacking and growing a server that has a corresponding stock still influence that stock's price.
|
||||
|
||||
Grafting is very useful in this BitNode. Losing capital after each reset sets you back a lot. Grafting allows you to continuously install augmentations without resetting.
|
||||
|
||||
## BitNode 9
|
||||
|
||||
This BitNode replaces HackNet Node with [HackNet Server](./hacknetservers.md).
|
||||
|
||||
HackNet Servers generate `hash`. You can sell `hash` for money or a variety of upgrades that boost other mechanics. You can also run scripts on these servers, but doing it reduces the amount of `hash` produced.
|
||||
|
||||
Among the benefits of its Source-File, 2 most important ones are:
|
||||
|
||||
- Source-File 9.2: Start with 128GB of RAM on your home computer when entering a new BitNode.
|
||||
- Source-File 9.3: Grant a highly upgraded Hacknet Server when entering a new BitNode. This effect only applies when entering a new BitNode, not when installing augmentations.
|
||||
|
||||
This BitNode's multipliers are extremely harsh. You should prepare carefully before entering it.
|
||||
|
||||
This BitNode disables private servers and significantly raises the RAM cost of your home computer. It also heavily nerfs hacking-related multipliers. You must find a way to properly utilize HackNet servers and their variety of upgrades. Inside this BitNode, you get the effect of Source-File 9.3 even before getting that Source-File. The free highly upgraded Hacknet Server is an extremely important asset at the start of the run.
|
||||
|
||||
## BitNode 10
|
||||
|
||||
This BitNode unlocks [Sleeves](./sleeves.md) and [Grafting](./grafting.md).
|
||||
|
||||
Sleeves are your "copies", so they can do most things that you can do (studying, working, committing crimes, etc.). This mechanic synergizes well with mechanics involving slow tasks that can be boosted by doing things simultaneously (e.g., farming karma for Gang, generating contracts/operations for Bladeburner). You can buy up to 5 Sleeves from "The Covenant" faction. Each Source-File level grants you a Sleeve.
|
||||
|
||||
Grafting is a special way of installing augmentations.
|
||||
|
||||
- Grafting bypasses the need of resetting the main body and farming faction reputation.
|
||||
- The augmentation is installed immediately after the grafting process finishes.
|
||||
- The requirement of faction reputation is ignored when grafting.
|
||||
- Grafting gives you a debuff that decreases many multipliers. This debuff can be removed by installing a special augmentation.
|
||||
|
||||
You should keep these things in mind:
|
||||
|
||||
- You cannot buy Sleeves and their memory upgrades outside this BitNode.
|
||||
- Sleeves are expensive. The last Sleeve costs 100e15 (100q). You will need a [batcher](../programming/hackingalgorithms.md) or a corporation.
|
||||
- Due to the debuff, grafting is sometimes underestimated and underutilized. When grafting, you need to choose the augmentations carefully. If you choose appropriate ones, grafting is a very strong mechanic.
|
||||
|
||||
This BitNode's multipliers are fairly harsh. You will need a source of high income for the last Sleeve anyway, so harsh multipliers should not be a big problem. Utilizing the grafting mechanic properly lessens the harsh multipliers.
|
||||
|
||||
## BitNode 11
|
||||
|
||||
This BitNode does not unlock or enhance any mechanics.
|
||||
|
||||
Its Source-File's rewards:
|
||||
|
||||
- Company favor increases the player's salary and reputation gain.
|
||||
- Increase the player's company salary and reputation gain multipliers.
|
||||
- Reduce the price increase for every augmentation bought.
|
||||
|
||||
This BitNode's multipliers are harsh, but its rewards are mediocre, especially when comparing them to rewards in other BitNodes.
|
||||
|
||||
## BitNode 12
|
||||
|
||||
This is a special BitNode. In other BitNodes, the BitNode's multipliers are always the same, regardless of how many times you enter it, and the rewards only scale up to Source-File level 3. In BitNode 12, the BitNode's multipliers and the rewards scale to the Source File level, and the Source File level does not have a theoretical upper limit. For example, if you complete BitNode 12 one hundred times, you will have Source-File 12.100, and both the BitNode's multipliers and the rewards scale up to that level.
|
||||
|
||||
Source-File 12 grants free NFG levels based on the Source-File's level.
|
||||
|
||||
In this BitNode, you need to constantly change your strategy, depending on the current BitNode's multipliers. These multipliers become increasingly harsher when you go higher. It's recommended to unlock all mechanics before trying high levels.
|
||||
|
||||
Note that, although there is no limit in theory, there is still a practical limit to how high you can go. You won't need to worry about that limit for a long time, though.
|
||||
|
||||
## BitNode 13
|
||||
|
||||
This BitNode unlocks [Stanek's Gift](./stanek.md). Stanek's Gift is a grid that you can freely put fragments on. There are many types of fragments, and each type boosts a different mechanic.
|
||||
|
||||
This mechanic is versatile. It can boost many different mechanics. You can freely decide how to boost them by choosing appropriate fragments and arranging those fragments on the grid as you like.
|
||||
|
||||
Stanek's Gift decreases many multipliers by 10%. "Church of the Machine God" faction offers 2 augmentations to gradually remove this penalty.
|
||||
|
||||
You must accept Stanek's Gift before purchasing any augmentations. NFG is the only exception. Due to the effect of Source-File 7.3, you must accept Stanek's Gift before joining the Bladeburner division if you have that Source-File.
|
||||
|
||||
This BitNode's multipliers are extremely harsh. You should prepare carefully before entering it. Utilizing the Gift's bonuses is crucial to lessen the harsh multipliers.
|
||||
|
||||
## BitNode 14
|
||||
|
||||
This BitNode's Source-File buffs IPvGO's benefits and unlocks the ability to use cheat APIs. Cheat APIs may help you tremendously if you use them strategically, especially when playing against hard opponents. The Source-File's rewards:
|
||||
|
||||
- Higher stat multipliers from Node Power.
|
||||
- Unlock `ns.go.cheat` APIs.
|
||||
- Higher maximum favor that you can gain for each faction from IPvGO.
|
||||
|
||||
The last reward is pretty interesting. If you can consistently win several games in a row and get a higher favor bonus, you will cut down the time to reach 150 favor points with IPvGO factions and have access to their augmentations much sooner.
|
||||
|
||||
This BitNode's multipliers are fairly harsh, but IPvGO's multipliers are buffed significantly. If you use IPvGO, even a slightly improved version of the tutorial script will help you complete this BitNode without much trouble.
|
||||
|
||||
# Order advice
|
||||
|
||||
## The first choice
|
||||
|
||||
Repeating BitNode 1 is the best choice.
|
||||
|
||||
- There is no penalty modifier in BitNode 1. It's the best place for you to improve your scripts and prepare for harder BitNodes.
|
||||
- The buff is huge. When you upgrade Source-File 1.1 to Source-File 1.2, you get a buff equivalent to 8 levels of NFG.
|
||||
|
||||
You should repeat it at least once to get Source-File 1.2. Most people complete this BitNode in one go and get Source-File 1.3.
|
||||
|
||||
## Early BitNodes
|
||||
|
||||
If you want to try different gameplay, BitNode 2 is a good choice. Gang is simple and useful in most BitNodes.
|
||||
|
||||
BitNode 5 is another good choice. Intelligence boosts many things, and it's permanent. Free access to Formulas APIs is very nice. A buff to hacking-related multipliers is useful in all BitNodes.
|
||||
|
||||
## Situational BitNodes and Hard BitNodes
|
||||
|
||||
If you hate doing things manually and want to automate everything, you will have to use Singularity APIs of BitNode 4. Note that this BitNode is not easy. Its multipliers are harsh, especially if you skip early BitNodes and only have Source-File 1. You also need to complete it entirely and get Source-File 4.3. Otherwise, you will have to pay the massive RAM cost. If you don't mind doing things manually, Source-File 4 is not really important.
|
||||
|
||||
Both BitNode 6 and BitNode 7 unlock Bladeburner. It's slow, but it's a good choice to beat extremely hard BitNodes (BitNode 9, BitNode 13). Ideally, you should complete both of them. However, if you decide to only use Bladeburner when needed and do not want to spend too much time doing both BitNodes, you can choose to complete only one of them. BitNode 6 is easier than BitNode 7, but Source-File 7 buffs Bladeburner's multipliers and gives you free access to "The Blade's Simulacrum" augmentation.
|
||||
|
||||
BitNode 10 unlocks 2 strong mechanics at the same time. Sleeves synergize well with many mechanics, especially Gang and Bladeburner. Grafting is useful in all BitNodes. Most people complete this BitNode in one go to get 8 Sleeves, but if you are in a rush, you can complete it once and get only Source-File 10.1. If you buy all 5 Sleeves from "The Covenant" faction, you will have 6 Sleeves and access to Grafting. That's not ideal, but still good enough.
|
||||
|
||||
BitNode 14 enhances IPvGO. IPvGO is _not_ locked behind this BitNode. It's available at the start of the game. You can play it by going to CIA (Sector-12) or using APIs in `ns.go`. If you have not touched that mechanic, you should do it now. IPvGO is tuned so that it still gives adequate benefits even if your script is only a slightly improved version of the tutorial script. Source-File 14 improves IPvGO's benefits and unlocks cheat APIs, which you can use to improve your win rate.
|
||||
|
||||
BitNode 9 and BitNode 13 unlock HackNet server and Stanek's Gift, respectively. They are powerful mechanics that buff other mechanics, but these BitNodes are extremely hard. You should prepare carefully before entering them.
|
||||
|
||||
## Challenging BitNodes
|
||||
|
||||
It's hard to recommend the priority of these BitNodes. They offer unique challenges. Some people can tackle them as early BitNodes without any problems. Some people complete them at the end, for the sake of completion. Some people despise and never touch them.
|
||||
|
||||
BitNode 3: This BitNode is not exactly hard. You can avoid the Corporation mechanic and complete it without any problems by using any mechanics that you have. Many people use Gang or just hacking scripts to beat it. However, that is not the point of BitNode 3. This BitNode unlocks Corporation, which is one of the most controversial mechanics in Bitburner. You either love it or hate it. Feel free to choose your path.
|
||||
|
||||
BitNode 8: You are forced to engage the stock market in this BitNode. The hardest part is to write a good (or at least usable) pre-4S stock market script. Even with good scripts, it still takes a long time to complete this BitNode. This is an interesting challenge.
|
||||
|
||||
## Special BitNodes
|
||||
|
||||
BitNode 12 is a unique BitNode. In the first dozen levels, it's an easy one, and you can beat it with any mechanics. When the difficulty ramps up due to increasingly harsher multipliers, you have to constantly change your strategy and use different mechanics. Thinking outside the box and exploiting oversights in the interaction of mechanics are the keys to success. You should try this BitNode after unlocking all mechanics.
|
||||
|
||||
## Bad BitNodes
|
||||
|
||||
BitNode 11 is hard, but its rewards are mediocre. You should only do it at the end, for the sake of completion.
|
||||
@@ -0,0 +1,84 @@
|
||||
# Which BitNode should I try next?
|
||||
|
||||
After destroying their first [BitNode](bitnodes.md), many players wonder which [BitNode](bitnodes.md) they should tackle next.
|
||||
This guide hopefully helps answer that question.
|
||||
As a player, you are not forced to tackle the [BitNodes](bitnodes.md) in any particular order.
|
||||
You are free to choose whichever ones you want.
|
||||
The "best" order can vary between players, depending on what you like to do any what kind of player you are.
|
||||
|
||||
## tl;dr
|
||||
|
||||
BN1, BN2 and BN5 are great starters.
|
||||
BN4 and BN6 are also good to do early if their mechanics appeal to you.
|
||||
BN10 has interesting mechanics if you can generate lots of money.
|
||||
BN9, BN13 and BN14 are tough but have interesting new mechanics
|
||||
BN3 has a very tough mechanic to automate with unparalleled power.
|
||||
BN7, BN8 and BN11 are tough with little to benefit newer players.
|
||||
BN12 is easy to start but quickly ramps up in difficulty.
|
||||
|
||||
## Good early BitNodes
|
||||
|
||||
BN1 is the introductory [BitNode](bitnodes.md) with no difficulty modifiers to slow you down.
|
||||
Its [Source-File](sourcefiles.md) is extremely powerful as it raises all multipliers by a significant amount.
|
||||
There are no other [BitNodes](bitnodes.md) which significantly simplify this one or make it particularly easier, so BN1.2 and BN1.3 are natural first choices.
|
||||
|
||||
BN2 introduces the [Gang](gang.md) mechanic.
|
||||
This mechanic provides both a good source of income and a large supply of [Augmentations](../basic/augmentations.md) from a single faction.
|
||||
Using the mechanic in other [BitNodes](bitnodes.md) requires a sufficiently low karma which requires a significant time investment or [Sleeves](sleeves.md).
|
||||
|
||||
BN5 grants [Intelligence](intelligence.md), a stat that persists between [BitNodes](bitnodes.md).
|
||||
The [Source-File](sourcefiles.md) bonuses are very helpful for [hacking](../basic/hacking.md) and also give `Formulas.exe`.
|
||||
Because of all the benefits this [BitNode](bitnodes.md) provides, it's definitely worth getting early.
|
||||
|
||||
## Depends on your priorities
|
||||
|
||||
BN4 gives access to the [Singularity API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.singularity.md).
|
||||
This mechanic allows the automation of many actions directly affecting the player.
|
||||
If this appeals to you then you should prioritize this BitNode.
|
||||
Due to the [RAM](../basic/ram.md) cost, it's strongly recommended to complete BN4.3 before using the [Singularity API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.singularity.md) in other [BitNodes](bitnodes.md).
|
||||
|
||||
BN6 introduces the [Bladeburner](bladeburners.md) mechanic and its corresponding [Bladeburner API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.bladeburner.md).
|
||||
Bladeburner is an alternative method to beat BitNodes which doesn't rely on money or hacking skill.
|
||||
[Sleeves](sleeves.md) help complete BN6 more quickly since they can share some Bladeburner tasks with the player but aren't a requirement.
|
||||
|
||||
BN10 unlocks two new mechanics: [Sleeves](sleeves.md) and [Grafting](grafting.md).
|
||||
[Sleeves](sleeves.md) act as additional players and can perform tasks like studying, training, crime and working for factions independently of the player.
|
||||
[Grafting](grafting.md) installs augmentations without a soft reset.
|
||||
Both are very useful to have but require large amounts of money to use to their fullest extent.
|
||||
Each [Source-File](sourcefiles.md) grants an additional sleeve and up to five additional sleeves may be purchased from a faction only in this BitNode.
|
||||
|
||||
## Tough but has new mechanics
|
||||
|
||||
BN3 makes available the [Corporation](corporations.md) mechanic.
|
||||
This mechanic can provide effectively limitless wealth and [Faction](../basic/factions.md) [Reputation](../basic/reputation.md), but is very complex and documentation-dependent.
|
||||
Using the mechanic in other [BitNodes](bitnodes.md) requires $150 billion so another source of starting wealth is still needed.
|
||||
Overall, this [BitNode](bitnodes.md) is considered an advanced one even if there are no particular [BitNodes](bitnodes.md) that should go before it.
|
||||
|
||||
BN9 introduces the [Hacknet Server](hacknetservers.md) mechanic to replace the [Hacknet Nodes](../basic/hacknet_nodes.md) mechanic.
|
||||
[Hacknet Servers](hacknetservers.md) generate hashes instead of money directly and these hashes can be traded for various benefits.
|
||||
Players who find [RAM](../basic/ram.md) tight at the beginning of a [BitNode](bitnodes.md) will find BN9.2's bonus to start with 128GiB in their home machine.
|
||||
|
||||
BN13 introduces [Stanek's Gift](stanek.md), a powerful augmentation that can provide bonuses to skills, [hacknet](../basic/hacknet_nodes.md) production and costs, working and [crime](../basic/crimes.md) gains, and [hacking](../basic/hacking.md) power and speed.
|
||||
These bonuses are versatile but not enough to offset the challenge of the BitNode itself.
|
||||
|
||||
BN14 is a relatively new BitNode focused on [IPvGO](../programming/go_algorithms.md).
|
||||
Automating the mechanic is challenging but it provides a wide variety of bonuses.
|
||||
|
||||
## Save these for later
|
||||
|
||||
BN7 used to give access to the [Bladeburner API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.bladeburner.md), but now it doesn't.
|
||||
Because of that change this [BitNode](bitnodes.md) is relatively low priority and should definitely happen after BN6.
|
||||
The benefit for completing BN7.3 is an aug that lets the player perform [Bladeburner](bladeburners.md) and non-Bladeburner actions at the same time.
|
||||
|
||||
BN8 focuses on the stock market to the point that there's no other way to make money.
|
||||
Completing at least BN10.1 is highly recommended in order to have [Grafting](grafting.md).
|
||||
This ensures that you don't need to install [Augmentations](../basic/augmentations.md) and lose market gains realized so far.
|
||||
Having a good hacking script can also help in order to manipulate the market.
|
||||
|
||||
BN11 doesn't have any new mechanics associated with it beyond a mild bonus to work income.
|
||||
The [Source-File](sourcefiles.md) makes buying large numbers of [Augmentations](../basic/augmentations.md) cheaper but isn't worth going out of your way for.
|
||||
Overall, this [BitNode](bitnodes.md) is very difficult for not much in return.
|
||||
|
||||
BN12 is BN1, just a little bit harder each time you complete it and continuing forever.
|
||||
This requires a variety of strategies using different mechanics as the penalties grow.
|
||||
The reason this isn't an early recommendation is that the [Source-File](sourcefiles.md) is relatively weak for the increasing amount of effort required.
|
||||
@@ -0,0 +1,253 @@
|
||||
# BitNodes
|
||||
|
||||
A BitNode is an important part of the game's storyline.
|
||||
In the game, you discover what BitNodes are by following the trail of clues left by the mysterious `jump3r`.
|
||||
|
||||
## What is a BitNode
|
||||
|
||||
A BitNode is the complex simulated reality in which you reside.
|
||||
By following the messages from `jump3r`, you discover that humanity was enslaved by an advanced alien race, called the Enders, using virtual simulations that trapped the minds of humans.
|
||||
|
||||
However, the Enders didn't just create a single virtual reality to enslave humans, but many different simulations.
|
||||
In other words, there are many different BitNodes that exist.
|
||||
These BitNodes are very different from each other.
|
||||
|
||||
jump3r tells you that the only hope for humanity is to destroy all of these BitNodes.
|
||||
Therefore, the end goal for the player is to enter and then destroy each BitNode.
|
||||
|
||||
Destroying a BitNode resets most of the player's progress but grants the player a powerful second-tier persistent upgrade called a [Source-File](sourcefiles.md).
|
||||
Different BitNodes grant different [Source-Files](sourcefiles.md).
|
||||
|
||||
Each BitNode has unique characteristics that are related to varying backstories.
|
||||
For example, in one BitNode the world is in the middle of a financial catastrophe with a collapsing market.
|
||||
In this BitNode, most forms of income such as working at a [Company](../basic/companies.md) or [Hacknet Nodes](../basic/hacknet_nodes.md) are significantly less profitable.
|
||||
[Servers](../basic/servers.md) have less money on them and lowered growth rates, but it is easier to lower their security level using the `weaken` function.
|
||||
|
||||
Furthermore, some BitNodes introduce new content and mechanics.
|
||||
For example, there is one BitNode that grants access to the [Singularity API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.singularity.md).
|
||||
There is another BitNode in which you can manage a [Gang](gang.md) to earn money and [Reputation](../basic/reputation.md).
|
||||
|
||||
## How to destroy a BitNode
|
||||
|
||||
Initially, the only way to destroy a BitNode is to join Daedalus.
|
||||
From Daedalus, the player can obtain an [Augmentation](../basic/augmentations.md) called `The Red Pill`, which doesn't cost any money but does require a good amount of [Faction](../basic/factions.md) [Reputation](../basic/reputation.md).
|
||||
|
||||
After installing `The Red Pill`, the player must search for and then manually `hack` a server called `w0r1d_d43m0n`.
|
||||
This server requires a hacking level of `3000`, sometimes more, in order to successfully hack it.
|
||||
This will destroy the player's current BitNode.
|
||||
|
||||
There is a second method of destroying a BitNode, but it must be unlocked by first destroying BitNode-6 or BitNode-7 ([Bladeburners](bladeburners.md)).
|
||||
|
||||
When the player destroys a BitNode, most of their progress will be reset.
|
||||
This includes things such as [Augmentations](../basic/augmentations.md) and [RAM](../basic/ram.md) upgrades on the home computer.
|
||||
The only things that will persist through destroying BitNodes are:
|
||||
|
||||
- [Source-Files](sourcefiles.md)
|
||||
- [Scripts](../basic/scripts.md) on the home computer
|
||||
- [Intelligence](intelligence.md)
|
||||
|
||||
## BitNode list
|
||||
|
||||
### BitNode 1: Source Genesis
|
||||
|
||||
This is the first BitNode created by the Enders to imprison the minds of humans. It became the prototype and testing ground for all of the BitNodes that followed.
|
||||
|
||||
This is the first BitNode that you play through. It has no special modifications or mechanics.
|
||||
|
||||
Destroying this BitNode will give you Source-File 1, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on their home computer when entering a new BitNode and increases all of the player's multipliers by:
|
||||
|
||||
- Level 1: 16%
|
||||
- Level 2: 24%
|
||||
- Level 3: 28%
|
||||
|
||||
### BitNode 2: Rise of the Underworld
|
||||
|
||||
Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the 2050s. As society and civilization broke down, people quickly succumbed to the innate human impulse of evil and savagery. The organized crime factions quickly rose to the top of the modern world.
|
||||
|
||||
Certain factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, NiteSec, and The Black Hand) give the player the ability to form and manage their own gang, which can earn the player money and reputation with the corresponding faction. The gang faction offers more augmentations than other factions, and in BitNode-2, it offers The Red Pill.
|
||||
|
||||
Destroying this BitNode will give you Source-File 2, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also increases your crime success rate, crime money, and charisma multipliers by:
|
||||
|
||||
- Level 1: 24%
|
||||
- Level 2: 36%
|
||||
- Level 3: 42%
|
||||
|
||||
### BitNode 3: Corporatocracy
|
||||
|
||||
Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.
|
||||
|
||||
Sometime in the early 21st century, economic and political globalization turned the world into a corporatocracy, and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own community, and evict their neighbors from houses in their desperate bid to increase their wealth.
|
||||
|
||||
In this BitNode, you can create and manage your own corporation. Running a successful corporation has the potential to generate massive profits.
|
||||
|
||||
Destroying this BitNode will give you Source-File 3, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this mechanic) and level 3 permanently unlocks the full API. This Source-File also increases your charisma and company salary multipliers by:
|
||||
|
||||
- Level 1: 8%
|
||||
- Level 2: 12%
|
||||
- Level 3: 14%
|
||||
|
||||
### BitNode 4: The Singularity
|
||||
|
||||
The Singularity has arrived. The human race is gone, replaced by artificially super intelligent beings that are more machine than man.
|
||||
|
||||
In this BitNode, you will gain access to a new set of Netscript functions known as Singularity functions. These functions allow you to control most aspects of the game through scripts, including working for factions/companies, purchasing/installing augmentations, and creating programs.
|
||||
|
||||
Destroying this BitNode will give you Source-File 4, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File lets you access and use the Singularity functions in other BitNodes. Each level of this Source-File reduces the RAM cost of singularity functions:
|
||||
|
||||
- Level 1: 16x
|
||||
- Level 2: 4x
|
||||
- Level 3: 1x
|
||||
|
||||
### BitNode 5: Artificial Intelligence
|
||||
|
||||
They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that couldn't be modeled by 1's and 0's. They were wrong.
|
||||
|
||||
Destroying this BitNode will give you Source-File 5, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File grants you a new stat called Intelligence. Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However, gaining Intelligence experience is much slower than other stats. Higher Intelligence levels will boost your production for many actions in the game.
|
||||
|
||||
In addition, this Source-File will unlock:
|
||||
|
||||
- `getBitNodeMultipliers()` Netscript function
|
||||
- Permanent access to `Formulas.exe`
|
||||
- Access to BitNode multiplier information on the `Stats` page
|
||||
|
||||
It will also raise all of your hacking-related multipliers by:
|
||||
|
||||
- Level 1: 8%
|
||||
- Level 2: 12%
|
||||
- Level 3: 14%
|
||||
|
||||
### BitNode 6: Bladeburners
|
||||
|
||||
In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of their Synthoid design, called MK-VI, by developing a hyper-intelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.
|
||||
|
||||
In this BitNode, you will be able to access the Bladeburner division at the NSA, which provides a new mechanic for progression.
|
||||
|
||||
Destroying this BitNode will give you Source-File 6, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner division in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:
|
||||
|
||||
- Level 1: 8%
|
||||
- Level 2: 12%
|
||||
- Level 3: 14%
|
||||
|
||||
### BitNode 7: Bladeburners 2079
|
||||
|
||||
In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a hyper-intelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.
|
||||
|
||||
In this BitNode, you will be able to access the Bladeburner division at the NSA, which provides a new mechanic for progression.
|
||||
|
||||
Destroying this BitNode will give you Source-File 7, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner division in other BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:
|
||||
|
||||
- Level 1: 8%
|
||||
- Level 2: 12%
|
||||
- Level 3: 14% and immediately receive "The Blade's Simulacrum" augmentation after joining the Bladeburner division
|
||||
|
||||
### BitNode 8: Ghost of Wall Street
|
||||
|
||||
You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.
|
||||
|
||||
In this BitNode:
|
||||
|
||||
- You start with $250 million
|
||||
- You start with a WSE membership and access to the TIX API
|
||||
- You are able to short stocks and place different types of orders (limit/stop)
|
||||
|
||||
Destroying this BitNode will give you Source-File 8, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:
|
||||
|
||||
- Level 1: Permanent access to WSE and TIX API
|
||||
- Level 2: Ability to short stocks in other BitNodes
|
||||
- Level 3: Ability to use limit/stop orders in other BitNodes
|
||||
|
||||
This Source-File also increases your hacking growth multipliers by:
|
||||
|
||||
- Level 1: 12%
|
||||
- Level 2: 18%
|
||||
- Level 3: 21%
|
||||
|
||||
### BitNode 9: Hacktocracy
|
||||
|
||||
When Fulcrum Secret Technologies released their open-source Linux distro Chapeau, it quickly became the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the Hacknet, which is a global, decentralized network used for nefarious purposes. Fulcrum Secret Technologies quickly abandoned the project and dissociated themselves from it.
|
||||
|
||||
This BitNode unlocks the Hacknet Server, which is an upgraded version of the Hacknet Node. Hacknet Servers generate hashes, which can be spent on a variety of different upgrades.
|
||||
|
||||
Destroying this BitNode will give you Source-File 9, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:
|
||||
|
||||
- Level 1: Permanently unlocks the Hacknet Server in other BitNodes
|
||||
- Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode
|
||||
- Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode
|
||||
|
||||
(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing augmentations)
|
||||
|
||||
This Source-File also increases hacknet production and reduces hacknet costs by:
|
||||
|
||||
- Level 1: 12%
|
||||
- Level 2: 18%
|
||||
- Level 3: 21%
|
||||
|
||||
### BitNode 10: Digital Carbon
|
||||
|
||||
In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their consciousness. Their consciousness could then be transferred into Synthoids or other bodies by transmitting the digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally
|
||||
achieved immortality - at least for those that could afford it.
|
||||
|
||||
This BitNode unlocks Sleeve and Grafting technology:
|
||||
|
||||
- Sleeve: Duplicate your consciousness into Synthoids, allowing you to perform different tasks asynchronously. You cannot buy Sleeves outside this BitNode.
|
||||
- Grafting: Visit VitaLife in New Tokyo to get access to this technology. It allows you to graft augmentations, which is an alternative way of installing augmentations.
|
||||
|
||||
Destroying this BitNode will give you Source-File 10, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File unlocks Sleeve and Grafting API in other BitNodes. Each level of this Source-File also grants you a Sleeve.
|
||||
|
||||
### BitNode 11: The Big Crash
|
||||
|
||||
The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period of disorder that eventually led to the governmental reformation of many global superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophes hit.
|
||||
|
||||
In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.
|
||||
|
||||
Destroying this BitNode will give you Source-File 11, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's company salary and reputation gain multipliers by:
|
||||
|
||||
- Level 1: 32%
|
||||
- Level 2: 48%
|
||||
- Level 3: 56%
|
||||
|
||||
It also reduces the price increase for every augmentation bought by:
|
||||
|
||||
- Level 1: 4%
|
||||
- Level 2: 6%
|
||||
- Level 3: 7%
|
||||
|
||||
### BitNode 12: The Recursion
|
||||
|
||||
To iterate is human; to recurse, divine.
|
||||
|
||||
Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you Source-File 12, or if you already have this Source-File, it will upgrade its level. There is no maximum level for Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the level of this source file.
|
||||
|
||||
### BitNode 13: They're lunatics
|
||||
|
||||
With the invention of augmentations in the 2040s, a religious group known as the Church of the Machine God has rallied far more support than anyone would have hoped.
|
||||
|
||||
Their leader, Allison "Mother" Stanek is said to have created her own augmentation whose power goes beyond any other. Find her in Chongqing and gain her trust.
|
||||
|
||||
Destroying this BitNode will give you Source-File 13, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File lets the Church of the Machine God appear in other BitNodes.
|
||||
|
||||
Each level of this Source-File increases the size of Stanek's Gift.
|
||||
|
||||
Due to the effect of Source-File 7.3, you must accept Stanek's Gift before joining the Bladeburner division if you have that Source-File.
|
||||
|
||||
### BitNode 14: IPvGO Subnet Takeover
|
||||
|
||||
In late 2070, the .org bubble burst, and most of the newly-implemented IPvGO 'net collapsed overnight. Since then, various factions have been fighting over small subnets to control their computational power. These subnets are very valuable in the right hands, if you can wrest them from their current owners. You will be opposed by the other factions, but you can overcome them with careful choices. Prevent their attempts to destroy your networks by controlling the open space in the 'net!
|
||||
|
||||
Destroying this BitNode will give you Source-File 14, or if you already have this Source-File, it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:
|
||||
|
||||
- Level 1: 100% increased stat multipliers from Node Power
|
||||
- Level 2: Permanently unlocks the go.cheat API
|
||||
- Level 3: 25% additive increased success rate for the go.cheat API
|
||||
|
||||
This Source-File also increases the maximum favor from winstreaks you can gain for each faction to:
|
||||
|
||||
- Level 1: 200k rep equivalent
|
||||
- Level 2: 300k rep equivalent
|
||||
- Level 3: 400k rep equivalent
|
||||
|
||||
and increases the reputation converted to favor for winning two games in a row to:
|
||||
|
||||
- Level 1: 1000 rep to favor
|
||||
- Level 2: 1500 rep to favor
|
||||
- Level 3: 2000 rep to favor
|
||||
@@ -0,0 +1,11 @@
|
||||
# Bladeburners
|
||||
|
||||
Bladeburner divisions were created internationally in the mid-21st century. Tasked with monitoring and "managing" rogue Synthoids, which may have blended into society and are sometimes considered a threat, working for Bladeburners gives access to powerful enhancements and a goal of destroying [BitNodes](bitnodes.md) by operating against increasingly strong Synthoid opposition.
|
||||
|
||||
## Bladeburner Skills:
|
||||
|
||||
Designed to improve a human agent's capabilities beyond their natural limits, Bladeburner skills add a persistent bonus while in the [BitNode](bitnodes.md) where they were purchased. Bladeburner skills are purchased with Bladeburner skill points, not money.
|
||||
|
||||
## Faction and Rank:
|
||||
|
||||
Bladeburners also offer unique [Augmentations](../basic/augmentations.md) and a [Faction](factions.md) invite to agents who "put in the work" to gain a small amount of rank. While Bladeburner rank and skill points persist after any augmentation installs, faction reputation will be reset. Bladeburner faction reputation can only be gained through Bladeburner actions.
|
||||
@@ -0,0 +1,44 @@
|
||||
# Basic gameplay – Terms
|
||||
|
||||
## Basic gameplay
|
||||
|
||||
There is a `corporation-management-handbook.lit` on your home server. Read it.
|
||||
|
||||
Go to City Hall in Sector-12 and create a Corporation through the UI if you want. However, you really should do everything by scripting.
|
||||
|
||||
You can use seed money when creating a corporation in BN3.
|
||||
|
||||
There are multiple industries that you can expand into. In order to do that, you need to choose an industry and create a division. Agriculture is the best starting industry. Check this [section](./industry-supply-chain.md) for details.
|
||||
|
||||
Each division can expand to 6 cities.
|
||||
|
||||
Each industry has different input materials and output materials/products. For example: Agriculture needs Water and Chemicals to produce Plants and Food. The number next to each material is its "coefficient" (You can call it "weight" or "factor" if you want).
|
||||
|
||||
$$0.5\ \textit{Water}+0.2\ \textit{Chemicals} \Rightarrow 1\ \textit{Plants}+1\ \textit{Food}$$
|
||||
|
||||
There is no "offline progress" in corporation. When you go offline, the corporation accumulates bonus time.
|
||||
|
||||
A corporation continuously transitions between 5 states: START → PURCHASE → PRODUCTION → EXPORT → SALE → START. The action occurs when the state is _entered_, i.e., when the state is PURCHASE, it means purchasing has just occurred. One cycle (going through one of these transitions) takes 10 seconds. If you have enough bonus time, it takes one second. Check this [section](./miscellany.md) for details.
|
||||
|
||||
Each division has its "division product multiplier". This multiplier can be increased by buying [boost materials](./boost-material.md): AI Cores, Hardware, Real Estate, and Robots.
|
||||
|
||||
You should look around to get familiar with the UI. One confusing thing for newbies is how to setup the "buy value" to buy materials. We have "Purchase" and "Bulk purchase":
|
||||
|
||||
- Purchase: This is "buy per second" value. For example: In cycle 1, you enter "100", then in cycle 2, at PURCHASE state, you'll have 100\*10 units in your inventory. You can buy more than what your funds allows (and go into debt) with this option. Important note: when you have enough units that you want, you must press "Clear purchase", otherwise it'll buy forever until you run out of storage space.
|
||||
- Bulk purchase: You buy exactly what you want. Must pay upfront.
|
||||
|
||||
If you want to buy something, write a script to do that. It's too error-prone to do it manually.
|
||||
|
||||
When you hover your mouse over "Storage space", you'll see the space that materials/products take up and the number of units in the warehouse.
|
||||
|
||||
## Terms
|
||||
|
||||
Smart Supply: Automatically buy optimal quantities of input material units.
|
||||
|
||||
Export: Allow export/import materials between divisions.
|
||||
|
||||
Wilson: Wilson Analytics upgrade.
|
||||
|
||||
Market-TA2: Automatically set optimal prices for your output materials/products.
|
||||
|
||||
RP: Research point.
|
||||
@@ -0,0 +1,170 @@
|
||||
# Boost material
|
||||
|
||||
## Division production multiplier
|
||||
|
||||
Each industry has a different set of boost material's coefficients. For example:
|
||||
|
||||
- Agriculture:
|
||||
- AI Cores: 0.3
|
||||
- Hardware: 0.2
|
||||
- Real Estate: 0.72
|
||||
- Robots: 0.3
|
||||
- Chemical:
|
||||
- AI Cores: 0.2
|
||||
- Hardware: 0.2
|
||||
- Real Estate: 0.25
|
||||
- Robots: 0.25
|
||||
- Tobacco:
|
||||
- AI Cores: 0.15
|
||||
- Hardware: 0.15
|
||||
- Real Estate: 0.15
|
||||
- Robots: 0.25
|
||||
|
||||
The division production multiplier is used for calculating [division raw production](./division-raw-production.md) in the PRODUCTION state. It's sum of each warehouse's `cityMult`, and `cityMult` is calculated by combining the quantity of each boost material with the boost material's coefficient.
|
||||
|
||||
This multiplier is `this.productionMult` in `Division.ts`.
|
||||
|
||||
```typescript
|
||||
calculateProductionFactors(): void {
|
||||
let multSum = 0;
|
||||
for (const warehouse of getRecordValues(this.warehouses)) {
|
||||
const materials = warehouse.materials;
|
||||
|
||||
const cityMult =
|
||||
Math.pow(0.002 * materials["Real Estate"].stored + 1, this.realEstateFactor) *
|
||||
Math.pow(0.002 * materials.Hardware.stored + 1, this.hardwareFactor) *
|
||||
Math.pow(0.002 * materials.Robots.stored + 1, this.robotFactor) *
|
||||
Math.pow(0.002 * materials["AI Cores"].stored + 1, this.aiCoreFactor);
|
||||
multSum += Math.pow(cityMult, 0.73);
|
||||
}
|
||||
|
||||
multSum < 1 ? (this.productionMult = 1) : (this.productionMult = multSum);
|
||||
}
|
||||
```
|
||||
|
||||
This is the reason we must expand to all 6 cities. More cities → Higher `this.productionMult` → Higher raw production → More produced materials/products → Higher profit per city → Higher total profit.
|
||||
|
||||
Expanding to 6 cities means `this.productionMult` is multiplied by 6, and we have 6 cities, so effectively production is multiplied by 36. This is not exactly true because there are more things that affect the raw production value of each city, but x36 can be seen as a rough estimate of benefit, especially in early rounds. In those rounds, division production multiplier is the most important thing.
|
||||
|
||||
## Optimizer
|
||||
|
||||
In order to increase `this.productionMult`, we need to buy boost materials. The problem is how much we should buy each material, given a specific constraint on storage space.
|
||||
|
||||
Each boost material has a coefficient ("factor" in source code) and a base size (size for 1 unit in storage).
|
||||
|
||||
Let's define:
|
||||
|
||||
- 4 coefficients: ${c_{1}}$, ${c_{2}}$, ${c_{3}}$, ${c_{4}}$
|
||||
- 4 base sizes: ${s_{1}}$, ${s_{2}}$, ${s_{3}}$, ${s_{4}}$
|
||||
- Quantities of each boost materials: x, y, z, w
|
||||
|
||||
Assuming the same warehouse setup in all cities, the division production multiplier is:
|
||||
|
||||
$$F(x,y,z,w) = \sum_{i = 1}^{6}\left( (1 + 0.002\ast x)^{c_{1}}\ast(1 + 0.002\ast y)^{c_{2}}{\ast(1 + 0.002\ast z)}^{c_{3}}{\ast(1 + 0.002\ast w)}^{c_{4}} \right)^{0.73}$$
|
||||
|
||||
In order to find the maximum of the function above, we can find the maximum of this function:
|
||||
|
||||
$$F(x,y,z,w) = (1 + 0.002\ast x)^{c_{1}}\ast(1 + 0.002\ast y)^{c_{2}}{\ast(1 + 0.002\ast z)}^{c_{3}}{\ast(1 + 0.002\ast w)}^{c_{4}}$$
|
||||
|
||||
Constraint function (S is storage space):
|
||||
|
||||
$$G(x,y,z,w) = s_{1}\ast x + s_{2}\ast y + s_{3}\ast z + s_{4}\ast w = S$$
|
||||
|
||||
Problem: Find the maximum of $F(x,y,z,w)$ with constraint $G(x,y,z,w)$.
|
||||
|
||||
## Solution
|
||||
|
||||
### Lagrange multiplier method
|
||||
|
||||
Disclaimer: This is based on discussion between \@Jesus and \@yichizhng on Discord. All credit goes to them.
|
||||
|
||||
By using the [Lagrange multiplier](https://en.wikipedia.org/wiki/Lagrange_multiplier) method, we have this system:
|
||||
|
||||
$$\begin{cases} \frac{\partial F}{\partial x} &= \lambda\frac{\partial G}{\partial x} \newline \frac{\partial F}{\partial y} &= \lambda\frac{\partial G}{\partial y} \newline \frac{\partial F}{\partial z} &= \lambda\frac{\partial G}{\partial z} \newline \frac{\partial F}{\partial w} &= \lambda\frac{\partial G}{\partial w} \newline G(x,y,z,w) &= S\end{cases}$$
|
||||
|
||||
In order to solve this system, we have 2 choices:
|
||||
|
||||
- Solve that system with [Ceres Solver](./miscellany.md).
|
||||
- Do the hard work with basic calculus and algebra. This is the optimal way in both accuracy and performance, so we'll focus on it. In the following sections, I'll show the proof for this solution.
|
||||
|
||||
$$x\ast s_{1} = \frac{S - 500\ast\left( \frac{s_{1}}{c_{1}}\ast\left( c_{2} + c_{3} + c_{4} \right) - \left( s_{2} + s_{3} + s_{4} \right) \right)}{\frac{c_{1} + c_{2} + c_{3} + c_{4}}{c_{1}}}$$
|
||||
|
||||
$$y\ast s_{2} = \frac{S - 500\ast\left( \frac{s_{2}}{c_{2}}\ast\left( c_{1} + c_{3} + c_{4} \right) - \left( s_{1} + s_{3} + s_{4} \right) \right)}{\frac{c_{1} + c_{2} + c_{3} + c_{4}}{c_{2}}}$$
|
||||
|
||||
$$z\ast s_{3} = \frac{S - 500\ast\left( \frac{s_{3}}{c_{3}}\ast\left( c_{1} + c_{2} + c_{4} \right) - \left( s_{1} + s_{2} + s_{4} \right) \right)}{\frac{c_{1} + c_{2} + c_{3} + c_{4}}{c_{3}}}$$
|
||||
|
||||
$$w\ast s_{4} = \frac{S - 500\ast\left( \frac{s_{4}}{c_{4}}\ast\left( c_{1} + c_{2} + c_{3} \right) - \left( s_{1} + s_{2} + s_{3} \right) \right)}{\frac{c_{1} + c_{2} + c_{3} + c_{4}}{c_{4}}}$$
|
||||
|
||||
## Proof
|
||||
|
||||
Define: $k = 0.002$
|
||||
|
||||
$$\begin{cases}\frac{\partial F}{\partial x} = \left( k\ast c_{1}\ast(1 + k\ast x)^{c_{1} - 1} \right)\ast(1 + k\ast y)^{c_{2}}\ast(1 + k\ast z)^{c_{3}}\ast(1 + k\ast w)^{c_{4}} = \lambda\ast s_{1} \newline \frac{\partial F}{\partial y} = (1 + k\ast x)^{c_{1}}\ast\left( k\ast c_{2}\ast(1 + k\ast y)^{c_{2} - 1} \right)\ast(1 + k\ast z)^{c_{3}}\ast(1 + k\ast w)^{c_{4}} = \lambda\ast s_{2} \end{cases}$$
|
||||
|
||||
≡
|
||||
|
||||
$$k\ast c_{1}\ast(1 + k\ast x)^{- 1}\ast s_{2} = k\ast c_{2}\ast(1 + k\ast y)^{- 1}\ast s_{1}$$
|
||||
|
||||
≡
|
||||
|
||||
$$c_{1}\ast s_{2}\ast(1 + k\ast y) = c_{2}\ast s_{1}\ast(1 + k\ast x)$$
|
||||
|
||||
≡
|
||||
|
||||
$$1 + k\ast y = \frac{c_{2}\ast s_{1}}{c_{1}\ast s_{2}}\ast(1 + k\ast x)$$
|
||||
|
||||
≡
|
||||
|
||||
$$y = \frac{c_{2}\ast s_{1} + k\ast x\ast c_{2}\ast s_{1} - c_{1}\ast s_{2}}{k\ast c_{1}\ast s_{2}}$$
|
||||
|
||||
≡
|
||||
|
||||
$$y\ast s_{2} = \frac{c_{2}\ast s_{1}\ast s_{2} + k\ast x\ast c_{2}\ast s_{1}\ast s_{2} - c_{1}\ast s_{2}\ast s_{2}}{k\ast c_{1}\ast s_{2}}$$
|
||||
|
||||
≡
|
||||
|
||||
$$y\ast s_{2} = \frac{c_{2}\ast s_{1}}{k\ast c_{1}} + \frac{x\ast c_{2}\ast s_{1}}{c_{1}} - \frac{s_{2}}{k}$$
|
||||
|
||||
≡
|
||||
|
||||
$$y\ast s_{2} = \frac{c_{2}}{c_{1}}\ast x\ast s_{1} + \frac{1}{k}\ast\frac{c_{2}\ast s_{1} - c_{1}\ast s_{2}}{c_{1}}$$
|
||||
|
||||
≡
|
||||
|
||||
$$y\ast s_{2} = \frac{c_{2}}{c_{1}}\ast x\ast s_{1} + 500\ast\frac{c_{2}\ast s_{1} - c_{1}\ast s_{2}}{c_{1}}$$
|
||||
|
||||
Repeating the above steps, we have:
|
||||
|
||||
$$z\ast s_{3} = \frac{c_{3}}{c_{1}}\ast x\ast s_{1} + 500\ast\frac{c_{3}\ast s_{1} - c_{1}\ast s_{3}}{c_{1}}$$
|
||||
|
||||
$$w\ast s_{4} = \frac{c_{4}}{c_{1}}\ast x\ast s_{1} + 500\ast\frac{c_{4}\ast s_{1} - c_{1}\ast s_{4}}{c_{1}}$$
|
||||
|
||||
Substituting into the constraint function:
|
||||
|
||||
$$x\ast s_{1} + y\ast s_{2} + z\ast s_{3} + w\ast s_{4} = S$$
|
||||
|
||||
≡
|
||||
|
||||
$$x\ast s_{1} + \frac{c_{2}}{c_{1}}\ast x\ast s_{1} + 500\ast\frac{c_{2}\ast s_{1} - c_{1}\ast s_{2}}{c_{1}} + \frac{c_{3}}{c_{1}}\ast x\ast s_{1} + 500\ast\frac{c_{3}\ast s_{1} - c_{1}\ast s_{3}}{c_{1}} + \frac{c_{4}}{c_{1}}\ast x\ast s_{1} + 500\ast\frac{c_{4}\ast s_{1} - c_{1}\ast s_{4}}{c_{1}} = S$$
|
||||
|
||||
≡
|
||||
|
||||
$$\frac{x\ast s_{1}\ast\left( c_{1} + c_{2} + c_{3} + c_{4} \right)}{c_{1}} + \frac{500}{c_{1}}\ast\left( c_{2}\ast s_{1} - c_{1}\ast s_{2} + c_{3}\ast s_{1} - c_{1}\ast s_{3} + c_{4}\ast s_{1} - c_{1}\ast s_{4} \right) = S$$
|
||||
|
||||
≡
|
||||
|
||||
$$\frac{x\ast s_{1}\ast\left( c_{1} + c_{2} + c_{3} + c_{4} \right)}{c_{1}} + \frac{500}{c_{1}}\ast\left( s_{1}\ast\left( c_{2} + c_{3} + c_{4}\ \right) - c_{1}\ast\left( s_{2} + s_{3} + s_{4} \right) \right) = S$$
|
||||
|
||||
≡
|
||||
|
||||
$$x\ast s_{1}\ast\frac{c_{1} + c_{2} + c_{3} + c_{4}}{c_{1}} + \frac{500}{c_{1}}\ast\left( s_{1}\ast\left( c_{2} + c_{3} + c_{4}\ \right) - c_{1}\ast\left( s_{2} + s_{3} + s_{4} \right) \right) = S$$
|
||||
|
||||
≡
|
||||
|
||||
$$x\ast s_{1} = \frac{S - 500\ast\left( \frac{s_{1}}{c_{1}}\ast\left( c_{2} + c_{3} + c_{4} \right) - \left( s_{2} + s_{3} + s_{4} \right) \right)}{\frac{c_{1} + c_{2} + c_{3} + c_{4}}{c_{1}}}$$
|
||||
|
||||
We can do the same steps for y,z,w.
|
||||
|
||||
## Handle low storage space
|
||||
|
||||
With small S, any variable (x,y,z,w) can be negative. In that case, we remove the variable that ends up being negative and then redo the steps above. When implementing this solution, we can use a recursive function to handle those cases.
|
||||
@@ -0,0 +1,47 @@
|
||||
# Demand - Competition
|
||||
|
||||
## Usage
|
||||
|
||||
They are used for calculating `MaxSalesVolume` of materials and products.
|
||||
|
||||
`Market Research - Demand` grants access to `Demand` data.
|
||||
|
||||
`Market Data - Competition` grants access to `Competition` data.
|
||||
|
||||
## Material
|
||||
|
||||
Each material has its own `demandBase`, `demandRange`, `competitionBase`, `competitionRange`, and `maxVolatility`. Both `demand` and `competition` start at their bases and are always in their respective ranges.
|
||||
|
||||
This is non-intuitive: `demand` and `competition` are _not_ used for calculating `marketPrice`.
|
||||
|
||||
During the START state, the game calculates 6 variables:
|
||||
|
||||
```typescript
|
||||
const priceVolatility: number = (Math.random() * this.maxVolatility) / 300;
|
||||
const priceChange: number = 1 + priceVolatility;
|
||||
const compVolatility: number = (Math.random() * this.maxVolatility) / 100;
|
||||
const compChange: number = 1 + compVolatility;
|
||||
const dmdVolatility: number = (Math.random() * this.maxVolatility) / 100;
|
||||
const dmdChange: number = 1 + dmdVolatility;
|
||||
```
|
||||
|
||||
`priceChange`, `compChange` and `dmdChange` are the amount of `marketPrice`, `competition` and `demand` changed in the next steps.
|
||||
|
||||
After that, it randomizes twice:
|
||||
|
||||
- First: `Math.random()` < 0.5. If yes, increase `competition` and `marketPrice`. If not, decrease them.
|
||||
- Second: `Math.random()` < 0.5. If yes, increase `demand` and `marketPrice`. If not, decrease them.
|
||||
|
||||
## Product
|
||||
|
||||
Initial values are set when the product is finished. Check the next [section](./product.md) for the formulas.
|
||||
|
||||
During the START state, the game decreases `demand` and increases `competition` of the product.
|
||||
|
||||
- Amount of change:
|
||||
|
||||
$$AmountOfChange = Random(0,3)*0.0004$$
|
||||
|
||||
- This amount is multiplied by 3 if the industry is Pharmaceutical, Software or Robotics.
|
||||
|
||||
`Demand`'s minimum value is 0.001. `Competition`'s maximum value is 99.99.
|
||||
@@ -0,0 +1,40 @@
|
||||
# Division raw production
|
||||
|
||||
## Definition
|
||||
|
||||
Each industry requires different input materials. Each required material has its own coefficient. This value is not the same as the boost material's coefficient; they are different things. For example:
|
||||
|
||||
- Agriculture: { Water: 0.5, Chemicals: 0.2 }
|
||||
- Chemical: { Plants: 1, Water: 0.5 }
|
||||
- Tobacco: { Plants: 1 }
|
||||
|
||||
Each division has a number that I call "Division raw production". This raw value is the division's production capability. Let's call it `RawProduction`. It's used for:
|
||||
|
||||
- Calculating how much input material that we need. It's multiplied by the input material's coefficient to find the required quantity of that input material.
|
||||
- Calculating how much material/product that division can produce. It's multiplied by `ProducibleFrac`. `ProducibleFrac` starts at 1 and is reduced if there are not enough input materials.
|
||||
|
||||
For example, with Agriculture, if `RawProduction` is 1000, we need 500 units of Water and 200 units of Chemicals. With these input materials, we can produce 1000 units of Plants and 1000 units of Food.
|
||||
|
||||
### Formula
|
||||
|
||||
`RawProduction` is the product of 4 multipliers:
|
||||
|
||||
- Office multiplier:
|
||||
- Employee production in 3 jobs (Operations, Engineer, Management) and their sum:
|
||||
- `OperationsProd = office.employeeProductionByJob.Operations`
|
||||
- `EngineerProd = office.employeeProductionByJob.Engineer`
|
||||
- `ManagementProd = office.employeeProductionByJob.Management`
|
||||
- $TotalEmployeesProd = OperationsProd + EngineerProd + ManagementProd$
|
||||
- Management factor:
|
||||
$$ManagementFactor = 1 + \frac{ManagementProd}{1.2\ast TotalEmployeesProd}$$
|
||||
- Employee production multiplier:
|
||||
$$EmployeeProductionMultiplier = \left( (OperationsProd)^{0.4} + (EngineerProd)^{0.3} \right)\ast ManagementFactor$$
|
||||
- Balancing multiplier:
|
||||
$$BalancingMultiplier = 0.05$$
|
||||
- If output is material:
|
||||
$$OfficeMultiplier = BalancingMultiplier\ast EmployeeProductionMultiplier$$
|
||||
- If output is product:
|
||||
$$OfficeMultiplier = 0.5\ast BalancingMultiplier\ast EmployeeProductionMultiplier$$
|
||||
- Division production multiplier: see previous [section](./boost-material.md).
|
||||
- Upgrade multiplier: multiplier from [Smart Factories](./unlocks-upgrade-research.md).
|
||||
- Research multiplier: multiplier from [research](./unlocks-upgrade-research.md).
|
||||
@@ -0,0 +1,226 @@
|
||||
# FAQ
|
||||
|
||||
#### What is a corporation good for?
|
||||
|
||||
Generating ridiculously massive income. With this income, you can buy whatever you want, e.g., augmentations or bribing factions for reputation.
|
||||
|
||||
#### How many investment rounds should I take?
|
||||
|
||||
There are 4 rounds, and you should take all of them. Investment funds greatly boost your corporation development. Your corporation won't be able to reach its full potential in a reasonable time without them.
|
||||
|
||||
#### Investors take too many shares. Can I buy them back later?
|
||||
|
||||
No.
|
||||
|
||||
#### The government takes too many shares when I use the "Seed money" option. Can I buy them back later?
|
||||
|
||||
No.
|
||||
|
||||
#### Why can I not buy back my shares?
|
||||
|
||||
You can buy back shares that were issued. Shares that were given to the government (when you use seed money) and investors (when you take investment offers) cannot be bought back.
|
||||
|
||||
You always have total control over your corporation, so you don't have to worry about "ownership". When your profit hits exponential growth, the share percentage means nothing. If your corporation's profit is 1e90/s and you only have 1% shares, you still get 1e88/s.
|
||||
|
||||
#### My corporation generates profit. Why does my money not increase?
|
||||
|
||||
Go public and set a dividend.
|
||||
|
||||
#### How many shares should I issue?
|
||||
|
||||
0
|
||||
|
||||
#### Why is my "earnings as a shareholder" lower than my calculation ("Dividends per share" \* "Owned Stock Shares")?
|
||||
|
||||
Your dividend is negatively affected by a penalty modifier called "tribute modifier". `ShadyAccounting` and `GovernmentPartnership` reduce this penalty modifier. Check this [section](./financial-statement.md) for details.
|
||||
|
||||
#### All corporation APIs require too much RAM. How do I deal with it?
|
||||
|
||||
Earn money by any normal means: hacking, committing crimes, cheating in the casino, etc. There is also another way:
|
||||
|
||||
- Follow the [advice](./general-advice.md) on round 1, but at the end, do not accept the investment offer.
|
||||
- Go public immediately.
|
||||
- Sell all your shares immediately.
|
||||
- Sell the CEO position and start a new corporation.
|
||||
|
||||
Also note that you don't have to do everything in one script. You can make smaller scripts that do less and use fewer APIs to keep the RAM usage down, and use `run()` to chain them together.
|
||||
|
||||
#### Why can I not create a corporation with the government's seed money ("Use seed money")?
|
||||
|
||||
That option is only available in BN3.
|
||||
|
||||
#### Can I sell my corporation via API?
|
||||
|
||||
No.
|
||||
|
||||
#### Can I transfer my (personal) money to the corporation's funds?
|
||||
|
||||
No. However, with SF9, you can sell hashes for corporation funds or RP.
|
||||
|
||||
#### Why can I not bribe factions for reputations? What's the exchange rate?
|
||||
|
||||
Your corporation's valuation must be at least 100e12 to bribe. Exchange rate: 1e9/reputation.
|
||||
|
||||
#### What's the maximum number of divisions?
|
||||
|
||||
In BN3, it's 20.
|
||||
|
||||
#### Why does my division not produce anything?
|
||||
|
||||
Check these things:
|
||||
|
||||
- Have at least 1 employee in Operations or Engineer
|
||||
- Have enough storage space. Warehouse congestion is a common problem.
|
||||
|
||||
#### Which industry should I focus on?
|
||||
|
||||
Check this [section](./industry-supply-chain.md).
|
||||
|
||||
#### Should I create more divisions for the same industry? For example: multiple Agriculture divisions.
|
||||
|
||||
No, focus your funds on one division for each industry.
|
||||
|
||||
#### Which "feature" (Export, Smart Supply, etc.) should I unlock?
|
||||
|
||||
Check this [section](./unlocks-upgrade-research.md).
|
||||
|
||||
#### Which upgrade should I buy?
|
||||
|
||||
Check this [section](./unlocks-upgrade-research.md).
|
||||
|
||||
#### Which research should I buy?
|
||||
|
||||
Check this [section](./unlocks-upgrade-research.md).
|
||||
|
||||
#### I unlocked "Smart Supply", but it does not work or its behavior is weird.
|
||||
|
||||
Check these things:
|
||||
|
||||
- You have to enable it if you unlock it after purchasing a warehouse.
|
||||
- Always choose "Use leftovers". "Use imported" is only useful in special cases.
|
||||
|
||||
#### How do I implement a custom Smart Supply script?
|
||||
|
||||
Check this [section](./smart-supply.md).
|
||||
|
||||
#### How do I setup the quantity of exported materials?
|
||||
|
||||
Specify an export string. The optimal export string is `(IPROD+IINV/10)*(-1)`. Check this [section](./miscellany.md) for details.
|
||||
|
||||
#### Is research's benefit shared between different divisions?
|
||||
|
||||
It's shared if those divisions are in the same industry. However, the RP pool is not shared.
|
||||
|
||||
#### Should I expand to all 6 cities?
|
||||
|
||||
Yes. In fact, you must do that for maximum efficiency. Check this [section](./boost-material.md).
|
||||
|
||||
#### What are boost materials?
|
||||
|
||||
They are the materials that boost [division production multiplier](./boost-material.md). There are 4 boost materials: AI Cores, Hardware, Real Estate, and Robots.
|
||||
|
||||
#### How many boost materials should I buy?
|
||||
|
||||
Check the optimizer in this [section](./boost-material.md).
|
||||
|
||||
#### Why does the [General advice](./general-advice.md) section tell me to use API to upgrade office size?
|
||||
|
||||
API (`upgradeOfficeSize`) gives you granular control over office size. You cannot do that through UI.
|
||||
|
||||
#### Why does `setJobAssignment` not take effect immediately?
|
||||
|
||||
It only takes effect in the next cycle's START state.
|
||||
|
||||
#### Why do energy and morale matter?
|
||||
|
||||
They are used for calculating `employeeProductionByJob`, then that property is used for calculating other things: RP, material's quality, product's stats, division raw production, and material/product's `MaxSalesVolume`.
|
||||
|
||||
#### What do Interns do?
|
||||
|
||||
They maintain energy and morale. You should only use them if you don't want to write scripts. A tea/party script can maintain energy and morale for you, and it is very simple to implement. It's recommended to implement that script instead of wasting employees on the "Intern" job.
|
||||
|
||||
#### I use 1/9 as Intern ratio, but energy and morale still drop.
|
||||
|
||||
You can only use that ratio when your corporation works fine (funds > 0 or profit > 0). If it does not, use 1/6.
|
||||
|
||||
#### Are there any other ways to maintain these 2 stats?
|
||||
|
||||
There are research upgrades for that. However, you should never buy them. It's always better spending your RP elsewhere or just stock up on RP.
|
||||
|
||||
#### Buying tea and throwing parties cost me too much money. Why are they so expensive?
|
||||
|
||||
Tea and parties are cheap. If your budget is so low that they cost you too much money, it means you wasted too much of your funds.
|
||||
|
||||
#### How much money should I spend to throw parties? How often should I buy tea / throw party?
|
||||
|
||||
Check this [section](./office.md).
|
||||
|
||||
#### How do I know if the qualities of my input materials are too low and need to be improved?
|
||||
|
||||
Check this [section](./quality.md).
|
||||
|
||||
#### What are Awareness and Popularity?
|
||||
|
||||
Check this [section](./wilson-analytics-advert.md).
|
||||
|
||||
#### Is Wilson retroactive?
|
||||
|
||||
No.
|
||||
|
||||
#### Does that mean I should buy Wilson as soon as possible? If yes, then why don't you buy any Wilson in round 1 and 2?
|
||||
|
||||
You should buy Wilson as soon as possible, but not too soon. Round 1 and 2 are those cases. Check this [section](./wilson-analytics-advert.md) for details.
|
||||
|
||||
#### What are Demand and Competition?
|
||||
|
||||
Check this [section](./demand-competition.md).
|
||||
|
||||
#### How much should I spend for "Design investment" and "Marketing investment" when I create a new product? How do they affect the product?
|
||||
|
||||
They are not too important. It's fine to spend 1% of your current funds for them. Check this [section](./product.md) for details.
|
||||
|
||||
#### Should I buy Market-TA1?
|
||||
|
||||
No, wait for Market-TA2. Market-TA1 is useless in most cases.
|
||||
|
||||
#### When should I buy Market-TA2?
|
||||
|
||||
As soon as possible, it greatly increases your profit because it can find the optimal price. However, you should not use all your RP to buy it. Depleting the entire RP pool severely degrades your product rating. That research costs a total of 75e3 RP (Hi-Tech R&D Laboratory + Market-TA1 + Market-TA2), so I recommend saving up 150e3 RP before buying it. Depleting half of the RP pool is acceptable, considering the positive effect of Market-TA2.
|
||||
|
||||
#### What is the difference between Market-TA1 and Market-TA2?
|
||||
|
||||
If you set the price of the material/product too much higher than the market price, you will get a penalty modifier that makes the material/product not be able to be sold as much as it should be.
|
||||
|
||||
Market-TA1 sets a price higher than the market price while ensuring that you don't get the penalty modifier.
|
||||
|
||||
Market-TA2 assumes that you can sell all stored units without any problems and can accept a penalty modifier. If that's the case, it finds the highest possible price.
|
||||
|
||||
With products, the price set by Market-TA2 is usually several orders of magnitude higher than Market-TA1.
|
||||
|
||||
#### I bought Market-TA2, but it does not set the optimal price for me.
|
||||
|
||||
You have to enable it.
|
||||
|
||||
#### Is there a workaround for Market-TA2? Waiting for RP takes too long.
|
||||
|
||||
Yes, you can reimplement Market-TA2. Implementing a custom Market-TA2 script is the best optimization in round 3+. Check this [section](./optimal-selling-price-market-ta2.md) to see how to do it.
|
||||
|
||||
### Why can I not sell all produced goods in the storage even after using Market-TA1 and Market-TA2?
|
||||
|
||||
In the SALE state, the game calculates `MaxSalesVolume` of the material/product. This is the number of items that can be sold in this state. This value is the product of many multipliers, and one of those multipliers is the markup multiplier. When it's higher than 1, it's a bonus multiplier helping you sell more items. When it's lower than 1, it's a penalty modifier making you sell fewer items.
|
||||
|
||||
With Market TA1 and Market TA2, the markup multiplier is always less than or equal to 1. In other words, they never help you sell more items than you can. Their job is to help you find a good price that is higher than the market price. If you want to sell more items than you can, you need to set the price below the market price. This is not the job of Market TA1 and Market TA2.
|
||||
|
||||
Check this [section](./optimal-selling-price-market-ta2.md) for more information and tips on how to increase `MaxSalesVolume`.
|
||||
|
||||
#### How do I discard materials/products?
|
||||
|
||||
Set the selling price to 0.
|
||||
|
||||
#### What is a dummy division?
|
||||
|
||||
Check this [section](./miscellany.md).
|
||||
|
||||
#### Can I skip the Chemical division in round 2 and invest all funds in the Agriculture division?
|
||||
|
||||
No. Without a Chemical division, the quality of your Agriculture division's output materials will be too low, and you cannot sell all those low-quality materials at a good price.
|
||||
@@ -0,0 +1,181 @@
|
||||
# Financial statement
|
||||
|
||||
## Total assets
|
||||
|
||||
`TotalAssets` is the sum of:
|
||||
|
||||
- Funds.
|
||||
- With each division:
|
||||
- Division's `RecoupableValue`. It's half of the sum of:
|
||||
- Industry's starting cost.
|
||||
- With each city that division has expanded to (exclude Sector-12):
|
||||
- Office's initial cost.
|
||||
- Warehouse's initial cost.
|
||||
- Output material: `material.stored * material.averagePrice`.
|
||||
- Product: `product.stored * product.productionCost`.
|
||||
|
||||
This value is kept track by `TotalAssets` and `PreviousTotalAssets`.
|
||||
|
||||
Funds is increased/decreased by `gainFunds`/`loseFunds` for each "action" (buying tea, throwing party, buying upgrade, etc.). Each action is either "long-term" (`FundsSourceLongTerm`) or "short-term" (`FundsSourceShortTerm`). If an action is "long-term", it modifies `totalAssets`.
|
||||
|
||||
```typescript
|
||||
if (LongTermFundsSources.has(source)) {
|
||||
this.totalAssets += amt;
|
||||
}
|
||||
this.funds += amt;
|
||||
```
|
||||
|
||||
`FundsSourceLongTerm` and `FundsSourceShortTerm` are in `FundsSource.ts`.
|
||||
|
||||
## Valuation
|
||||
|
||||
Cycle's valuation:
|
||||
|
||||
- AssetDelta:
|
||||
|
||||
$$AssetDelta = \frac{TotalAssets - PreviousTotalAssets}{10}$$
|
||||
|
||||
- Pre-IPO:
|
||||
- If `AssetDelta` is greater than 0, it's used for calculating valuation.
|
||||
- Formula:
|
||||
$$Valuation = \left( 10^{10} + \frac{Funds}{3} + AssetDelta\ast 315000 \right)\ast\left( \sqrt[12]{1.1} \right)^{NumberOfOfficesAndWarehouses}$$
|
||||
- Valuation is rounded down to nearest million.
|
||||
- Post-IPO:
|
||||
- `AssetDelta` is affected by `DividendRate`:
|
||||
$$AssetDelta = AssetDelta\ast(1 - DividendRate)$$
|
||||
- Formula:
|
||||
|
||||
$$Valuation = (Funds + AssetDelta\ast 85000)\ast\left(\sqrt[12]{1.1}\right)^{NumberOfOfficesAndWarehouses}$$
|
||||
|
||||
- Minimum value of valuation is $10^{10}$.
|
||||
- Valuation is multiplied by `CorporationValuation`. Many BitNodes cripple Corporation via this multiplier.
|
||||
|
||||
Corporation's valuation is the mean of last 10 cycles' valuations.
|
||||
|
||||
Bribing faction for reputation is unlocked when corporation's valuation is greater than or equal to 100e12. Exchange rate: 1e9/reputation.
|
||||
|
||||
## Investment offer
|
||||
|
||||
There are 4 investment rounds.
|
||||
|
||||
Each round has its own `FundingRoundShares` and `FundingRoundMultiplier`.
|
||||
|
||||
- $FundingRoundShares = [0.1, 0.35, 0.25, 0.2]$
|
||||
- $FundingRoundMultiplier = [3, 2, 2, 1.5]$
|
||||
|
||||
Formula:
|
||||
|
||||
$$Offer = CorporationValuation\ast FundingRoundShares\ast FundingRoundMultiplier$$
|
||||
|
||||
Analyses:
|
||||
|
||||
- Offer depends on `Funds`, `AssetDelta` and `NumberOfOfficesAndWarehouses`.
|
||||
- `Funds` are usually depleted to improve divisions.
|
||||
- `NumberOfOfficesAndWarehouses` is the exponent of the multiplier, it can be increased by creating [dummy division](./miscellany.md). It is an easy way to get higher offer in round 3+, when we have enough funds to do that.
|
||||
- `AssetDelta` is multiplied by 315000, so it is the main source of offer.
|
||||
- Assuming that we can sell all produced units and not buy more boost materials, `AssetDelta` is the delta of funds, and the delta of funds is profit. This is why we try our best to improve profit.
|
||||
|
||||
## Dividend and Tribute modifier
|
||||
|
||||
Your dividend is negatively affected by a penalty modifier called `TributeModifier`. `TributeModifier` depends on `CorporationSoftcap`. In BN3, `CorporationSoftcap` is 1.
|
||||
|
||||
$$TributeModifier = 1.15 - CorporationSoftcap$$
|
||||
|
||||
`ShadyAccounting` reduces `TributeModifier` by 0.05.
|
||||
|
||||
`GovernmentPartnership` reduces `TributeModifier` by 0.1.
|
||||
|
||||
Formula:
|
||||
|
||||
$$TotalDividends = DividendRate\ast(Revenue - Expenses)\ast 10$$
|
||||
|
||||
$$Dividend = \left(OwnedShares\ast\frac{TotalDividends}{TotalShares}\right)^{1 - TributeModifier}$$
|
||||
|
||||
Retained earning:
|
||||
|
||||
$$RetainedEarning = (1 - DividendRate)\ast(Revenue - Expenses)\ast 10$$
|
||||
|
||||
Dividend is added to player's money. Retained earning is added to corporation's funds. This means if we increase `DividendRate`, corporation's valuation is dwindled.
|
||||
|
||||
## Shares
|
||||
|
||||
Self-fund:
|
||||
|
||||
- Cost 150b.
|
||||
- Total shares: 1b.
|
||||
- Initial owned shares: 1b.
|
||||
|
||||
Use seed money:
|
||||
|
||||
- Does not cost money.
|
||||
- Total shares: 1.5b.
|
||||
- Initial owned shares: 1b.
|
||||
|
||||
In each investment round, investors take a percentage of initial owned shares. The percentage of each round is in `FundingRoundShares`.
|
||||
|
||||
If your corporation is self-funded and you sell CEO position, you only need 50b to create next corporation.
|
||||
|
||||
`TargetSharePrice`:
|
||||
|
||||
$$OwnershipPercentage = \frac{OwnedShares}{TotalShares}$$
|
||||
|
||||
$$TargetSharePrice = \frac{CorporationValuation*\left(0.5+\sqrt{OwnershipPercentage}\right)}{TotalShares}$$
|
||||
|
||||
When corporation goes public, the initial share price is `TargetSharePrice`.
|
||||
|
||||
Share price is updated in START state.
|
||||
|
||||
$$SharePrice = \begin{cases} SharePrice\ast(1 + Math.random()\ast 0.01), & SharePrice \leq TargetSharePrice \newline SharePrice\ast(1 - Math.random()\ast 0.01), & SharePrice > TargetSharePrice\end{cases}$$
|
||||
|
||||
Minimum share price is 0.01.
|
||||
|
||||
Issue new shares:
|
||||
|
||||
- Maximum number of new shares is 20% of total shares.
|
||||
- The number of new shares issued must be a multiple of 10 million.
|
||||
- New share price:
|
||||
|
||||
$$NewOwnershipPercentage = \frac{OwnedShares}{TotalShares+NewShares}$$
|
||||
|
||||
$$NewSharePrice = \frac{CorporationValuation\ast\left(0.5+\sqrt{NewOwnershipPercentage}\right)}{TotalShares}$$
|
||||
|
||||
- Profit:
|
||||
|
||||
$$Profit = {NewShares\ast(SharePrice + NewSharePrice)}\ast{0.5}$$
|
||||
|
||||
- Profit is added to corporation's funds.
|
||||
- `DefaultCooldown` is 4 hours.
|
||||
- Cooldown: $$Cooldown = DefaultCooldown\ast\frac{TotalShares}{10^{9}}$$
|
||||
- Part of the new shares are added to `InvestorShares`. The remaining ones are added to `IssuedShares`.
|
||||
- `MaxPrivateShares`:
|
||||
$$MaxPrivateShares = {NewShares}\ast{0.5}\ast\frac{InvestorShares}{TotalShares}$$
|
||||
- `PrivateShares` is randomized between 0 and `MaxPrivateShares`, rounded to nearest 10 million.
|
||||
- `InvestorShares`:
|
||||
$$InvestorShares = InvestorShares + PrivateShares$$
|
||||
- `IssuedShares`:
|
||||
$$IssuedShares = IssuedShares + NewShares - PrivateShares$$
|
||||
|
||||
Sell shares:
|
||||
|
||||
- We cannot sell all our shares.
|
||||
- We cannot sell more than $10^{14}$ shares at a time.
|
||||
- Cooldown is 1 hour.
|
||||
- Sold shares are added to `IssuedShares`.
|
||||
|
||||
Buy back shares:
|
||||
|
||||
- We can only buy back shares that were issued. The shares that were owned by government (when we use seed money) and investors cannot be bought back.
|
||||
- Shares must be bought back at a 10% premium over the market price.
|
||||
- We cannot use corporation's funds to buy back shares. They must be bought with our money.
|
||||
- We cannot buy back more than $10^{14}$ shares at a time.
|
||||
|
||||
Sold/bought back shares are processed in multiple "iterations".
|
||||
|
||||
- Number of shares processed each iteration is shareSalesUntilPriceUpdate. Default value is $10^6$.
|
||||
- Share price is recalculated each iteration.
|
||||
|
||||
$$OwnershipPercentage = \frac{OwnedShares - ProcessedShares}{TotalShares}$$
|
||||
|
||||
$$TargetSharePrice = \frac{CorporationValuation\ast\left(0.5 + \sqrt{OwnershipPercentage}\right)}{TotalShares}$$
|
||||
|
||||
$$SharePrice = \begin{cases} SharePrice\ast 1.005, SharePrice \leq TargetSharePrice \newline SharePrice\ast 0.995, SharePrice > TargetSharePrice\end{cases}$$
|
||||
@@ -0,0 +1,109 @@
|
||||
# General advice
|
||||
|
||||
## Round 1
|
||||
|
||||
Create Agriculture division, expand to 6 cities and buy 6 warehouses.
|
||||
|
||||
Use API (`upgradeOfficeSize`) to upgrade office size from 3 to 4. Set 4 employees to R&D and wait until RP is at least 55. Switch to Operations (1) + Engineer (1) + Business (1) + Management (1) before buying boost materials.
|
||||
|
||||
Make sure that your employees' energy and morale are at maximum value. This is always mandatory, not just in round 1.
|
||||
|
||||
Buy the "Smart Supply" feature or write a custom "Smart Supply" script. The built-in "Smart Supply" costs 25b, and 25b is huge in round 1. If you have a custom "Smart Supply" script, you will have more funds to invest in other important upgrades. However, the custom "Smart Supply" script may be a bit hard to implement correctly, especially if you are a new player and do not have much corporation experience. It's fine to skip it and use the built-in "Smart Supply". Having a working, non-optimal division is still better than having a non-working division.
|
||||
|
||||
If you buy the built-in feature, remember to check if it's enabled. If you want to implement a custom script, you can look for some hints at [Smart Supply](./smart-supply.md).
|
||||
|
||||
There are not many things else to do in this round. The budget is too low, so you can skip all these things:
|
||||
|
||||
- Expand into other industries.
|
||||
- Buy corporation's upgrades (except Smart Storage).
|
||||
|
||||
Use remaining funds to buy these upgrades:
|
||||
|
||||
- Only focus on Smart Storage and warehouse upgrade.
|
||||
- Buy 2 Advert levels.
|
||||
|
||||
After that, find the optimal quantities of boost materials and buy them. Do not use "Bulk Purchase", it requires paying upfront. Buying boost materials per second does not need funds because you can go into debt.
|
||||
|
||||
## Round 2
|
||||
|
||||
Buy "Export".
|
||||
|
||||
Upgrade Agriculture division:
|
||||
|
||||
- Find a good number for office size. 8 is the optimal size.
|
||||
- Buy a couple of Advert levels. Advert level 8 is enough for most cases.
|
||||
|
||||
Create Chemical division:
|
||||
|
||||
- Expanding into Chemical industry is mandatory. Without high-quality Chemicals (material) from Chemical division, output materials in Agriculture will be low-quality, and low-quality materials cannot be sold well.
|
||||
- Chemical division is a support division, so don't invest much funds on it. Don't waste funds on its Office/Advert upgrades.
|
||||
- Chemical industry has low boost materials' coefficients, so you should only buy very small number of warehouse upgrade for it. On the other hand, you should not skip Chemical's warehouse upgrade entirely. You still need Chemical division produces an acceptable amount of high-quality Chemical; otherwise, the quality of Chemical used in PRODUCTION state of Agriculture division is reduced too much due to "dilution" in PURCHASE state. For this purpose, 1 warehouse upgrade is enough.
|
||||
|
||||
Focus on Smart Storage, Smart Factories, warehouse upgrade (Agriculture).
|
||||
|
||||
Waiting for RP is mandatory in this round. It serves 2 purposes:
|
||||
|
||||
- Raising RP in Chemical. High RP means high-quality Chemicals (material).
|
||||
- Raising RP in Agriculture. High RP means high-quality Plants.
|
||||
- High-quality Plants can be exported to Chemical to create a loop of quality-enhancing process.
|
||||
- High-quality Plants can be sold easier (higher [MaxSalesVolume](./optimal-selling-price-market-ta2.md)). With your limited budget, you can only increase `MaxSalesVolume` by buying Advert and improving quality of output material. Buying Advert costs money, but waiting for RP is free (except your time).
|
||||
|
||||
Waiting for 700RP/390RP in Agriculture/Chemical division respectively is enough. You can wait for more if you want.
|
||||
|
||||
## Round 3+
|
||||
|
||||
Create Tobacco division in round 3 and set up export route for Plants from Agriculture to Tobacco. This is the optimal product division in this phase.
|
||||
|
||||
The basic game loop that you need to do in round 3+ is simple:
|
||||
|
||||
- Buy research.
|
||||
- Buy Wilson and Advert.
|
||||
- Continuously develop new product.
|
||||
- Upgrade product division and buy corporation's upgrades.
|
||||
- Upgrade support divisions.
|
||||
|
||||
These are the most important things that you need to focus on:
|
||||
|
||||
- Buy Wilson and Advert.
|
||||
- Continuously develop new product.
|
||||
- Get high-quality input materials from support division(s).
|
||||
- Stock up on RP.
|
||||
- Get Market-TA2 as soon as possible.
|
||||
|
||||
Wilson and Advert are extremely important, they are the main factors that make product extremely profitable.
|
||||
|
||||
- Check this [section](./wilson-analytics-advert.md) for details about the mechanism of Wilson and Advert.
|
||||
- When you continuously improve the product division and buy the upgrades with small budget (profit of a few cycles):
|
||||
- Buy Wilson if you can afford it.
|
||||
- After that, use at least 20% of current funds to buy Advert.
|
||||
- Stop buying Wilson and Advert when product division's awareness/popularity reaches max value.
|
||||
|
||||
[Product](./product.md) is the center of round 3+.
|
||||
|
||||
Product's rating is limited to product's effective rating by quality of input materials. You must make sure that support divisions produce enough high-quality materials for product division. For material divisions, increasing RP is the best way to improve the quality in early rounds. However, in round 3+, the most important factor is `EngineerProduction`, so you must prioritize the "Engineer" job over other jobs. It's especially true for Agriculture due to its mediocre `ScienceFactor`. Check this [section](./quality.md) for details. On the other hand, it's fine to invest minimally in support divisions, as long as they produce enough high-quality materials.
|
||||
|
||||
RP is important for product's rating. Do not deplete RP pool, especially right before completing new product.
|
||||
|
||||
Check this [section](./unlocks-upgrade-research.md) for more advice about research upgrades.
|
||||
|
||||
Office setup is important to efficiently develop new product. There are multiple setups for different purposes:
|
||||
|
||||
- Raw production: This setup prioritizes production capability. For support divisions, you should "combine" the prioritization of "Engineer" job with this setup.
|
||||
- Progress: This setup prioritizes development speed of new product. It's best for product division in round 3 and round 4. The product's development speed is very low in these 2 rounds (especially in round 3). By focusing on development speed and get better product sooner, you can reach the point that you can get an adequate offer faster.
|
||||
- Profit. This setup prioritizes profit. It's best at the end of a round, before accepting offer.
|
||||
- Profit-Progress. This setup provides good balance between current profit and development speed of new product. It's best after accepting last offer.
|
||||
|
||||
All the setups above can be calculated by an optimizer. However, that optimizer is hard to implement correctly and efficiently. If you are a newbie, you can skip this optimization and spread employees equally across non-R&D jobs. It's not optimal, but you can still reach the endgame after couple hours if you follow other important advice.
|
||||
|
||||
There are 2 types of office: main office and support office. Main office is where you develop new product. Support office is where you assign a large number of employees to R&D job to increase RP. The most common setup is 1 main office and 5 support offices. The most important office is the main office, its budget must be much higher than support offices' budget.
|
||||
|
||||
The purpose of investment offer is to get large funds and quickly grow the corporation. Better product brings more profit, and higher profit means higher offer. However, it takes a long time to develop early product(s). Sometimes, spending more time to develop better product before accepting offer can harm your overall growth. You must find a good number of products to develop before accepting offer.
|
||||
|
||||
Miscellaneous advice:
|
||||
|
||||
- Buy tea / throw party every cycle.
|
||||
- `DesignInvestment` and `AdvertisingInvestment` scale very badly (the exponent is 0.1). It's fine to spend 1% of your current funds for them.
|
||||
- Create [dummy divisions](./miscellany.md) to get higher offer.
|
||||
- Prioritize Tobacco division over Chemical division when setting up export routes for Plants. [Export](./miscellany.md) route is FIFO.
|
||||
|
||||
You can visit the [official Discord server](https://discord.gg/TFc3hKD) to get access to more information.
|
||||
@@ -0,0 +1,66 @@
|
||||
# Industry - Supply chain
|
||||
|
||||
## Basic term
|
||||
|
||||
Industry consumes input materials and produces output materials/products. Most industries produce either materials or products, some industries produce both of them.
|
||||
|
||||
- Material industries are simple to bootstrap. We use them as starting/support industries.
|
||||
- Product industries are hard to bootstrap, but they generate massive profits.
|
||||
|
||||
Each industry has different values of "factor":
|
||||
|
||||
- `AICoreFactor`, `HardwareFactor`, `RealEstateFactor`, `RobotFactor`: boost material's coefficient. They are used for calculating [division production multiplier](./boost-material.md).
|
||||
- `ScienceFactor`:
|
||||
- With material industry: affect the output material's [quality](./quality.md).
|
||||
- With product industry: affect the output product's [markup and rating](./product.md).
|
||||
- `AdvertisingFactor`: affect the number of units that we can sell ([AdvertFactor](./optimal-selling-price-market-ta2.md)).
|
||||
|
||||
"Support industry" is the industry that provides high-quality input materials for other industries.
|
||||
|
||||
"Endgame" is the very late phase after the division passes the exponential growth. In this phase, the new product is only marginally better than the old products, and the profit increases slowly. For example, the endgame of Tobacco is when profit reaches ~1e98/s.
|
||||
|
||||
## Criterion
|
||||
|
||||
In order to choose good industries for our supply chain, we must consider many criteria:
|
||||
|
||||
- Good synergy between industries. Industries must be able to support each other with the "Export" feature. After the reworking in 2.3, the quality of input material becomes crucial, and importing high-quality materials from other industries is mandatory.
|
||||
- Must have an easy-to-start material industry for early rounds. This industry must have good combinations of boost materials' coefficients and boost materials' sizes. This ensures a high division product multiplier that is the most crucial factor in early rounds. In 4 boost materials, Real Estate (material, not industry) should be noticed because of its tiny size.
|
||||
- High `ScienceFactor` is a bonus for the support industry because its output material's quality can be boosted without much investment in early rounds.
|
||||
- Must have a highly profitable product industry for late phases.
|
||||
- It's preferred to require material from the starting industry rather than to expand into another support industry.
|
||||
- High `ScienceFactor`. This is necessary for a high product's rating.
|
||||
- High `AdvertisingFactor`. This means our product's selling price can be boosted greatly by Wilson and Advert. This is the most important factor for the endgame. `AdvertisingFactor` scales tremendously well when you reach high advert bonuses (Awareness and Popularity). These bonuses are capped at ~1.7977e308.
|
||||
- Any worthy industry must have at least 1 input material. Having no input material may look convenient at first glance, but it's a trap for newbies. Without input materials, the quality/rating of the output material/product is always capped at the square root of its maximum value.
|
||||
|
||||
## Agriculture + Chemical + Tobacco
|
||||
|
||||
Agriculture is inarguably the best starting industry. Its `realEstateFactor` is highest among all industries (0.72), and real estate's size is tiny (0.005). It means we can stock up on a huge number of real estate and increase the division product multiplier to an extremely high value in early rounds.
|
||||
|
||||
Chemical is the best support industry if we choose Agriculture as the starting industry. It has the highest `ScienceFactor` among all material industries (0.75). As you can see in round 2's strategy, we only need to invest a minimal budget in the Chemical division and it can still adequately boost the Agriculture division (after waiting for some RP).
|
||||
|
||||
Agriculture and Chemical have great synergy. Agriculture needs `Chemicals` from Chemical and produces `Plants`. Chemical needs `Plants` from Agriculture and produces `Chemicals`.
|
||||
|
||||
Tobacco is an excellent product industry:
|
||||
|
||||
- It requires only Plants, and Plants come from Agriculture. Therefore, the quality of input material is not a problem with this industry if we choose Agriculture as the starting industry.
|
||||
- High `ScienceFactor` (0.75), only below Pharmaceutical.
|
||||
- High `AdvertisingFactor` (0.2), only below Restaurant and Real Estate.
|
||||
|
||||
## Other product industries
|
||||
|
||||
All other product industries always have some kind of flaws in them and not be as versatile as Tobacco. For example:
|
||||
|
||||
- Pharmaceutical has the highest `ScienceFactor` (0.8) but a low `AdvertisingFactor` (0.16).
|
||||
- Its products are potentially better than Tobacco's ones. This sounds good in theory, but not in practice. Pharmaceutical requires Chemicals. Chemicals can only be produced by the Chemical industry, and that industry has bad production capability. The early products' effective rating will be low because the Chemical division cannot produce enough high-quality material units. In the end, the offers of round 3 and round 4 are much lower than Tobacco's ones.
|
||||
- It is worse than Tobacco in the endgame.
|
||||
- Healthcare has the same `ScienceFactor` as Tobacco (0.75) but the lowest `AdvertisingFactor` (0.11).
|
||||
- It requires 4 input materials instead of 1 or 2. Those materials include Robots with a coefficient of 10 (the highest value of all industries), and the size of Robots is the biggest among boost materials. This means the required materials take up huge space in the warehouse.
|
||||
- This industry is the worst one in the endgame due to its extremely low `AdvertisingFactor`.
|
||||
- Restaurant has the highest `AdvertisingFactor` (0.25) but very low `ScienceFactor` (0.12).
|
||||
- Its products are significantly worse than Tobacco's ones. It takes too long to hit the exponential growth (due to worse products) and surpass Tobacco in profit.
|
||||
- It's fine to expand into this industry after Tobacco to have a better endgame.
|
||||
- Real Estate has the same `AdvertisingFactor` as Restaurant but the lowest `ScienceFactor` (0.05). It requires 4 input materials instead of 1 or 2. This industry has the same potential and problem as Restaurant with its high `AdvertisingFactor` and low `ScienceFactor`. The only difference is that its `ScienceFactor` is even lower than the Restaurant's one.
|
||||
|
||||
## Conclusion
|
||||
|
||||
Agriculture + Chemical + Tobacco is the most balanced supply chain. It's very easy to bootstrap in early rounds and reaches high profit in late phases for practical purposes.
|
||||
@@ -0,0 +1,109 @@
|
||||
# Miscellany
|
||||
|
||||
## Corporation's state
|
||||
|
||||
Corporation continuously transitions between 5 states: START → PURCHASE → PRODUCTION → EXPORT → SALE → START. 1 cycle of these transitions takes 10 seconds. If you have enough bonus time, it takes 1 second.
|
||||
|
||||
START:
|
||||
|
||||
- Division:
|
||||
- Office:
|
||||
- Calculate: energy, morale, total experience, salary, employee production by jobs.
|
||||
- Set employees' jobs: copy data from `employeeNextJobs` to `employeeJobs`.
|
||||
- Material market: update `demand`, `competition`, `marketPrice`.
|
||||
- Product market: decrease `demand` and increase `competition`.
|
||||
- Calculate corporation's financial statements: revenue, expenses, profit, dividend, total assets, valuation, share price.
|
||||
|
||||
PURCHASE:
|
||||
|
||||
- Buy input materials.
|
||||
- If we have unlocked "Smart Supply", it's used for calculating optimal quantity of input material units.
|
||||
|
||||
PRODUCTION:
|
||||
|
||||
- Produce output materials and products.
|
||||
- If new product's `developmentProgress` is greater than or equal to 100, it's finished. New finished product's stats are calculated in this state.
|
||||
|
||||
EXPORT: export output materials.
|
||||
|
||||
SALE:
|
||||
|
||||
- Sell output materials and product.
|
||||
- If we have unlocked "Market-TA1" / "Market-TA2", it's used for calculating selling price.
|
||||
|
||||
Special cases: RP and salary expense are increased in 4 states: PURCHASE, PRODUCTION, EXPORT, SALE.
|
||||
|
||||
## Import and export
|
||||
|
||||
Importing/exporting material is done in EXPORT state.
|
||||
|
||||
EXPORT state is before SALE state. It means you sell the material units remained after being exported.
|
||||
|
||||
Export string can use "MAX", "EINV", "IINV", "EPROD" and "IPROD". Read the description in export popup for the meaning of these values.
|
||||
|
||||
The optimal export string is `(IPROD+IINV/10)*(-1)`. For example: export "Chemicals" from Chemical division to Agriculture division:
|
||||
|
||||
- Agriculture division needs 100 Chemicals/s and has 700 Chemicals in warehouse.
|
||||
- IPROD = -100 ("Consumption is negative production")
|
||||
- IINV = 700
|
||||
- "Export" is expressed by number of units per second, so we want to export:
|
||||
|
||||
$$\left(100-\frac{700}{10}\right)=\left(-100+\frac{700}{10}\right)\ast(-1)=\left(IPROD+\frac{IINV}{10}\right)\ast(-1)$$
|
||||
|
||||
Export route is FIFO. You can remove an export route by using `cancelExportMaterial` NS API.
|
||||
|
||||
Export data is in `material.exports`.
|
||||
|
||||
## Use mathematical library
|
||||
|
||||
I use the JavaScript ports of these libraries. They don't support JavaScript.
|
||||
|
||||
I use the default setting without any tuning. If you tune their parameters properly, their accuracy and performance will be improved.
|
||||
|
||||
### Ceres Solver
|
||||
|
||||
Quote from <http://ceres-solver.org/>
|
||||
|
||||
> Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It can be used to solve Non-linear Least Squares problems with bounds constraints and general unconstrained optimization problems.
|
||||
|
||||
JavaScript port: <https://github.com/Pterodactylus/Ceres.js>
|
||||
|
||||
We can use it to solve the non-linear systems in these cases:
|
||||
|
||||
- Case 1: Find the optimal quantities of boost materials.
|
||||
- Case 2: Find `CreationJobFactors[JobName]` when calculating product markup.
|
||||
|
||||
The accuracy and performance are acceptable, so we employ it case 2. We don't use it in case 1 because there is another optimal solution, it's better in both accuracy and performance.
|
||||
|
||||
Quick test for case 2 shows that the accuracy is pretty good:
|
||||
|
||||
- `creationJobFactors`:
|
||||
- Business: 420.103620358641
|
||||
- Engineer: 29666.47672073447
|
||||
- Management: 40466.091598191015
|
||||
- Operations: 25760.399443536793
|
||||
- Solver's result:
|
||||
- Business: 420.08121628008024
|
||||
- Engineer: 29664.894610028987
|
||||
- Management: 40463.933544920386
|
||||
- Operations: 25759.025643594476
|
||||
|
||||
## Noodles trick
|
||||
|
||||
There is a place called "Noodle Bar" in New Tokyo. After going there, there is a button that says "Eat noodles". Eating noodles gives you multiple benefits. Each benefit is miniscule, but you can press that button programmatically. With Corporation, the benefit is:
|
||||
|
||||
```typescript
|
||||
Player.corporation.gainFunds(Player.corporation.revenue * 0.000001, "glitch in reality");
|
||||
```
|
||||
|
||||
In previous versions, the revenue is multiplied by 0.01. If you do it fast enough, it'll raise the investment offer by a considerable amount. Nowadays, this trick is useless.
|
||||
|
||||
## Dummy division
|
||||
|
||||
Dummy division is the division that you create only to increase the [valuation](./financial-statement.md) and the [investment offer](./financial-statement.md).
|
||||
|
||||
Use Restaurant industry for dummy division. Its starting cost is only 10e9.
|
||||
|
||||
For dummy division, you only need to expand to 6 cities and buy 6 warehouses. Don't invest in other things (Warehouse/Office/Advert upgrades).
|
||||
|
||||
If you start round 3 with large budget, you can create dummy divisions immediately to simplify the script's logic. It's not optimal but still acceptable. However, if the budget is tight, you should not create them at the start of round 3. After completing first product, profit will be high enough to get enough funds to create them without any problem.
|
||||
@@ -0,0 +1,191 @@
|
||||
# Office
|
||||
|
||||
## Basic information
|
||||
|
||||
Employee stats are kept track of as average values. There are 6 average values: `AvgEnergy`, `AvgMorale`, `AvgIntelligence`, `AvgCharisma`, `AvgCreativity`, `AvgEfficiency`. Every time you hire a new employee, these average values are recalculated. They are modified by a randomized number from 50 to 100:
|
||||
|
||||
```typescript
|
||||
this.avgMorale =
|
||||
(this.avgMorale * this.numEmployees + getRandomInt(averageStat, averageStat)) / (this.numEmployees + 1);
|
||||
```
|
||||
|
||||
Job assignment:
|
||||
|
||||
- Each office has 2 records: `employeeJobs` and `employeeNextJobs`. Data in `employeeJobs` (number of employees in each job) is used for calculations of other relevant data like `EmployeeProductionByJob`, `AvgEnergy`, `AvgMorale`, `TotalExperience`. When you call `setJobAssignment`, its parameter is calculated and assigned to `employeeNextJobs`. In the next cycle's START state, data in `employeeNextJobs` will be copied to `employeeJobs`.
|
||||
- Behavior of `setJobAssignment` may be confused at first glance. Let's say you call it like this: `ns.corporation.setJobAssignment("Agriculture","Sector-12","Operations", 5)`
|
||||
- If you have 5 \"Operations\" employees, it does nothing.
|
||||
- If you have 7 \"Operations\" employees, it reduces number of \"Operations\" employees to 5, and set \"Unassigned\" employees to 2.
|
||||
- If you have 2 \"Operations\" employees, it checks if you have at least 3 \"Unassigned\" employees. If yes, it changes \"Operations\" employees to 5 and reduces \"Unassigned\" employees by 3. If not, it throws error. Essentially, it tries to move employees from \"Unassigned\" to \"Operations\".
|
||||
- This means the proper way to use `setJobAssignment` is:
|
||||
- Use it to set all jobs to 0.
|
||||
- Use it to set all jobs to your requirements.
|
||||
|
||||
Total experience is increased in these cases:
|
||||
|
||||
- Hire a new employee. Each new employee increases total experience by `getRandomInt(50, 100)`.
|
||||
- In the START state. Gain per cycle:
|
||||
|
||||
$$TotalExperienceGain = 0.0015\ast(TotalEmployees - UnassignedEmployees + InternEmployees\ast 9)$$
|
||||
|
||||
- If an office has 100 employees and all employees are assigned to non-intern positions, it gains 0.15 experience/cycle. It's 54 experience/hour without bonus time.
|
||||
|
||||
Salary per cycle:
|
||||
|
||||
$$Salary = 3\ast TotalEmployees\ast\left(AvgIntelligence+AvgCharisma+AvgCreativity+AvgEfficiency+\frac{TotalExperience}{TotalEmployees}\right)$$
|
||||
|
||||
## Upgrade
|
||||
|
||||
Upgrade cost:
|
||||
|
||||
$$UpgradeCost = BasePrice\ast\left( \frac{\sqrt[3]{1.09} - 1}{0.09} \right)\ast{1.09}^{\frac{CurrentSize}{3}}$$
|
||||
|
||||
Upgrade cost from size 3 to size n:
|
||||
|
||||
$$UpgradeCost_{From\ 3\ to\ n} = \sum_{k = 3}^{n - 1}{BasePrice\ast\left( \frac{\sqrt[3]{1.09} - 1}{0.09} \right)\ast{1.09}^{\frac{k}{3}}}$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ 3\ to\ n} = \sum_{k = 3}^{n - 1}{BasePrice\ast\left( \frac{\sqrt[3]{1.09} - 1}{0.09} \right)\ast\left( \sqrt[3]{1.09} \right)^{k}}$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ 3\ to\ n} = BasePrice\ast\left( \frac{\sqrt[3]{1.09} - 1}{0.09} \right)\ast\left( \frac{\left( \sqrt[3]{1.09} \right)^{n} - 1.09}{\sqrt[3]{1.09} - 1} \right)$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ 3\ to\ n} = BasePrice\ast\left( \frac{{1.09}^{\frac{n}{3}} - 1.09}{0.09} \right)$$
|
||||
|
||||
Upgrade cost size a to size b:
|
||||
|
||||
$$UpgradeCost_{From\ a\ to\ b} = BasePrice\ast\left( \frac{{1.09}^{\frac{b}{3}} - {1.09}^{\frac{a}{3}}}{0.09} \right)$$
|
||||
|
||||
Maximum size with a given `MaxCost`:
|
||||
|
||||
$$MaxSize = 3\ast\log_{1.09}\left( MaxCost\ast\frac{0.09}{BasePrice} + {1.09}^{\frac{CurrentSize}{3}} \right)$$
|
||||
|
||||
## Energy and morale
|
||||
|
||||
They are calculated in the START state.
|
||||
|
||||
They start dropping when your office's number of employees is greater than or equal to 9. The minimum value is 10.
|
||||
|
||||
PerfMult is a multiplier that increases/decreases energy/morale.
|
||||
|
||||
$$InternMultiplier = 0.002\ast Min\left(\frac{1}{9},\frac{InternEmployees}{TotalEmployees}-\frac{1}{9}\right)\ast 9$$
|
||||
|
||||
$$PenaltyMultiplier = \begin{cases}0, & (CorpFunds > 0) \vee (DivisionLastCycleRevenue > DivisionLastCycleExpenses) \newline 0.001, & (CorpFunds < 0) \land (DivisionLastCycleRevenue < DivisionLastCycleExpenses)\end{cases}$$
|
||||
|
||||
$$PerfMult = \begin{cases}1.002, & TotalEmployees < 9 \newline 1 + InternMultiplier - PenaltyMultiplier, & TotalEmployees \geq 9\end{cases}$$
|
||||
|
||||
Buying tea gives a flat +2 to energy. It costs 500e3 per employee.
|
||||
|
||||
When throwing party, `PartyMult` is calculated. It's used in the calculation of morale in the next cycle.
|
||||
|
||||
$$PartyMult = 1 + \frac{PartyCostPerEmployee}{10^{7}}$$
|
||||
|
||||
`PartyMult` is not affected by the number of employees. Therefore, you can throw a "big party" (high `PartyCostPerEmployee`) when you have 1 employee at low total cost (due to having only 1 employee), then hire the rest of the employees later.
|
||||
|
||||
There is a flat randomized reduction of energy/morale per cycle. It's capped at 0.002 per cycle. This is tiny, so it's not a problem.
|
||||
|
||||
There is a flat increase of morale if `PartyMult` is greater than 1. `PartyMult` is based on `PartyCostPerEmployee`, so this increase is based on `PartyCostPerEmployee`.
|
||||
|
||||
$$IncreaseOfMorale = (PartyMult - 1)\ast 10$$
|
||||
|
||||
≡
|
||||
|
||||
$$IncreaseOfMorale = \frac{PartyCostPerEmployee}{10^{6}}$$
|
||||
|
||||
```typescript
|
||||
const reduction = 0.002 * marketCycles;
|
||||
const increase = this.partyMult > 1 ? (this.partyMult - 1) * 10 : 0;
|
||||
this.avgEnergy = (this.avgEnergy - reduction * Math.random()) * perfMult + (this.teaPending ? 2 : 0);
|
||||
this.avgMorale = ((this.avgMorale - reduction * Math.random()) * perfMult + increase) * this.partyMult;
|
||||
```
|
||||
|
||||
There are 3 ways to counter the drop of energy/morale:
|
||||
|
||||
- Buy tea and throw party. You should always use this option. Writing a script to automate them is very easy.
|
||||
- Assign Intern. Many people throw around the ratio 1/9 as the way to counter the drop of energy/morale. You can only use that ratio when your corporation/division works fine. If it does not, there is a penalty multiplier (0.001). In this case, you need to use 1/6.
|
||||
- Buy 2 research upgrades: AutoBrew and AutoPartyManager. They keep energy/morale at maximum value. However, you should never buy them. It's always better to spend your RP on other useful research upgrades or just stock up on RP.
|
||||
|
||||
`AvgEnergy` and `AvgMorale` are increased by a randomized amount when we hire a new employee.
|
||||
|
||||
```typescript
|
||||
this.avgMorale = (this.avgMorale * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1);
|
||||
this.avgEnergy = (this.avgEnergy * this.numEmployees + getRandomInt(50, 100)) / (this.numEmployees + 1);
|
||||
```
|
||||
|
||||
Optimal `PartyCostPerEmployee`:
|
||||
|
||||
- The flat randomized reduction is tiny, so we can ignore it.
|
||||
- We want to increase `AvgMorale` from `CurrentMorale` to `MaxMorale`:
|
||||
|
||||
$$\left( CurrentMorale\ast PerfMult + \frac{PartyCostPerEmployee}{10^{6}} \right)\ast\left( 1 + \frac{PartyCostPerEmployee}{10^{7}} \right) = MaxMorale$$
|
||||
|
||||
- Define:
|
||||
|
||||
$$a = CurrentMorale$$
|
||||
|
||||
$$b = MaxMorale$$
|
||||
|
||||
$$k = PerfMult$$
|
||||
|
||||
$$x = PartyCostPerEmployee$$
|
||||
|
||||
- We have equation:
|
||||
|
||||
$$\left( a\ast k + \frac{x}{10^{6}} \right)\ast\left( 1 + \frac{x}{10^{7}} \right) = b$$
|
||||
|
||||
≡
|
||||
|
||||
$$x_{1} = - 500000\ast\left( \sqrt{(a\ast k - 10)^{2} + 40\ast b} + a\ast k + 10 \right)$$
|
||||
|
||||
$$x_{2} = 500000\ast\left( \sqrt{(a\ast k - 10)^{2} + 40\ast b} - a\ast k - 10 \right)$$
|
||||
|
||||
- $x_{1}$ is always negative. Therefore, $x_{2}$ is the only solution.
|
||||
|
||||
One big party is less cost-effective than multiple small parties. For example: throwing 1 big party for 70→100 morale costs more than throwing 3 small parties: 70→80, 80→90, 90→100.
|
||||
|
||||
Don't be a cheapskate when it comes to tea/party. Energy and morale are vital to an efficient office. Check the next part for the formulas.
|
||||
|
||||
- It's fine to spend 500e3 per employee when throwing party. You can spend more if you want.
|
||||
- Try to maintain maximum energy/morale at all times. Personally, I always buy tea / throw party when energy/morale decreases to 99.5 (109.5, if I bought the relevant research upgrades).
|
||||
- In round 1 and 2, the office's size is small, it's usually smaller than 9, so energy/morale is not a problem. In round 3+, you should buy tea / throw party every cycle.
|
||||
|
||||
## Employee production by job
|
||||
|
||||
In each cycle's START state, all stats are used for calculating "production" values. These values are saved in `office.employeeProductionByJob` and used later for calculating:
|
||||
|
||||
- RP.
|
||||
- Material's quality.
|
||||
- Product's stats.
|
||||
- Division raw production.
|
||||
- Material/product's MaxSalesVolume.
|
||||
|
||||
Formulas:
|
||||
|
||||
- Calculate multipliers of Intelligence, Charisma, Creativity, and Efficiency. They are the product of average values, upgrade benefit and research benefit.
|
||||
- Production base:
|
||||
|
||||
$$ProductionBase = AvgMorale\ast AvgEnergy\ast 10^{-4}$$
|
||||
|
||||
- Experience:
|
||||
|
||||
$$Exp = \frac{TotalExperience}{TotalEmployees}$$
|
||||
|
||||
- Production multiplier:
|
||||
- Operations: $$ProductionMultiplier = 0.6\ast IntelligenceMult + 0.1\ast CharismaMult + Exp + 0.5\ast CreativityMult + EfficiencyMult$$
|
||||
- Engineer: $$ProductionMultiplier = IntelligenceMult + 0.1\ast CharismaMult + 1.5\ast Exp + EfficiencyMult$$
|
||||
- Business: $$ProductionMultiplier = 0.4\ast IntelligenceMult + CharismaMult + 0.5\ast Exp$$
|
||||
- Management: $$ProductionMultiplier = 2\ast CharismaMult + Exp + 0.2\ast CreativityMult + 0.7\ast EfficiencyMult$$
|
||||
- Research and Development: $$ProductionMultiplier = 1.5\ast IntelligenceMult + 0.8\ast Exp + CreativityMult + 0.5\ast EfficiencyMult$$
|
||||
- $EmployeesJobCount = office.employeeJobs[JobName]$
|
||||
- Employee production by job:
|
||||
|
||||
$$EmployeeProductionByJob = EmployeesJobCount\ast ProductionMultiplier\ast ProductionBase$$
|
||||
|
||||
## Calculate employee's stat
|
||||
|
||||
4 stats `AvgIntelligence`, `AvgCharisma`, `AvgCreativity`, `AvgEfficiency` are inaccessible through NS API.
|
||||
|
||||
We can calculate them by using the formulas from the previous part and [Ceres Solver](./miscellany.md). In 5 jobs (i.e., Operations, Engineer, Business, Management, and Research & Development), we need at least 4 jobs having 1 employee at the minimum to use this solution.
|
||||
@@ -0,0 +1,141 @@
|
||||
# Optimal selling price - Market-TA2
|
||||
|
||||
## Market price and markup limit
|
||||
|
||||
Market price:
|
||||
|
||||
- Material: `material.marketPrice`.
|
||||
- Product: `product.productionCost`. This value is based on `ProductMarketPriceMult`, input materials' `MarketPrice` and `Coefficient`.
|
||||
- $n = {Number\ of\ input\ materials}$
|
||||
- $ProductMarketPriceMult = 5$
|
||||
|
||||
$$ProductMarketPrice = ProductMarketPriceMult\ast\sum_{i = 1}^{n}{MaterialMarketPrice_i\ast MaterialCoefficient_i}$$
|
||||
|
||||
Markup limit: This is how high you can raise the price above the market price before the sales volume is affected negatively.
|
||||
For example: Let's say a product has MarketPrice = 5000 and MarkupLimit = 700. If you set the price smaller than or equal to 5700, the sales volume of this product will not be penalized.
|
||||
|
||||
- Material:
|
||||
|
||||
$$MaterialMarkupLimit = \frac{MaterialQuality}{MaterialMarkup}$$
|
||||
|
||||
- Product:
|
||||
|
||||
$$ProductMarkupLimit = \frac{Max(ProductEffectiveRating,0.001)}{ProductMarkup}$$
|
||||
|
||||
## Sales volume
|
||||
|
||||
`MaxSalesVolume` is the maximum number of items that you can sell in the SALE state.
|
||||
|
||||
`PotentialSalesVolume` is the sales volume in theory.
|
||||
|
||||
`MarkupMultiplier` is defined by a piecewise function depending on selling price, market price, and markup limit.
|
||||
|
||||
$$MaxSalesVolume = PotentialSalesVolume\ast MarkupMultiplier$$
|
||||
|
||||
### Potential sales volume
|
||||
|
||||
`PotentialSalesVolume` depends on:
|
||||
|
||||
- The quality of materials and the effective rating of products.
|
||||
- Number of Business employees.
|
||||
- Advert.
|
||||
- Demand and Competition.
|
||||
- ABC SalesBots.
|
||||
|
||||
It is the product of 6 multipliers:
|
||||
|
||||
$$PotentialSalesVolume = \ ItemMultiplier\ast BusinessFactor\ast AdvertFactor\ast MarketFactor\ast SaleBotsBonus\ast ResearchBonus$$
|
||||
|
||||
- Quality/EffectiveRating multiplier:
|
||||
- Material:
|
||||
$$ItemMultiplier = MaterialQuality + 0.001$$
|
||||
- Product:
|
||||
$$ItemMultiplier = 0.5\ast(ProductEffectiveRating)^{0.65}$$
|
||||
- Business factor:
|
||||
- `BusinessProduction = 1 + office.employeeProductionByJob["Business"]`
|
||||
|
||||
$${BusinessFactor = (BusinessProduction)}^{0.26} + \left({BusinessProduction}\ast{0.0001}\right)$$
|
||||
|
||||
- Advert factor:
|
||||
|
||||
$$AwarenessFactor = (Awareness + 1)^{IndustryAdvertisingFactor}$$
|
||||
|
||||
$$PopularityFactor = (Popularity + 1)^{IndustryAdvertisingFactor}$$
|
||||
|
||||
$$RatioFactor = \begin{cases}Max(0.01,\frac{Popularity + 0.001}{Awareness}), & Awareness \neq 0 \newline 0.01, & Awareness = 0 \end{cases}$$
|
||||
|
||||
$$AdvertFactor = (AwarenessFactor\ast PopularityFactor\ast RatioFactor)^{0.85}$$
|
||||
|
||||
- Market factor:
|
||||
|
||||
$$MarketFactor = Max\left(0.1,{Demand\ast(100 - Competition)}\ast{0.01}\right)$$
|
||||
|
||||
- Corporation's upgrade bonus: `SalesBots` bonus.
|
||||
- Division's research bonus: this is always 1. Currently there is not any research that increases the sales bonus.
|
||||
|
||||
### Markup multiplier
|
||||
|
||||
$$MarkupMultiplier = \begin{cases}10^{12} & SellingPrice \in (-\infty, 0] \newline \frac{MarketPrice}{SellingPrice} & SellingPrice \in (0, MarketPrice] \newline 1 & SellingPrice \in (MarketPrice, MarketPrice + MarkupLimit] \newline \left(\frac{MarkupLimit}{SellingPrice - MarketPrice}\right)^{2} & SellingPrice \in (MarketPrice + MarkupLimit, \infty) \end{cases}$$
|
||||
|
||||
Analysis for 4 ranges, in the same order of the above formula:
|
||||
|
||||
- Range 1: We can set `SellingPrice` to 0 and get an extremely high `MarkupMultiplier`. With this high value, we can sell all units, regardless of other factors. This is the fastest way to discard stored units.
|
||||
- Range 2: `MarkupMultiplier` is a "bonus multiplier". It boosts `PotentialSalesVolume`. This means you can boost the sales volume by setting `SellingPrice` below `MarketPrice`.
|
||||
- Range 3: `MaxSalesVolume` = `PotentialSalesVolume` (No bonus, no penalty). Market TA1 always set `SellingPrice` to `MarketPrice + MarkupLimit`. This means you can sell things at a price higher than the market price while ensuring the sales volume is not affected negatively.
|
||||
- Range 4: `MarkupMultiplier` is a penalty modifier. More about this case later.
|
||||
|
||||
### Maximize sales volume
|
||||
|
||||
In order to increase `MaxSalesVolume`, you can:
|
||||
|
||||
- Improve the quality of materials and the effective rating of products.
|
||||
- Use more Business employees.
|
||||
- Increase the level of Advert.
|
||||
- Increase the level of ABC SalesBots.
|
||||
- Set the price lower than the market price. Note that you should NOT do this in most cases. If you need to do this, it's very likely that your strategy is flawed, and you need to fix it.
|
||||
|
||||
## Optimal selling price
|
||||
|
||||
Let's say that we want to sell all stored units. Define:
|
||||
|
||||
$$ExpectedSalesVolume = \frac{StoredUnits}{10}$$
|
||||
|
||||
Assume that we can sell all stored units.
|
||||
|
||||
$$MaxSalesVolume = ExpectedSalesVolume$$
|
||||
|
||||
≡
|
||||
|
||||
$$PotentialSalesVolume\ast MarkupMultiplier = ExpectedSalesVolume$$
|
||||
|
||||
≡
|
||||
|
||||
$$PotentialSalesVolume\ast\left(\frac{MarkupLimit}{SellingPrice - MarketPrice}\right)^{2} = ExpectedSalesVolume$$
|
||||
|
||||
≡
|
||||
|
||||
$$\frac{MarkupLimit}{SellingPrice - MarketPrice} = \sqrt{\frac{ExpectedSalesVolume}{PotentialSalesVolume}}$$
|
||||
|
||||
≡
|
||||
|
||||
$$SellingPrice = \frac{MarkupLimit\ast\sqrt{PotentialSalesVolume}}{\sqrt{ExpectedSalesVolume}} + MarketPrice$$
|
||||
|
||||
There are 2 cases:
|
||||
|
||||
- When `PotentialSalesVolume` > `ExpectedSalesVolume`, we can accept a penalty modifier (`MarkupMultiplier` < 1) and raise the price above `MarketPrice + MarkupLimit`.
|
||||
- When `PotentialSalesVolume` <= `ExpectedSalesVolume`: `MarketPrice` <= `SellingPrice` <= `MarketPrice + MarkupLimit`.
|
||||
- The selling price is still higher than the market price.
|
||||
- There is no penalty modifier. In this case, we already cannot sell all items, so having no penalty modifier means that the situation is at least not worse.
|
||||
|
||||
This is what Market-TA2 does. It assumes that we can sell all stored units without any problems (`PotentialSalesVolume` > `ExpectedSalesVolume`) and can accept a penalty modifier. If that's the case, it assumes `MaxSalesVolume = ExpectedSalesVolume`, "exploits" the range 4 in the previous part, and finds the highest possible price. Otherwise, the price is in range 3, and `MaxSalesVolume` is not affected negatively.
|
||||
|
||||
This is also the reason why we should not bother with Market-TA1. It simply sets `SellingPrice = MarketPrice + MarkupLimit`. This means Market-TA1 only sets a "safe" `SellingPrice` for us and guarantees that we are not penalized due to setting the price too high. However, in most cases (high-quality materials, good products, high Advert, etc.), `PotentialSalesVolume` is much higher than `ExpectedSalesVolume`. In this case, the "safe" `SellingPrice` from Market-TA1 is too low, and we can find a much higher `SellingPrice` with Market-TA2.
|
||||
|
||||
In order to use the formula of Market-TA2, we need `MarkupLimit`. With products, we need `ProductMarkup` to calculate `MarkupLimit`, but `ProductMarkup` is inaccessible via NS API. We have two solutions:
|
||||
|
||||
- Calculate the approximation value. Check the previous section to see how to do this.
|
||||
- Calculate `MarkupLimit` directly:
|
||||
- Set `SellingPrice` to a very high value. It must be so high that we cannot sell all produced units (`MaxSalesVolume < ExpectedSalesVolume`). This forces the game to apply the penalty modifier that contains `MarkupLimit`.
|
||||
- Wait for 1 cycle to get `ActualSalesVolume`. It's `product.actualSellAmount` and `material.actualSellAmount`.
|
||||
- Use `ActualSalesVolume` in place of `ExpectedSalesVolume` in the previous formula: $MarkupLimit = (SellingPrice - MarketPrice)\ast\sqrt{\frac{ActualSalesVolume}{M}}$
|
||||
- Calculate `ProductMarkup` from `MarkupLimit`, save `ProductMarkup` to reuse later. `ProductMarkup` never changes.
|
||||
@@ -0,0 +1,176 @@
|
||||
# Product
|
||||
|
||||
## Overview
|
||||
|
||||
The product industry is much better than the material industry in the late phases because we can sell products at ridiculously high prices.
|
||||
|
||||
Market-TA2 automatically sets the optimal prices for products. Check this [section](./optimal-selling-price-market-ta2.md) to see how to implement a custom Market-TA2 script. Implementing a custom Market-TA2 script is the best optimization in round 3+.
|
||||
|
||||
Products need to be developed before being produced. We can put multiple products in the development queue, but only one product can be developed at a time.
|
||||
|
||||
There is a limit on how many products a division can have. The default limit is 3. There are 2 research upgrades that increase that limit. However, those research upgrades are nearly useless because, in most cases, there is no point in increasing the maximum number of products. Check this [section](./unlocks-upgrade-research.md) for details. When we reach the limit, we need to discontinue a product before developing a new one.
|
||||
|
||||
We need to continuously develop new products. New products are almost always better than the old ones and generate much more profit.
|
||||
|
||||
The product's markup and effective rating are extremely important because they are part of [MaxSalesVolume](./optimal-selling-price-market-ta2.md)'s calculation.
|
||||
|
||||
The product's effective rating is based on the product's rating and the input material's quality. Check this [section](./quality.md) to see how input material's quality affects the product's rating and effective rating. This is why we need a support division that produces high-quality material for the product division.
|
||||
|
||||
The product's markup and rating are based on:
|
||||
|
||||
- `CreationJobFactors[JobName]`. More about this in the next part.
|
||||
- RP. This is why we should stock up on RP.
|
||||
- `ResearchFactor`. It is the industry's `scienceFactor`.
|
||||
- Design investment and advertising investment. Game UI shows them as "Design investment" and "Marketing investment". These two investments are not too important because their exponents in the formulas are very low. It's fine to use only 1% of current funds for them.
|
||||
|
||||
Office's upgrade and employee stats' upgrades are very important for products because they increase employee production. High employee production means high `CreationJobFactors` and RP. Those upgrades and products create a powerful loop: More upgrades → Better product → Higher profit → More upgrades.
|
||||
|
||||
Office setup is important to efficiently develop new products. Check this [section](./general-advice.md) for advice on how to set up the office.
|
||||
|
||||
## Formula
|
||||
|
||||
`CreationJobFactors[JobName]` are values accumulated over the time that product was developed. `DevelopmentProgress` starts at 0. In each cycle:
|
||||
|
||||
- Total employee production:
|
||||
|
||||
$$TotalEmployeeProd = OperationsProd + EngineerProd + ManagementProd$$
|
||||
|
||||
- Management factor:
|
||||
|
||||
$$ManagementFactor = 1 + \frac{ManagementProd}{1.2\ast TotalEmployeeProd}$$
|
||||
|
||||
- Product development multiplier:
|
||||
|
||||
$$ProductDevelopmentMultiplier = \left( (EngineerProd)^{0.34} + (OperationsProd)^{0.2} \right)\ast ManagementFactor$$
|
||||
|
||||
- Progress:
|
||||
|
||||
$$Progress = 0.01\ast ProductDevelopmentMultiplier$$
|
||||
|
||||
- Development progress:
|
||||
|
||||
$$DevelopmentProgress = DevelopmentProgress + Progress$$
|
||||
|
||||
- `CreationJobFactors[JobName]`:
|
||||
|
||||
$$CreationJobFactors\lbrack JobName\rbrack = CreationJobFactors\lbrack JobName\rbrack + {\lbrace EmployeeJob\rbrace Prod\ast Progress}\ast{0.01}$$
|
||||
|
||||
|
||||
When `DevelopmentProgress` reaches 100, product is finished.
|
||||
|
||||
- Define:
|
||||
|
||||
$$A = \ CreationJobFactors\lbrack Engineer\rbrack$$
|
||||
|
||||
$$B = \ CreationJobFactors\lbrack Management\rbrack$$
|
||||
|
||||
$$C = \ CreationJobFactors\lbrack RnD\rbrack$$
|
||||
|
||||
$$D = \ CreationJobFactors\lbrack Operations\rbrack$$
|
||||
|
||||
$$E = \ CreationJobFactors\lbrack Business\rbrack$$
|
||||
|
||||
$$TotalCreationJobFactors = A + B + C + D + E$$
|
||||
|
||||
- {JobName}Ratio:
|
||||
|
||||
$$EngineerRatio = \frac{A}{TotalCreationJobFactors}$$
|
||||
|
||||
$$ManagementRatio = \frac{B}{TotalCreationJobFactors}$$
|
||||
|
||||
$$RnDRatio = \frac{C}{TotalCreationJobFactors}$$
|
||||
|
||||
$$OperationsRatio = \frac{D}{TotalCreationJobFactors}$$
|
||||
|
||||
$$BusinessRatio = \frac{E}{TotalCreationJobFactors}$$
|
||||
|
||||
- Design investment multiplier:
|
||||
|
||||
$$DesignInvestMult = 1 + {(DesignInvestment)^{0.1}}\ast{0.01}$$
|
||||
|
||||
- Science multiplier:
|
||||
|
||||
$$ScienceMult = 1 + {(RP)^{ResearchFactor}}\ast{0.00125}$$
|
||||
|
||||
- Balance multiplier:
|
||||
|
||||
$$BalanceMult = 1.2\ast EngineerRatio + 0.9\ast ManagementRatio + 1.3\ast RnDRatio + 1.5\ast OperationsRatio + BusinessRatio$$
|
||||
|
||||
- Total multiplier:
|
||||
|
||||
$$TotalMult = BalanceMult\ast DesignInvestMult\ast ScienceMult$$
|
||||
|
||||
- Product's quality:
|
||||
|
||||
$$TotalMult\ast (0.1\ast A + 0.05\ast B + 0.05\ast C + 0.02\ast D + 0.02\ast E)$$
|
||||
|
||||
- Product's performance:
|
||||
|
||||
$$TotalMult\ast (0.15\ast A + 0.02\ast B + 0.02\ast C + 0.02\ast D + 0.02\ast E)$$
|
||||
|
||||
- Product's durability:
|
||||
|
||||
$$TotalMult\ast (0.05\ast A + 0.02\ast B + 0.08\ast C + 0.05\ast D + 0.05\ast E)$$
|
||||
|
||||
- Product's reliability:
|
||||
|
||||
$$TotalMult\ast (0.02\ast A + 0.08\ast B + 0.02\ast C + 0.05\ast D + 0.08\ast E)$$
|
||||
|
||||
- Product's aesthetics:
|
||||
|
||||
$$TotalMult\ast (0.08\ast B + 0.05\ast C + 0.02\ast D + 0.1\ast E)$$
|
||||
|
||||
- Product's features:
|
||||
|
||||
$$TotalMult\ast (0.08\ast A + 0.05\ast B + 0.02\ast C + 0.05\ast D + 0.05\ast E)$$
|
||||
|
||||
- Product's rating:
|
||||
- If an industry produces product, it has its own `RatingWeights` for its product. `RatingWeights` contains coefficients of 6 stats: quality, performance, durability, reliability, aesthetics, features. For example: Tobacco's `RatingWeights`:
|
||||
- Quality's coefficient: 0.7.
|
||||
- Durability's coefficient: 0.1.
|
||||
- Aesthetics' coefficient: 0.2.
|
||||
- `RatingWeights` is `industryData.product.ratingWeights`.
|
||||
- Formula:
|
||||
|
||||
$$ProductRating = \sum_{i = 1}^{6}{{ProductStat}_i\ast{StatCoefficient}_i}$$
|
||||
|
||||
- Advertising investment multiplier:
|
||||
|
||||
$$AdvertInvestMult = 1 + {(AdvertisingInvestment)^{0.1}}\ast{0.01}$$
|
||||
|
||||
- Business-Management ratio:
|
||||
|
||||
$$BusinessManagementRatio = Max\left( BusinessRatio + ManagementRatio,\ \left( \frac{1}{TotalCreationJobFactors} \right) \right)$$
|
||||
|
||||
- Product's markup:
|
||||
|
||||
$$ProductMarkup = \frac{100}{AdvertInvestMult\ast(ProductQuality + 0.001)^{0.65}\ast BusinessManagementRatio}$$
|
||||
|
||||
- Product's demand:
|
||||
|
||||
$$Demand = \begin{cases}Min(100,AdvertInvestMult\ast(100\ast(Popularity/Awareness))), & Awareness \neq 0 \newline 20, & Awareness = 0 \end{cases}$$
|
||||
|
||||
- Product's competition:
|
||||
|
||||
$$Competition = Random(0,70)$$
|
||||
|
||||
- Product's size:
|
||||
- It's `product.size`.
|
||||
- Formula:
|
||||
|
||||
$$ProductSize = \sum_{i = 1}^{NumberOfInputMaterials}{{InputMaterialSize}_i\ast{InputMaterialCoefficient}_i}$$
|
||||
|
||||
## Approximation value of product markup
|
||||
|
||||
In order to calculate product markup, we need:
|
||||
|
||||
- `CreationJobFactors[JobName]`
|
||||
- `RP`
|
||||
- `ResearchFactor`
|
||||
- `DesignInvestment`
|
||||
- `AdvertisingInvestment`
|
||||
|
||||
Product markup is calculated when product is finished. At that time, there is one thing that we cannot get: `CreationJobFactors[JobName]`, because there is not any NS API to query it. There are 2 approaches for this problem:
|
||||
|
||||
- Manually record them. This means that we simulate `product.creationJobFactors`. This approach is simple, but it has a big problem: if we miss any cycle, the data is invalid.
|
||||
- Calculate them directly. Product's stats are public data, so with above formulas, we have a system of 6 functions with only 5 variables. We can use [Ceres Solver](./miscellany.md) to find its solution.
|
||||
@@ -0,0 +1,71 @@
|
||||
# Quality
|
||||
|
||||
## Basic term
|
||||
|
||||
Let's define some terms:
|
||||
|
||||
- `AvgInputQuality`: average quality of input materials.
|
||||
- `MaxOutputQuality`: maximum value of output material's quality.
|
||||
- `OutputQuality`: final value of output material's quality. This value is always less than or equal to `MaxOutputQuality`.
|
||||
- `MaxOutputRating`: maximum value of output product's rating.
|
||||
- `OutputRating`: final value of output product's rating. This value is always less than or equal to `MaxOutputRating`.
|
||||
|
||||
Each industry has a set of input materials and their coefficients, for example, Agriculture needs Water and Chemicals, their coefficients are [0.5, 0.2] respectively. These coefficients do not affect `AvgInputQuality`. `AvgInputQuality` is the mean value of qualities of input materials in warehouse. For example, if Agriculture division's warehouse has Water (quality 1) and Chemicals (quality 11), `AvgInputQuality` is (1+11)/2.
|
||||
|
||||
Purchased material is low-quality. Its quality is always 1.
|
||||
|
||||
When you import/export your materials between different divisions, you can see quality of some input materials constantly change. Quality is high after EXPORT state, but it reduces after PURCHASE state. Qualities of the materials in warehouse are recalculated in these 2 states.
|
||||
|
||||
In PURCHASE state, material's quality is "diluted" by low-quality purchased material (quality 1).
|
||||
|
||||
$$Quality = \frac{Quality\ast CurrentQuantity + BuyAmount}{CurrentQuantity + BuyAmount}$$
|
||||
|
||||
In PRODUCTION state, the "diluted" quality value is used for calculating `AvgInputQuality`.
|
||||
|
||||
In EXPORT state:
|
||||
|
||||
$$Quality = \frac{Quality\ast CurrentQuantity + ImportQuality\ast ImportAmount}{CurrentQuantity + ImportAmount}$$
|
||||
|
||||
The production capability of support division should be balanced. The `ImportAmount` (the number of material units that the support division exports) does not need to equal the required number of input material units, but it should also not be too small.
|
||||
|
||||
## Material
|
||||
|
||||
`MaxOutputQuality` is sum of 3 values:
|
||||
|
||||
- Engineer summand:
|
||||
- `EngineerProduction = office.employeeProductionByJob["Engineer"]`
|
||||
|
||||
$$EngineerSummand = \frac{EngineerProduction}{90}$$
|
||||
|
||||
- Research point summand:
|
||||
|
||||
$$ResearchPointSummand = (RP)^{IndustryScienceFactor}$$
|
||||
|
||||
- AI Cores summand (if there is AI Cores in the warehouse):
|
||||
|
||||
$$AICoresSummand = AICoresQuantity^{IndustryAICoreFactor}\ast{0.001}$$
|
||||
|
||||
Output quality:
|
||||
|
||||
$$OutputQuality = \sqrt{MaxOutputQuality}\ast AvgInputQuality$$
|
||||
|
||||
With formulas above, we have these conclusions:
|
||||
|
||||
- In early rounds, increasing RP is the best way to improve `MaxOutputQuality`. This is especially true for industry with high science factor like Chemical.
|
||||
- In late rounds (round 3+), we have large funds to upgrade offices. In this case, the most important factor of `MaxOutputQuality` is `EngineerProduction`. "Engineer" is more significant than "Research & Development".
|
||||
- `OutputQuality` starts at square root of `MaxOutputQuality`. `AvgInputQuality` increases it until it reaches `MaxOutputQuality`.
|
||||
- This is a simple strategy for checking if we need to increase `AvgInputQuality`:
|
||||
- If square of `AvgInputQuality` is greater than or equal to current output quality, it's fine.
|
||||
- If not, you need to increase input material's quality. It usually means you need to improve the support division.
|
||||
|
||||
## Product
|
||||
|
||||
`MaxOutputRating` is product.rating.
|
||||
|
||||
Game UI shows `OutputRating` as "Effective rating"
|
||||
|
||||
Output rating:
|
||||
|
||||
$$OutputRating = \sqrt{MaxOutputRating}\ast AvgInputQuality$$
|
||||
|
||||
Use same strategy as material for checking `AvgInputQuality`.
|
||||
@@ -0,0 +1,51 @@
|
||||
# Smart Supply
|
||||
|
||||
## Logic
|
||||
|
||||
Create a function called `getLimitedRawProduction`:
|
||||
|
||||
- Calculate `RawProduction`.
|
||||
- Multiply `RawProduction` by 10.
|
||||
- Calculate `RequiredStorageSpaceOfEachOutputUnit`. It is the net change in warehouse's storage space when producing an output unit.
|
||||
- If `RequiredStorageSpaceOfEachOutputUnit` is greater than 0:
|
||||
- Calculate `MaxNumberOfOutputUnits`. It is the maximum number of units that we can produce and store in warehouse's free space.
|
||||
- Limit `RawProduction` to `MaxNumberOfOutputUnits` if needed.
|
||||
|
||||
Create a map called `SmartSupplyData`. Its key is `${divisionName}|${city}`. Its value is the `TotalRawProduction` that will be calculated later.
|
||||
|
||||
After PURCHASE state:
|
||||
|
||||
- Initialize `TotalRawProduction` with 0.
|
||||
- If division produces materials: call `getLimitedRawProduction`, then add the returned value to `TotalRawProduction`.
|
||||
- If division produces products:
|
||||
- Loop through all products of the division.
|
||||
- If the product is finished, call `getLimitedRawProduction`, then add the returned value to `TotalRawProduction`.
|
||||
- Set `TotalRawProduction` to `SmartSupplyData`.
|
||||
|
||||
Before PURCHASE state:
|
||||
|
||||
- Check if warehouse is congested. If it is, alert player and try to mitigate the situation.
|
||||
- Find required quantity of each input material to produce material/product:
|
||||
- Get `TotalRawProduction` from `SmartSupplyData`.
|
||||
- Multiply `TotalRawProduction` with input material's coefficient.
|
||||
- Find which input material creates the least number of output units.
|
||||
- Align all the input materials to the smallest amount.
|
||||
- Calculate the total size of all input materials we are trying to buy.
|
||||
- If there is not enough free space, we apply a multiplier to required quantity to not overfill warehouse.
|
||||
- Deduct the number of stored input material units from the required quantity.
|
||||
- Buy input materials.
|
||||
|
||||
## Detect warehouse congestion
|
||||
|
||||
Warehouse can be congested due to multiple reasons. One common case is when the logic of calculating required quantity of input materials does not take into account of free space and stored input materials units in warehouse. When it happens, warehouse is filled with excessive input materials and the production process is halted completely due to no free space for produced units.
|
||||
|
||||
For each case, we need to find way(s) to detect congestion and mitigate it. In the case above, we can use this simple heuristic:
|
||||
|
||||
- Create a map called `WarehouseCongestionData`. Its key is `${divisionName}|${city}`. Its value is the number of times that we suspect the warehouse is congested.
|
||||
- In each cycle, check `material.productionAmount` and `product.productionAmount` of output material/product.
|
||||
- If `productionAmount` is 0, increase the entry's value of this warehouse in the map by 1. If not, set the entry's value to 0.
|
||||
- If the entry's value is greater than 5, the warehouse is very likely congested.
|
||||
- This heuristic is based on the observation: when warehouse is filled with excessive input materials, the production process is halted completely, this means `productionAmount` is 0. We wait for 5 times to reduce false positives.
|
||||
- When we start our Smart Supply script, `productionAmount` of output material/product may be 0, because nothing controls the production process in previous cycles.
|
||||
|
||||
When there are excessive input materials, discarding all of them is the simplest mitigation measure. It's inefficient, but it's the fastest way to make our production line restart.
|
||||
@@ -0,0 +1,174 @@
|
||||
# Unlocks - Upgrade - Research
|
||||
|
||||
## Unlocks
|
||||
|
||||
| **Name** | **Price** | **Description** |
|
||||
| ------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Export | 20e9 | Allow exporting material between different divisions. Extremely important. Buy it at the start of round 2. |
|
||||
| Smart Supply | 25e9 | Enable "Smart Supply" feature. Only buy it if you don't implement your custom [Smart Supply](./smart-supply.md) script. |
|
||||
| Market Research - Demand | 5e9 | Grant access to [Demand](./demand-competition.md) data. You need it to implement a custom [Market-TA2](./optimal-selling-price-market-ta2.md) script. |
|
||||
| Market Data - Competition | 5e9 | Grant access to [Competition](./demand-competition.md) data. You need it to implement a custom [Market-TA2](./optimal-selling-price-market-ta2.md) script. |
|
||||
| Shady Accounting | 500e12 | Reduce [DividendTax](./financial-statement.md) by 0.05 |
|
||||
| Government Partnership | 2e15 | Reduce [DividendTax](./financial-statement.md) by 0.1 |
|
||||
|
||||
|
||||
|
||||
## Upgrade
|
||||
|
||||
Each upgrade has different `BasePrice`, `PriceMult`, `Benefit.
|
||||
|
||||
Most upgrades affect all divisions.
|
||||
|
||||
There are 3 special upgrades. These upgrades only affect its division and have different formulas for cost/benefits.
|
||||
|
||||
- Warehouse. Check this [part](./warehouse.md).
|
||||
- Office. Check this [part](./office.md).
|
||||
- Advert. Check this [part](./wilson-analytics-advert.md).
|
||||
|
||||
Normal upgrade's formulas:
|
||||
|
||||
- Upgrade cost:
|
||||
|
||||
$$UpgradeCost = BasePrice\ast{PriceMult}^{CurrentLevel}$$
|
||||
|
||||
- Upgrade cost from level 0 to level n:
|
||||
|
||||
$$UpgradeCost_{From\ 0\ to\ n} = \sum_{k = 0}^{n - 1}{BasePrice\ast {PriceMult}^k}$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ 0\ to\ n} = BasePrice\ast\left( \frac{1 - {PriceMult}^{n}}{1 - PriceMult} \right)$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ 0\ to\ n} = BasePrice\ast\left( \frac{{PriceMult}^{n} - 1}{PriceMult - 1} \right)$$
|
||||
|
||||
- Upgrade cost level a to level b:
|
||||
|
||||
$$UpgradeCost_{From\ a\ to\ b} = \sum_{k = 0}^{b - 1}{BasePrice\ast {PriceMult}^k} - \sum_{k = 0}^{a - 1}{BasePrice\ast {PriceMult}^k}$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ a\ to\ b} = BasePrice\ast\left( \frac{{PriceMult}^{b} - 1}{PriceMult - 1} \right) - BasePrice\ast\left( \frac{{PriceMult}^{a} - 1}{PriceMult - 1} \right)$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ a\ to\ b} = BasePrice\ast\left( \frac{{PriceMult}^{b} - {PriceMult}^{a}}{PriceMult - 1} \right)$$
|
||||
|
||||
- Maximum upgrade level with a given `MaxCost`:
|
||||
|
||||
$$MaxUpgradeLevel = \log_{PriceMult}\left( MaxCost\ast\frac{PriceMult - 1}{BasePrice} + (PriceMult)^{CurrentLevel} \right)$$
|
||||
|
||||
- Benefit: All benefits are multipliers. `BaseBenefit` is 1.
|
||||
|
||||
$$Benefit = BaseBenefit + Benefit\ast CurrentLevel$$
|
||||
|
||||
|
||||
Normal upgrades:
|
||||
|
||||
| **Name** | **Base price** | **Price multiplier** | **Benefit** | **Type** |
|
||||
| ---------------------------------- | -------------- | -------------------- | ----------- | ----------------------- |
|
||||
| SmartFactories | 2e9 | 1.06 | 0.03 | Production |
|
||||
| SmartStorage | 2e9 | 1.06 | 0.1 | Storage |
|
||||
| WilsonAnalytics | 4e9 | 2 | 0.005 | Advert's benefits |
|
||||
| NuoptimalNootropicInjectorImplants | 1e9 | 1.06 | 0.1 | Employee's creativity |
|
||||
| SpeechProcessorImplants | 1e9 | 1.06 | 0.1 | Employee's charisma |
|
||||
| NeuralAccelerators | 1e9 | 1.06 | 0.1 | Employee's intelligence |
|
||||
| FocusWires | 1e9 | 1.06 | 0.1 | Employee's efficiency |
|
||||
| ABCSalesBots | 1e9 | 1.07 | 0.01 | Sales |
|
||||
| ProjectInsight | 5e9 | 1.07 | 0.05 | RP |
|
||||
|
||||
|
||||
Special upgrades:
|
||||
|
||||
| **Name** | **Base price** | **Price multiplier** | **Type** |
|
||||
| --------- | -------------- | -------------------- | -------------------- |
|
||||
| Warehouse | 1e9 | 1.07 | Storage |
|
||||
| Office | 4e9 | 1.09 | Office's size |
|
||||
| Advert | 1e9 | 1.06 | Awareness/Popularity |
|
||||
|
||||
|
||||
Advice:
|
||||
|
||||
- Round 1:
|
||||
- SmartStorage and Warehouse are the most important upgrades in this round.
|
||||
- Only buy 1 or 2 Advert level(s).
|
||||
- Round 2:
|
||||
- SmartFactories, SmartStorage and Warehouse are the most important upgrades in this round.
|
||||
- Only buy 1 Office level and a couple of Advert levels for Agriculture division.
|
||||
- Do not buy Office/Advert for Chemical division.
|
||||
- Check this [section](./general-advice.md) for more advice, especially for round 3+.
|
||||
|
||||
## Research
|
||||
|
||||
Each research has a set of multipliers. For example: `sciResearchMult`, `productionMult`, etc.
|
||||
|
||||
Benefit of research type is the product of all research's multiplier of the same type.
|
||||
|
||||
| **Type** | **Research** | **Multiplier** | **Effect** |
|
||||
| --------------------- | --------------------------------------------- | -------------- | ----------------------- |
|
||||
| advertisingMult | No research | 1 | Advert's benefits |
|
||||
| employeeChaMult | CPH4 Injections | 1.1 | Employee's charisma |
|
||||
| employeeCreMult | CPH4 Injections | 1.1 | Employee's creativity |
|
||||
| employeeEffMult | CPH4 Injections, Overclock | 1.1\*1.25 | Employee's efficiency |
|
||||
| employeeIntMult | CPH4 Injections, Overclock | 1.1\*1.25 | Employee's intelligence |
|
||||
| productionMult | Drones -- Assembly Self-Correcting Assemblers | 1.2\*1.1 | Production |
|
||||
| productProductionMult | uPgrade: Fulcrum | 1.05 | Product's production |
|
||||
| salesMult | No research | 1 | Sales |
|
||||
| sciResearchMult | Hi-Tech R&D Laboratory | 1.1 | RP |
|
||||
| storageMult | Drones - Transport | 1.5 | Storage |
|
||||
|
||||
|
||||
Research list:
|
||||
|
||||
| **Name** | **Cost** | **Description** |
|
||||
| ----------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Hi-Tech R&D Laboratory | 5000 | Top priority. Increase RP gain rate. It is the prerequisite of all other research upgrades. |
|
||||
| Market-TA.I | 20000 | Useless. It is the prerequisite of Market-TA.II. |
|
||||
| Market-TA.II | 50000 | Top priority if you don't write custom script. Check this [section](./optimal-selling-price-market-ta2.md) to see how to write custom script. |
|
||||
| Automatic Drug Administration | 10000 | It is the prerequisite of Go-Juice and CPH4 Injections. |
|
||||
| Go-Juice | 25000 | Useful. Increase maximum energy. |
|
||||
| CPH4 Injections | 25000 | Useful. Increase employee's stats. |
|
||||
| Overclock | 15000 | Useful. Increase employee's stats. It is the prerequisite of Sti.mu. |
|
||||
| Sti.mu | 30000 | Useful. Increase maximum morale. |
|
||||
| Drones | 5000 | It is the prerequisite of Drones - Assembly and Drones - Transport. |
|
||||
| Drones - Assembly | 25000 | Useful. Increase all productions. |
|
||||
| Drones - Transport | 30000 | Useful. Increase warehouse's storage space. |
|
||||
| Self-Correcting Assemblers | 25000 | Useful. Increase all productions. |
|
||||
| uPgrade: Fulcrum | 10000 | Useful. Increase product's production. |
|
||||
| uPgrade: Capacity.I | 20000 | Not useful. The cost is too high for its mediocre benefit. Increase maximum number of products by 1 (from 3 to 4). |
|
||||
| uPgrade: Capacity.II | 30000 | Not useful. The cost is too high for its mediocre benefit. Increase maximum number of products by 1 (from 4 to 5). |
|
||||
| uPgrade: Dashboard | 5000 | Useless. |
|
||||
| AutoBrew | 12000 | Useless. |
|
||||
| AutoPartyManager | 15000 | Useless. |
|
||||
| HRBuddy-Recruitment | 15000 | Useless. |
|
||||
| HRBuddy-Training | 20000 | Useless. |
|
||||
|
||||
|
||||
Advice:
|
||||
|
||||
- Do not deplete entire RP pool to buy research. You should only buy research if it costs less than half of the RP pool. Personally, my conditions for buying research upgrades are:
|
||||
- For energy/morale and employee's stats: if it costs less than 20% of RP pool.
|
||||
- For production: if it costs less than 10% of RP pool.
|
||||
- If you don't have a custom Market-TA2 script, you must prioritize Market-TA1 and Market-TA2. Market-TA1 is useless, the only reason to buy it is because it's the prerequisite of Market-TA2. If you buy them, you should stock up on RP and buy them together. However, I recommend implementing a custom Market-TA2 ASAP. Market-TA1 and Market-TA2 cost 70000 RP, that's a huge number of RP at the start of round 3+. **Implementing a custom Market-TA2 script is the best optimization in round 3+.**
|
||||
- After that, you should prioritize research upgrades for higher maximum energy/morale and employee's stats over production. Research upgrades for production are nice to have, but it's much less important than energy/morale/employee's stats.
|
||||
- My research order for higher maximum energy/morale and employee's stats: Overclock → Sti.mu → Automatic Drug Administration → Go-Juice → CPH4 Injections.
|
||||
- Do not buy these useless ones:
|
||||
- uPgrade: Dashboard
|
||||
- AutoBrew
|
||||
- AutoPartyManager
|
||||
- HRBuddy-Recruitment
|
||||
- HRBuddy-Training
|
||||
- In most cases, uPgrade: Capacity.I and uPgrade: Capacity.II are useless. New products are usually much better than the old ones, so there is no point in increasing the maximum number of products. The only exception is when you reach the endgame. In the endgame, new products are only marginally better than the old ones, so having more product slots may be beneficial. However, even in the endgame, those research upgrades may do more harm than good. In the endgame, the warehouse's size and high-quality input materials are serious bottlenecks. Having more product slots means that you need more free space in the warehouse and more units of input materials. In some cases, increasing product slots actually reduces the overall profit. You need to fine-tune it per use case.
|
||||
|
||||
You can exchange hashes for RP if you have SF9. This number of RP is added to all divisions.
|
||||
|
||||
RP gain rate:
|
||||
|
||||
- RP is increased in 4 states: PURCHASE, PRODUCTION, EXPORT and SALE.
|
||||
- RP gain per city per state:
|
||||
- `RnDProduction = office.employeeProductionByJob["Research & Development"]`
|
||||
|
||||
$$RPGain = 0.004\ast(RnDProduction)^{0.5}\ast UpgradeMultiplier\ast ResearchMultiplier$$
|
||||
|
||||
- Industry's `ScienceFactor` does not affect RP gain rate.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Warehouse
|
||||
|
||||
Warehouse starts at level 1 after being bought. The initial price is 5e9.
|
||||
|
||||
`BasePrice` in the following formulas is the upgrade's base price (1e9), not the initial price above.
|
||||
|
||||
Warehouse upgrade cost: its formula is a bit different from other upgrades (the exponent is `CurrentLevel+1` instead of `CurrentLevel`):
|
||||
|
||||
$$UpgradeCost = BasePrice\ast{1.07}^{CurrentLevel + 1}$$
|
||||
|
||||
Upgrade cost for buying from level 1 to level n:
|
||||
|
||||
$$UpgradeCost_{From\ 1\ to\ n} = \sum_{k = 2}^{n}{BasePrice\ast {1.07}^k}$$
|
||||
|
||||
≡
|
||||
|
||||
$$UpgradeCost_{From\ 1\ to\ n} = BasePrice\ast\left( \frac{{1.07}^{n + 1} - {1.07}^{2}}{0.07} \right)$$
|
||||
|
||||
Upgrade cost for buying from level a to level b:
|
||||
|
||||
$$UpgradeCost_{From\ a\ to\ b} = BasePrice\ast\left( \frac{{1.07}^{b + 1} - {1.07}^{a + 1}}{0.07} \right)$$
|
||||
|
||||
Maximum level with a given `MaxCost`:
|
||||
|
||||
$$MaxLevel = (log_{1.07}\left(MaxCost\ast\frac{0.07}{BasePrice} + {1.07}^{CurrentLevel+1} \right)) - 1$$
|
||||
|
||||
Warehouse size:
|
||||
|
||||
- Upgrade multiplier: multiplier from Smart Storage.
|
||||
- Research multiplier: multiplier from research.
|
||||
|
||||
$$WarehouseSize = WarehouseLevel\ast 100\ast UpgradeMultiplier\ast ResearchMultiplier$$
|
||||
@@ -0,0 +1,39 @@
|
||||
# Wilson Analytics - Advert
|
||||
|
||||
## Awareness and popularity
|
||||
|
||||
Wilson and Advert increase 2 important stats: awareness and popularity. These 2 stats affect initial demand and maximum sellable number of product units. I'll show formulas for them in later sections.
|
||||
|
||||
Awareness and popularity are capped at `Number.MAX_VALUE` (~1.7976931348623157E+308).
|
||||
|
||||
Raw values of those stats are crucial, but their ratio is also important. We want to have high ratio of popularity/awareness, check this [section](./optimal-selling-price-market-ta2.md) for formulas.
|
||||
|
||||
Popularity decreases by 0.0001 per cycle.
|
||||
|
||||
## Wilson Analytics
|
||||
|
||||
Wilson is a multiplier that is applied on Advert's benefits when we buy Advert, so it's not retroactive. Therefore, we need to buy it as soon as possible. However, there are cases that Wilson is too expensive and it does not bring much benefits. Round 1 and 2 are those cases.
|
||||
|
||||
Wilson has `priceMult` of 2, so its price is doubled every time we buy it. The exponentiation of Advert's cost function uses base of 1.06, so its price increases much slower.
|
||||
|
||||
## Advert
|
||||
|
||||
Advert is a special upgrade. It affects only the division that buys it.
|
||||
|
||||
Cost: use the formulas in this [section](./unlocks-upgrade-research.md) with `BasePrice` = 1e9 and `PriceMult` = 1.06.
|
||||
|
||||
Benefit:
|
||||
|
||||
$$AdvertMultiplier = WilsonUpgradeBenefit\ast ResearchAdvertisingMultiplier$$
|
||||
|
||||
$$Awareness = (Awareness + 3\ast AdvertMultiplier)\ast(1.005*AdvertMultiplier)$$
|
||||
|
||||
$$Popularity = (Popularity + AdvertMultiplier)\ast(1 + {Random(1,3)}\ast{0.005})\ast AdvertMultiplier$$
|
||||
|
||||
## Advice
|
||||
|
||||
Buying Advert without Wilson is a valid strategy in extremely low-budget situations like round 1 and 2.
|
||||
|
||||
Wilson becomes extremely important in big-budget situations. Wilson is usually good investment in late phases.
|
||||
|
||||
In round 3+, we usually improve the divisions continuously with relatively small budget (profit of a few cycles). In this case, we should buy Wilson as soon as we can afford it.
|
||||
@@ -0,0 +1,81 @@
|
||||
# Corporation
|
||||
|
||||
Corporation is an interesting feature of Bitburner. It's the most profitable feature in the game, and it's so overpowered that many BitNodes tend to apply a penalty modifier. However, it's extremely complex and opaque for newbies. There are too many mechanisms that are intertwined with each other, so it's very easy to make a mistake, and that mistake can cripple your corporation. This documentation explains all the mechanisms that you need to know to build a successful corporation.
|
||||
|
||||
The documentation is a bit long and intimidating at first glance, but you don't need to read all the sections below at once. I recommend that you read the first 4 sections. They are the most important sections for newbies. After that, you can read the following sections at your leisure.
|
||||
|
||||
## Contents
|
||||
|
||||
- [Basic gameplay and term](./corporation/basic-gameplay-and-term.md)
|
||||
- Basic gameplay
|
||||
- Term
|
||||
- [FAQ](./corporation/faq.md)
|
||||
- [Industry - Supply chain](./corporation/industry-supply-chain.md)
|
||||
- Basic term
|
||||
- Criterion
|
||||
- Agriculture + Chemical + Tobacco
|
||||
- Other product industries
|
||||
- Conclusion
|
||||
- [General advice](./corporation/general-advice.md)
|
||||
- Round 1
|
||||
- Round 2
|
||||
- Round 3+
|
||||
- [Unlocks - Upgrade - Research](./corporation/unlocks-upgrade-research.md)
|
||||
- Unlocks
|
||||
- Upgrade
|
||||
- Research
|
||||
- [Warehouse](./corporation/warehouse.md)
|
||||
- [Boost material](./corporation/boost-material.md)
|
||||
- Division production multiplier
|
||||
- Optimizer
|
||||
- Solution
|
||||
- Lagrange multiplier method
|
||||
- Proof
|
||||
- Handle low storage space
|
||||
- [Division raw production](./corporation/division-raw-production.md)
|
||||
- Definition
|
||||
- Formula
|
||||
- [Office](./corporation/office.md)
|
||||
- Basic information
|
||||
- Upgrade
|
||||
- Energy and morale
|
||||
- Employee production by job
|
||||
- Calculate employee's stat
|
||||
- [Quality](./corporation/quality.md)
|
||||
- Basic term
|
||||
- Material
|
||||
- Product
|
||||
- [Smart Supply](./corporation/smart-supply.md)
|
||||
- Logic
|
||||
- Detect warehouse congestion
|
||||
- [Wilson Analytics – Advert](./corporation/wilson-analytics-advert.md)
|
||||
- Awareness and popularity
|
||||
- Wilson Analytics
|
||||
- Advert
|
||||
- Advice
|
||||
- [Demand – Competition](./corporation/demand-competition.md)
|
||||
- Usage
|
||||
- Material
|
||||
- Product
|
||||
- [Product](./corporation/product.md)
|
||||
- Overview
|
||||
- Formula
|
||||
- Approximation value of product markup
|
||||
- [Optimal selling price – Market-TA2](./corporation/optimal-selling-price-market-ta2.md)
|
||||
- Market price and markup limit
|
||||
- Maximize sales volume
|
||||
- Optimal selling price
|
||||
- [Financial statement](./corporation/financial-statement.md)
|
||||
- Total assets
|
||||
- Valuation
|
||||
- Investment offer
|
||||
- Dividend
|
||||
- Shares
|
||||
- [Miscellany](./corporation/miscellany.md)
|
||||
- Corporation's states
|
||||
- Import and export
|
||||
- Use mathematical library
|
||||
- Ceres Solver
|
||||
- Noodles trick
|
||||
- "sudo.Assist" research
|
||||
- Dummy division
|
||||
@@ -0,0 +1,73 @@
|
||||
# List of Factions and their Requirements
|
||||
|
||||
### Early Game Factions
|
||||
|
||||
| Faction Name | Requirements |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| CyberSec | \* Install a backdoor on the `CSEC` server |
|
||||
| Tian Di Hui | \* \$1m<br />\* Hacking Level 50<br />\* Be in Chongqing, New Tokyo, or Ishima |
|
||||
| Netburners | \* Hacking Level 80<br />\* Total Hacknet Levels of 100<br />\* Total Hacknet RAM of 8<br />\* Total Hacknet Cores of 4 |
|
||||
| Shadows of Anarchy | \* Successfully infiltrate a company |
|
||||
|
||||
### City Factions
|
||||
|
||||
| Faction Name | Requirements | Cannot join if you are working for: |
|
||||
| ------------ | -------------------------------- | ----------------------------------------------------------------------------- |
|
||||
| Sector-12 | \* Be in Sector-12<br />\* \$15m | \* Chongqing<br />\* New Tokyo<br />\* Ishima<br />\* Volhaven |
|
||||
| Chongqing | \* Be in Chongqing<br />\* \$20m | \* Sector-12<br />\* Aevum<br />\* Volhaven |
|
||||
| New Tokyo | \* Be in New Tokyo<br />\* \$20m | \* Sector-12<br />\* Aevum<br />\* Volhaven |
|
||||
| Ishima | \* Be in Ishima<br />\* \$30m | \* Sector-12<br />\* Aevum<br />\* Volhaven |
|
||||
| Aevum | \* Be in Aevum<br />\* \$40m | \* Chongqing<br />\* New Tokyo<br />\* Ishima<br />\* Volhaven |
|
||||
| Volhaven | \* Be in Volhaven<br />\* \$50m | \* Sector-12<br />\* Aevum<br />\* Chongqing<br />\* New Tokyo<br />\* Ishima |
|
||||
|
||||
### Hacking Groups
|
||||
|
||||
| Faction Name | Requirements |
|
||||
| -------------- | ----------------------------------------------------------------------- |
|
||||
| CyberSec | \* Install a backdoor on the `CSEC` server (Hacking Level 51+) |
|
||||
| NiteSec | \* Install a backdoor on the `avmnite-02h` server (Hacking Level 202+) |
|
||||
| The Black Hand | \* Install a backdoor on the `I.I.I.I` server (Hacking Level 340+) |
|
||||
| BitRunners | \* Install a backdoor on the `run4theh111z` server (Hacking Level 505+) |
|
||||
|
||||
### Megacorporations
|
||||
|
||||
If you install a backdoor on a company's server, the required reputation of that company faction is reduced by 25%.
|
||||
|
||||
| Faction Name | Requirements |
|
||||
| --------------------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| ECorp | \* Have 400k reputation with the Corporation |
|
||||
| MegaCorp | \* Have 400k reputation with the Corporation |
|
||||
| KuaiGong International | \* Have 400k reputation with the Corporation |
|
||||
| Four Sigma | \* Have 400k reputation with the Corporation |
|
||||
| NWO | \* Have 400k reputation with the Corporation |
|
||||
| Blade Industries | \* Have 400k reputation with the Corporation |
|
||||
| OmniTek Incorporated | \* Have 400k reputation with the Corporation |
|
||||
| Bachman & Associates | \* Have 400k reputation with the Corporation |
|
||||
| Clarke Incorporated | \* Have 400k reputation with the Corporation |
|
||||
| Fulcrum Secret Technologies | \* Have 400k reputation with the Corporation<br />\* Install a backdoor on the `fulcrumassets` server |
|
||||
|
||||
### Criminal Organizations
|
||||
|
||||
| Faction Name | Requirements | Cannot join if you are working for: |
|
||||
| --------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| Slum Snakes | \* All Combat Stats of 30<br />\* \$1m<br />\* -9 Karma | |
|
||||
| Tetrads | \* Be in Chongqing, New Tokyo, or Ishima<br />\* All Combat Stats of 75<br />\* -18 Karma | |
|
||||
| Silhouette | \* CTO, CFO, or CEO of a company<br />\* \$15m<br />\* -22 Karma | |
|
||||
| Speakers for the Dead | \* Hacking Level 100<br />\* All Combat Stats of 300<br />\* 30 People Killed<br />\* -45 Karma | \* CIA<br />\* NSA |
|
||||
| The Dark Army | \* Hacking Level 300<br />\* All Combat Stats of 300<br />\* Be in Chongqing<br />\* 5 People Killed<br />\* -45 Karma | \* CIA<br />\* NSA |
|
||||
| The Syndicate | \* Hacking Level 200<br />\* All Combat Stats of 200<br />\* Be in Aevum or Sector-12<br />\* \$10m<br />\* -90 Karma | \* CIA<br />\* NSA |
|
||||
|
||||
### Lategame Factions
|
||||
|
||||
| Faction Name | Requirements |
|
||||
| ------------ | ------------------------------------------------------------------------------------------------- |
|
||||
| The Covenant | \* 20 Augmentations<br />\* \$75b<br />\* Hacking Level of 850<br />\* All Combat Stats of 850 |
|
||||
| Illuminati | \* 30 Augmentations<br />\* \$150b<br />\* Hacking Level of 1500<br />\* All Combat Stats of 1200 |
|
||||
| Daedalus | \* 30 Augmentations<br />\* \$100b<br />\* Hacking Level of 2500 OR All Combat Stats of 1500 |
|
||||
|
||||
### Endgame Factions
|
||||
|
||||
| Faction Name | Requirements |
|
||||
| ------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| Bladeburners | \* Be in BitNode 6 or 7 or have Source-File 6 or 7<br />\* Join Bladeburner Division<br />\* Have 25 Rank |
|
||||
| Church of the Machine God | \* Be in BitNode 13 or have Source-File 13<br />\* Have not installed any augmentations in the current BitNode |
|
||||
@@ -0,0 +1,35 @@
|
||||
# Gangs
|
||||
|
||||
In the wake of crisis and war, Gang activity surged. Stronger than ever in a lawless world - Enhanced with fantastic technology, no longer held back by ethics and morals, 'free from the shadows'....
|
||||
|
||||
Seen by most of the population as nihilistic, murderous and vile, occasional rumors suggest Gangs sometimes involve themselves with vigilantism, hacktivism, perhaps even plotting against The Enders, seeking to destroy a world they cannot save.
|
||||
|
||||
## Starting and Recruiting
|
||||
|
||||
Outside of [BitNode-2](bitnodes.md) gangs require much more crime and heartbreak to create, but can still be a great help. Creating a Gang in other [BitNodes](bitnodes.md) will offer more [Augmentations](../basic/augmentations.md) than other [Factions](../basic/factions.md), but they will not be a way to destroy the [BitNode](bitnodes.md) alone.
|
||||
|
||||
After creating a gang, you will be able to start recruiting, adding members to your gang as you gain Respect. While in a BitNode, your gang and gang member stats will not reset if you install augmentations.
|
||||
|
||||
## Respect
|
||||
|
||||
Earned as your gang members complete tasks, Respect affects your gang's productivity, including your Faction Reputation (needed to buy augmentations from your Gang Faction), and the number of recruits you can have. An individual gang member's Respect is lost or reset if they Ascend, or are killed in a Territory Warfare clash.
|
||||
|
||||
## Ascending
|
||||
|
||||
When experienced enough, gang members are offered Ascension, a permanent boost to their stat multipliers at the cost of resetting their base stats and equipment to 0, and reducing your Gang Reputation by the same amount as that member had earned since they last Ascended.
|
||||
|
||||
## Equipping and Managing
|
||||
|
||||
Buying Equipment for a gang member will give them a stat boost until they Ascend or are killed, at which point most equipment will reset.
|
||||
|
||||
Augmentations you install on gang members (in the Gang Equipment subpage) do not reset when they Ascend.
|
||||
|
||||
Active gang members earn stats, respect and money based on their current stats, their equipment, and the effects of Ascending.
|
||||
|
||||
## Wanted, Territory and Clashes
|
||||
|
||||
Your gang's "Wanted Level" can make tasks much less productive, and is affected by the tasks assigned to gang members. "Ethical Hacking" or "Vigilante Justice" tasks can lower Wanted Level.
|
||||
|
||||
"Territory Warfare" is a special task that builds Power for your gang. If "Territory Clashes" are enabled [see the Territory subpage of your Gang page], members have a chance to win or lose territory by clashing with other gangs. The % of Territory you control affects most aspects of your gang productivity.
|
||||
|
||||
Note that gang members can die during clashes, even if your gang wins.
|
||||
@@ -0,0 +1,13 @@
|
||||
# Grafting
|
||||
|
||||
Grafting is an experimental process through which you can obtain the benefits of [Augmentations](../basic/augmentations.md), without needing to reboot your body.
|
||||
|
||||
Grafting can be done at VitaLife in New Tokyo, where you'll find a shady researcher with questionable connections.
|
||||
From there, you can spend a sum of money to begin grafting [Augmentations](../basic/augmentations.md).
|
||||
This will take some time.
|
||||
When done, the [Augmentation](../basic/augmentations.md) will be applied to your character without needing to install.
|
||||
|
||||
Be warned, some who have tested grafting have reported an unidentified malware.
|
||||
Dubbed `Entropy`, this virus seems to grow in potency as more [Augmentations](../basic/augmentations.md) are grafted, causing unpredictable affects to the victim.
|
||||
|
||||
Note that when grafting an [Augmentation](../basic/augmentations.md), cancelling will **not** save your progress, and the money spent will **not** be returned.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Hacknet Servers
|
||||
|
||||
This is a very powerful upgrade to [Hacknet Nodes](../basic/hacknet_nodes.md). It is unlocked in BitNode 9.
|
||||
|
||||
Instead of producing money, Hacknet servers produce `hash`. This currency can be exchanged for a variety of upgrades that boost most other mechanics of the game.
|
||||
|
||||
We can run scripts on them, but it reduces the amount of `hash` produced.
|
||||
|
||||
There are 5 multipliers that affect them:
|
||||
|
||||
- `hacknet_node_money` affects the hash production rate.
|
||||
- `hacknet_node_purchase_cost` affects the cost of purchasing a server.
|
||||
- `hacknet_node_ram_cost` affects the cost of upgrading RAM.
|
||||
- `hacknet_node_core_cost` affects the cost of upgrading core.
|
||||
- `hacknet_node_level_cost` affects the cost of upgrading level.
|
||||
|
||||
There is no multiplier that affects the cost of upgrading cache.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Intelligence
|
||||
|
||||
Intelligence is a stat that is unlocked by having [Source-File 5](sourcefiles.md) (i.e. Destroying [BitNode-5](bitnodes.md)).
|
||||
|
||||
Intelligence is unique because it is permanent and persistent.
|
||||
It never gets reset back to 1.
|
||||
However, gaining Intelligence experience is extremely slow.
|
||||
It is a stat that gradually builds up as you continue to play the game.
|
||||
|
||||
Intelligence will boost your production for many actions in the game, including:
|
||||
|
||||
- [Hacking](../basic/hacking.md)
|
||||
- [Infiltration](../basic/infiltration.md)
|
||||
- [Crime](../basic/crimes.md) success rate
|
||||
- [Bladeburner](bladeburners.md) actions
|
||||
- [Reputation](../basic/reputation.md) gain for [Companies](../basic/companies.md) & [Factions](../basic/factions.md)
|
||||
- [Augmentation](../basic/augmentations.md) [Grafting](grafting.md) speed
|
||||
@@ -0,0 +1,27 @@
|
||||
# How Scripts Work Offline
|
||||
|
||||
The scripts you write and execute in the BitVerse are real, working JavaScript.
|
||||
For this reason, it is not possible for Bitburner scripts to run when
|
||||
|
||||
- the game is closed
|
||||
- the browser tab is inactive (if playing Bitburner in a web browser)
|
||||
- or your system is sleeping
|
||||
|
||||
all of which we call being "offline" for game purposes.
|
||||
|
||||
It is important to know that logic such as `if`/`else` statements and most functions such as `ns.purchaseHacknetNode()`, `ns.hack()`, and `ns.nuke()` will not work while the game is offline.
|
||||
|
||||
However, scripts WILL continue to generate money and hacking exp for you while offline.
|
||||
This offline production is based on the average online production of all your hacking scripts since your last augmentation, as shown on your Active Scripts page.
|
||||
|
||||
`ns.grow()` and `ns.weaken()` methods are also applied when the game is offline, although at a slower rate.
|
||||
This is done by having each script track the rate at which the `ns.grow()` and `ns.weaken()` commands are called while online,
|
||||
then determining how many calls would have been made while offline, and their effect is applied.
|
||||
|
||||
Also, note that because of the way the JavaScript engine works, whenever you reload or re-open the game all of your Active Scripts will start again from the BEGINNING of their code. The game does not keep track of where exactly the execution of a script is when it saves/loads.
|
||||
|
||||
# Bonus Time
|
||||
|
||||
Because of the above details, some activities in Bitburner accumulate "Bonus Time" while the game is closed or in an inactive browser tab. For mechanics that have a Bonus Time effect, the rate of the associated activity or task is significantly increased.
|
||||
|
||||
For example, if a certain [Bladeburner](bladeburners.md) contract requires 15 seconds to complete under normal conditions, the same task will be finished instead in 3 seconds if the Bonus Time effect is 5x. The specific details and effects of Bonus Time vary by mechanic.
|
||||
@@ -0,0 +1,85 @@
|
||||
# Sleeves
|
||||
|
||||
When VitaLife unveiled their Persona Core technology that allowed people to digitize and transfer their consciousness into other vessels, human bodies became nothing more than 'sleeves' for the human consciousness.
|
||||
This technology thus became known as "Sleeve technology".
|
||||
|
||||
Sleeve technology unlocks two different gameplay features:
|
||||
|
||||
- Duplicate Sleeves
|
||||
- [Grafting](grafting.md)
|
||||
|
||||
Sleeve technology is unlocked in [BitNode-10](bitnodes.md).
|
||||
|
||||
## Duplicate Sleeves
|
||||
|
||||
Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied.
|
||||
In other words, these Synthoids contain a perfect duplicate of your mind.
|
||||
|
||||
Duplicate Sleeves are essentially clones which you can use to perform work-type actions, such as working for a [Company](../basic/companies.md) / [Faction](../basic/factions.md) or committing a [Crime](../basic/crimes.md).
|
||||
When sleeves perform these tasks, they will earn money, experience, and [Reputation](../basic/reputation.md).
|
||||
|
||||
Sleeves are their own individuals, which means they each have their own experience and stats.
|
||||
|
||||
When a sleeve earns experience, it earns experience for itself, the player's original consciousness, as well as all of the player's other sleeves.
|
||||
|
||||
Duplicate Sleeves are **not** reset when installing [Augmentations](../basic/augmentations.md), but they are reset when switching [BitNodes](bitnodes.md).
|
||||
|
||||
## Obtaining Duplicate Sleeves
|
||||
|
||||
There are two methods of obtaining Duplicate Sleeves:
|
||||
|
||||
- Destroy [BitNode-10](bitnodes.md).
|
||||
Each completion gives you one additional Duplicate Sleeve.
|
||||
- Purchase Duplicate Sleeves from The Covenant.
|
||||
This is only available in [BitNode-10](bitnodes.md).
|
||||
Sleeves purchased this way are **permanent** (they persist through [BitNodes](bitnodes.md)).
|
||||
You can purchase up to 5 Duplicate Sleeves from The Covenant.
|
||||
|
||||
## Synchronization
|
||||
|
||||
Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves.
|
||||
It is a numerical value between `1` and `100`, and it affects how much experience is earned when the sleeve is performing a task.
|
||||
|
||||
Synchronization can be increased by assigning sleeves to the `Synchronize` task.
|
||||
|
||||
## Sleeve Shock
|
||||
|
||||
Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body.
|
||||
It is a numerical value between `0` and `100`, where `100` indicates full shock and `0` indicates no shock.
|
||||
Shock affects the amount of experience earned by the sleeve.
|
||||
|
||||
Sleeve shock slowly decreases over time.
|
||||
You can further increase the rate at which it decreases by assigning sleeves to the `Shock Recovery` task.
|
||||
|
||||
Let `X` be the sleeve's recovery ratio (calculated as `(100 - shock) / 100`), and `Y` be the sleeve's synchronization ratio (calculated as `synchronize / 100`).
|
||||
When performing a task would give you `A` experience normally, the sleeve gains `A * X` experience instead.
|
||||
|
||||
The player’s original host consciousness earns a fraction of the experience the sleeve gained, namely `A * X * Y`.
|
||||
|
||||
Other sleeves also earn the experience. However, their own shock affects this gain.
|
||||
Let `Z` be the receiving sleeve's recovery ratio. It earns `A * X * Y * Z` experience.
|
||||
|
||||
## Augmentations
|
||||
|
||||
You can purchase [Augmentations](../basic/augmentations.md) for your Duplicate Sleeves.
|
||||
In order to do this, the sleeve's shock must be at `0`.
|
||||
Any [Augmentation](../basic/augmentations.md) that is currently available to you through a faction is also available for your Duplicate Sleeves.
|
||||
There are a few [Augmentations](../basic/augmentations.md), such as NeuroFlux Governor and [Bladeburner](bladeburners.md)-specific ones, that cannot be purchased for a Duplicate Sleeve.
|
||||
|
||||
When you purchase an [Augmentation](../basic/augmentations.md) for a Duplicate Sleeve, it is instantly installed.
|
||||
When this happens, the sleeve's stats are instantly reset back to 0, similar to when you normally install [Augmentations](../basic/augmentations.md).
|
||||
|
||||
The cost of purchasing an [Augmentation](../basic/augmentations.md) for a Duplicate Sleeve is **not** affected by how many [Augmentations](../basic/augmentations.md) you have purchased for yourself, and vice versa.
|
||||
|
||||
## Memory
|
||||
|
||||
Sleeve memory dictates what a sleeve's synchronization will be when it is reset by switching [BitNodes](bitnodes.md).
|
||||
For example, if a sleeve has a memory of `10`, then when you switch [BitNodes](bitnodes.md) its synchronization will initially be set to `10`, rather than 1.
|
||||
|
||||
Memory can only be increased by purchasing upgrades from The Covenant.
|
||||
Just like the ability to purchase additional sleeves, this is only available in [BitNode-10](bitnodes.md).
|
||||
|
||||
Memory is a persistent stat, meaning it never gets reset back to `1`.
|
||||
The maximum possible value for a sleeve's memory is `100`.
|
||||
|
||||
Buying memory has no instant affect on synchronization - memory affects only the starting synchronization upon entering a [BitNode](bitnodes.md).
|
||||
@@ -0,0 +1,8 @@
|
||||
# Source-Files
|
||||
|
||||
Source-Files are a type of persistent upgrade that is more powerful than [Augmentations](../basic/augmentations.md).
|
||||
Source-Files are received by destroying a [Bitnode](bitnodes.md).
|
||||
There are many different [BitNodes](bitnodes.md) in the game and each [BitNode](bitnodes.md) will grant a different Source-File when it is destroyed.
|
||||
|
||||
A Source-File can be upgraded by destroying its corresponding [BitNode](bitnodes.md) a second or third time (playing through that [BitNode](bitnodes.md) again).
|
||||
It can be upgraded to a maximum of level 3, with the exception of Source-File 12, which has no hard limit.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Stanek
|
||||
|
||||
Allison is a bit crazy.
|
||||
But her special [Augmentation](../basic/augmentations.md) is very useful despite its ~~bugs~~ features.
|
||||
The Gift consists of a grid of squares in which Tetris-like pieces called fragments can be placed.
|
||||
Each fragment boost a different player multiplier.
|
||||
However, the fragments are not very powerful by themselves.
|
||||
|
||||
To increase the power of a fragment, the `ns.stanek.charge()` function needs to be called.
|
||||
More threads means more power.
|
||||
|
||||
There are also special fragments called booster fragments which increase the power of the fragment it touches.
|
||||
@@ -0,0 +1,63 @@
|
||||
# Augmentations
|
||||
|
||||
Advances in science and medicine have led to powerful new technologies that allow people to augment themselves beyond normal human capabilities.
|
||||
There are many different types of Augmentations, ranging from cybernetic to genetic to biological.
|
||||
Acquiring these Augmentations enhances the user's physical and mental faculties.
|
||||
|
||||
Augmentations provide persistent upgrades in the form of multipliers.
|
||||
These multipliers apply to a wide variety of things such as stats, experience gain, and [hacking](hacking.md), just to name a few.
|
||||
The effects of Augmentations stack multiplicatively.
|
||||
Your multipliers can be viewed in the `Character` pages.
|
||||
|
||||
## How to acquire Augmentations
|
||||
|
||||
Because of how powerful Augmentations are, the technology behind them is kept private and secret by the corporations and organizations that create them.
|
||||
Therefore, the only way for the player to obtain Augmentations is through [Factions](factions.md).
|
||||
After joining a [Faction](factions.md) and earning enough [Reputation](reputation.md) in it, you will be able to purchase its Augmentations.
|
||||
Different [Factions](factions.md) offer different Augmentations.
|
||||
Augmentations must be purchased in order to be installed, and they are fairly expensive.
|
||||
They also require [Reputation](reputation.md) with a [Faction](factions.md) before they will let you purchase their Augmentations.
|
||||
|
||||
## Installing Augmentations
|
||||
|
||||
You will not gain the benefits of your purchased Augmentations until you install them.
|
||||
You can choose to install Augmentations through the `Augmentations` menu tab, found under `Character`.
|
||||
|
||||
Unfortunately, installing Augmentations has side effects.
|
||||
You will lose most of the progress you've made, including your skills, stats, and money.
|
||||
You will have to start over, but you will have all of the Augmentations you have installed to help you progress.
|
||||
This is the game's "soft reset" or "prestige" mechanic.
|
||||
|
||||
To summarize, here is a list of everything you will **LOSE** when you install an Augmentation:
|
||||
|
||||
- Stats/Skills
|
||||
- Money
|
||||
- [Scripts](scripts.md) on all [servers](servers.md) EXCEPT your home computer
|
||||
- Purchased [servers](servers.md)
|
||||
- [Hacknet Nodes](hacknet_nodes.md)
|
||||
- [Company](companies.md) / [Faction](factions.md) [Reputation](reputation.md), but you gain [Favor](reputation.md).
|
||||
- Jobs and [Faction](factions.md) memberships
|
||||
- Programs
|
||||
- [Stocks](stockmarket.md)
|
||||
- TOR router
|
||||
|
||||
Here is everything you will **KEEP** when you install an Augmentation:
|
||||
|
||||
- Every Augmentation you have previously installed
|
||||
- [Scripts](scripts.md) on your home computer
|
||||
- [RAM](ram.md) / Core Upgrades on your home computer
|
||||
- [World Stock Exchange account](stockmarket.md) and [TIX API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.tix.md) Access
|
||||
|
||||
## Purchasing Multiple Augmentations
|
||||
|
||||
You do not have to install an Augmentation right after you purchase it.
|
||||
You can purchase as many Augmentations as you'd like before you choose to install them.
|
||||
When you install your purchased Augmentations they will **ALL** get installed at once.
|
||||
|
||||
There are a few drawbacks to this, however.
|
||||
First, obviously, you won't gain the benefits of your purchased Augmentations until after you install them.
|
||||
Second, purchasing multiple Augmentations before installing them will cause the Augmentations to get progressively more expensive.
|
||||
When you purchase an Augmentation, the price of purchasing another Augmentation doubles.
|
||||
This multiplier stacks for each Augmentation you purchase.
|
||||
Once you install your purchased Augmentations, their costs are reset back to the original prices.
|
||||
You can only purchase each augmentation once, with the exception of `NeuroFlux Governor`, which can be purchased infinitely at increasing cost.
|
||||
@@ -0,0 +1,97 @@
|
||||
# Autocomplete
|
||||
|
||||
The BitBurner terminal offers tab-completion, where pressing tab after typing a command offers suggestions for arguments to pass. You can customize this behavior for your scripts.
|
||||
|
||||
This relies on an exported function named "autocomplete" that is placed _outside_ of main, in the base scope of the script.
|
||||
|
||||
This function must return an array, the contents of which make up the autocomplete options.
|
||||
|
||||
A basic example as a complete script;
|
||||
|
||||
```javascript
|
||||
/**
|
||||
* @param {AutocompleteData} data - context about the game, useful when autocompleting
|
||||
* @param {string[]} args - current arguments, not including "run script.js"
|
||||
* @returns {string[]} - the array of possible autocomplete options
|
||||
*/
|
||||
export function autocomplete(data, args) {
|
||||
return ["argument0", "argument1", "argument2"];
|
||||
}
|
||||
|
||||
/** @param {NS} ns */
|
||||
export function main(ns) {
|
||||
const args = ns.args;
|
||||
ns.tprint(args[0], args[1], args[2]);
|
||||
}
|
||||
```
|
||||
|
||||
Running this script from the terminal like `run script.js` or `./script.js` and pressing tab, would offer "argument0", "argument1" and "argument2" as autocomplete options.
|
||||
|
||||
## AutocompleteData
|
||||
|
||||
To make this feature more useful, an [AutocompleteData](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.autocompletedata.md) object is provided to the autocomplete function that holds information commonly passed as arguments to scripts, such as server names and filenames.
|
||||
|
||||
AutocompleteData is an object with the following properties;
|
||||
|
||||
```javascript
|
||||
{
|
||||
command: // the command being run, as seen on the terminal.
|
||||
enums: // the ns.enums object with various in-game strings.
|
||||
filename: // the name of the script file containing the autocomplete function.
|
||||
hostname: // the name of the host server the script would be running on.
|
||||
processes: // list of all processes running on the current server.
|
||||
servers: // list of all servers in the game. Some servers are hidden until you satisfy their requirements. This array does not contain those servers if you do not satisfy their requirements.
|
||||
txts: // list of all text files on the current server.
|
||||
scripts: // list of all scripts on the current server.
|
||||
flags: // the same flags function as passed with ns. Calling this function adds all the flags as autocomplete arguments.
|
||||
}
|
||||
```
|
||||
|
||||
Here is a more complete example, utilising and returning information from the AutocompleteData object.
|
||||
|
||||
```javascript
|
||||
/**
|
||||
* @param {AutocompleteData} data - context about the game, useful when autocompleting
|
||||
* @param {string[]} args - current arguments, not including "run script.js"
|
||||
* @returns {string[]} - the array of possible autocomplete options
|
||||
*/
|
||||
export function autocomplete(data, args) {
|
||||
const scripts = data.scripts;
|
||||
const servers = data.servers;
|
||||
|
||||
const gymTypesObject = data.enums.GymType; // The data.enums holds the enum information as objects.
|
||||
const gymTypes = Object.values(gymTypesObject); // We are only interested in the string values from the enums object.
|
||||
|
||||
return [...scripts, ...servers, ...gymTypes]; // Offer a list of all servers, all scripts on the current server, and gym jobs ("str", "agi" etc) as autocomplete options.
|
||||
}
|
||||
```
|
||||
|
||||
## args
|
||||
|
||||
The args array is also passed to the autocomplete function as a second parameter. Similar to ns.args passed to `main` in normal scripts, this array contains the arguments currently inputted into the terminal.
|
||||
|
||||
This can be used to remove already passed arguments from the autocomplete suggestions.
|
||||
|
||||
For example;
|
||||
|
||||
```javascript
|
||||
/**
|
||||
* @param {AutocompleteData} data - context about the game, useful when autocompleting
|
||||
* @param {string[]} args - current arguments, not including "run script.js"
|
||||
* @returns {string[]} - the array of possible autocomplete options
|
||||
*/
|
||||
export function autocomplete(data, args) {
|
||||
const servers = data.servers;
|
||||
const serversWithArgsRemoved = servers.filter((server) => !args.includes(server));
|
||||
|
||||
return serversWithArgsRemoved;
|
||||
}
|
||||
```
|
||||
|
||||
In that example typing `run script.js` and pressing tab would initially suggest every server for autocomplete. Then if "n00dles" is added to the arguments and tab is pressed again, "n00dles" would no longer be suggested in subsequent autocomplete calls.
|
||||
|
||||
# Notes
|
||||
|
||||
- The autocomplete function in the file is called each time the tab key is pressed following `run file.js` or `./file.js` in the terminal.
|
||||
- The autocomplete function is separate from `main`, and does not receive an `ns` context as a parameter. This means no `ns` game commands will work in autocomplete functions.
|
||||
- If a multi-element array is returned then multiple options are displayed. If a single-element array is returned then that element is auto-filled to the terminal. This is handy for the "--tail" run argument, for example.
|
||||
@@ -0,0 +1,74 @@
|
||||
# Coding Contracts
|
||||
|
||||
Coding Contracts are a mechanic that lets players earn rewards in exchange for solving programming problems.
|
||||
|
||||
Coding Contracts are files with the `.cct` extension.
|
||||
They can be accessed through the [Terminal](terminal.md) or through [Scripts](scripts.md) using the [Coding Contract API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md).
|
||||
|
||||
Each contract has a limited number of attempts.
|
||||
If you provide the wrong answer too many times and exceed the number of attempts, the contract will self destruct (delete itself).
|
||||
|
||||
Coding Contracts are randomly generated and spawn over time. Initially, you'll only see a small range of the easier contracts, but as you progress further through the game more challenging ones will unlock.
|
||||
They can appear on any [server](servers.md) (including your home computer), except for your purchased [servers](servers.md).
|
||||
|
||||
## Running in Terminal
|
||||
|
||||
To run a Coding Contract in the [Terminal](terminal.md), simply use the `run` command:
|
||||
|
||||
$ run some-contract.cct
|
||||
|
||||
Doing this will bring up a popup.
|
||||
The popup will display the contract's problem, the number of attempts remaining, and an area to provide an answer.
|
||||
|
||||
## Interacting through Scripts
|
||||
|
||||
See the [Coding Contract API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md).
|
||||
Interacting with Coding Contracts via the [Terminal](terminal.md) can be tedious the more contracts you solve.
|
||||
Consider using the [API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md) to automate various aspects of your solution.
|
||||
For example, some contracts have long solutions while others have even longer solutions.
|
||||
You might want to use the [API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md) to automate the process of submitting your solution rather than copy and paste a long solution into an answer box.
|
||||
The [Coding Contract API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md) can also be used to find out useful information about a contract including the number of attempts you have left, the type of contract and its difficulty.
|
||||
|
||||
However, using the [API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md) comes at a cost.
|
||||
Like most functions in other APIs, almost all of the functions in the [Coding Contract API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md) have a RAM cost.
|
||||
|
||||
Depending on which function you use, the initial [RAM](ram.md) on your home server might not be enough to allow you to use various [API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md) functions.
|
||||
Plan on upgrading the [RAM](ram.md) on your home server if you want to use the [Coding Contract API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.md).
|
||||
|
||||
The [`getContractTypes`](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.codingcontract.getcontracttypes.md) function is free, and returns a list of all of the contract types currently in the game.
|
||||
|
||||
## Submitting Solutions
|
||||
|
||||
Different contract problem types will require different types of solutions.
|
||||
Some may be numbers, others may be strings or arrays.
|
||||
If a contract asks for a specific solution format, then use that.
|
||||
Otherwise, follow these rules when submitting solutions:
|
||||
|
||||
- String-type solutions should **not** have quotation marks surrounding the string (unless specifically asked for).
|
||||
Only quotation marks that are part of the actual string solution should be included.
|
||||
- Array-type solutions should be submitted with each element in the array separated by commas.
|
||||
Brackets are optional.
|
||||
For example, both of the following are valid solution formats:
|
||||
- `1,2,3`
|
||||
- `[1,2,3]`
|
||||
- If the solution is a multidimensional array, then all arrays that are not the outer-most array DO require the brackets.
|
||||
For example, an array of arrays can be submitted as one of the following:
|
||||
- `[1,2],[3,4]`
|
||||
- `[[1,2],[3,4]]`
|
||||
|
||||
Numeric solutions should be submitted normally, as expected
|
||||
|
||||
## Rewards
|
||||
|
||||
There are currently four possible rewards for solving a Coding Contract:
|
||||
|
||||
- [Faction](factions.md) [Reputation](reputation.md) for a specific [Faction](factions.md)
|
||||
- [Faction](factions.md) [Reputation](reputation.md) for all [Factions](factions.md) that you are a member of
|
||||
- [Company](companies.md) [Reputation](reputation.md) for a specific [Company](companies.md)
|
||||
- Money
|
||||
|
||||
The `amount` of the reward varies based on the difficulty of the problem posed by the Coding Contract.
|
||||
|
||||
## Notes
|
||||
|
||||
- The `scp` [Terminal](terminal.md) command does not work on Coding Contracts
|
||||
@@ -0,0 +1,14 @@
|
||||
# Companies
|
||||
|
||||
When exploring the [World](world.md), you can visit various companies.
|
||||
At these companies, you can apply for jobs.
|
||||
|
||||
Working a job lets you earn money, experience, and [Reputation](reputation.md) with that company.
|
||||
|
||||
While working for a company, you can click `Do something else simultaneously` to be able to do things while you continue to work in the background.
|
||||
There is a 20% penalty to the related gains.
|
||||
Clicking the `Focus` button under the overview will return you to the current work.
|
||||
|
||||
If you've been hired to do a job you can click that `Apply for X Job` button again to get a promotion if you meet the requirements.
|
||||
You can see the requirements by hovering your cursor over the button.
|
||||
Higher positions give increased rewards.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Crimes
|
||||
|
||||
Committing crimes is an active gameplay mechanic that allows the player to train their [Stats](stats.md) and potentially earn money.
|
||||
The player can attempt to commit crimes by visiting `The Slums` through the `City` tab (Alt + w).
|
||||
`The Slums` is available in every city.
|
||||
|
||||
## Basic Mechanics
|
||||
|
||||
When you visit `The Slums` you will see a list of buttons that show all of the available crimes.
|
||||
Simply select one of the options to begin attempting that crime.
|
||||
Attempting to commit a crime takes a certain amount of time.
|
||||
This time varies between crimes.
|
||||
|
||||
While doing crimes, you can click `Do something else simultaneously` to be able to do things while you continue to do crimes in the background.
|
||||
There is a 20% penalty to the related gains.
|
||||
Clicking the `Focus` button under the overview will return you to the current task.
|
||||
|
||||
Crimes are not always successful.
|
||||
Your rate of success is determined by your [Stats](stats.md) and [Augmentations](augmentations.md).
|
||||
The odds can be seen on the crime-selection page.
|
||||
If you are unsuccessful at committing a crime you will gain EXP, but you will not earn money.
|
||||
If you are successful at committing the crime you will gain extra EXP (4x of what an unsuccessful attempt would give) and earn money.
|
||||
|
||||
Harder crimes are typically more profitable, and also give more EXP.
|
||||
@@ -0,0 +1,22 @@
|
||||
# Factions
|
||||
|
||||
Throughout the game you may receive invitations from factions.
|
||||
There are many different factions, and each faction has different criteria for determining its potential members.
|
||||
Joining a faction and furthering its cause is crucial to progressing in the game and unlocking endgame content.
|
||||
|
||||
It is possible to join multiple factions if you receive invitations from them.
|
||||
However, note that joining a faction may prevent you from joining other rival factions.
|
||||
(Don't worry, this usually isn't the case.
|
||||
Also, it would only be temporary since resetting the game by installing [Augmentations](augmentations.md) will clear all your factions)
|
||||
|
||||
The `Factions` link on the menu brings up a list of all factions that you have joined.
|
||||
You can select a Faction on this list to go to that Faction page.
|
||||
This page displays general information about the Faction and also lets you perform work for the faction.
|
||||
Working for a Faction is similar to working for a [Company](companies.md) except that you don't get paid a salary.
|
||||
You will only earn [Reputation](reputation.md) in your Faction and train your [Stats](stats.md).
|
||||
|
||||
Earning [Reputation](reputation.md) for a Faction unlocks powerful [Augmentations](augmentations.md).
|
||||
Purchasing and installing these [Augmentations](augmentations.md) will upgrade your abilities.
|
||||
The [Augmentations](augmentations.md) that are available to unlock vary from Faction to Faction.
|
||||
|
||||
See also the complete [List of Factions and their Requirements](../advanced/faction_list.md) (contains spoilers).
|
||||
@@ -0,0 +1,87 @@
|
||||
# Hacking
|
||||
|
||||
In the year 2077, currency has become digital and decentralized.
|
||||
People and corporations store their money on [servers](servers.md).
|
||||
By hacking these [servers](servers.md), you can steal their money and gain experience.
|
||||
|
||||
## Gaining Root Access
|
||||
|
||||
The first step to hacking a [server](servers.md) is to gain root access to that [server](servers.md).
|
||||
This can be done using the `NUKE.exe` virus.
|
||||
You start the game with a copy of the `NUKE.exe` virus on your home computer.
|
||||
The `NUKE.exe` virus attacks the target [server](servers.md)'s open ports using buffer overflow exploits.
|
||||
When successful, you are granted root administrative access to the machine.
|
||||
|
||||
In order for the `NUKE.exe` virus to succeed, the target [server](servers.md) needs to have enough open ports.
|
||||
Some [servers](servers.md) have no security and will not need any ports opened.
|
||||
Some will have very high security and will need many ports opened.
|
||||
In order to open ports on another [server](servers.md), you will need to run programs that attack the [server](servers.md) to open specific ports.
|
||||
These programs can be coded once your hacking skill gets high enough, or they can be purchased if you can find a seller.
|
||||
|
||||
**There are two ways to execute port-opening programs and the NUKE virus:**
|
||||
|
||||
- Connect to the target [server](servers.md) through the [Terminal](terminal.md) and use the `run` command: `$ run [programName]`
|
||||
- Use a function:
|
||||
- `nuke`
|
||||
- `brutessh`
|
||||
- `ftpcrack`
|
||||
- `relaysmtp`
|
||||
- `httpworm`
|
||||
- `sqlinject`
|
||||
|
||||
**There are two ways to determine how many ports need to be opened
|
||||
on a [server](servers.md) in order to successfully NUKE it:**
|
||||
|
||||
- Connect to that [server](servers.md) through the [Terminal](terminal.md) and use the `analyze` command.
|
||||
- Use the `getServerNumPortsRequired` function.
|
||||
|
||||
Once you have enough ports opened on a [server](servers.md) and have ran the NUKE virus to gain root access, you will be able to hack it.
|
||||
|
||||
### For specific details of how Hacking work "offline"
|
||||
|
||||
See [Offline And Bonus Time](../advanced/offlineandbonustime.md).
|
||||
|
||||
## General Hacking Mechanics
|
||||
|
||||
When you execute the `hack` command, either manually through the [Terminal](terminal.md) or automatically through a script, you attempt to hack the [server](servers.md).
|
||||
This action takes time.
|
||||
The more advanced a [server](servers.md)'s security is, the more time it will take.
|
||||
Your hacking skill level also affects the hacking time, with a higher hacking skill leading to shorter hacking times.
|
||||
Also, running the hack command manually through [Terminal](terminal.md)
|
||||
is faster than hacking from a script.
|
||||
|
||||
Your attempt to hack a [server](servers.md) will not always succeed.
|
||||
The chance you have to successfully hack a [server](servers.md) is also determined by the [server](servers.md)'s security and your hacking skill level.
|
||||
Even if your hacking attempt is unsuccessful, you will still gain experience points.
|
||||
|
||||
When you successfully hack a [server](servers.md).
|
||||
You steal a certain percentage of that [server](servers.md)'s total money.
|
||||
This percentage is, once again, determined by the [server](servers.md)'s security and your hacking skill level.
|
||||
The amount of money on a [server](servers.md) is not limitless.
|
||||
So, if you constantly hack a [server](servers.md) and deplete its money, then you will encounter diminishing returns in your hacking (since you are only hacking a certain percentage).
|
||||
You can increase the amount of money on a [server](servers.md) using a script and the `grow` function.
|
||||
|
||||
## Server Security
|
||||
|
||||
Each [server](servers.md) has a security level, typically between `1` and `100`.
|
||||
A higher number means the [server](servers.md) has stronger security.
|
||||
|
||||
As mentioned above, a [server](servers.md)'s security level is an important factor to consider when hacking.
|
||||
You can check a [server](servers.md)'s security level using the `analyze` [Terminal](terminal.md) command.
|
||||
You can also check a [server](servers.md)'s security in a script, using the `getServerSecurityLevel` function.
|
||||
|
||||
Whenever a [server](servers.md) is hacked manually or through a script, its security level increases by a small amount.
|
||||
Calling the `grow` function in a script will also increase security level of the target [server](servers.md).
|
||||
These actions will make it harder for you to hack the [server](servers.md), and decrease the amount of money you can steal.
|
||||
You can lower a [server](servers.md)'s security level in a script using the `weaken` function.
|
||||
|
||||
Each server has a minimum security level. The [server](servers.md)'s security level will not fall below this value if you try to `weaken` it. You can get this value with the `getServerMinSecurityLevel` function.
|
||||
|
||||
## Backdoors
|
||||
|
||||
[Servers](servers.md) that can be hacked can also have backdoors installed.
|
||||
These backdoors will provide you with a benefit - the services may be cheaper, penalties may be reduced or there may be other results.
|
||||
Honeypots exist and will let factions know when you have succeeded at backdooring their system.
|
||||
Once you have a backdoor installed, you can connect to that [server](servers.md) directly.
|
||||
|
||||
When you visit a location in the city and see that the name is partially scrambled, this indicates that you have backdoored the [server](servers.md) related to the location.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Hacknet nodes
|
||||
|
||||
This distributed network of computers allows you to gain passive income.
|
||||
By upgrading a node's level, RAM, and CPU cores you can increase the amount of money it earns.
|
||||
You can also purchase new nodes to expand your Hacknet - The cost for each node increases as your network grows.
|
||||
|
||||
**Hacknet nodes won't make as much money as basic hacking scripts, and they are not enough to progress alone.**
|
||||
|
||||
Later in the game, there is a powerful change to the Hacknet system called [Hacknet Servers](../advanced/hacknetservers.md).
|
||||
@@ -0,0 +1,93 @@
|
||||
# Infiltration
|
||||
|
||||
Infiltration is a gameplay mechanic that allows you to infiltrate a [Company](companies.md)'s facility to try and steal the [Company](companies.md)'s classified secrets.
|
||||
These secrets can be sold for money or for [Reputation](reputation.md) with a [Faction](factions.md).
|
||||
|
||||
## Overview
|
||||
|
||||
Many companies have facilities that you can attempt to infiltrate.
|
||||
By infiltrating, you can steal classified [Company](companies.md) secrets and then sell these for money or for [Faction](factions.md) [Reputation](reputation.md).
|
||||
To try and infiltrate a [Company](companies.md), visit a [Company](companies.md) through the [World](world.md) menu.
|
||||
There will be an option that says 'Infiltrate [Company](companies.md)'.
|
||||
|
||||
When infiltrating a [Company](companies.md), you will be presented with short active challenges.
|
||||
|
||||
- None of the challenges uses the mouse.
|
||||
- Most challenges use spacebar as the `action`.
|
||||
- Some challenges use WASD or arrows interchangeably.
|
||||
- A few others use the rest of the keyboard.
|
||||
|
||||
Each location that can be infiltrated has 3 important values:
|
||||
|
||||
- Difficulty: It affects how difficult the challenges are. This value depends on your "common" stats (combat stats and charisma). It's reduced when you improve your stats. It is not recommended to attempt infiltrations when the difficulty is above normal.
|
||||
- Max clearance level: It is the number of challenges you need to pass to receive the infiltration reward.
|
||||
- Starting security level: It affects the difficulty and rewards.
|
||||
|
||||
Every time you successfully complete an infiltration challenge and go to the higher clearance level, the "effective" difficulty is increased. The difficulty value in the introduction screen is the initial value for the first clearance level. When you go to higher levels, this value will be increased, so the challenges will become harder.
|
||||
|
||||
Every time you fail an infiltration challenge, you will take damage based on the starting security level of the location.
|
||||
If your HP is reduced to 0, you will be hospitalized, and the infiltration will immediately end.
|
||||
|
||||
Infiltration rewards depend on:
|
||||
|
||||
- Max clearance level. Higher max clearance level = Higher rewards.
|
||||
- Starting security level. Higher starting security level = Higher rewards.
|
||||
- Your stats' **multipliers** (**NOT** skill levels). **Lower** multipliers = Higher rewards.
|
||||
- "SoA - phyzical WKS harmonizer" augmentation.
|
||||
- An endgame stat [1]. You will know what it is when you reach the endgame.
|
||||
- An endgame multiplier [2]. You will know what it is when you reach the endgame.
|
||||
|
||||
The most common misconception of infiltration rewards is that they depend on skill levels. This is wrong. The rewards do **NOT** depend on skill levels. They depend on stats' multipliers. When you install augmentations that improve stats' multipliers, the rewards are reduced.
|
||||
|
||||
In some special cases, you may observe this behavior: When you install augmentations or soft reset, your skill levels drop to 1 and infiltration rewards are increased. Some players mistakenly think that this is why infiltrations should be done with low stats to optimize the rewards. This is totally wrong. Again, infiltration rewards do **NOT** depend on skill levels. In these special cases, the rewards are increased because stats' **multipliers** are reduced due to losing bonuses from other mechanics (IPvGO and some endgame mechanics).
|
||||
|
||||
Raising raw values of stats (skill levels) is one of the proper ways to optimize the infiltration. Having higher stats does not increase the rewards, but it allows you to infiltrate harder locations (higher max clearance level, higher starting security level, easier to complete more infiltrations in the same time frame, etc.).
|
||||
|
||||
Proper ways to optimize the infiltration (with the same [2] and the same stats' multipliers) are:
|
||||
|
||||
- Raise stats. Do NOT purposely keep them low. Having higher stats does not increase the rewards, but it allows you to infiltrate harder locations. Training at gyms, committing crimes, and working for companies/factions are good and easy ways to raise stats without changing stats' multipliers.
|
||||
- Infiltrate harder locations after getting higher stats (higher max clearance level, higher starting security level, easier to complete more infiltrations in the same time frame, etc.).
|
||||
- Increase [1].
|
||||
- Buy SoA augmentations (especially "SoA - phyzical WKS harmonizer").
|
||||
|
||||
## Challenge list
|
||||
|
||||
### Attack the distracted sentinel
|
||||
|
||||
Press space bar to attack when the sentinel drops his guard and is distracted. Do not alert him!
|
||||
|
||||
There are 3 phases:
|
||||
|
||||
1. Guarding - The sentinel is guarding. Attacking will result in a failure.
|
||||
2. Distracted - The sentinel is distracted. Attacking will result in a victory.
|
||||
3. Alerted - The sentinel is alerted. Attacking will result in a failure.
|
||||
|
||||
### Close the brackets
|
||||
|
||||
Enter all the matching brackets in reverse order.
|
||||
|
||||
### Type it backward
|
||||
|
||||
Type the words that are written backward.
|
||||
|
||||
### Say something nice about the guard.
|
||||
|
||||
Use the arrows to find a compliment for the guard.
|
||||
|
||||
### Enter the Code!
|
||||
|
||||
Match the arrows as they appear.
|
||||
|
||||
### Match the symbols!
|
||||
|
||||
Move the cursor to the matching symbol and press space to confirm.
|
||||
|
||||
### Remember all the mines!
|
||||
|
||||
At first, the cursor cannot be moved - remember the positions of the mines.
|
||||
Next, move the cursor and press space to mark the mines on the board.
|
||||
|
||||
### Cut the wires
|
||||
|
||||
Follow the instructions and press the numbers `1` through `9` to cut the appropriate
|
||||
wires.
|
||||
@@ -0,0 +1,16 @@
|
||||
## Programs
|
||||
|
||||
In Bitburner "Programs" refer specifically to the list of `.exe` files found in the Programs tab of the side menu.
|
||||
|
||||
Unlike [scripts](scripts.md) you write for yourself with JavaScript, Programs are supplied to you by Bitburner and are only "programs" in name; they do not require or allow you to access actual lines of code. Instead once you have a Program you will be able to use it directly as a function in the [Terminal](terminal.md) or scripts.
|
||||
|
||||
[n00dles /]> run BruteSSH.exe
|
||||
[n00dles /]> scan-analyze 10
|
||||
|
||||
or
|
||||
|
||||
ns.sqlinject("n00dles")
|
||||
|
||||
After meeting the [Hacking Skill level](stats.md) threshold shown on each Program, you have the option to Create Program, allowing you to do that as a focused or unfocused activity. The time needed to create a Program generally increases with their level requirement, and scales with your [stats](stats.md).
|
||||
|
||||
Alternatively, you may also find the same Programs available for purchase by connecting to the in-game `Darkweb`, accessed after finding a tech store in a City and purchasing Tor [("The Onion Router")](<https://en.wikipedia.org/wiki/Tor_(network)>).
|
||||
@@ -0,0 +1,8 @@
|
||||
# RAM
|
||||
|
||||
In Bitburner, RAM determines how many [Scripts](scripts.md) can run on a [Server](servers.md).
|
||||
|
||||
Multiplying the number of threads a [Script](scripts.md) uses multiplies its RAM cost, but also multiplies the effectiveness of several functions such as `ns.hack()`, `ns.grow()`, and `ns.weaken()`.
|
||||
|
||||
You can purchase more RAM for your home computer from tech vendors.
|
||||
You can also use other purchased or hacked servers as a source of additional RAM.
|
||||
@@ -0,0 +1,14 @@
|
||||
# Reputation
|
||||
|
||||
In order to acquire [Augmentations](augmentations.md) from [Factions](factions.md), you need to earn their trust.
|
||||
|
||||
This can be done in a variety of ways, but the most common is offering your services to a [Faction](factions.md).
|
||||
Another option is to give them intel from [Infiltrations](infiltration.md).
|
||||
|
||||
When installing [Augmentations](augmentations.md), all your reputation gets converted to favor.
|
||||
Favor increases the rate at which reputation is gained with that faction.
|
||||
|
||||
With enough favor, donations are unlocked.
|
||||
Donations allow you to spend money to acquire reputation directly.
|
||||
Without working for the faction.
|
||||
This feature is particularly useful when a very large amount of reputation is needed for an augmentation.
|
||||
@@ -0,0 +1,162 @@
|
||||
# Before you start
|
||||
|
||||
It is highly recommended that you have a basic familiarity with programming concepts like [`for`/`while` loops](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for), [conditionals like `if`/`else`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else), [`functions`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions),[`arrays`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) and [`variables`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const) before starting to write scripts - but you can start with basic skills and learn with practice.
|
||||
|
||||
If you'd like to first learn a bit about programming, see [this page](../programming/learn.md).
|
||||
|
||||
# Scripts
|
||||
|
||||
Scripts you write in Bitburner are real, working JavaScript and can be used to automate basic hacking logic, and almost any mechanic in the game.
|
||||
|
||||
Running any script requires in-game [RAM](ram.md), with a minimum cost of 1.6 GB per script.
|
||||
More complex scripts and API functions generally require more [RAM](ram.md), which you will gain in many ways.
|
||||
Scripts can be run on any [server](servers.md) you have root access to, but not all servers you find will have useable RAM.
|
||||
|
||||
## How Scripts work offline
|
||||
|
||||
Being actual JavaScript, Bitburner also contains some quirks and limitations.
|
||||
For this reason, it is not possible for Bitburner scripts to run the same way at all times.
|
||||
However, you will continue to earn money and exp when Bitburner is not running, though at a slower rate.
|
||||
See [How Scripts Work Offline](../advanced/offlineandbonustime.md) for more details.
|
||||
|
||||
## Identifying a Script
|
||||
|
||||
Many commands and functions target other scripts running on the same or a different server.
|
||||
Therefore, there must be a way to specify which script you want to affect.
|
||||
|
||||
One way to identify a script is by its unique PID (Process IDentifier).
|
||||
A PID number is returned from `ns.run()`, `ns.exec()`, etc; and is also shown in the output of `ns.ps()`.
|
||||
|
||||
A second way to identify scripts is by filename, hostname **and** arguments.
|
||||
However, you will probably run multiple copies of a script with the same arguments, so this method is not necessarily **unique** to a script.
|
||||
In case of multiple matches, most functions will return an arbitrary one (typically the oldest).
|
||||
|
||||
If searching by filename, arguments must be an **exact** match - both the order and [type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) of the arguments you supply matter.
|
||||
|
||||
## Referencing Other Scripts
|
||||
|
||||
In order to reference a file, `functions` require the **full** absolute file path.
|
||||
For example
|
||||
|
||||
ns.run("/scripts/hacking/helpers.myHelperScripts.js");
|
||||
ns.rm("/logs/myHackingLogs.txt");
|
||||
ns.rm("thisIsAFileInTheRootDirectory.txt");
|
||||
|
||||
A full file path **must** begin with a forward slash (/) if that file is not in the root directory.
|
||||
For details on references in terminal commands, see [Terminal](terminal.md).
|
||||
|
||||
## Script Arguments
|
||||
|
||||
When running a script, you can use [flags](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.flags.md) and [arguments](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.args.md), which the script's logic can access and act on, allowing flexibility in your script designs. For example allowing you to get different results or attack different targets without re-writing your code:
|
||||
|
||||
$ run hack.js "harakiri-sushi"
|
||||
$ run hack.js "silver-helix"
|
||||
|
||||
## Multithreading scripts
|
||||
|
||||
A script can be run with multiple threads, which we call "multithreading."
|
||||
Multithreading affects every call to the `ns.hack()`, `ns.grow()`, and `ns.weaken()` methods, multiplying their effects by the number of threads used.
|
||||
For example, if a script run with 1 thread is able to hack \$10,000, then running the same script with 5 threads would hack \$50,000.
|
||||
|
||||
[Note -- Scripts will not actually become multithreaded in the real-world sense - Javascript is a "single-threaded" coding language.]
|
||||
|
||||
When "multithreading" a script, the total [RAM](ram.md) cost can be calculated by simply multiplying the [RAM](ram.md) cost of a single instance of your script by the number of threads you will use. [See [`ns.getScriptRam()`](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.getscriptram.md) or the `mem` terminal command detailed below]
|
||||
|
||||
## Never-ending scripts
|
||||
|
||||
Sometimes it might be necessary for a script to never end and keep doing a particular task.
|
||||
In that case you would want to write your script in a never-ending loop, like `while (true)`.
|
||||
|
||||
However, if you are not careful, this can crash your game.
|
||||
If the code inside the loop doesn't `await` for some time, it will never give other scripts and the game itself time to process.
|
||||
|
||||
To help you find this potential bug, any `while (true)` loop without any `await` statement inside it will be marked.
|
||||
A red decoration will appear on the left side of the script editor, telling you about the issue.
|
||||
|
||||
If you are really sure that this is not an oversight, you can suppress the warning using the comment `// @ignore-infinite` directly above the loop.
|
||||
|
||||
## Working with Scripts in Terminal
|
||||
|
||||
Here are some [terminal](terminal.md) commands you will find useful when working with scripts:
|
||||
|
||||
**check [script] [args...]**
|
||||
|
||||
Prints the logs of the script specified by the name and arguments to [Terminal](terminal.md).
|
||||
Remember that scripts are uniquely identified by their arguments as well as their name, and
|
||||
Arguments should be separated by a space.
|
||||
For example, if you ran a script `foo.js` with the argument `foodnstuff` then in order to 'check' it you must also add `foodnstuff` as an argument for the `check` command:
|
||||
|
||||
$ check foo.js foodnstuff
|
||||
|
||||
**free**
|
||||
|
||||
Shows the current server's [RAM](ram.md) usage and availability
|
||||
|
||||
**kill [pid]** or **kill [script] [args...]**
|
||||
|
||||
Stops a script that is running with the specified PID, or script name and arguments.
|
||||
Remember that scripts are identified by their arguments as well as their name, and
|
||||
Arguments should be separated by a space.
|
||||
For example, if you ran a script `foo.js` with the arguments `1` and `2`, then just typing `kill foo.js` will not work.
|
||||
Instead use:
|
||||
|
||||
$ kill foo.js 1 2
|
||||
|
||||
**mem [script] [-t] [n]**
|
||||
|
||||
Check how much [RAM](ram.md) a script requires to run with "n" threads
|
||||
|
||||
$ mem [scriptname] -t n
|
||||
$ mem hack.js -t 500
|
||||
|
||||
**nano [script]**
|
||||
|
||||
Create/Edit a script.
|
||||
The name of a script must end with a script extension (.js, .jsx, .ts, .tsx). You can also create a text file with a text extension (.txt, .json).
|
||||
|
||||
**ps**
|
||||
|
||||
Displays all scripts that are actively running on the current [server](servers.md)
|
||||
|
||||
**rm [script]**
|
||||
|
||||
Permanently delete a script from the [server](servers.md). Can only be undone with a save import.
|
||||
|
||||
**run [script] [-t] [n] [args...]**
|
||||
|
||||
Run a script with n threads and the specified arguments.
|
||||
Each argument should be separated by a space.
|
||||
Both the thread count and arguments are optional.
|
||||
If neither are specified, then the script will be run with a single thread and no arguments.
|
||||
|
||||
Examples:
|
||||
|
||||
Run `foo.js` single-threaded with no arguments::
|
||||
|
||||
$ run foo.js
|
||||
|
||||
Run `foo.js` with 10 threads and no arguments:
|
||||
|
||||
$ run foo.js -t 10
|
||||
|
||||
Run `foo.js` single-threaded with three arguments: `[foodnstuff, sigma-cosmetics, 10]`:
|
||||
|
||||
$ run foo.js foodnstuff sigma-cosmetics 10
|
||||
|
||||
Run `foo.js` with 50 threads and a single argument: `foodnstuff`:
|
||||
|
||||
$ run foo.js -t 50 foodnstuff
|
||||
|
||||
**tail [pid]** or **tail [script] [args...]**
|
||||
|
||||
Displays the logs of the script specified by the PID or filename and arguments.
|
||||
Remember that scripts are identified by their arguments as well as their filename.
|
||||
For example, if you ran a script `foo.js` with the argument `foodnstuff`, in order to `tail` it you must also add the `foodnstuff` argument to the `tail` command as so:
|
||||
|
||||
$ tail foo.js foodnstuff
|
||||
|
||||
**top**
|
||||
|
||||
Prints all scripts running on the server and their [RAM](ram.md) usage.
|
||||
|
||||
$ top
|
||||
@@ -0,0 +1,58 @@
|
||||
# Servers
|
||||
|
||||
In this game, a server refers to a computer that can be connected to, accessed, and manipulated through the [Terminal](terminal.md).
|
||||
All servers in the game are connected to each other to form a large, global network.
|
||||
To learn about how to navigate this network and connect to other servers, see the [terminal](terminal.md) page.
|
||||
|
||||
## Server Statistics
|
||||
|
||||
Each server has its own statistics, such as [RAM](ram.md), required hacking level, and number of ports required to successfully `NUKE` it.
|
||||
|
||||
Perhaps the most important property of a server to make note of is its [RAM](ram.md), which refers to how much memory is available on that machine. [RAM](ram.md) is important because it is required to run [Scripts](scripts.md).
|
||||
More [RAM](ram.md) allows the user to run more powerful and complicated [scripts](scripts.md), as well as executing scripts with more threads.
|
||||
|
||||
The `free`, `scan-analyze`, and `analyze` [Terminal](terminal.md) commands can be used to check how much [RAM](ram.md) a server has.
|
||||
|
||||
Some servers have some randomized statistics, such as [RAM](ram.md), max Money, or required hacking level.
|
||||
These statistics are randomly generated from a range of values.
|
||||
|
||||
## Identifying Servers
|
||||
|
||||
A server is identified by its hostname.
|
||||
A hostname is a label assigned to a server.
|
||||
A hostname will usually give you a general idea of what the server is.
|
||||
For example, the company Nova Medical might have a server with the hostname `nova-med`.
|
||||
|
||||
Hostnames are unique.
|
||||
This means that if one server has the the hostname `some-server`, then no other server in the game can have that that hostname.
|
||||
|
||||
There are many `functions` and [terminal](terminal.md) commands in the game that will require you to target a specific server by hostname.
|
||||
|
||||
## Player-owned Servers
|
||||
|
||||
The player starts with a single server: his/her home computer.
|
||||
This server will have the hostname `home`.
|
||||
The player's home computer is special for a variety of reasons:
|
||||
|
||||
- The home computer's [RAM](ram.md) can be upgraded.
|
||||
This can be done by visiting certain locations in the [World](world.md).
|
||||
- The home computer persists through [Augmentation](augmentations.md) installations.
|
||||
This means that you will not lose any [RAM](ram.md) upgrades or [Scripts](scripts.md) on your home computer when you install [Augmentations](augmentations.md)
|
||||
(you will, however, lose programs and messages on your home computer).
|
||||
|
||||
The player can also purchase additional servers.
|
||||
This can be done by visiting certain locations in the [World](world.md), or it can be done automatically through a script using the `purchaseServer` function.
|
||||
The advantage of purchased servers is that, in terms of [RAM](ram.md), they are cheaper than upgrading your home computer.
|
||||
The disadvantage is that your purchased servers are lost when you install [Augmentations](augmentations.md).
|
||||
|
||||
## Hackable Servers
|
||||
|
||||
Most servers that are not owned by the player can be [hacked](hacking.md) for money and exp.
|
||||
|
||||
Different servers have different levels of security, but also offer different rewards when being hacked.
|
||||
|
||||
## Server Connections
|
||||
|
||||
The servers are in a randomly organized tree-structure.
|
||||
The distance from the home computer to each server is fixed, but the exact route to them is randomized when you install [augmentations](augmentations.md).
|
||||
In general, the further away from home computer a server is the higher its statistics are.
|
||||
@@ -0,0 +1,66 @@
|
||||
Below are some of the stats that will increase with play and reset during augmentation installs as you progress through the game.
|
||||
Your stats can be found in the Overview panel, the Stats subpage of the side menu, or with API methods like `ns.getPlayer()`.
|
||||
|
||||
## Hack Skill
|
||||
|
||||
For many aspects of Bitburner, increasing your Hack skill will be an important goal. Primarily affected by the efficiency of your hacking strategies, you will also be offered [Augmentations](augmentations.md) that greatly enhance your Hack Skill level and how effective its results are.
|
||||
|
||||
Affects:
|
||||
|
||||
- Time needed to execute `hack`, `grow`, or `weaken` and similar methods
|
||||
- Your chance to successfully hack a server
|
||||
- Percent of a server's money stolen when hacking it
|
||||
- Success rate of certain [crimes](crimes.md)
|
||||
- Time needed to create a [Program](programs.md)
|
||||
- [Faction](factions.md) [Reputation](reputation.md) gain when carrying out Hacking Contracts or Field Work
|
||||
- [Company](companies.md) [Reputation](reputation.md) gain for certain jobs
|
||||
|
||||
Gain Hack experience by:
|
||||
|
||||
- Manually hacking servers through the [Terminal](terminal.md)
|
||||
- Using `ns.hack()`, `ns.grow()`, or `ns.weaken()` through scripts
|
||||
- Committing certain [crimes](crimes.md)
|
||||
- Carrying out Hacking Contracts or doing Field work for [Factions](factions.md)
|
||||
- Some [Company](companies.md) jobs and other types of work
|
||||
- Studying at a university
|
||||
|
||||
## Combat Skills
|
||||
|
||||
### Strength, Defense, Dexterity, and Agility
|
||||
|
||||
These represent your physical skill and attributes, including your ability to sneak, inflict or endure damage, and pull off high precision tasks. Similar to your Hack skill, you will be offered [Faction](factions.md) [Augmentations](augmentations.md) to multiplicatively enhance your Combat Skills and exp gain.
|
||||
|
||||
Affects:
|
||||
|
||||
- HP scales with Defense. Infiltration and some jobs may cause you to take damage.
|
||||
- Success rate of certain [crimes](crimes.md)
|
||||
- [Faction](factions.md) [Reputation](reputation.md) gain for Security and Field Work
|
||||
- [Company](companies.md) [Reputation](reputation.md) gain for certain jobs
|
||||
|
||||
Gain experience by:
|
||||
|
||||
- Working out at a gym
|
||||
- Committing certain [crimes](crimes.md)
|
||||
- Doing Security or Field Work for a [Faction](factions.md)
|
||||
- Working certain jobs at a [Company](companies.md)
|
||||
|
||||
## Charisma
|
||||
|
||||
Rarely as useful as Hacking and Physical skills, Charisma can help get a company job, gain trust, or calm chaos in social situations.
|
||||
|
||||
Charisma can also be enhanced with [Augmentations](augmentations.md).
|
||||
|
||||
Affects:
|
||||
|
||||
- Success rate of certain [crimes](crimes.md)
|
||||
- [Faction](factions.md) [Reputation](reputation.md) gain for Field Work
|
||||
- [Company](companies.md) [Reputation](reputation.md) gain for most jobs
|
||||
|
||||
Gain experience by:
|
||||
|
||||
- Committing certain [crimes](crimes.md)
|
||||
- Studying at a university
|
||||
- Working certain jobs at a [Company](companies.md)
|
||||
- Doing Field work for a [Faction](factions.md)
|
||||
|
||||
### Other Stats and abilities are available in later stages of the game.
|
||||
@@ -0,0 +1,185 @@
|
||||
# Stock Market
|
||||
|
||||
The Stock Market refers to the World Stock Exchange (WSE), through which you can buy and sell stocks in order to make money.
|
||||
|
||||
The WSE can be found in the `City` tab, and is accessible in every city.
|
||||
|
||||
## Fundamentals
|
||||
|
||||
The Stock Market is not as simple as "buy at price X and sell at price Y".
|
||||
The following are several fundamental concepts you need to understand about the stock market.
|
||||
|
||||
For those that have experience with finance/trading/investing, please be aware that the game's stock market does not function exactly like it does in the real world.
|
||||
So these concepts below should seem similar, but won't be exactly the same.
|
||||
|
||||
## Positions: Long vs Short
|
||||
|
||||
First off, note that _all_ transactions have a flat commission fee, so
|
||||
high-frequency trading is not a good strategy.
|
||||
|
||||
When making a transaction on the stock market, there are two types of positions: Long and Short.
|
||||
A Long position is the typical scenario where you buy a stock and earn a profit if the price of that stock increases.
|
||||
Meanwhile, a Short position is the exact opposite.
|
||||
|
||||
In a Short position, you borrow shares of a stock to sell and earn a profit if the price of that stock decreases.
|
||||
This is also called 'shorting' a stock. The proceeds from the sale are held as
|
||||
collateral, called 'margin'. You also have to add additional margin equal to
|
||||
the current value of the stock - this is the cost to 'purchase' the short.
|
||||
|
||||
When you close a short position, you buy back the shares to pay back the securities loan.
|
||||
You then get the margin back, minus whatever was used to repurchase the shares.
|
||||
So, your profit is still the change in price times the number of shares.
|
||||
Beware that, unlike Long positions which have unlimited upside and limited
|
||||
downside, shorts have limited upside and unlimited downside, and selling a
|
||||
sufficiently underwater short can cause your money to go negative.
|
||||
|
||||
Shorting stocks is not available immediately, and must be unlocked later in the game.
|
||||
|
||||
## Forecast & Second-Order Forecast
|
||||
|
||||
A stock's forecast is its likelihood of increasing or decreasing in value.
|
||||
The forecast is typically represented by its probability of increasing in either a decimal or percentage form.
|
||||
For example, a forecast of `70%` means the stock has a `70%` chance of increasing and a `30%` chance of decreasing.
|
||||
|
||||
A stock's second-order forecast is the target value that its forecast trends towards.
|
||||
For example, if a stock has a forecast of `60%` and a second-order forecast of `70%`, then the stock's forecast should slowly trend towards `70%` over time.
|
||||
However, this is determined by RNG so there is a chance that it may never reach `70%`.
|
||||
|
||||
Both the forecast and the second-order forecast change over time.
|
||||
|
||||
A stock's forecast can be viewed after purchasing Four Sigma (4S) Market Data access.
|
||||
This lets you see the forecast info on the Stock Market UI.
|
||||
If you also purchase access to the 4S Market Data TIX API, then you can view a stock's forecast using the `getStockForecast` function.
|
||||
|
||||
A stock's second-order forecast is always hidden.
|
||||
|
||||
## Spread (Bid Price & Ask Price)
|
||||
|
||||
The **bid price** is the maximum price at which someone will buy a stock on the stock market.
|
||||
|
||||
The **ask price** is the minimum price that a seller is willing to receive for a stock on the stock market
|
||||
|
||||
The ask price will always be higher than the bid price (This is because if a seller is willing to receive less than the bid price, that transaction is guaranteed to happen).
|
||||
The difference between the bid and ask price is known as the **spread**.
|
||||
A stock's "price" will be the average of the bid and ask price.
|
||||
|
||||
The bid and ask price are important because these are the prices at which a transaction actually occurs.
|
||||
If you purchase a stock in the long position, the cost of your purchase depends on that stock's ask price.
|
||||
If you then try to sell that stock (still in the long position), the price at which you sell is the stock's bid price.
|
||||
Note that this is reversed for a short position.
|
||||
Purchasing a stock in the short position will occur at the stock's bid price, and selling a stock in the short position will occur at the stock's ask price.
|
||||
|
||||
## Transactions Influencing Stock Forecast
|
||||
|
||||
Buying or selling a large number of shares of a stock will influence that stock's forecast & second-order forecast.
|
||||
The forecast is the likelihood that the stock will increase or decrease in price.
|
||||
The magnitude of this effect depends on the number of shares being transacted.
|
||||
More shares will have a bigger effect.
|
||||
|
||||
The effect that transactions have on a stock's second-order forecast is significantly smaller than the effect on its forecast.
|
||||
|
||||
## Order Types
|
||||
|
||||
There are three different types of orders you can make to buy or sell stocks on the exchange:
|
||||
Market Order, Limit Order, and Stop Order.
|
||||
|
||||
Limit Orders and Stop Orders are not available immediately, and must be unlocked later in the game.
|
||||
|
||||
When you place a Market Order to buy or sell a stock, the order executes immediately at whatever the current price of the stock is.
|
||||
For example if you choose to short a stock with 5000 shares using a Market Order, you immediately purchase those 5000 shares in a Short position at whatever the current market price is for that stock.
|
||||
|
||||
A Limit Order is an order that only executes under certain conditions.
|
||||
A Limit Order is used to buy or sell a stock at a specified price or better.
|
||||
For example, lets say you purchased a Long position of 100 shares of some stock at a price of \$10 per share.
|
||||
You can place a Limit Order to sell those 100 shares at \$50 or better.
|
||||
The Limit Order will execute when the price of the stock reaches a value of \$50 or higher.
|
||||
|
||||
A Stop Order is the opposite of a Limit Order.
|
||||
It is used to buy or sell a stock at a specified price (before the price gets 'worse').
|
||||
For example, lets say you purchased a Short position of 100 shares of some stock at a price of \$100 per share.
|
||||
The current price of the stock is \$80 (a profit of \$20 per share).
|
||||
You can place a Stop Order to sell the Short position if the stock's price reaches \$90 or higher.
|
||||
This can be used to lock in your profits and limit any losses.
|
||||
|
||||
Here is a summary of how each order works and when they execute:
|
||||
|
||||
**In a LONG Position:**
|
||||
|
||||
A Limit Order to buy will execute if the stock's price <= order's price
|
||||
|
||||
A Limit Order to sell will execute if the stock's price >= order's price
|
||||
|
||||
A Stop Order to buy will execute if the stock's price >= order's price
|
||||
|
||||
A Stop Order to sell will execute if the stock's price <= order's price
|
||||
|
||||
**In a SHORT Position:**
|
||||
|
||||
A Limit Order to buy will execute if the stock's price >= order's price
|
||||
|
||||
A Limit Order to sell will execute if the stock's price <= order's price
|
||||
|
||||
A Stop Order to buy will execute if the stock's price <= order's price
|
||||
|
||||
A Stop Order to sell will execute if the stock's price >= order's price.
|
||||
|
||||
## Player Actions Influencing Stocks
|
||||
|
||||
It is possible for your actions elsewhere in the game to influence the stock market.
|
||||
|
||||
### Hacking
|
||||
|
||||
If a server has a corresponding stock (e.g. _foodnstuff_ server -> FoodNStuff stock), then hacking that server can decrease the stock's second-order forecast.
|
||||
This causes the corresponding stock's forecast to trend downwards in value over time.
|
||||
|
||||
This effect only occurs if you set the stock option to true when calling the `hack` function.
|
||||
The chance that hacking a server will cause this effect is based on what percentage of the server's total money you steal.
|
||||
|
||||
A single hack will have a minor effect, but continuously hacking a server for lots of money over time will have a noticeable effect in making the stock's forecast trend downwards.
|
||||
|
||||
### Growing
|
||||
|
||||
If a server has a corresponding stock (e.g. `foodnstuff` server -> FoodNStuff stock), then growing that server's money can increase the stock's second-order forecast.
|
||||
This causes the corresponding stock's forecast to trend upwards in value over time.
|
||||
|
||||
This effect only occurs if you set the `stock` option to true when calling the `grow` function.
|
||||
The chance that growing a server will cause this effect is based on what percentage of the server's total money to add to it.
|
||||
|
||||
A single grow operation will have a minor effect, but continuously growing a server for lots of money over time will have a noticeable effect in making the stock's forecast trend upwards.
|
||||
|
||||
### Working for a Company
|
||||
|
||||
If a [Company](companies.md) has a corresponding stock, then working for that [Company](companies.md) will increase the corresponding stock's second-order forecast.
|
||||
This will cause the stock's forecast to (slowly) trend upwards in value over time.
|
||||
|
||||
The potency of this effect is based on how effective you are when you work (i.e. it's based on your stats and multipliers).
|
||||
|
||||
## Automating the Stock Market
|
||||
|
||||
You can write scripts to perform automatic and algorithmic trading on the Stock Market.
|
||||
See [TIX API](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.tix.md) for more details.
|
||||
|
||||
## Under the Hood
|
||||
|
||||
Stock prices are updated every ~6 seconds.
|
||||
|
||||
Whether a stock's price moves up or down is random.
|
||||
However, stocks have properties that can influence the way their price moves.
|
||||
These properties are hidden, although some of them can be made visible by purchasing the Four Sigma (4S) Market Data upgrade.
|
||||
Some examples of these properties are:
|
||||
|
||||
- Volatility
|
||||
- Likelihood of increasing or decreasing (i.e. the stock's forecast)
|
||||
- Likelihood of forecast increasing or decreasing (i.e. the stock's second-order forecast)
|
||||
- How easily a stock's price/forecast is influenced by transactions
|
||||
- Spread percentage
|
||||
- Maximum price (not a real maximum, more of a "soft cap")
|
||||
|
||||
Each stock has its own unique values for these properties.
|
||||
|
||||
## Offline Progression
|
||||
|
||||
The Stock Market does not change or process anything while the game has closed.
|
||||
However, it does accumulate time when offline.
|
||||
This accumulated time allows the stock market to run `50%` faster when the game is opened again.
|
||||
This means that stock prices will update every ~4 seconds instead of 6.
|
||||
@@ -0,0 +1,102 @@
|
||||
# Terminal
|
||||
|
||||
The Terminal is a console emulator program that lets you interface with other [Servers](servers.md) in the game.
|
||||
It can be accessed by clicking the `Terminal` tab on the navigation menu on the left-hand side of the game (you may need to expand the 'Hacking' header in order to see the `Terminal` tab).
|
||||
Alternatively, the shortcut Alt + t can be used to open the Terminal.
|
||||
|
||||
## Filesystem (Directories)
|
||||
|
||||
The Terminal contains a very basic filesystem to help you organize files into different directories.
|
||||
Note that this is **not** a _true_ filesystem implementation and instead relies almost entirely on string manipulation.
|
||||
For this reason, some features found in real-world filesystems do not exist in our Terminal. For example:
|
||||
|
||||
- Tab autocompletion does not work with relative paths
|
||||
- **`mv` and `rm` commands only accept full filepaths in their arguments.**
|
||||
**They do not act on directories.**
|
||||
|
||||
These features are typically in Linux filesystems and have not yet been added to the game.
|
||||
|
||||
## Directories
|
||||
|
||||
In order to create a directory, simply name a file using a full absolute Linux-style path:
|
||||
|
||||
/scripts/myScript.js
|
||||
|
||||
This will automatically create a "directory" called `scripts`.
|
||||
This will also work for subdirectories:
|
||||
|
||||
/scripts/hacking/helpers/myHelperScripts.js
|
||||
|
||||
Files in the root directory do not need to begin with a forward slash:
|
||||
|
||||
thisIsAFileInTheRootDirectory.txt
|
||||
|
||||
Note that **there is no way to manually create or remove directories.**
|
||||
Creation and deletion of "directories" is automatically handled as you create, rename, or delete files in game.
|
||||
|
||||
## Absolute vs Relative Paths
|
||||
|
||||
Many Terminal commands accept both absolute and relative paths for specifying a file.
|
||||
|
||||
An absolute path specifies the location of the file from the root directory (/).
|
||||
Any path that begins with the forward slash is an absolute path:
|
||||
|
||||
$ nano /scripts/myScript.js
|
||||
$ cat /serverList.txt
|
||||
|
||||
A relative path specifies the location of the file relative to the current working directory.
|
||||
Any path that does **not** begin with a forward slash is a relative path.
|
||||
Note that the Linux-style dot symbols will work for relative paths:
|
||||
|
||||
. (a single dot) - represents the current directory
|
||||
.. (two dots) - represents the parent directory
|
||||
|
||||
$ cd ..
|
||||
$ nano ../scripts/myScript.js
|
||||
$ nano ../../helper.js
|
||||
|
||||
For additional details about specifying paths and references in scripts, see [Scripts](scripts.md).
|
||||
|
||||
## Argument Parsing
|
||||
|
||||
When evaluating a terminal command, arguments are initially parsed based on whitespace (usually spaces).
|
||||
Each whitespace character signifies the end of an argument, and potentially the start of new one.
|
||||
For most terminal commands, this is all you need to know.
|
||||
|
||||
When running scripts, however, it may be important to know specific detail, especially two main points:
|
||||
|
||||
- Quotation marks can be used to wrap a single argument and force it to be parsed as a string.
|
||||
Any whitespace inside the quotation marks will not cause a new argument to be parsed.
|
||||
- Anything that can represent a number is automatically cast to a number, unless it's surrounded by quotation marks.
|
||||
|
||||
Here's an example to show how these rules work.
|
||||
Consider the following script `argType.js`:
|
||||
|
||||
export async function main(ns) {
|
||||
ns.tprint("Number of args: " + ns.args.length);
|
||||
for (var i = 0; i < ns.args.length; ++i) {
|
||||
ns.tprint(typeof ns.args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Then if we run the following terminal command:
|
||||
|
||||
$ run argType.js 123 1e3 "5" "this is a single argument"
|
||||
|
||||
We'll see the following in the Terminal:
|
||||
|
||||
Running script with 1 thread(s), pid 1 and args: [123, 1000, "5", "this is a single argument"].
|
||||
argType.js: Number of args: 4
|
||||
argType.js: number
|
||||
argType.js: number
|
||||
argType.js: string
|
||||
argType.js: string
|
||||
|
||||
## Chaining Commands
|
||||
|
||||
You can run multiple Terminal commands at once by separating each command
|
||||
with a semicolon (;). For example:
|
||||
|
||||
$ run foo.js; tail foo.js
|
||||
|
||||
Chained commands do **not** wait for functions like `hack` or `wget` to finish executing, and so may not always work as expected.
|
||||
@@ -0,0 +1,13 @@
|
||||
# World
|
||||
|
||||
In Bitburner, the world consists of six different cities:
|
||||
|
||||
- Sector-12 (this is where you start out)
|
||||
- Aevum
|
||||
- Ishima
|
||||
- New Tokyo
|
||||
- Chongqing
|
||||
- Volhaven
|
||||
|
||||
Each city has its own map and [Factions](factions.md).
|
||||
Each city also offers different services such as gyms, universities, hardware stores, and places of work.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,659 @@
|
||||
# Changelog - Legacy v1
|
||||
|
||||
## v1.6.3 - 2022-04-01 Few stanek fixes
|
||||
|
||||
Stanek Gift
|
||||
|
||||
- Has a minimum size of 2x3
|
||||
- Active Fragment property 'avgCharge' renamed to 'highestCharge'
|
||||
- Formula for fragment effect updated to make 561% more sense.
|
||||
Now you can charge to your heart content.
|
||||
- Logs for the 'chargeFragment' function updated.
|
||||
|
||||
Misc.
|
||||
|
||||
- Nerf noodle bar.
|
||||
|
||||
## v1.6.0 - 2022-03-29 Grafting
|
||||
|
||||
** Vitalife secret lab **
|
||||
|
||||
- A new mechanic called Augmentation Grafting has been added. Resleeving has been removed.
|
||||
- Credit to @violet for her incredible work.
|
||||
|
||||
** Stanek **
|
||||
|
||||
- BREAKING: Many functions in the stanek API were renamed in order to avoid name collision with things like Map.prototype.get
|
||||
|
||||
** UI **
|
||||
|
||||
- Major update to Sleeve, Gang UI, and Create Program (@violet)
|
||||
- re-add pre tags to support slash n in prompt (@jacktose)
|
||||
- Tabelize linked output of 'ls' (@Master-Guy)
|
||||
- Add the ability to filter open scripts (@phyzical)
|
||||
- Add minHeight to editor tabs (@violet)
|
||||
- Properly expand gang equipment cards to fill entire screen (@violet)
|
||||
- Add shortcut to Faction augmentations page from FactionsRoot (@violet)
|
||||
- Fix extra space on editor tabs (@violet)
|
||||
- Present offline message as list (@DSteve595)
|
||||
- add box showing remaining augments per faction (@jjayeon)
|
||||
- Add tab switching support to vim mode (@JParisFerrer)
|
||||
- Show current task on gang management screen (@zeddrak)
|
||||
- Fix for ui of gang members current task when set via api (@phyzical)
|
||||
- Don't hide irrelevant materials if their stock is not empty and hide irrelevant divisions from Export (@SagePtr)
|
||||
- Fix regex to enable alpha transparency hex codes (8 digits) (@surdaft)
|
||||
|
||||
** API **
|
||||
|
||||
- Added dark web functions to ns api
|
||||
- BREAKING: purchaseTor() should returns true if player already has Tor. (@DavidGrinberg, @waffleattack)
|
||||
- Implement getBonusTime in Corporation API (@t-wolfeadam)
|
||||
- Added functions to purchase TIX and WSI (@incubusnb)
|
||||
- purchaseSleeveAug checks shock value (@incubusnb)
|
||||
- Fix bug with hacknet api
|
||||
- Fix spendHashes bug
|
||||
- Added 0 cost of asleep() (@Master-Guy)
|
||||
- Fix some misleading corporation errors (@TheRealMaxion)
|
||||
- expose the inBladeburner on the player object (@phyzical)
|
||||
- added ram charge for stanek width and height (@phyzical)
|
||||
- Fix sufficient player money check to buy back shares. (@ChrissiQ)
|
||||
- Fix Static Ram Circumventing for some NS functions (@CrafterKolyan)
|
||||
- added CorporationSoftCap to NetscriptDefinitions (@phyzical)
|
||||
- Added definition of autocomplete() 'data' argument. (@tigercat2000)
|
||||
- Adding support for text/select options in Prompt command (@PhilipArmstead)
|
||||
- Added the ability to exportGame via api (@phyzical)
|
||||
|
||||
** Arcade **
|
||||
|
||||
- Added an arcade to New Tokyo where you can play a 4 year old version of bitburner.
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Add a warning triggered while auto-saves are off. (@MartinFournier)
|
||||
- Log info for field analysis now displays actual rank gained. (@ApamNapat)
|
||||
- Removed BladeburnerSkillCost from skill point cost description. (@ApamNapat)
|
||||
- Fix handling for UpArrow in bladeburner console. (@dowinter)
|
||||
- Add GitHub action to check PRs for generated files. (@MartinFournier)
|
||||
- Cap Staneks gift at 25x25 to prevent crashes. (@waffleattack)
|
||||
- Remove old & unused files from repository. (@MartinFournier)
|
||||
- Factions on the factions screens are sorted by story progress / type. (@phyzical)
|
||||
- Fix log manager not picking up new runs of scripts. (@phyzical)
|
||||
- Added prettier to cicd.
|
||||
- UI improvements (@phyzical)
|
||||
- Documentation / Typos (@nanogyth, @Master-Guy, @incubusnb, @ApamNapat, @phyzical, @SagePtr)
|
||||
- Give player code a copy of Division.upgrades instead of the live object (@Ornedan)
|
||||
- Fix bug with small town achievement.
|
||||
- Fix bug with purchaseSleeveAug (@phyzical)
|
||||
- Check before unlocking corp upgrade (@gianfun)
|
||||
- General codebase improvements. (@phyzical, @Master-Guy, @ApamNapat)
|
||||
- Waiting on promises in NS1 no longer freezes the script. (@Master-Guy)
|
||||
- Fix bug with missing ramcost for tFormat (@TheMas3212)
|
||||
- Fix crash with new prompt
|
||||
- Quick fix to prevent division by 0 in terminal (@Master-Guy)
|
||||
- removed ip references (@phyzical, @Master-Guy)
|
||||
- Terminal now supports 'ls -l'
|
||||
- Fix negative number formatting (@Master-Guy)
|
||||
- Fix unique ip generation (@InDieTasten)
|
||||
- remove terminal command theme from docs (@phyzical)
|
||||
- Fix 'Augmentations Left' with gang factions (@violet)
|
||||
- Attempt to fix 'bladeburner.process()' early routing issue (@MartinFournier)
|
||||
- work in progress augment fix (@phyzical)
|
||||
- Fixes missing space in Smart Supply (@TheRealMaxion)
|
||||
- Change license to Apache 2 with Commons Clause
|
||||
- updated regex sanitization (@mbrannen)
|
||||
- Sleeve fix for when faction isnt found (@phyzical)
|
||||
- Fix editor "close" naming (@phyzical)
|
||||
- Fix bug with sleeves where some factions would be listed as workable. (@phyzical)
|
||||
- Fix research tree of product industries post-prestige (@pd)
|
||||
- Added a check for exisiting industry type before expanding (@phyzical)
|
||||
- fix hackAnalyzeThreads returning infinity (@chrisrabe)
|
||||
- Make growthAnalyze more accurate (@dwRchyngqxs)
|
||||
- Add 'Zoom -> Reset Zoom' command to Steam (@smolgumball)
|
||||
- Add hasOwnProperty check to GetServer (@SagePtr)
|
||||
- Speed up employee productivity calculation (@pd)
|
||||
- Field Work and Security Work benefit from 'share' (@SagePtr)
|
||||
- Nerf noodle bar.
|
||||
|
||||
## v1.5.0 - Steam Cloud integration
|
||||
|
||||
** Steam Cloud Saving **
|
||||
|
||||
- Added support for steam cloud saving (@MartinFournier)
|
||||
|
||||
** UI **
|
||||
|
||||
- background now matches game primary color (@violet)
|
||||
- page title contains version (@MartinFourier)
|
||||
- Major text editor improvements (@violet)
|
||||
- Display bonus time on sleeve page (@MartinFourier)
|
||||
- Several UI improvements (@violet, @smolgumball, @DrCuriosity, @phyzical)
|
||||
- Fix aug display in alpha (@Dominik Winter)
|
||||
- Fix display of corporation product equation (@SagePtr)
|
||||
- Make Bitverse more accessible (@ChrissiQ)
|
||||
- Make corporation warehouse more accessible (@ChrissiQ)
|
||||
- Make tab style more consistent (@violet)
|
||||
|
||||
** Netscript **
|
||||
|
||||
- Fix bug with async.
|
||||
- Add 'printf' ns function (@Ninetailed)
|
||||
- Remove blob caching.
|
||||
- Fix formulas access check (@Ornedan)
|
||||
- Fix bug in exp calculation (@qcorradi)
|
||||
- Fix NaN comparison (@qcorradi)
|
||||
- Fix travelToCity with bad argument (@SlyCedix)
|
||||
- Fix bug where augs could not be purchased via sing (@reacocard)
|
||||
- Fix rounding error in donateToFaction (@Risenafis)
|
||||
- Fix bug with weakenAnalyze (@rhobes)
|
||||
- Prevent exploit with atExit (@Ornedan)
|
||||
- Double 'share' power
|
||||
|
||||
** Corporations **
|
||||
|
||||
- Fix bugs with corp API (@pigalot)
|
||||
- Add smart supply func to corp API (@pd)
|
||||
|
||||
** Misc. **
|
||||
|
||||
- The file API now allows GET and DELETE (@lordducky)
|
||||
- Force achievement calculation on BN completion (@SagePtr)
|
||||
- Cleanup in repository (@MartinFourier)
|
||||
- Several improvements to the electron version (@MartinFourier)
|
||||
- Fix bug with casino roulette (@jamie-mac)
|
||||
- Terminal history persists in savefile (@MartinFourier)
|
||||
- Fix tests (@jamie-mac)
|
||||
- Fix crash with electron windows tracker (@smolgumball)
|
||||
- Fix BN6/7 passive reputation gain (@BrianLDev)
|
||||
- Fix Sleeve not resetting on install (@waffleattack)
|
||||
- Sort joined factions (@jjayeon)
|
||||
- Update documentation / typo (@lethern, @Meowdoleon, @JohnnyUrosevic, @JosephDavidTalbot,
|
||||
@pd, @lethern, @lordducky, @zeddrak, @fearnlj01, @reasonablytall, @MatthewTh0,
|
||||
@SagePtr, @manniL, @Jedimaster4559, @loganville, @Arrow2thekn33, @wdpk, @fwolfst,
|
||||
@fschoenfeldt, @Waladil, @AdamTReineke, @citrusmunch, @factubsio, @ashtongreen,
|
||||
@ChrissiQ, @DJ-Laser, @waffleattack, @ApamNapat, @CrafterKolyan, @DSteve595)
|
||||
- Nerf noodle bar.
|
||||
|
||||
## v1.4.0 - 2022-01-18 Sharing is caring
|
||||
|
||||
** Computer sharing **
|
||||
|
||||
- A new mechanic has been added, it's is invoked by calling the new function 'share'.
|
||||
This mechanic helps you farm reputation faster.
|
||||
|
||||
** gang **
|
||||
|
||||
- Installing augs means losing a little bit of ascension multipliers.
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Prevent gang API from performing actions for the type of gang they are not. (@TheMas3212)
|
||||
- Fix donation to gang faction. (@TheMas3212)
|
||||
- Fix gang check crashing the game. (@TheMas3212)
|
||||
- Make time compression more robust.
|
||||
- Fix bug with scp.
|
||||
- Add zoom to steam version. (@MartinFourier)
|
||||
- Fix donateToFaction accepts donation of NaN. (@woody-lam-cwl)
|
||||
- Show correct hash capacity gain on cache level upgrade tooltip. (@woody-lam-cwl)
|
||||
- Fix tests (@woody-lam-cwl)
|
||||
- Fix cache tooltip (@woody-lam-cwl)
|
||||
- Added script to prettify save file for debugging (@MartinFourier)
|
||||
- Update documentation / typos (@theit8514, @thadguidry, @tigercat2000, @SlyCedix, @Spacejoker, @KenJohansson,
|
||||
@Ornedan, @JustAnOkapi, @violet, @philarmstead, @TheMas3212, @dcragusa, @XxKingsxX-Pinu,
|
||||
@paiv, @smolgumball, @zeddrak, @stinky-lizard, @violet, @Feodoric, @daanflore,
|
||||
@markusariliu, @mstruebing, @erplsf, @waffleattack, @Dexalt142, @AIT-OLPE, @deathly809, @BuckAMayzing,
|
||||
@MartinFourier, @pigalot, @lethern)
|
||||
- Fix BN3+ achievement (@SagePtr)
|
||||
- Fix reputation carry over bug (@TheMas3212)
|
||||
- Add button to exit infiltrations (@TheMas3212)
|
||||
- Add dev menu achievement check (@TheMas3212)
|
||||
- Add 'host' config for electron server (@MartinFourier)
|
||||
- Suppress save toast only works for autosave (@MartinFourier)
|
||||
- Fix some achievements not triggering with 'backdoor' (@SagePtr)
|
||||
- Update Neuroflux Governor description.
|
||||
- Fix bug with electron server.
|
||||
- Fix bug with corporation employee assignment function (@Ornedan)
|
||||
- Add detailed information to terminal 'mem' command (@MartinFourier)
|
||||
- Add savestamp to savefile (@MartinFourier)
|
||||
- Dev menu can apply export bonus (@MartinFourier)
|
||||
- Icarus message no longer applies on top of itself (@Feodoric)
|
||||
- purchase augment via API can no longer buy Neuroflux when it shouldn't (@Feodoric)
|
||||
- Syntax highlighter should be smarter (@neuralsim)
|
||||
- Fix some miscalculation when calculating money stolen (@zeddrak)
|
||||
- Fix max cache achievement working with 0 cache (@MartinFourier)
|
||||
- Add achievements in the game, not just steam (@MartinFourier)
|
||||
- Overflow hash converts to money automatically (@MartinFourier)
|
||||
- Make mathjax load locally (@MartinFourier)
|
||||
- Make favor calculation more efficient (@kittycat2002)
|
||||
- Fix some scripts crashing the game on startup (@MartinFourier)
|
||||
- Toasts will appear above tail window (@MartinFourier)
|
||||
- Fix issue that can cause terminal actions to start on one server and end on another (@MartinFourier)
|
||||
- Fix 'fileExists' not correctly matching file names (@TheMas3212)
|
||||
- Refactor some code to be more efficient (@TheMas3212)
|
||||
- Fix exp gain for terminal grow and weaken (@violet)
|
||||
- Refactor script death code to reject waiting promises instead of resolving (@Ornedan)
|
||||
- HP recalculates on defense exp gain (@TheMas3212)
|
||||
- Fix log for ascendMember (@TheMas3212)
|
||||
- Netscript ports clear on reset (@TheMas3212)
|
||||
- Fix bug related to company (@TheMas3212)
|
||||
- Fix bug where corporation handbook would not be correctly added (@TheMas3212)
|
||||
- Servers in hash upgrades are sorted alpha (@MartinFourier)
|
||||
- Fix very old save not properly migrating augmentation renamed in 0.56 (@MartinFourier)
|
||||
- Add font height and line height in theme settings (@MartinFourier)
|
||||
- Fix crash when quitting job (@MartinFourier)
|
||||
- Added save file validation system (@TheMas3212)
|
||||
- React and ReactDOM are now global objects (@pigalot)
|
||||
- 'nano' supports globs (@smolgumball)
|
||||
- Character overview can be dragged (@MartinFourier)
|
||||
- Job page updates in real time (@violet)
|
||||
- Company favor gain uses the same calculation as faction, this is just performance
|
||||
the value didn't change (@violet)
|
||||
- ns2 files work with more import options (@theit8514)
|
||||
- Allow autocomplete for partial executables (@violet)
|
||||
- Add support for contract completion (@violet)
|
||||
- 'ls' link are clickable (@smolgumball)
|
||||
- Prevent steam from opening external LOCAL files (@MartinFourier)
|
||||
- Fix a bug with autocomplete (@Feodoric)
|
||||
- Optimise achievement checks (@Feodoric)
|
||||
- Hacknet server achievements grant associated hacknet node achievement (@Feodoric)
|
||||
- Fix display bug with hacknet (@Feodoric)
|
||||
- 'analyze' now says if the server is backdoored (@deathly809)
|
||||
- Add option to exclude running script from save (@MartinFourier)
|
||||
- Game now catches more errors and redirects to recovery page (@MartinFourier)
|
||||
- Fix bug with autocomplete (@violet)
|
||||
- Add tooltip to unfocus work (@violet)
|
||||
- Add detailst overview (@MartinFourier)
|
||||
- Fix focus bug (@deathly809)
|
||||
- Fix some NaN handling (@deathly809)
|
||||
- Added 'mv' ns function (@deathly809)
|
||||
- Add focus argument to some singularity functions (@violet)
|
||||
- Fix some functions not disabling log correctly (@deathly809)
|
||||
- General UI improvements (@violet)
|
||||
- Handle steamworks errors gravefully (@MartinFourier)
|
||||
- Fix some react component not unmounting correctly (@MartinFourier)
|
||||
- 'help' autocompletes (@violet)
|
||||
- No longer push all achievements to steam (@Ornedan)
|
||||
- Recovery page has more information (@MartinFourier)
|
||||
- Added 'getGameInfo' ns function (@MartinFourier)
|
||||
- SF3.3 unlocks all corp API (@pigalot)
|
||||
- Major improvements to corp API (@pigalot)
|
||||
- Prevent seed money outside BN3 (@pigalot)
|
||||
- Fix bug where using keyboard shortcuts would crash if the feature is not available (@MartinFourier)\
|
||||
- Sidebar remains opened/closed on save (@MartinFourier)
|
||||
- Added tooltip to sidebar when closed (@MartinFourier)
|
||||
- Fix bug where Formulas.exe is not available when starting BN5 (@TheMas3212)
|
||||
- Fix CI (@tvanderpol)
|
||||
- Change shortcuts to match sidebar (@MartinFourier)
|
||||
- Format gang respect (@attrib)
|
||||
- Add modal to text editor with ram details (@violet)
|
||||
- Fix several bugs with singularity focus (@violet)
|
||||
- Nerf noodle bar.
|
||||
|
||||
## v1.3.0 - 2022-01-04 Cleaning up
|
||||
|
||||
** External IDE integration **
|
||||
|
||||
- The Steam version has a webserver that allows integration with external IDEs.
|
||||
A VSCode extension is available on the market place. (The documentation for the ext. isn't
|
||||
written yet)
|
||||
|
||||
** Source-Files **
|
||||
|
||||
- SF4 has been reworked.
|
||||
- New SF -1.
|
||||
|
||||
** UI **
|
||||
|
||||
- Fix some edge case with skill bat tooltips (@MartinFournier)
|
||||
- Made some background match theme color (@Kejikus)
|
||||
- Fix problem with script editor height not adjusting correctly (@billyvg)
|
||||
- Fix some formatting issues with Bladeburner (@MartinFournier, @violet)
|
||||
- Fix some functions like 'alert' format messages better (@MageKing17)
|
||||
- Many community themes added.
|
||||
- New script editor theme (@Hedrauta, @Dexalt142)
|
||||
- Improvements to tail windows (@theit8514)
|
||||
- Training is more consise (@mikomyazaki)
|
||||
- Fix Investopedia not displaying properly (@JotaroS)
|
||||
- Remove alpha from theme editor (@MartinFournier)
|
||||
- Fix corporation tooltip not displaying properly (@MartinFournier)
|
||||
- Add tooltip on backdoored location names (@MartinFournier)
|
||||
- Allow toasts to be dismissed by clicking them (@violet)
|
||||
- Darkweb item listing now shows what you own. (@hexnaught)
|
||||
|
||||
** Bug fix **
|
||||
|
||||
- Fix unit tests (@MartinFournier)
|
||||
- Fixed issue with 'cat' and 'read' not finding foldered files (@Nick-Colclasure)
|
||||
- Buying on the dark web will remove incomplete exe (@hexnaught)
|
||||
- Fix bug that would cause the game to crash trying to go to a job without a job (@hexnaught)
|
||||
- purchaseServer validation (@violet)
|
||||
- Script Editor focuses code when changing tab (@MartinFournier)
|
||||
- Fix script editor for .txt files (@65-7a)
|
||||
- Fix 'buy' command not displaying correctly. (@hexnaught)
|
||||
- Fix hackAnalyzeThread returning NaN (@mikomyazaki)
|
||||
- Electron handles exceptions better (@MageKing17)
|
||||
- Electron will handle 'unresponsive' event and present the opportunity to reload the game with no scripts (@MartinFournier)
|
||||
- Fix 'cp' between folders (@theit8514)
|
||||
- Fix throwing null/undefined errors (@violet)
|
||||
- Allow shortcuts to work when unfocused (@MageKing17)
|
||||
- Fix some dependency issue (@locriacyber)
|
||||
- Fix corporation state returning an object instead of a string (@antonvmironov)
|
||||
- Fix 'mv' overwriting files (@theit8514)
|
||||
- Fix joesguns not being influenced by hack/grow (@dou867, @MartinFournier)
|
||||
- Added warning when opening external links. (@MartinFournier)
|
||||
- Prevent applying for positions that aren't offered (@TheMas3212)
|
||||
- Import has validation (@MartinFournier)
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Added vim mode to script editor (@billyvg)
|
||||
- Clean up script editor code (@Rez855)
|
||||
- 'cat' works on scripts (@65-7a)
|
||||
- Add wordWrap for Monaco (@MartinFournier)
|
||||
- Include map bundles in electron for easier debugging (@MartinFournier)
|
||||
- Fix importing very large files (@MartinFournier)
|
||||
- Cache program blob, reducing ram usage of the game (@theit8514)
|
||||
- Dev menu can set server to \$0 (@mikomyazaki)
|
||||
- 'backdoor' allows direct connect (@mikomyazaki)
|
||||
- Github workflow work (@MartinFournier)
|
||||
- workForFaction / workForCompany have a new parameter (@theit8514)
|
||||
- Alias accept single quotes (@sporkwitch, @FaintSpeaker)
|
||||
- Add grep options to 'ps' (@maxtimum)
|
||||
- Added buy all option to 'buy' (@anthonydroberts)
|
||||
- Added more shortcuts to terminal input (@Frank-py)
|
||||
- Refactor some port code (@ErzengelLichtes)
|
||||
- Settings to control GiB vs GB (@ErzengelLichtes)
|
||||
- Add electron option to export save game (@MartinFournier)
|
||||
- Electron improvements (@MartinFournier)
|
||||
- Expose some notifications functions to electron (@MartinFournier)
|
||||
- Documentation (@MartinFournier, @cyn, @millennIumAMbiguity, @2PacIsAlive,
|
||||
@TheCoderJT, @hexnaught, @sschmidTU, @FOLLGAD, @Hedrauta, @Xynrati,
|
||||
@mikomyazaki, @Icehawk78, @aaronransley, @TheMas3212, @Hedrauta, @alkemann,
|
||||
@ReeseJones, @amclark42, @thadguidry, @jasonhaxstuff, @pan-kuleczka, @jhollowe,
|
||||
@ApatheticsAnonymous, @erplsf, @daanflore, @violet, @Kebap, @smolgumball,
|
||||
@woody-lam-cwl)
|
||||
|
||||
## v1.1.0 - 2021-12-18 You guys are awesome (community because they're god damn awesome)
|
||||
|
||||
** Script Editor **
|
||||
|
||||
- The text editor can open several files at once. (@Rez855 / @Shadow72)
|
||||
It's not perfect so keep the feedback coming.
|
||||
|
||||
** Steam **
|
||||
|
||||
- Windows has a new launch option that lets player start with killing all their scripts
|
||||
This is a safety net in case all the other safety nets fail.
|
||||
- Linux has several launch options that use different flags for different OS.
|
||||
- Debug and Fullscreen are available in the window utility bar.
|
||||
- Tried (and maybe failed) to make the game completely kill itself after closing.
|
||||
This one I still don't know wtf is going.
|
||||
- No longer has background throttling.
|
||||
- Default color should be pitch black when loading
|
||||
- Add BN13: Challenge achievement.
|
||||
|
||||
** Tutorial **
|
||||
|
||||
- I watched someone play bitburner on youtube and reworked part of
|
||||
the tutorial to try to make some parts of the game clearer.
|
||||
https://www.youtube.com/watch?v=-_JETXff4Zo
|
||||
- Add option to restart tutorial.
|
||||
|
||||
** Netscript **
|
||||
|
||||
- getGangInformation returns more information.
|
||||
- getAscensionResult added
|
||||
- getMemberInformation returns more info
|
||||
- Formulas API has new functions for gang.
|
||||
- Added documentation for corp API.
|
||||
- exec has clearer error message when you send invalid data.
|
||||
- getServer returns all defined field for hacknet servers.
|
||||
- Fix a bug with scp multiple files (@theit8514)
|
||||
- Stack traces should be smarter at replacing blobs with filenames
|
||||
- Fix a weird error message that would occur when throwing raw strings.
|
||||
- Fix shortcuts not working.
|
||||
- Re-added setFocus and isFocused (@theit8514)
|
||||
- new function getHashUpgrades (@MartinFournier)
|
||||
- enableLog accepts "ALL" like disableLog (@wynro)
|
||||
- toast() doesn't crash on invalid data (@ivanjermakov)
|
||||
- alert() doesn't crash on invalid data (@Siern)
|
||||
- Fixed an issue where scripts don't run where they should.
|
||||
- Sleeve getInformation now returns cha
|
||||
- getServer does work with no argument now
|
||||
- workForFaction returns false when it mistakenly returned null
|
||||
|
||||
** Character Overview **
|
||||
|
||||
- The character overview now shows the amount of exp needed to next level (@MartinFournier)
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Add option to supress Game Saved! toasts (@MartinFournier)
|
||||
- Fix bug where ctrl+alt+j was eaten by the wrong process. (@billyvg)
|
||||
- Theme Editor lets you paste colors (@MartinFournier)
|
||||
- ctrl + u/k/w should work on terminal (@billyvg)
|
||||
- Game now shows commit number, this is mostly for me. (@MartinFourier)
|
||||
- running a bad script will give a clearer error message (@TheCoderJT)
|
||||
- Default terminal capacity is maximum (@SayntGarmo)
|
||||
- Fix problems with cp and mv (@theit8514)
|
||||
- Make monaco load fully offline for players behind firewalls.
|
||||
- change beginer guide to use n00dles instead of foodnstuff
|
||||
- BN13 is harder
|
||||
- nerf int gain from manualHack
|
||||
- Fix UI displaying wrong stats (@DJMatch3000)
|
||||
- Fix button not disabling as it should.
|
||||
- New location in Ishima.
|
||||
- Add setting to suppress stock market popups.
|
||||
- Typo fixes (@Hedrauta, @cvr-119, @Ationi, @millennIumAMbiguity
|
||||
@TealKoi, @TheCoderJT, @cblte, @2PacIsAlive, @MageKing17,
|
||||
@Xynrati, @Adraxas, @pobiega)
|
||||
- Fix 100% territory achievement.
|
||||
- Reword message on active scripts page.
|
||||
- Fix terminal not clearing after BN
|
||||
- Remove references to .fconf
|
||||
- Augmentation pages shows BN difficulty with SF5
|
||||
- Fix scripts saving on wrong server while 'connect'ing
|
||||
- Fix gym discount not working.
|
||||
- Fix scan-analyze not working with timestamps
|
||||
- Hash upgrades remember last choice.
|
||||
- Save files now sort by date
|
||||
- The covenant no longer supports negative memory purchases
|
||||
- Fix corp shares buyback triggering by pressing enter
|
||||
- Staneks gift display avg / num charges
|
||||
- Infiltration rewards no longer decay with better stats
|
||||
- terminal 'true' is parsed as boolean not string
|
||||
- tail and kill use autocomplete()
|
||||
- Fix focus for coding contract
|
||||
- massive boost to noodle bar.
|
||||
|
||||
** Special Thanks **
|
||||
|
||||
- Special thank you to everyone on Discord who can answer
|
||||
new player questions so I can focus on more important things.
|
||||
|
||||
## v1.1.0 - 2021-12-03 BN13: They're Lunatics (hydroflame & community)
|
||||
|
||||
** BN13: They're Lunatics **
|
||||
|
||||
- BN13 added.
|
||||
|
||||
** Steam **
|
||||
|
||||
- Tested on all 3 major OS.
|
||||
- 94 achievements added
|
||||
- Release is 2021-12-10.
|
||||
|
||||
** Corporation API **
|
||||
|
||||
- Added corporation API. (Unstable)
|
||||
|
||||
** Netscript **
|
||||
|
||||
- tprintf crashes when not giving a format as first arg.
|
||||
- tprintf no longer prints filename (@BartKoppelmans)
|
||||
- TIX buy/sell/sellShort all return askprice/bidprice (@Insight)
|
||||
- getRunningScript now works.
|
||||
- Fix disableLog for gang and TIX API
|
||||
- getOwnedSourceFiles is not singularity anymore (makes it easier to share scripts.) (@theit8514)
|
||||
- true/false is a valid value to send to other scripts.
|
||||
- workForFaction no longer returns null when trying to work for gang.
|
||||
- Scripts logging no longer generates the string if logging is disabled.
|
||||
This should give performance boost for some scripts.
|
||||
|
||||
** Gang **
|
||||
|
||||
- Gang with 0 territory can no longer fight
|
||||
- Territory now caps at exactly 0 or 1.
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Clicking "previous" on the browser will not pretend you had unsaved information
|
||||
allowing you to cancel if needs be.
|
||||
- Fixed some tail box coloring issue.
|
||||
- Fixed BladeBurner getCityCommunities ram cost
|
||||
- The download terminal command no longer duplicate extensions (@Insight)
|
||||
- Fix #000 on #000 text in blackjack. (@Insight)
|
||||
- Remove reference to .fconf
|
||||
- Tail boxes all die on soft reset.
|
||||
- Fix codign contract focus bug.
|
||||
- Megacorp factions simply re-invite you instead of auto added on reset. (@theit8514)
|
||||
- Tail window is bound to html body.
|
||||
- Infiltration reward is tied to your potential stats, not your actual stats
|
||||
So you won't lose reward for doing the same thing over and over.
|
||||
- intelligence lowers program creation requirements.
|
||||
- Terminal parses true as the boolean, not the string.
|
||||
- Tail and kill autocomplete using the ns2 autocomplete feature.
|
||||
- scan-analyze doesn't take up as many terminal entries.
|
||||
- GangOtherInfo documentation now renders correctly.
|
||||
- ActiveScripts search box also searches for script names.
|
||||
- Infinite money no longer allows for infinite hacknet server.
|
||||
- Blackjack doesn't make you lose money twice.
|
||||
- Recent Scripts is now from most to least recent.
|
||||
- Fix mathjax ascii art bug in NiteSec.
|
||||
- Remove warning that the theme editor is slow, it's only slow in dev mode.
|
||||
- In BN8 is it possible to reduce the money on a server without gaining any.
|
||||
- In the options, the timestamp feature has a placeholder explaining the expected format.
|
||||
- Bunch of doc typo fix. (hydroflame & @BartKoppelmans & @cvr-119)
|
||||
- nerf noodle bar
|
||||
|
||||
## v1.0.2 - 2021-11-17 It's the little things (hydroflame)
|
||||
|
||||
** Breaking (very small I promise!) **
|
||||
|
||||
- buy / sell now return getAskPrice / getBidPrice instead of just price.
|
||||
This should help solve some inconsistencies.
|
||||
|
||||
** Misc. **
|
||||
|
||||
- scripts logs are colorized. Start your log with SUCCESS, ERROR, FAIL, WARN, INFO.
|
||||
- documentation for scp not say string | string[]
|
||||
- Donation link updated.
|
||||
- nerf noodle bar
|
||||
|
||||
## v1.0.1 - 2021-11-17 New documentation (hydroflame)
|
||||
|
||||
** Documentation **
|
||||
|
||||
- The new documentation for the netscript API is available at
|
||||
https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.md
|
||||
This documentation is used in-game to validate the code, in-editor to autocomplete, and
|
||||
for users to reference. This is a huge quality of life improvements for me.
|
||||
|
||||
** Reputation **
|
||||
|
||||
- Fixed favor not affecting faction work reputation gain (Yeah, I know right?)
|
||||
|
||||
** Hacknet **
|
||||
|
||||
- Servers are now considerd "purchasedByPlayers"
|
||||
|
||||
** Script Editor **
|
||||
|
||||
- solarized themes now work.
|
||||
|
||||
** Corporation **
|
||||
|
||||
- Dividends are now much more taxed.
|
||||
- The 2 upgrades that reduced taxes are now much stronger.
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Starting / Stopping scripts on hashnet servers immediately updates their hash rate (instead of on the next tick)
|
||||
- Hacknet has tooltip showing what the result of the upgrade would be.
|
||||
- Augmentations page displayes current price multiplier as well as explains the mechanic.
|
||||
- Terminal now is 25x stronger.
|
||||
- Tail boxes use pre-wrap for it's lines.
|
||||
- Tail boxes allow you to rerun dead scripts.
|
||||
- Tail boxes can no longer open the same one twice.
|
||||
- Terminal now autocompletes through aliases.
|
||||
- Make alter reality harder.
|
||||
- Fix bladeburner cancelling actions when manually starting anything with Simulacrum.
|
||||
- Buying hash upgrade to increase uni class or gym training will apply to current class.
|
||||
- Internally the game no longer uses the decimal library.
|
||||
- Fix an issue where 'download \*' would generate weird windows files.
|
||||
- Timestamps can be set to any format in the options.
|
||||
- Fix typo in documentation share popup.
|
||||
- Remove bunch of debug log.
|
||||
- Fix typo in corporation handbook literature.
|
||||
- Fix typo in documentation
|
||||
- Fix duplicate SF -1 exploit. (Yeah, an exploit of exploits, now were meta)
|
||||
- Fix offline hacking earning being attributed to hacknet.
|
||||
- nerf noodle bar
|
||||
|
||||
## v1.0.0 - 2021-11-10 Breaking the API :( (blame hydroflame)
|
||||
|
||||
** Announcement **
|
||||
|
||||
- Several API breaks have been implemented.
|
||||
- See the v1.0.0 migration guide under Documentation
|
||||
- Everyone gets 10 free neuroflux level.
|
||||
|
||||
** Netscript **
|
||||
|
||||
- Fix a bug that would cause RAM to not get recalculated.
|
||||
- New function: hackAnalyzeSecurity
|
||||
- New function: growthAnalyzeSecurity
|
||||
- New function: weakenAnalyze
|
||||
|
||||
** Script Editor **
|
||||
|
||||
- Sometimes warn you about unawaited infinite loops.
|
||||
- ns1 functions are now correctly colors in Monokai.
|
||||
|
||||
** Programs **
|
||||
|
||||
- Formulas.exe is a new program that lets you use the formulas API.
|
||||
|
||||
** Corporations **
|
||||
|
||||
- Real Estate takes up a tiny bit of room.
|
||||
- Dividends are now taxes exponentially in certain bitnodes.
|
||||
- UI displays how many level of each corporation upgrade.
|
||||
- Fix exploit with going public.
|
||||
- Employee salary no longer increase.
|
||||
|
||||
** Documentation **
|
||||
|
||||
- The documentation is now autogenerated into .md files.
|
||||
It is usable but not yet linked to readthedocs. It's on github.
|
||||
|
||||
** Misc. **
|
||||
|
||||
- Favor is not internall floating point. Meaning I don't have to save an extra variable.
|
||||
- Manually starting a Bladeburner action cancels unfocused action.
|
||||
- Updated description of gang territory to be clearer.
|
||||
- Hacknet expenses and profit are in different categories.
|
||||
- Fixed favor equation.
|
||||
- Toast messages aren't hidden behind work in progress screen.
|
||||
- Fix bug that made infiltration checkmark look off by one.
|
||||
- Fix some inconsistency with running files that start or don't start with /
|
||||
- Can't tail the same window twice.
|
||||
- Added recovery mode. Hopefully no one will ever have to use it.
|
||||
- Fix readthedocs
|
||||
- Programs now give int exp based on time not program.
|
||||
- Many sing. functions now give int exp.
|
||||
- Active Scripts page now displays some arguments next to script name.
|
||||
- Fixed some invisible black text.
|
||||
- Button colors can be edited.
|
||||
- Added 2 new colors in the theme editor: background primary and background secondary.
|
||||
- infiltration uses key instead of keycode so it should work better on non-american keyboards.
|
||||
- buff noodle bar.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,774 @@
|
||||
# Getting Started Guide for Beginner Programmers
|
||||
|
||||
_Note_: The [Scripts](../basic/scripts.md) and strategies in this guide aren't necessarily optimal or comprehensive.
|
||||
This guide is tailored to help those with minimal programming knowledge experience Bitburner during early stages of the game.
|
||||
|
||||
If you are confused or overwhelmed by the game, especially the coding and scripting aspects, this guide is perfect for you!
|
||||
|
||||
## Introduction
|
||||
|
||||
Bitburner is a cyberpunk-themed incremental RPG.
|
||||
You will progress by raising your [Stats](../basic/stats.md), earning money, and with practice, advancing your real-world coding skills.
|
||||
After reaching certain criteria, you will receive invitations from in-game [Factions](../basic/factions.md).
|
||||
Joining [Factions](../basic/factions.md) and working for them will unlock various [Augmentations](../basic/augmentations.md),
|
||||
which are purchased and "installed," adding a persistent bonus to [stats](../basic/stats.md) and other abilities. Working with Factions and installing Augmentations is a basic step for progressing in Bitburner.
|
||||
|
||||
The game has an open, minimalistic storyline that can be played in multiple ways to reach your goals.
|
||||
Since this guide is written as a basic introduction to Bitburner, it will not expose the entire scope or storyline available.
|
||||
|
||||
## First Steps
|
||||
|
||||
I'm going to assume you followed the introductory tutorial when you first began the game.
|
||||
In this introductory tutorial, you created a [Script](../basic/scripts.md) called `n00dles.js` and ran it on the `n00dles` server.
|
||||
Now, we'll kill this [Script](../basic/scripts.md). There are two ways to do this:
|
||||
|
||||
- You can go to the Terminal and enter: `$ kill n00dles.js`
|
||||
- You can go to the `Active Scripts` page (Alt + s) and press the `Kill Script` button for `n00dles.js`.
|
||||
|
||||
If you skipped the introductory tutorial, then ignore the part above.
|
||||
Instead, go to the `Hacknet Nodes` page (Alt + h) and purchase a [Hacknet Node](../basic/hacknet_nodes.md) to start generating some passive income.
|
||||
|
||||
## Creating our First Script
|
||||
|
||||
Now, we'll create a generic [hacking](../basic/hacking.md) [Script](../basic/scripts.md) that can be used early on in the game (or throughout the entire game, if you want). This script is usually called "early hack template" or EHT.
|
||||
|
||||
Before we write the [Script](../basic/scripts.md), here are some things you'll want to familiarize yourself with:
|
||||
|
||||
- `hacking`
|
||||
- `security`
|
||||
- `hack`
|
||||
- `grow`
|
||||
- `weaken`
|
||||
- `brutessh`
|
||||
- `nuke`
|
||||
|
||||
To briefly summarize: Each [Server](../basic/servers.md) has a security level that affects how difficult it is to hack.
|
||||
Each [Server](../basic/servers.md) also has a certain amount of money, as well as a maximum amount of money it can hold.
|
||||
[Hacking](../basic/hacking.md) a [Server](../basic/servers.md) steals a percentage of that [Server](../basic/servers.md)'s money.
|
||||
The `hack()` function is used to hack a [Server](../basic/servers.md).
|
||||
The `grow()` function is used to increase the amount of money available on a [Server](../basic/servers.md).
|
||||
The `weaken()` function is used to decrease a [Server](../basic/servers.md)'s security level.
|
||||
|
||||
Now let's move on to actually creating the [Script](../basic/scripts.md).
|
||||
Go to your home computer and then create a [Script](../basic/scripts.md) called `early-hack-template.js` by going to [Terminal](../basic/terminal.md) and entering the following two commands:
|
||||
|
||||
$ home
|
||||
$ nano early-hack-template.js
|
||||
|
||||
This will take you to the [Script](../basic/scripts.md) editor, which you can use to code and create [Scripts](../basic/scripts.md).
|
||||
|
||||
Enter the following code in the [Script](../basic/scripts.md) editor:
|
||||
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
// Defines the "target server", which is the server
|
||||
// that we're going to hack. In this case, it's "n00dles"
|
||||
const target = "n00dles";
|
||||
|
||||
// Defines how much money a server should have before we hack it
|
||||
// In this case, it is set to the maximum amount of money.
|
||||
const moneyThresh = ns.getServerMaxMoney(target);
|
||||
|
||||
// Defines the minimum security level the target server can
|
||||
// have. If the target's security level is higher than this,
|
||||
// we'll weaken it before doing anything else
|
||||
const securityThresh = ns.getServerMinSecurityLevel(target);
|
||||
|
||||
// If we have the BruteSSH.exe program, use it to open the SSH Port
|
||||
// on the target server
|
||||
if (ns.fileExists("BruteSSH.exe", "home")) {
|
||||
ns.brutessh(target);
|
||||
}
|
||||
|
||||
// Get root access to target server
|
||||
ns.nuke(target);
|
||||
|
||||
// Infinite loop that continously hacks/grows/weakens the target server
|
||||
while(true) {
|
||||
if (ns.getServerSecurityLevel(target) > securityThresh) {
|
||||
// If the server's security level is above our threshold, weaken it
|
||||
await ns.weaken(target);
|
||||
} else if (ns.getServerMoneyAvailable(target) < moneyThresh) {
|
||||
// If the server's money is less than our threshold, grow it
|
||||
await ns.grow(target);
|
||||
} else {
|
||||
// Otherwise, hack it
|
||||
await ns.hack(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
The [Script](../basic/scripts.md) above contains comments that document what it does, but let's go through it step-by-step anyway.
|
||||
|
||||
const target = "n00dles";
|
||||
|
||||
This first command defines a string which contains our target [Server](../basic/servers.md).
|
||||
That's the [Server](../basic/servers.md) that we're going to [hack](../basic/hacking.md).
|
||||
For now, it's set to `"n00dles"` because that's the only [Server](../basic/servers.md) with a required hacking level of `1`.
|
||||
If you want to [hack](../basic/hacking.md) a different [Server](../basic/servers.md), simply change this variable to be the hostname of another [Server](../basic/servers.md).
|
||||
|
||||
const moneyThresh = ns.getServerMaxMoney(target);
|
||||
|
||||
This second command defines a numerical value representing the minimum amount of money that must be available on the target [Server](../basic/servers.md) in order for our [Script](../basic/scripts.md) to [hack](../basic/hacking.md) it.
|
||||
If the money available on the target [Server](../basic/servers.md) is less than this value, then our [Script](../basic/scripts.md) will `grow()` the [Server](../basic/servers.md) rather than [hacking](../basic/hacking.md) it.
|
||||
It is set to the maximum amount of money that can be available on the [Server](../basic/servers.md).
|
||||
The `getServerMaxMoney()` function is used to find this value
|
||||
|
||||
const securityThresh = ns.getServerMinSecurityLevel(target);
|
||||
|
||||
This third command defines a numerical value representing the minimum security level the target [Server](../basic/servers.md) can have.
|
||||
If the target [Server](../basic/servers.md)'s security level is higher than this value, then our [Script](../basic/scripts.md) will `weaken()` the server before doing anything else.
|
||||
|
||||
if (ns.fileExists("BruteSSH.exe", "home")) {
|
||||
ns.brutessh(target);
|
||||
}
|
||||
|
||||
ns.nuke(target);
|
||||
|
||||
This section of code is used to gain root access on the target [Server](../basic/servers.md).
|
||||
This is necessary for [hacking](../basic/hacking.md).
|
||||
|
||||
while (true) {
|
||||
if (ns.getServerSecurityLevel(target) > securityThresh) {
|
||||
// If the server's security level is above our threshold, weaken it
|
||||
await ns.weaken(target);
|
||||
} else if (ns.getServerMoneyAvailable(target) < moneyThresh) {
|
||||
// Otherwise, if the server's money is less than our threshold, grow it
|
||||
await ns.grow(target);
|
||||
} else {
|
||||
// Otherwise, hack it
|
||||
await ns.hack(target);
|
||||
}
|
||||
}
|
||||
|
||||
This is the main section that drives our [Script](../basic/scripts.md).
|
||||
It dictates the [Script](../basic/scripts.md)'s logic and carries out the [hacking](../basic/hacking.md) operations.
|
||||
The `while (true)` creates an infinite loop that will continuously run the [hacking](../basic/hacking.md) logic until the the [Script](../basic/scripts.md) is killed.
|
||||
|
||||
The await keyword is needed for `hack()` / `grow()` / `weaken()` because these commands take time to execute, unlike the others.
|
||||
If you forget to await these commands, you will get an exception saying you tried to do multiple things at once, because your code will immediately finish the function call without waiting for the operation to be done.
|
||||
Also important is that await can only be used in functions marked `async` (note that `main()` is marked `async`).
|
||||
|
||||
## Running our Scripts
|
||||
|
||||
Now we want to start running our [hacking](../basic/hacking.md) [Script](../basic/scripts.md) so that it can start earning us money and experience.
|
||||
Our home computer only has 8GB of [RAM](../basic/ram.md), and we'll be using it for something else later.
|
||||
Instead, we'll take advantage of the [RAM](../basic/ram.md) on other machines.
|
||||
|
||||
Go to `Terminal` and enter the following command:
|
||||
|
||||
$ scan-analyze 2
|
||||
|
||||
This will show detailed information about some [Servers](../basic/servers.md) on the network.
|
||||
The **network is randomized so it will be different for every person**.
|
||||
Here's what mine showed at the time I made this:
|
||||
|
||||
[home ~]> scan-analyze 2
|
||||
┕ home
|
||||
┃ Root Access: YES, Required hacking skill: 1
|
||||
┃ Number of open ports required to NUKE: 5
|
||||
┃ RAM: 8.00GB
|
||||
┣ n00dles
|
||||
┃ ┃ Root Access: YES, Required hacking skill: 1
|
||||
┃ ┃ Number of open ports required to NUKE: 0
|
||||
┃ ┃ RAM: 4.00GB
|
||||
┃ ┕ nectar-net
|
||||
┃ Root Access: NO, Required hacking skill: 20
|
||||
┃ Number of open ports required to NUKE: 0
|
||||
┃ RAM: 16.00GB
|
||||
┣ foodnstuff
|
||||
┃ ┃ Root Access: NO, Required hacking skill: 1
|
||||
┃ ┃ Number of open ports required to NUKE: 0
|
||||
┃ ┃ RAM: 16.00GB
|
||||
┃ ┕ zer0
|
||||
┃ Root Access: NO, Required hacking skill: 75
|
||||
┃ Number of open ports required to NUKE: 1
|
||||
┃ RAM: 32.00GB
|
||||
┣ sigma-cosmetics
|
||||
┃ ┃ Root Access: NO, Required hacking skill: 5
|
||||
┃ ┃ Number of open ports required to NUKE: 0
|
||||
┃ ┃ RAM: 16.00GB
|
||||
┃ ┕ max-hardware
|
||||
┃ Root Access: NO, Required hacking skill: 80
|
||||
┃ Number of open ports required to NUKE: 1
|
||||
┃ RAM: 32.00GB
|
||||
┣ joesguns
|
||||
┃ Root Access: NO, Required hacking skill: 10
|
||||
┃ Number of open ports required to NUKE: 0
|
||||
┃ RAM: 16.00GB
|
||||
┣ hong-fang-tea
|
||||
┃ Root Access: NO, Required hacking skill: 30
|
||||
┃ Number of open ports required to NUKE: 0
|
||||
┃ RAM: 16.00GB
|
||||
┣ harakiri-sushi
|
||||
┃ Root Access: NO, Required hacking skill: 40
|
||||
┃ Number of open ports required to NUKE: 0
|
||||
┃ RAM: 16.00GB
|
||||
┕ iron-gym
|
||||
┃ Root Access: NO, Required hacking skill: 100
|
||||
┃ Number of open ports required to NUKE: 1
|
||||
┃ RAM: 32.00GB
|
||||
┕ CSEC
|
||||
Root Access: NO, Required hacking skill: 55
|
||||
Number of open ports required to NUKE: 1
|
||||
RAM: 8.00GB
|
||||
|
||||
Take note of the following servers:
|
||||
|
||||
- `sigma-cosmetics`
|
||||
- `joesguns`
|
||||
- `nectar-net`
|
||||
- `hong-fang-tea`
|
||||
- `harakiri-sushi`
|
||||
|
||||
All of these servers have 16GB of [RAM](../basic/ram.md).
|
||||
Furthermore, all of these servers do not require any open ports in order to NUKE.
|
||||
In other words, we can gain root access to all of these servers and then run [Scripts](../basic/scripts.md) on them.
|
||||
|
||||
First, let's determine how many threads of our [hacking](../basic/hacking.md) [Script](../basic/scripts.md) we can run.
|
||||
(See the page on [scripts](../basic/scripts.md) for more information on multithreading.)
|
||||
|
||||
The [Script](../basic/scripts.md) we wrote uses 2.6GB of [RAM](../basic/ram.md).
|
||||
You can check this using the following `Terminal` command:
|
||||
|
||||
$ mem early-hack-template.js
|
||||
|
||||
This means we can run 6 threads on a 16GB server.
|
||||
Now, to run our [Scripts](../basic/scripts.md) on all of these servers, we have to do the following:
|
||||
|
||||
1. Use the `scp` command to copy our [Script](../basic/scripts.md) to each server.
|
||||
2. Use the `connect` command to connect to a server.
|
||||
3. Use the `run` command to run the `NUKE.exe` program and gain root access.
|
||||
4. Use the `run` command again to run our [Script](../basic/scripts.md).
|
||||
5. Repeat steps 2-4 for each server.
|
||||
|
||||
Here's the sequence of `Terminal` commands I used in order to achieve this:
|
||||
|
||||
$ home
|
||||
$ scp early-hack-template.js n00dles
|
||||
$ scp early-hack-template.js sigma-cosmetics
|
||||
$ scp early-hack-template.js joesguns
|
||||
$ scp early-hack-template.js nectar-net
|
||||
$ scp early-hack-template.js hong-fang-tea
|
||||
$ scp early-hack-template.js harakiri-sushi
|
||||
$ connect n00dles
|
||||
$ run NUKE.exe
|
||||
$ run early-hack-template.js -t 1
|
||||
$ home
|
||||
$ connect sigma-cosmetics
|
||||
$ run NUKE.exe
|
||||
$ run early-hack-template.js -t 6
|
||||
$ home
|
||||
$ connect joesguns
|
||||
$ run NUKE.exe
|
||||
$ run early-hack-template.js -t 6
|
||||
$ home
|
||||
$ connect hong-fang-tea
|
||||
$ run NUKE.exe
|
||||
$ run early-hack-template.js -t 6
|
||||
$ home
|
||||
$ connect harakiri-sushi
|
||||
$ run NUKE.exe
|
||||
$ run early-hack-template.js -t 6
|
||||
$ home
|
||||
$ connect hong-fang-tea
|
||||
$ connect nectar-net
|
||||
$ run NUKE.exe
|
||||
$ run early-hack-template.js -t 6
|
||||
|
||||
Pressing the `Tab` key in the middle of a Terminal command will attempt to auto-complete the command.
|
||||
For example, if you type in `scp ea` and then hit `Tab`, the rest of the [Script](../basic/scripts.md)'s name should automatically be filled in.
|
||||
This works for most commands in the game!
|
||||
|
||||
The `home` command is used to connect to the home computer. When running our [Scripts](../basic/scripts.md) with the `run early-hack-template.js -t 6` command, the `-t 6` specifies that the [Script](../basic/scripts.md) should be run with 6 threads.
|
||||
|
||||
Note that the `nectar-net` [Server](../basic/servers.md) isn't in the home computer's immediate network.
|
||||
This means you can't directly connect to it from home. You will have to search for it inside the network.
|
||||
The results of the `scan-analyze 2` command we ran before will show where it is.
|
||||
In my case, I could connect to it by going from `hong-fang-tea` -> `nectar-net`.
|
||||
However, this will probably be different for you.
|
||||
|
||||
After running all of these `Terminal` commands, our [Scripts](../basic/scripts.md) are now up and running.
|
||||
These will earn money and hacking experience over time.
|
||||
These gains will be really slow right now, but they will increase once our hacking skill rises and we start running more [Scripts](../basic/scripts.md).
|
||||
|
||||
## Increasing Hacking Level
|
||||
|
||||
There are many [Servers](../basic/servers.md) besides `n00dles` that can be hacked, but they have higher required hacking levels.
|
||||
Therefore, we should raise our hacking level.
|
||||
Not only will this let us hack more [Servers](../basic/servers.md), but it will also increase the effectiveness of our [hacking](../basic/hacking.md) against `n00dles`.
|
||||
|
||||
The easiest way to train your hacking level is to visit Rothman University.
|
||||
You can do this from the `City` tab (Alt + w) on the left-hand navigation menu.
|
||||
Rothman University should be the "U" near the bottom-right.
|
||||
Click the "U" to go to the location.
|
||||
|
||||
Once you go to Rothman University, you should see a screen with several options.
|
||||
These options describe different courses you can take.
|
||||
You should click the first button, which says: `Study Computer Science (free)`.
|
||||
|
||||
After you click the button, you will start studying and earning hacking experience.
|
||||
While you are doing this, you cannot interact with any other part of the game until you click either `Stop taking course` or `Do something else simultaneously`.
|
||||
|
||||
Right now, we want a hacking level of 10.
|
||||
You need approximately 174 hacking experience to reach level 10.
|
||||
You can check how much hacking experience you have by going to the `Stats` tab (Alt + c) on the left-hand navigation menu.
|
||||
Since studying at Rothman University earns you 1 experience per second, this will take 174 seconds, or approximately 3 minutes.
|
||||
Feel free to do something in the meantime!
|
||||
|
||||
## Editing our Hacking Script
|
||||
|
||||
Now that we have a hacking level of 10, we can hack the `joesguns` [Server](../basic/servers.md).
|
||||
This [Server](../basic/servers.md) will be slightly more profitable than `n00dles`.
|
||||
Therefore, we want to change our [hacking](../basic/hacking.md) [Script](../basic/scripts.md) to target `joesguns` instead of `n00dles`.
|
||||
|
||||
Go to `Terminal` and edit the [hacking](../basic/hacking.md) [Script](../basic/scripts.md) by entering:
|
||||
|
||||
$ home
|
||||
$ nano early-hack-template.js
|
||||
|
||||
At the top of the [Script](../basic/scripts.md), change the `target` variable to be `"joesguns"`:
|
||||
|
||||
const target = "joesguns";
|
||||
|
||||
Note that this will **NOT** affect any instances of the [Script](../basic/scripts.md) that are already running.
|
||||
This will only affect instances of the [Script](../basic/scripts.md) that are run from this point forward.
|
||||
|
||||
## Creating a New Script to Purchase New Servers
|
||||
|
||||
Next, we're going to create a [Script](../basic/scripts.md) that automatically purchases additional [Servers](../basic/servers.md).
|
||||
These [Servers](../basic/servers.md) will be used to run many [Scripts](../basic/scripts.md).
|
||||
Running this [Script](../basic/scripts.md) will initially be very expensive since purchasing a [Server](../basic/servers.md) costs money, but it will pay off in the long run.
|
||||
|
||||
In order to create this [Script](../basic/scripts.md), you should familiarize yourself with the following functions:
|
||||
|
||||
- `purchaseServer()`
|
||||
- `getPurchasedServerCost()`
|
||||
- `getPurchasedServerLimit()`
|
||||
- `getServerMoneyAvailable()`
|
||||
- `scp()`
|
||||
- `exec()`
|
||||
|
||||
Create the [Script](../basic/scripts.md) by going to `Terminal` and typing:
|
||||
|
||||
$ home
|
||||
$ nano purchase-server-8gb.js
|
||||
|
||||
Paste the following code into the [Script](../basic/scripts.md) editor:
|
||||
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
// How much RAM each purchased server will have. In this case, it'll
|
||||
// be 8GB.
|
||||
const ram = 8;
|
||||
|
||||
// Iterator we'll use for our loop
|
||||
let i = 0;
|
||||
|
||||
// Continuously try to purchase servers until we've reached the maximum
|
||||
// amount of servers
|
||||
while (i < ns.getPurchasedServerLimit()) {
|
||||
// Check if we have enough money to purchase a server
|
||||
if (ns.getServerMoneyAvailable("home") > ns.getPurchasedServerCost(ram)) {
|
||||
// If we have enough money, then:
|
||||
// 1. Purchase the server
|
||||
// 2. Copy our hacking script onto the newly-purchased server
|
||||
// 3. Run our hacking script on the newly-purchased server with 3 threads
|
||||
// 4. Increment our iterator to indicate that we've bought a new server
|
||||
let hostname = ns.purchaseServer("pserv-" + i, ram);
|
||||
ns.scp("early-hack-template.js", hostname);
|
||||
ns.exec("early-hack-template.js", hostname, 3);
|
||||
++i;
|
||||
}
|
||||
//Make the script wait for a second before looping again.
|
||||
//Removing this line will cause an infinite loop and crash the game.
|
||||
await ns.sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
This code uses a while loop to purchase the maximum amount of [Servers](../basic/servers.md) using the `purchaseServer()` function.
|
||||
Each of these [Servers](../basic/servers.md) will have 8GB of [RAM](../basic/ram.md), as defined in the `ram` variable.
|
||||
Note that the [Script](../basic/scripts.md) uses the command `getServerMoneyAvailable("home")` to get the amount of money you currently have.
|
||||
This is then used to check if you can afford to purchase a [Server](../basic/servers.md).
|
||||
|
||||
Whenever the script purchases a new [Server](../basic/servers.md), it uses the `scp()` function to copy our [Script](../basic/scripts.md) onto that new [Server](../basic/servers.md), and then it uses the `exec()` function to execute it on that [Server](../basic/servers.md).
|
||||
|
||||
To run this [Script](../basic/scripts.md), go to `Terminal` and type:
|
||||
|
||||
$ run purchase-server-8gb.js
|
||||
|
||||
This purchase will continuously run until it has purchased the maximum number of [Servers](../basic/servers.md).
|
||||
When this happens, it'll mean that you have a bunch of new [Servers](../basic/servers.md) that are all running [hacking](../basic/hacking.md) [Scripts](../basic/scripts.md) against the `joesguns` [Server](../basic/servers.md)!
|
||||
|
||||
The reason we're using so many [Scripts](../basic/scripts.md) to hack `joesguns` instead of targeting other [Servers](../basic/servers.md) is because it's more effective.
|
||||
This early in the game, we don't have enough [RAM](../basic/ram.md) to efficiently hack multiple targets, and trying to do so would be slow as we'd be spread too thin.
|
||||
You should definitely do this later on, though!
|
||||
|
||||
Note that purchasing a [Server](../basic/servers.md) is fairly expensive, and purchasing the maximum amount of [Servers](../basic/servers.md) even more so.
|
||||
At the time of writing this guide, the [Script](../basic/scripts.md) above requires \$11 million in order to finish purchasing all of the 8GB [Servers](../basic/servers.md).
|
||||
Therefore, we need to find additional ways to make money to speed up the process!
|
||||
These are covered in the next section.
|
||||
|
||||
## Additional Sources of Income
|
||||
|
||||
There are other ways to gain money in this game besides [Scripts](../basic/scripts.md) & [hacking](../basic/hacking.md).
|
||||
|
||||
## Hacknet Nodes
|
||||
|
||||
If you completed the introductory tutorial, you were already introduced to this method: [Hacknet Nodes](../basic/hacknet_nodes.md).
|
||||
Once you have enough money, you can start upgrading your [Hacknet Nodes](../basic/hacknet_nodes.md) in order to increase your passive income stream.
|
||||
This is completely optional.
|
||||
Since each [Hacknet Node](../basic/hacknet_nodes.md) upgrade takes a certain amount of time to "pay itself off", it may not necessarily be in your best interest to use these.
|
||||
|
||||
Nonetheless, [Hacknet Nodes](../basic/hacknet_nodes.md) are a good source of income early in the game, although their effectiveness tapers off later on.
|
||||
If you do wind up purchasing and upgrading [Hacknet Nodes](../basic/hacknet_nodes.md), I would suggest only upgrading their levels for now.
|
||||
I wouldn't bother with [RAM](../basic/ram.md) and Core upgrades until later on.
|
||||
|
||||
## Crime
|
||||
|
||||
The best source of income right now is from [crimes](../basic/crimes.md).
|
||||
This is because it not only gives you a large amount of money, but it also raises your hacking level.
|
||||
To commit [crimes](../basic/crimes.md), go to the `City` tab (Alt + w).
|
||||
Then, click on the link that says `The Slums`.
|
||||
|
||||
In the Slums, you can attempt to commit a variety of [crimes](../basic/crimes.md), each of which gives certain types of experience and money if successful.
|
||||
See [crimes](../basic/crimes.md) for more details.
|
||||
|
||||
You are not always successful when you attempt to commit a crime.
|
||||
Nothing bad happens if you fail a [crime](../basic/crimes.md), but you won't earn any money and the experience gained will be reduced.
|
||||
Raising your stats improves your chance of successfully committing a [crime](../basic/crimes.md).
|
||||
|
||||
Right now, the best option is the `Rob Store` [crime](../basic/crimes.md).
|
||||
This takes 60 seconds to attempt, gives \$400k if successful, and gives hacking experience (which is very important right now).
|
||||
|
||||
Alternatively, you can also use the `Shoplift` [crime](../basic/crimes.md).
|
||||
This takes 2 seconds to attempt and gives \$15k if successful.
|
||||
This [crime](../basic/crimes.md) is slightly easier and more profitable than `Rob Store`, but doesn't give hacking experience.
|
||||
|
||||
## Work for a Company
|
||||
|
||||
If you don't want to commit [crimes](../basic/crimes.md), there's another option - working for a [company](../basic/companies.md).
|
||||
This will not be nearly as profitable as [crimes](../basic/crimes.md), but will provide [company](../basic/companies.md) [reputation](../basic/reputation.md).
|
||||
|
||||
Go to the `City` tab on the left-hand navigation menu and then go to `Joe's Guns`.
|
||||
At `Joe's Guns`, there will be an option that says `Apply to be an Employee`.
|
||||
Click this to get the job.
|
||||
Then, a new option will appear that simply says `Work`.
|
||||
Click this to start working.
|
||||
Working at `Joe's Guns` earns \$110 per second and also grants some experience for every stat except hacking.
|
||||
|
||||
Working for a [company](../basic/companies.md), like [crime](../basic/crimes.md), is completely passive.
|
||||
You can choose to focus on your work, do something else simultaneously, or switch between those two.
|
||||
While you focus on work, you will not be able to do anything else in the game.
|
||||
If you do something else simultaneously, you will not gain [reputation](../basic/reputation.md) at the same speed.
|
||||
You can cancel working at any time.
|
||||
|
||||
Once your hacking hits level 75, you can visit `Carmichael Security` in the city and get a software job there.
|
||||
This job offers higher pay and also earns you hacking experience.
|
||||
|
||||
There are many more companies in the `City` tab that offer more pay and also more gameplay features.
|
||||
Feel free to explore!
|
||||
|
||||
## After you Purchase your New Servers
|
||||
|
||||
After you've made a total of \$11 million, your automatic [Server](../basic/servers.md)-purchasing [Script](../basic/scripts.md) should finish running.
|
||||
This will free up some [RAM](../basic/ram.md) on your home computer.
|
||||
We don't want this [RAM](../basic/ram.md) to go to waste, so we'll make use of it.
|
||||
Go to `Terminal` and enter the following commands:
|
||||
|
||||
$ home
|
||||
$ run early-hack-template.js -t 3
|
||||
|
||||
## Reaching a Hacking Level of 50
|
||||
|
||||
Once you reach a hacking level of 50, two new important parts of the game open up.
|
||||
|
||||
## Creating your first program: BruteSSH.exe
|
||||
|
||||
On the left-hand navigation menu you will notice a `Create Program` tab (Alt + p) with a red notification icon.
|
||||
This indicates that there are programs available to be created.
|
||||
Go to that tab, and you'll see a list of all the programs you can currently create.
|
||||
Hovering over a program will give a brief description of its function.
|
||||
Simply click on a program to start creating it.
|
||||
|
||||
Right now, the program we want to create is `BruteSSH.exe`.
|
||||
This program is used to open up SSH ports on [Servers](../basic/servers.md).
|
||||
This will allow you to hack more [Servers](../basic/servers.md), as many [Servers](../basic/servers.md) in the game require a certain number of opened ports in order for `NUKE.exe` to gain root access.
|
||||
|
||||
Feel free to cancel your work on creating a program at any time, as your progress will be saved and can be picked back up later.
|
||||
`BruteSSH.exe` takes about 10 minutes to complete.
|
||||
|
||||
## Optional: Create AutoLink.exe
|
||||
|
||||
On the `Create Programs` page, you will notice another program you can create called `AutoLink.exe`.
|
||||
If you don't mind waiting another 10-15 minutes, you should go ahead and create this program.
|
||||
It makes it much less tedious to connect to other [Servers](../basic/servers.md), but it's not necessary for progression.
|
||||
|
||||
## Joining your first faction: CyberSec
|
||||
|
||||
Shortly after you reached level 50 hacking, you should have received a message that said this:
|
||||
|
||||
Message received from unknown sender:
|
||||
|
||||
We've been watching you. Your skills are very impressive. But you're wasting your talents.
|
||||
If you join us, you can put your skills to good use and change the world for the better.
|
||||
If you join us, we can unlock your full potential.
|
||||
|
||||
But first, you must pass our test. Find and install the backdoor on our server.
|
||||
|
||||
-CyberSec
|
||||
|
||||
This message was saved as csec-test.msg onto your home computer.
|
||||
|
||||
If you didn't, or if you accidentally closed it, that's okay!
|
||||
Messages get saved onto your home computer.
|
||||
Enter the following `Terminal` commands to view the message:
|
||||
|
||||
$ home
|
||||
$ cat csec-test.msg
|
||||
|
||||
This message is part of the game's main "quest-line".
|
||||
It is a message from the `CyberSec` [faction](../basic/factions.md) that is asking you to pass their test.
|
||||
Passing their test is simple, you just have to find their [Server](../basic/servers.md), hack it, and install a backdoor through the `Terminal`.
|
||||
Their [Server](../basic/servers.md) is called `CSEC`.
|
||||
To do this, we'll use the `scan-analyze` Terminal command, just like we did before:
|
||||
|
||||
$ home
|
||||
$ scan-analyze 2
|
||||
|
||||
This will show you the network for all [Servers](../basic/servers.md) that are up to 2 "nodes" away from your home computer.
|
||||
Remember that the network is randomly generated so it'll look different for everyone.
|
||||
Here's the relevant part of my `scan-analyze` results:
|
||||
|
||||
┕ home
|
||||
┃ Root Access: YES, Required hacking skill: 1
|
||||
┃ Number of open ports required to NUKE: 5
|
||||
┃ RAM: 8.00GB
|
||||
┣ harakiri-sushi
|
||||
┃ Root Access: NO, Required hacking skill: 40
|
||||
┃ Number of open ports required to NUKE: 0
|
||||
┃ RAM: 16.00GB
|
||||
┕ iron-gym
|
||||
┃ Root Access: NO, Required hacking skill: 100
|
||||
┃ Number of open ports required to NUKE: 1
|
||||
┃ RAM: 32.00GB
|
||||
┕ CSEC
|
||||
Root Access: NO, Required hacking skill: 55
|
||||
Number of open ports required to NUKE: 1
|
||||
RAM: 8.00GB
|
||||
|
||||
This tells me that I can reach `CSEC` by going through `iron-gym`:
|
||||
|
||||
$ connect iron-gym
|
||||
$ connect CSEC
|
||||
|
||||
If you created the `AutoLink.exe` program earlier, then there is an easier method of connecting to `CSEC`.
|
||||
You'll notice that in the `scan-analyze` results, all of the [Server](../basic/servers.md) hostnames are white and underlined.
|
||||
You can simply click one of the [Server](../basic/servers.md) hostnames in order to connect to it.
|
||||
So, simply click `CSEC`!
|
||||
|
||||
Make sure you notice the required hacking skill for the `CSEC` [Server](../basic/servers.md).
|
||||
This is a random value between 51 and 60.
|
||||
Although you receive the message from CSEC once you hit 50 hacking, you cannot actually pass their test until your hacking is high enough to install a backdoor on their [Server](../basic/servers.md).
|
||||
|
||||
After you are connected to the `CSEC` [Server](../basic/servers.md), you can backdoor it.
|
||||
Note that this [Server](../basic/servers.md) requires one open port in order to gain root access.
|
||||
We can open the SSH port using the `BruteSSH.exe` program we created earlier.
|
||||
In `Terminal`:
|
||||
|
||||
$ run BruteSSH.exe
|
||||
$ run NUKE.exe
|
||||
$ backdoor
|
||||
|
||||
After you successfully install the backdoor, you should receive a [faction](../basic/factions.md) invitation from `CyberSec` shortly afterwards.
|
||||
Accept it.
|
||||
If you accidentally reject the invitation, that's okay.
|
||||
Just go to the `Factions` tab (Alt + f) and you should see an option that lets you accept the invitation.
|
||||
|
||||
Congrats!
|
||||
You just joined your first [faction](../basic/factions.md).
|
||||
Don't worry about doing anything with this [faction](../basic/factions.md) yet, we can come back to it later.
|
||||
|
||||
## Using Additional Servers to Hack Joesguns
|
||||
|
||||
Once you have the `BruteSSH` program, you will be able to gain root access to several additional [Servers](../basic/servers.md).
|
||||
These [Servers](../basic/servers.md) have more [RAM](../basic/ram.md) that you can use to run [Scripts](../basic/scripts.md).
|
||||
We'll use the [RAM](../basic/ram.md) on these [Servers](../basic/servers.md) to run more [Scripts](../basic/scripts.md) that target `joesguns`.
|
||||
|
||||
## Copying our Scripts
|
||||
|
||||
The [Servers](../basic/servers.md) we'll be using to run our [Scripts](../basic/scripts.md) are:
|
||||
|
||||
- `neo-net`
|
||||
- `zer0`
|
||||
- `max-hardware`
|
||||
- `iron-gym`
|
||||
|
||||
All of these [Servers](../basic/servers.md) have 32GB of [RAM](../basic/ram.md).
|
||||
You can use the `Terminal` command `scan-analyze 3` to see for yourself.
|
||||
To copy our [hacking](../basic/hacking.md) [Scripts](../basic/scripts.md) onto these [Servers](../basic/servers.md), go to `Terminal` and run:
|
||||
|
||||
$ home
|
||||
$ scp early-hack-template.js neo-net
|
||||
$ scp early-hack-template.js zer0
|
||||
$ scp early-hack-template.js max-hardware
|
||||
$ scp early-hack-template.js iron-gym
|
||||
|
||||
Since each of these [Servers](../basic/servers.md) has 32GB of [RAM](../basic/ram.md), we can run our [hacking](../basic/hacking.md) script with 12 threads on each [Server](../basic/servers.md).
|
||||
By now, you should know how to connect to [Servers](../basic/servers.md).
|
||||
So find and connect to each of the [Servers](../basic/servers.md) above using the `scan-analyze 3` `Terminal` command.
|
||||
Then, use following `Terminal` command to run our [hacking](../basic/hacking.md) script with 12 threads:
|
||||
|
||||
$ run early-hack-template.js -t 12
|
||||
|
||||
Remember that if you have the `AutoLink` program, you can simply click on the hostname of a [Server](../basic/servers.md) after running `scan-analyze` to connect to it.
|
||||
|
||||
## Profiting from Scripts & Gaining Reputation with CyberSec
|
||||
|
||||
Now it's time to play the waiting game.
|
||||
It will take some time for your [Scripts](../basic/scripts.md) to start earning money.
|
||||
Remember that most of your [Scripts](../basic/scripts.md) are targeting `joesguns`.
|
||||
It will take a bit for them to `grow()` and `weaken()` the [Server](../basic/servers.md) to the appropriate values before they start [hacking](../basic/hacking.md) it.
|
||||
Once they do, however, the [Scripts](../basic/scripts.md) will be very profitable.
|
||||
|
||||
For reference, in about two hours after starting my first [Script](../basic/scripts.md), my [Scripts](../basic/scripts.md) had a production rate of \$20k per second and had earned a total of \$70 million.
|
||||
(You can see these stats on the `Active Scripts` tab).
|
||||
|
||||
After another 15 minutes, the production rate had increased to \$25k per second and the [Scripts](../basic/scripts.md) had made an additional \$55 million.
|
||||
|
||||
Your results will vary based on how fast you earned money from [crime](../basic/crimes.md)/[working](../basic/companies.md)/[hacknet nodes](../basic/hacknet_nodes.md), but this will hopefully give you a good indication of how much the [Scripts](../basic/scripts.md) can earn.
|
||||
|
||||
In the meantime, we are going to be gaining reputation with the `CyberSec` [faction](../basic/factions.md).
|
||||
Go to the `Factions` tab (Alt + f) on the left-hand navigation menu, and from there select `CyberSec`.
|
||||
In the middle of the page there should be a button for `Hacking Contracts`.
|
||||
Click it to start earning [reputation](../basic/reputation.md) for the `CyberSec` [faction](../basic/factions.md) (as well as some hacking experience).
|
||||
The higher your hacking level, the more [reputation](../basic/reputation.md) you will gain.
|
||||
Note that while you are working for a [faction](../basic/factions.md), you can choose to not interact with the rest of the game in any way to gain [reputation](../basic/reputation.md) at full speed.
|
||||
You can also select to do something else simultaneously, gaining [reputation](../basic/reputation.md) a bit more slowly, until you focus again.
|
||||
You can cancel your [faction](../basic/factions.md) work at any time with no penalty to your [reputation](../basic/reputation.md) gained so far.
|
||||
|
||||
## Purchasing Upgrades and Augmentations
|
||||
|
||||
As I mentioned before, within 1-2 hours I had earned over \$200 million.
|
||||
Now, it's time to spend all of this money on some persistent upgrades to help progress!
|
||||
|
||||
## Upgrading RAM on Home computer
|
||||
|
||||
The most important thing to upgrade right now is the [RAM](../basic/ram.md) on your home computer.
|
||||
This will allow you to run more [Scripts](../basic/scripts.md).
|
||||
|
||||
To upgrade your [RAM](../basic/ram.md), go to the `City` tab and visit the company `Alpha Enterprises`.
|
||||
There will be a button that says `Upgrade 'home' RAM (8.00GB -> 16.00GB) - $1.010m`.
|
||||
Click it to upgrade your [RAM](../basic/ram.md).
|
||||
|
||||
I recommend getting your home computer's [RAM](../basic/ram.md) to **at least** 128GB.
|
||||
Getting it even higher would be better.
|
||||
|
||||
## Purchasing your First Augmentations
|
||||
|
||||
Once you get ~1000 [reputation](../basic/reputation.md) with the `CyberSec` [faction](../basic/factions.md), you can purchase your first [Augmentation](../basic/augmentations.md) from them.
|
||||
|
||||
To do this, go to the `Factions` tab on the left-hand navigation menu (Alt + f) and select `CyberSec`.
|
||||
There is a button near the bottom that says `Purchase Augmentations`.
|
||||
This will bring up a page that displays all of the [Augmentations](../basic/augmentations.md) available from `CyberSec`.
|
||||
Some of them may be locked right now.
|
||||
To unlock these, you will need to earn more [reputation](../basic/reputation.md) with `CyberSec`.
|
||||
|
||||
[Augmentations](../basic/augmentations.md) give persistent upgrades in the form of multipliers.
|
||||
These aren't very powerful early in the game because the multipliers are small.
|
||||
However, the effects of [Augmentations](../basic/augmentations.md) stack multiplicatively **with each other**, so as you continue to install many [Augmentations](../basic/augmentations.md), their effects will increase significantly.
|
||||
|
||||
Because of this, I would recommend investing more in [RAM](../basic/ram.md) upgrades for your home computer rather than [Augmentations](../basic/augmentations.md) early on.
|
||||
Having enough [RAM](../basic/ram.md) to run many [Scripts](../basic/scripts.md) will allow you to make much more money, and then you can come back later on and get all these [Augmentations](../basic/augmentations.md).
|
||||
|
||||
Right now, I suggest purchasing at the very least the `Neurotrainer I` [Augmentation](../basic/augmentations.md) from `CyberSec`.
|
||||
If you have the money to spare, I would also suggest getting `BitWire` and several levels of the `NeuroFlux Governor` (`NFG`) [Augmentations](../basic/augmentations.md).
|
||||
Note that each time you purchase an [Augmentation](../basic/augmentations.md), **the price of purchasing another increases by 90%**, so make sure you buy the most expensive [Augmentation](../basic/augmentations.md) first.
|
||||
Don't worry, once you choose to install [Augmentations](../basic/augmentations.md), their prices will reset back to their original values.
|
||||
|
||||
## Next Steps
|
||||
|
||||
That's the end of the walkthrough portion of this guide!
|
||||
You should continue to explore what the game has to offer.
|
||||
There's quite a few features that aren't covered or mentioned in this guide, and even more that get unlocked as you continue to play!
|
||||
|
||||
Also, check out the API documentation to see what it has to offer.
|
||||
Writing [Scripts](../basic/scripts.md) to perform and automate various tasks is where most of the fun in the game comes from (in my opinion)!
|
||||
|
||||
The following are a few things you may want to consider doing in the near future.
|
||||
|
||||
## Installing Augmentations (and Resetting)
|
||||
|
||||
If you've purchased any [Augmentations](../basic/augmentations.md), you'll need to install them before you actually gain their effects.
|
||||
Installing [Augmentations](../basic/augmentations.md) is the game's "soft-reset" or "prestige" mechanic.
|
||||
|
||||
To install your [Augmentations](../basic/augmentations.md), go to the `Augmentations` tab (Alt + a) on the left-hand navigation menu.
|
||||
You will see a list of all of the [Augmentations](../basic/augmentations.md) you have purchased.
|
||||
Below that, you will see a button that says `Install Augmentations`.
|
||||
Be warned, after clicking this there is no way to undo it (unless you load an earlier save).
|
||||
|
||||
## Automating the Script Startup Process
|
||||
|
||||
Whenever you install [Augmentations](../basic/augmentations.md), all of your [Scripts](../basic/scripts.md) are killed and you'll have to re-run them.
|
||||
Doing this every time you install [Augmentations](../basic/augmentations.md) would be very tedious and annoying, so you should write a [Script](../basic/scripts.md) to automate the process.
|
||||
Here's a simple example for a startup [Script](../basic/scripts.md).
|
||||
Feel free to adjust it to your liking.
|
||||
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
// Array of all servers that don't need any ports opened
|
||||
// to gain root access. These have 16 GB of RAM
|
||||
const servers0Port = ["sigma-cosmetics",
|
||||
"joesguns",
|
||||
"nectar-net",
|
||||
"hong-fang-tea",
|
||||
"harakiri-sushi"];
|
||||
|
||||
// Array of all servers that only need 1 port opened
|
||||
// to gain root access. These have 32 GB of RAM
|
||||
const servers1Port = ["neo-net",
|
||||
"zer0",
|
||||
"max-hardware",
|
||||
"iron-gym"];
|
||||
|
||||
// Copy our scripts onto each server that requires 0 ports
|
||||
// to gain root access. Then use nuke() to gain admin access and
|
||||
// run the scripts.
|
||||
for (let i = 0; i < servers0Port.length; ++i) {
|
||||
const serv = servers0Port[i];
|
||||
|
||||
ns.scp("early-hack-template.js", serv);
|
||||
ns.nuke(serv);
|
||||
ns.exec("early-hack-template.js", serv, 6);
|
||||
}
|
||||
|
||||
// Wait until we acquire the "BruteSSH.exe" program
|
||||
while (!ns.fileExists("BruteSSH.exe")) {
|
||||
await ns.sleep(60000);
|
||||
}
|
||||
|
||||
// Copy our scripts onto each server that requires 1 port
|
||||
// to gain root access. Then use brutessh() and nuke()
|
||||
// to gain admin access and run the scripts.
|
||||
for (let i = 0; i < servers1Port.length; ++i) {
|
||||
const serv = servers1Port[i];
|
||||
|
||||
ns.scp("early-hack-template.js", serv);
|
||||
ns.brutessh(serv);
|
||||
ns.nuke(serv);
|
||||
ns.exec("early-hack-template.js", serv, 12);
|
||||
}
|
||||
}
|
||||
|
||||
## Random Tips
|
||||
|
||||
- Early on in the game, it's better to spend your money on upgrading [RAM](../basic/ram.md) and purchasing new [Servers](../basic/servers.md) rather than spending it on [Augmentations](../basic/augmentations.md)
|
||||
- The more money available on a [Server](../basic/servers.md), the more effective the `hack()` and `grow()` functions will be.
|
||||
This is because both of these functions use percentages rather than flat values.
|
||||
`hack()` steals a percentage of a [Server](../basic/servers.md)'s total available money, and `grow()` increases a [Server](../basic/servers.md)'s money by X%.
|
||||
- There is a limit to how much money can exist on a [Server](../basic/servers.md).
|
||||
This value is different for each [Server](../basic/servers.md).
|
||||
The `getServerMaxMoney()` function will tell you this maximum value.
|
||||
- At this stage in the game, your combat stats (strength, defense, etc.) are not nearly as useful as your hacking stat.
|
||||
Do not invest too much time or money into gaining combat stat exp.
|
||||
- As a rule of thumb, your hacking target should be the [Server](../basic/servers.md) that has the highest ratio of `MaxMoney / MinimumSecurityLevel` and its `RequiredHackingLevel` is under half of your hacking level.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Tools & Resource
|
||||
|
||||
## Official Script Repository
|
||||
|
||||
There are plans to create an official repository of Bitburner scripts.
|
||||
As of right now, this is not a priority and has not been started.
|
||||
However, if you'd like to contribute scripts now, you can find the repository [here](https://github.com/bitburner-official/bitburner-scripts) and submit pull requests.
|
||||
@@ -0,0 +1,63 @@
|
||||
# Documentation
|
||||
|
||||
## Guides
|
||||
|
||||
- [Beginner's guide](help/getting_started.md)
|
||||
|
||||
## Basic Mechanics
|
||||
|
||||
- [Stats](basic/stats.md)
|
||||
- [Terminal](basic/terminal.md)
|
||||
- [Hacking](basic/hacking.md)
|
||||
- [Scripts](basic/scripts.md)
|
||||
- [Servers](basic/servers.md)
|
||||
- [RAM](basic/ram.md)
|
||||
- [Hacknet nodes](basic/hacknet_nodes.md)
|
||||
- [Augmentations](basic/augmentations.md)
|
||||
- [Companies](basic/companies.md)
|
||||
- [Factions](basic/factions.md)
|
||||
- [Crimes](basic/crimes.md)
|
||||
- [Infiltration](basic/infiltration.md)
|
||||
- [Programs](basic/programs.md)
|
||||
- [Reputation](basic/reputation.md)
|
||||
- [Stock market](basic/stockmarket.md)
|
||||
- [World](basic/world.md)
|
||||
- [Coding contracts](basic/codingcontracts.md)
|
||||
- [Autocomplete](basic/autocomplete.md)
|
||||
|
||||
## Advanced Mechanics
|
||||
|
||||
- [Hacking algorithms](programming/hackingalgorithms.md)
|
||||
- [List of factions and their requirements](advanced/faction_list.md)
|
||||
- [Offline scripts and bonus time](advanced/offlineandbonustime.md)
|
||||
- [BitNodes](advanced/bitnodes.md)
|
||||
- [BitNode recommendation - Short guide](advanced/bitnode_recommendation_short_guide.md)
|
||||
- [BitNode recommendation - Comprehensive guide](advanced/bitnode_recommendation_comprehensive_guide.md)
|
||||
- [Source-Files](advanced/sourcefiles.md)
|
||||
- [Gang](advanced/gang.md)
|
||||
- [Corporation](advanced/corporations.md)
|
||||
- [Intelligence](advanced/intelligence.md)
|
||||
- [Bladeburner](advanced/bladeburners.md)
|
||||
- [Hacknet servers](advanced/hacknetservers.md)
|
||||
- [Sleeves](advanced/sleeves.md)
|
||||
- [Grafting](advanced/grafting.md)
|
||||
- [Stanek's Gift](advanced/stanek.md)
|
||||
- [IPvGO](programming/go_algorithms.md)
|
||||
|
||||
## Resources
|
||||
|
||||
- [NS API documentation](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.md)
|
||||
- [Learn to program](programming/learn.md)
|
||||
- [Remote API](programming/remote_api.md)
|
||||
- [Game frozen or stuck?](programming/game_frozen.md)
|
||||
- [React](programming/react.md)
|
||||
- [Tools & Resources](help/tools_and_resources.md)
|
||||
- [Changelog](changelog.md)
|
||||
- [Changelog - Legacy v1](changelog-v1.md)
|
||||
- [Changelog - Legacy v0](changelog-v0.md)
|
||||
|
||||
## Migration
|
||||
|
||||
- [Bitburner v1.0.0 script migration guide](migrations/v1.md)
|
||||
- [Bitburner v2.0.0 script migration guide](migrations/v2.md)
|
||||
- [Netscript 2 migration guide (.script to .js)](migrations/ns2.md)
|
||||
@@ -0,0 +1,78 @@
|
||||
# "Netscript 2" Migration Guide
|
||||
|
||||
In previous versions, the game supported two script formats:
|
||||
|
||||
- `.script` (also sometimes called "Netscript 1" or "NS1") files are ran through an interpreter that is based on a version of Javascript from 2009 (ES5).
|
||||
|
||||
- `.js` (also sometimes called "Netscript 2" or "NS2") files are native javascript that is ran directly by the web browser. Modern features of javascript that are supported by your web browser are supported in `.js` files, because they are run as native js.
|
||||
|
||||
Support for running `.script` files was removed in version 3.0.
|
||||
|
||||
## Why do I have to change anything?
|
||||
|
||||
Since all ES5 code is still valid Javascript, you may be wondering why the old code doesn't just work when renamed to `.js`. In this section, some key differences are explained.
|
||||
|
||||
- **API access method**: In `.script` files, the game API is available at top-level scope within the file, as if they were at global scope. In `.js` files, the game API is passed as an argument into a script's `main` function, and is not available at top-level scope.
|
||||
- **Execution differences**: Running a `.script` file begins code execution at the top of the file. Running a `.js` file launches the `main` function (passing the game API in as the first argument, typically named `ns`).
|
||||
- **Timing differences**: In `.script` files, code execution contains automatic delays between every statement. In `.js` files, the code is being run natively so there are no builtin delays, so any needed delays must be added manually.
|
||||
|
||||
## Basic steps for script migration
|
||||
|
||||
1. Wrap the entire script inside of an exported main function, like so:
|
||||
|
||||
```js
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
// your code here
|
||||
}
|
||||
```
|
||||
|
||||
2. Add `ns.` as a prefix to all game functions or objects (such as `ns.hack()` or `ns.args`).
|
||||
3. If a function returns a `Promise`, you need to put the `await` keyword before it (With the JSDoc comment you can hover over the function to see the return type). Note that only functions declared as `async` are allowed to `await` anything, and typically you should also await the calls to your own `async` functions.
|
||||
4. Because there are no forced delays, an infinite loop will cause the game to hang if a delay is not manually added. Such loops should `await` a function (usually `ns.sleep()`) at least once to avoid this.
|
||||
5. The `var` keyword is rarely used in modern js for declaring variables. `let` or `const` (if the variable is never reassigned) keywords are preferred. This change is not required.
|
||||
|
||||
## Example migration
|
||||
|
||||
Original (`early-hacking-template.script`):
|
||||
|
||||
```js
|
||||
var target = "n00dles";
|
||||
var moneyThresh = getServerMaxMoney(target) * 0.9;
|
||||
var securityThresh = getServerMinSecurityLevel(target) + 5;
|
||||
|
||||
while (true) {
|
||||
if (getServerSecurityLevel(target) > securityThresh) {
|
||||
weaken(target);
|
||||
} else if (getServerMoneyAvailable(target) < moneyThresh) {
|
||||
grow(target);
|
||||
} else {
|
||||
hack(target);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Migrated (`early-hacking-template.js`):
|
||||
|
||||
```js
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
const target = "n00dles";
|
||||
const moneyThresh = ns.getServerMaxMoney(target) * 0.9;
|
||||
const securityThresh = ns.getServerMinSecurityLevel(target) + 5;
|
||||
|
||||
while (true) {
|
||||
if (ns.getServerSecurityLevel(target) > securityThresh) {
|
||||
await ns.weaken(target);
|
||||
} else if (ns.getServerMoneyAvailable(target) < moneyThresh) {
|
||||
await ns.grow(target);
|
||||
} else {
|
||||
await ns.hack(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Additional problems or edge cases
|
||||
|
||||
To get additional help with the migration, please join the [official Discord server](https://discord.gg/TFc3hKD).
|
||||
@@ -0,0 +1,36 @@
|
||||
# v1.0.0 Migration Guide
|
||||
|
||||
In v1.0.0 a few API have been broken.
|
||||
|
||||
migrated (only for ns2):
|
||||
|
||||
- bladeburner.getActionTime will return milliseconds instead of seconds.
|
||||
- getHackTime will return milliseconds instead of seconds.
|
||||
- getGrowTime will return milliseconds instead of seconds.
|
||||
- getWeakenTime will return milliseconds instead of seconds.
|
||||
- hackAnalyzePercent renamed to hackAnalyze
|
||||
- hackAnalyzePercent will return decimal instead of percentage
|
||||
- hackChance (not formulas.basic.hackChance) renamed to hackAnalyzeChance
|
||||
- formulas.basic is split into formulas.skills and formulas.hacking
|
||||
|
||||
not migrated (require manual changes sometimes):
|
||||
|
||||
- getPlayer().hacking_skill renamed `hacking`
|
||||
- same thing in sleeves
|
||||
- getPurchasedServers won't let you query for ips instead of hostnames.
|
||||
- getStats is deprecated in favor getPlayer
|
||||
- getCharacterInformation is deprecated in favor getPlayer
|
||||
- getServerRam deprecated in favor of getServerMaxRam and getServerUsedRam
|
||||
- getServerBaseSecurityLevel will be deprecated in favor of nothing, it's not really used.
|
||||
- sleep can no longer be called simultaneously, a new function called asleep will let you.
|
||||
- write returns promise (needs to be await ed).
|
||||
- scp returns a promise (needs to be await ed).
|
||||
- free port, write, read
|
||||
- write, read does not support port anymore, writePort and readPort does.
|
||||
|
||||
Upon loading v1.0.0 the game will apply some rules to change everything.
|
||||
The game never changes a file before making a backup called `BACKUP_filename.ext`, then,
|
||||
in the script it will change whatever it thinks it should change.
|
||||
But will prefix the modified line with the original line.
|
||||
|
||||
A file called `v1_DETECTED_CHANGES.txt` will point out every file with some possible problem.
|
||||
@@ -0,0 +1,97 @@
|
||||
# v2.0.0 Migration Guide
|
||||
|
||||
In v2.0.0 a few more APIs have been broken.
|
||||
|
||||
## Working
|
||||
|
||||
Working has been rebuilt from the ground up. The motivation for this change is that all
|
||||
different types of work all required different cached variables on the main Player object.
|
||||
This caused a lot of bugs and crashes. It's been reworked in such a way as to prevent bugs
|
||||
and make it nearly trivial to add new kinds of work.
|
||||
All work types give their reward immediately. No need to stop work to bank rewards like reputation.
|
||||
Faction and Company work no longer have a time limit.
|
||||
Company work no longer reduces rep gain by half for quitting early.
|
||||
Company factions now require 400k rep to join (up from 200k).
|
||||
Backdooring a company server reduces faction requirement to 300k.
|
||||
All types of work generally no longer keep track of cumulative gains like exp and reputation since it's applied instantly.
|
||||
|
||||
## commitCrime
|
||||
|
||||
Crime now loops, meaning after finishing one shoplift you start the next one with no input. While the signature
|
||||
has not changed, its behavior has. It also has a new 'focus' parameter.
|
||||
|
||||
## getPlayer
|
||||
|
||||
The following work-related fields are no longer included:
|
||||
|
||||
- workChaExpGained
|
||||
- currentWorkFactionName
|
||||
- workDexExpGained
|
||||
- workHackExpGained
|
||||
- createProgramReqLvl
|
||||
- workStrExpGained
|
||||
- companyName
|
||||
- crimeType
|
||||
- workRepGained
|
||||
- workChaExpGainRate
|
||||
- workType
|
||||
- workStrExpGainRate
|
||||
- isWorking
|
||||
- workRepGainRate
|
||||
- workDefExpGained
|
||||
- currentWorkFactionDescription
|
||||
- workHackExpGainRate
|
||||
- workAgiExpGainRate
|
||||
- workDexExpGainRate
|
||||
- workMoneyGained
|
||||
- workMoneyLossRate
|
||||
- workMoneyGainRate
|
||||
- createProgramName
|
||||
- workDefExpGainRate
|
||||
- workAgiExpGained
|
||||
- className
|
||||
|
||||
The reason for this, is that these fields are all, in one way or another, included in the new work field `currentWork`.
|
||||
Some of these values are also irrelevant.
|
||||
Take a look at the new singularity.getCurrentWork function:
|
||||
|
||||
All fields ending in `_mult` have been moved to the `mults` struct.
|
||||
For example: `getPlayer().hacking_skill_mult` => `getPlayer().mults.hacking_skill`
|
||||
|
||||
skills has been moved to the skills struct
|
||||
For example: `getPlayer().hacking` => `getPlayer().skills.hacking`
|
||||
|
||||
exp has been moved to the exp struct
|
||||
For example: `getPlayer().hacking_exp` => `getPlayer().exp.hacking`
|
||||
|
||||
hp has been moved to the hp struct
|
||||
For example: `getPlayer().max_hp` => `getPlayer().hp.max` or `hp.current`
|
||||
|
||||
`hasWseAccount`, `hasTixApiAccess`, `has4SData`, `has4SDataTixApi` have been removed and replaced with similar stock functions.
|
||||
|
||||
## workForCompany
|
||||
|
||||
The argument 'companyName' is now required.
|
||||
|
||||
## getScriptIncome & getScriptExpGain
|
||||
|
||||
These two functions used to have a call where, if no arguments were provided, it would return the total for all scripts. This caused weird signature.
|
||||
If you want to get the total income/exp for all scripts, use the new getTotalScriptIncome / getTotalScriptExpGain instead.
|
||||
|
||||
## scp
|
||||
|
||||
The last two arguments of scp have been reversed. The signature is now scp(files, destination, optional_source)
|
||||
|
||||
## Singularity
|
||||
|
||||
The top level singularity functions were deprecated a while ago in favor of the singularity namespace.
|
||||
This means calls like 'ns.connect' need to be changed to 'ns.singularity.connect'
|
||||
|
||||
## stock.buy, stock.sell, stock.short
|
||||
|
||||
These functions were renamed to stock.buyStock, stock.sellStock, and stock.buyShort because 'buy', 'sell', and 'short'
|
||||
are very common tokens that would trick the ram calculation.
|
||||
|
||||
## corporation.bribe
|
||||
|
||||
The ability to give shares as a bribe has been removed. The signature is now bribe(faction, money)
|
||||
@@ -0,0 +1,61 @@
|
||||
# Game Frozen or Stuck?
|
||||
|
||||
## Infinite Loop in Scripts
|
||||
|
||||
If your game is frozen or stuck in any way, then the most likely culprit is an infinitely running loop in your script.
|
||||
To get past the freezing, run the game with `?noScripts` in the URL:
|
||||
|
||||
[Link to no freeze](https://bitburner-official.github.io?noScripts)
|
||||
|
||||
Then, to fix your script, make sure you have a `sleep()` or any other timed function like `hack()` or `grow()` in any infinite loops:
|
||||
|
||||
while(true) {
|
||||
// This is an infinite loop that does something
|
||||
...
|
||||
await ns.sleep(1000); // Add a 1s sleep to prevent freezing
|
||||
}
|
||||
|
||||
Also make sure that each while loop gets to the `await`ed function or `break`, for example the next snippet has a `sleep()` function, but it nor any possible conditional breaks are never reached and therefore will crash the game:
|
||||
|
||||
while(true) {
|
||||
let currentMoney = ns.getServerMoneyAvailable("n00dles");
|
||||
let maxMoney = ns.getServerMaxMoney("n00dles");
|
||||
if (currentMoney < maxMoney/2){
|
||||
await ns.grow("n00dles");
|
||||
}
|
||||
if (currentMoney === maxMoney){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
If `n00dles` current money is, for example, 75% of the maximum money, the script will reach neither `grow()` nor `break` and the game will crash.
|
||||
Adding a sleep like in the first example, or changing the code so that the `awaited` function or `break` is always reached, would prevent the crash.
|
||||
|
||||
Common infinite loop when translating the server purchasing script in starting guide to scripts is to have a while loop, where the condition's change is conditional:
|
||||
|
||||
var ram = 8;
|
||||
var i = 0;
|
||||
|
||||
while (i < ns.getPurchasedServerLimit()) {
|
||||
if (ns.getServerMoneyAvailable("home") > ns.getPurchasedServerCost(ram)) {
|
||||
var hostname = ns.purchaseServer("pserv-" + i, ram);
|
||||
ns.scp("early-hack-template.js", hostname);
|
||||
ns.exec("early-hack-template.js", hostname, 3);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
If the player does not currently have enough money to purchase a server, the `if`'s condition will be false and `++i` will not be reached.
|
||||
Since the script doesn't have `sleep()` and value `i` will not change without the `if` being true, this will crash the game.
|
||||
Adding a `sleep()` that is always reached would prevent the crash.
|
||||
|
||||
## Black screen
|
||||
|
||||
If the game window becomes a black screen without the game itself crashing, this is caused by the game running too many concurrent scripts (the game runs on a browser and each tab can only use so much ram until it crashes).
|
||||
Depending on which scripts are running and your hardware, this number can vary between 50000 to 100000 instances (in version 2.0.2. In prior versions this number was about 1/5th of that).
|
||||
To prevent this from happening make sure to multithread the scripts as much as possible.
|
||||
|
||||
## Bug
|
||||
|
||||
Otherwise, the game is probably frozen/stuck due to a bug.
|
||||
To report a bug, follow the guidelines [here](https://github.com/bitburner-official/bitburner-src/blob/stable/CONTRIBUTING.md#reporting-bugs).
|
||||
@@ -0,0 +1,322 @@
|
||||
## Automating IPvGO
|
||||
|
||||
IPvGO is a strategic territory control minigame accessible from DefComm in New Tokyo, or the CIA in Sector-12. Form networks of routers on a grid to control open space and gain stat multipliers and favor, but make sure the opposing faction does not surround and destroy your network!
|
||||
|
||||
For basic instructions, go to DefComm or CIA to access the current subnet, and look through the "How to Play" section. This document is specifically focused on building scripts to automate subnet takeover, which will be more applicable you have played a few subnets.
|
||||
|
||||
For a full list of all IpvGO methods and their descriptions and documentation, you can use the game's [API documentation page](https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.go.md).
|
||||
|
||||
|
||||
|
||||
#### Overview
|
||||
|
||||
The rules of Go, at their heart, are very simple. Because of this, they can be used to make a very simple script to automatically collect node power from IPvGO subnets.
|
||||
|
||||
This script can be iteratively improved upon, gradually giving it more tools and types of move to look for, and becoming more consistent at staking out territory on the current subnet.
|
||||
|
||||
This document starts out with a lot of detail and example code to get you started, but will transition to more high-level algorithm design and pseudocode as it progresses. If you get stuck implementing some of these ideas, feel free to discuss in the [official Discord server](https://discord.gg/TFc3hKD)
|
||||
|
||||
|
||||
|
||||
### Script outline: Starting with the basics
|
||||
|
||||
|
||||
|
||||
#### Testing Validity
|
||||
|
||||
The `ns.go` API provides a number of useful tools to understand the current subnet state.
|
||||
|
||||
`ns.go.analysis.getValidMoves()` returns a 2D array of true/false, indicating if you can place a router on the current square.
|
||||
|
||||
You can test if a given move `x,y` is valid with a test like this:
|
||||
|
||||
```js
|
||||
const validMoves = ns.go.analysis.getValidMoves();
|
||||
|
||||
if (validMoves[x][y] === true) {
|
||||
// Do something
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Choosing a random move
|
||||
|
||||
The simplest move type, and the fallback if no other move can be found, is to pick a random valid move.
|
||||
|
||||
The `validMoves` grid can be retrieved using `getValidMoves()` as mentioned above. `board` comes from `ns.go.getBoardState()`, more on that later.
|
||||
|
||||
It would be a problem to fill in every single node on the board, however. If networks ever lose contact with any empty nodes, they will be destroyed! So, leave some "airspace" by excluding certain moves from the random ones we select.
|
||||
|
||||
One way to do this is to exclude nodes with both even X coordinate and even y coordinate:
|
||||
|
||||
```js
|
||||
/**
|
||||
* Choose one of the empty points on the board at random to play
|
||||
*/
|
||||
const getRandomMove = (board, validMoves) => {
|
||||
const moveOptions = [];
|
||||
const size = board[0].length;
|
||||
|
||||
// Look through all the points on the board
|
||||
for (let x = 0; x < size; x++) {
|
||||
for (let y = 0; y < size; y++) {
|
||||
// Make sure the point is a valid move
|
||||
const isValidMove = validMoves[x][y] === true;
|
||||
// Leave some spaces to make it harder to capture our pieces.
|
||||
// We don't want to run out of empty node connections!
|
||||
const isNotReservedSpace = x % 2 === 1 || y % 2 === 1;
|
||||
|
||||
if (isValidMove && isNotReservedSpace) {
|
||||
moveOptions.push([x, y]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Choose one of the found moves at random
|
||||
const randomIndex = Math.floor(Math.random() * moveOptions.length);
|
||||
return moveOptions[randomIndex] ?? [];
|
||||
};
|
||||
```
|
||||
|
||||
This idea can also be improved to focus on a specific area or corner first, rather than spread across the whole board right away.
|
||||
|
||||
|
||||
|
||||
#### Playing moves
|
||||
|
||||
Now that a simple move type is available, it can be used to play on the current subnet!
|
||||
|
||||
`await ns.go.makeMove(x, y)` can be used to play a chosen move `x,y`. Note that it returns a `Promise`, meaning it needs to be used with `await`.
|
||||
|
||||
`await ns.go.passTurn()` can be used if no moves are found. This will end the game if the AI also passes (or just passed previously).
|
||||
|
||||
Both `makeMove()` and `passTurn()`, when awaited, return an object that tells you what the AI's response is, and if the game is over.
|
||||
|
||||
```js
|
||||
{
|
||||
// If the opponent moved or passed, or if the game is now over.
|
||||
type: "move" | "pass" | "gameOver";
|
||||
x: number | null; // Opponent move's x coord (if applicable)
|
||||
y: number | null; // Opponent move's y coord (if applicable)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
When used together with the `getRandomMove()` implemented above, the framework of the script is ready. An example `main()` that implements this is below. Search for a new subnet using the UI, then launch the script you have been working on, and watch it play!
|
||||
|
||||
```js
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
let result, x, y;
|
||||
|
||||
do {
|
||||
const board = ns.go.getBoardState();
|
||||
const validMoves = ns.go.analysis.getValidMoves();
|
||||
|
||||
const [randX, randY] = getRandomMove(board, validMoves);
|
||||
// TODO: more move options
|
||||
|
||||
// Choose a move from our options (currently just "random move")
|
||||
x = randX;
|
||||
y = randY;
|
||||
|
||||
if (x === undefined) {
|
||||
// Pass turn if no moves are found
|
||||
result = await ns.go.passTurn();
|
||||
} else {
|
||||
// Play the selected move
|
||||
result = await ns.go.makeMove(x, y);
|
||||
}
|
||||
|
||||
// Log opponent's next move, once it happens
|
||||
await ns.go.opponentNextTurn();
|
||||
|
||||
await ns.sleep(200);
|
||||
|
||||
// Keep looping as long as the opponent is playing moves
|
||||
} while (result?.type !== "gameOver");
|
||||
|
||||
// TODO: add a loop to keep playing
|
||||
// TODO: reset board, e.g. `ns.go.resetBoardState("Netburners", 7)`
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Adding network expansion moves
|
||||
|
||||
Just playing random moves is not very effective, though. The next step is to use the board state to try and take over territory.
|
||||
|
||||
`ns.go.getBoardState()` returns a simple grid representing what the current board looks like. The player's routers are marked with `X`, and the opponents with `O`.
|
||||
|
||||
Example 5x5 board state, with a number of networks for each player:
|
||||
|
||||
```angularjs
|
||||
[ "XX.O.",
|
||||
"X..OO",
|
||||
".XO..",
|
||||
"XXO..",
|
||||
".XOO.", ]
|
||||
```
|
||||
|
||||
The board state can be used to look at all the nodes touching a given point, by looking at an adjacent pair of coordinates.
|
||||
|
||||
For example, the point to the 'north' of the current point `x, y` can be retrieved with `board[x + 1]?.[y]`. If it is a friendly router it will have value `"X"`. (It will be undefined if `x,y` is on the north edge of the subnet)
|
||||
|
||||
That info can be used to make decisions about where to place routers.
|
||||
|
||||
In order to expand the area that is controlled by the player's networks, connecting to friendly routers (when possible) is a strong move. This can be done with a very similar implementation to `getRandomMove()`, with the additional check of looking for a neighboring friendly router. For each point on the board:
|
||||
|
||||
```text
|
||||
Detect expansion moves:
|
||||
For each point on the board:
|
||||
* If the empty point is a valid move, and
|
||||
* If the point is not an open space reserved to protect the network [see getRandomMove()], and
|
||||
* If a point to the north, south, east, or west is a friendly router
|
||||
|
||||
Then, the move will expand an existing network
|
||||
```
|
||||
|
||||
When possible, an expansion move like this should be used over a random move. When neither can be found, pass turn.
|
||||
|
||||
This idea can be improved: reserved spaces can be skipped if the nodes are in different networks. Se `ns.go.analysis.getChains()`
|
||||
|
||||
After implementing this, the script will consistently get points on the subnet against most opponents (at least on the larger boards), and will sometimes even get lucky and win against the easiest factions.
|
||||
|
||||
|
||||
|
||||
#### Next Steps
|
||||
|
||||
There is a lot we can still do to improve the script. For one, it currently only plays one game, and must be restarted each time! Also, it does not re-set the subnet upon game completion yet.
|
||||
|
||||
In addition, the script only knows about a few types of moves, and does not yet know how to capture or defend networks.
|
||||
|
||||
|
||||
|
||||
#### Killing duplicate scripts
|
||||
|
||||
Because there is only one subnet active at any time, you do not want multiple copies of your scripts running and competing with each other. It may be helpful to kill any other scripts with the same name as your IPvGO script on startup. This can be done using `ns.getRunningScript()` to get the script details and `ns.kill()` to remove old copies of the script.
|
||||
|
||||
|
||||
|
||||
### Move option: Capturing the opponent's networks
|
||||
|
||||
If the opposing faction's network is down to its last open port, placing a router in that empty node will capture and destroy that entire network.
|
||||
|
||||
To find out what networks are in danger of capture, `ns.go.analysis.getLiberties()` shows how many empty nodes / open ports each network has. As with `getBoardState()` and `getValidMoves()` , the number of liberties (open ports) for a given point's network can be retrieved via its coordinates `[x][y]` on the grid returned by `getLiberties()`
|
||||
|
||||
```text
|
||||
Detect moves to capture the opponent's routers:
|
||||
For each point on the board:
|
||||
* If the empty point is a valid move, and
|
||||
* If a point to the north, south, east, or west is a router with exactly 1 liberty [via its coordinates in getLiberties()], and
|
||||
* That point is controlled by the opponent [it is a "O" via getBoardState()]
|
||||
|
||||
Then, playing that move will capture the opponent's network.
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Move option: Defending your networks from capture
|
||||
|
||||
`getLiberties()` can also be used to detect your own networks that are in danger of being captured, and look for moves to try and save it.
|
||||
|
||||
```text
|
||||
Detect moves to defend a threatened network:
|
||||
For each point on the board:
|
||||
* If the empty point is a valid move, and
|
||||
* If a point to the north, south, east, or west is a router with exactly 1 liberty [via its coordinates in getLiberties()], and
|
||||
* That point is controlled by the player [it is a "X" via getBoardState()]
|
||||
|
||||
Then, that network is in danger of being captured.
|
||||
|
||||
|
||||
To detect if that network can be saved:
|
||||
|
||||
* Ensure the new move will not immediately allow the opponent to capture:
|
||||
* That empty point ALSO has two or more empty points adjacent to it [a "." via getBoardState()], OR
|
||||
* That empty point has a friendly network adjacent to it, and that network has 3 or more liberties [via getLiberties()]
|
||||
|
||||
Then, playing that move will prevent your network from being captured (at least for a turn or two)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Move option: Smothering the opponent's networks
|
||||
|
||||
In some cases, an opponent's network cannot YET be captured, but by placing routers all around it, the network can be captured on a future move. (Or at least you force the opponent to spend moves defending their network.)
|
||||
|
||||
There are many ways to approach this, but the simplest is to look for any opposing network with the fewest liberties remaining (ideally 2), and find a safe point to place a router that touches it.
|
||||
|
||||
To make sure the move will not immediately get re-captured, make sure the point you play on has two adjacent empty nodes, or is touching a friendly network with three+ liberties. (This is the same as the check in the move to defend a friendly chain.)
|
||||
|
||||
|
||||
|
||||
### Move option: Expanding your networks' connections to empty nodes
|
||||
|
||||
The more empty nodes a network touches, the stronger it is, and the more territory it influences. Thus, placing routers that touch a friendly network and also to as many open nodes as possible is often a strong move.
|
||||
|
||||
This is similar to the logic for defending your networks from immediate capture. Look for a friendly network with the fewest open ports, and find an empty node adjacent to it that touches multiple other empty nodes.
|
||||
|
||||
|
||||
|
||||
### Move option: Encircling space to control empty nodes
|
||||
|
||||
A key part of the strategy of Go is fully encircling groups of empty nodes. The examples at the start of this doc simply leave out specific nodes and hope they stay empty, but this can be done in much better ways.
|
||||
|
||||
As a simple approach, look for possible moves that are:
|
||||
|
||||
- adjacent to two separate empty nodes (open areas it will divide up)
|
||||
- adjacent a friendly piece and the edge of a board (or a second friendly piece from a different chain than the first)
|
||||
|
||||
This will find moves which are connecting your chains together, or connecting to the edge of the board, and dividing up empty space in the process. This allows you to control space, making it harder to capture your chains in the process.
|
||||
|
||||
|
||||
|
||||
### Choosing a good move option
|
||||
|
||||
Having multiple plausible moves to select from is helpful, but choosing the right option is important to making a strong Go script. In some cases, if a move type is available, it is almost always worth playing (such as defending your network from immediate capture, or capturing a vulnerable enemy network)
|
||||
|
||||
Each of the IPvGO factions has a few moves they will almost always choose (The Black hand will always capture if possible, for example). Coming up with a simple prioritized list is a good start to compete with these scripts. Experiment to see what works best!
|
||||
|
||||
This idea can be improved, however, by including information such as the size of the network that is being threatened or that is vulnerable to capture. It is probably worth giving up one router in exchange for capturing a large enemy network, for example. Adding two new open ports to a large network is helpful, but limiting an opponent's network to one open port might be better.
|
||||
|
||||
|
||||
|
||||
### Other types of move options
|
||||
|
||||
**Preparing to invade the opponent**
|
||||
|
||||
Empty areas that are completely surrounded and controlled by a single player can be seen via `ns.go.analysis.getControlledEmptyNodes()`. However, just because the area is currently controlled by the opponent does not mean it cannot be attacked! Start by surrounding an opponent's network from the outside, then it can be captured by attacking the space it surrounds and controls. (Note that this only works on networks that have a single interior empty space: if they have multiple inner empty points, the suicide rule prevents you from filling any of them)
|
||||
|
||||
**Wrapping empty space**
|
||||
|
||||
The starting script uses some very simple logic to leave open empty nodes inside its networks (simply excluding points with `x % 2 === 0 && y % 2 === 0`). However, it is very strong to look for ways to actively surround empty space.
|
||||
|
||||
Look for moves that connect a network to the edge of a board that touch an empty node, or look for moves that connect two networks and touch an empty node. Or, look for a move that touches a friendly network and splits apart a chain of empty nodes.
|
||||
|
||||
**Jumps and Knights' moves**
|
||||
|
||||
The factions currently only look at moves directly connected to friendly or enemy networks in most cases. however, especially on the larger board, playing a router a few spaces away from an existing line/network allows the player to influence more territory, compared to slower moves that connect one adjacent node at a time. Consider skipping a node or two, or playing diagonally, or combining them to make L shaped jumps (like a knight's move in chess)
|
||||
|
||||
**Pattern Matching**
|
||||
|
||||
There are a lot of strong shapes in Go, that are worth attempting to re-create. The factions look for ways to slip diagonally between the players' networks and cut them apart. They also look for ways to wrap around isolated opposing routers. Consider making a small library of strong shapes, then looking to match them on the board (or their rotations or mirrors). The exact shapes will require some research into Go, but there is a lot of good documentation online about this idea.
|
||||
|
||||
**Creating "Eyes"**
|
||||
|
||||
If a single network fully encloses two different disconnected empty nodes, it can never be taken. (If it only had one inner airspace, the opponent could eventually surround and then fill it to capture the network. If there is two, however, the suicide rule prevents them from filling either inner empty space.) Detecting moves that make figure-8 type shapes, or split an encircled empty node chain into two smaller ones, are very strong.
|
||||
|
||||
In addition, if the opponent has only a single such move, playing there first to block it is often extremely disruptive, and can even lead to their network being captured.
|
||||
|
||||
|
||||
|
||||
A deeper dive into this idea will involve making your own code to identify chains of pieces (and continuous empty nodes).
|
||||
|
||||
- Find all moves that divide up empty space and connect two chains or a chain and the edge as in the 'encircling empty space' idea above
|
||||
- Apply the move on a sample board in memory, one at a time
|
||||
- Identify all chains and continuous groups of empty nodes in the resulting board, and which color pieces surround the new empty node groups
|
||||
- Prioritize the move that makes the most empty node groups fully surrounded by your player color.
|
||||
- Alternatively, count how many empty node groups each friendly chain is touching, and prioritize moves that create a second of these "eyes" for friendly chains
|
||||
@@ -0,0 +1,131 @@
|
||||
# Hacking algorithms
|
||||
|
||||
There are three primary families of hacking algorithms.
|
||||
This guide will go over each of them and advise on how they can be implemented.
|
||||
|
||||
## Self-contained algorithms
|
||||
|
||||
**Difficulty**: Easy
|
||||
|
||||
Pros:
|
||||
|
||||
- Easy to implement
|
||||
- Does not require other scripts to work
|
||||
- Works at any stage of the game
|
||||
|
||||
Cons:
|
||||
|
||||
- Limits income generation
|
||||
- Extremely [RAM](../basic/ram.md) inefficient
|
||||
- Utilizes script online time poorly
|
||||
- Risk of over hacking
|
||||
|
||||
Self-contained algorithms are the simplest family of hacking algorithms to implement.
|
||||
Each script is tasked with choosing which function to execute based on the status of the target server.
|
||||
Because of this, they guarantee a consistent, but relatively small, flow of money.
|
||||
|
||||
The general logic goes like this:
|
||||
|
||||
loop forever {
|
||||
if security is not minimum {
|
||||
await ns.weaken(target)
|
||||
} else if money is not maximum {
|
||||
await ns.grow(target)
|
||||
} else {
|
||||
await ns.hack(target)
|
||||
}
|
||||
}
|
||||
|
||||
This algorithm is perfectly capable of paving the way through the majority of the game, but it has a few significant issues.
|
||||
|
||||
- It tends to make all your scripts on every server do the same thing.
|
||||
(e.g. If the target is 0.01 security above the minimum, all scripts will decide to weaken, when only a handful of threads should be devoted to the task)
|
||||
- At higher thread counts, these scripts have the potential to hack the server to \$0, or maximum security, requiring a long setup time while the scripts return the server to the best stats.
|
||||
- Requires function calls such as `getServerSecurityLevel` and `getServerMoneyAvailable`, as well as calling all three hacking functions, increasing RAM cost which is multiplied by the number of allocated threads
|
||||
|
||||
## Loop algorithms
|
||||
|
||||
**Difficulty**: Easy to Medium
|
||||
|
||||
Pros:
|
||||
|
||||
- Simple to understand
|
||||
- Works at any stage of the game
|
||||
- Maximize RAM usage
|
||||
|
||||
Cons:
|
||||
|
||||
- Requires a script that handles deployment
|
||||
|
||||
By splitting our hack, weaken, and grow functions into three separate scripts, we can both remove our reliance on functions such as `getServerSecurityLevel` as well as removing functions that cannot work concurrently, reducing RAM requirements, and thus increasing our thread limits.
|
||||
Loop scripts are formatted like this:
|
||||
|
||||
loop forever {
|
||||
await ns.hack(target) // or grow, or weaken
|
||||
}
|
||||
|
||||
Now we can take the total amount of threads available and split it and allocate, for example:
|
||||
|
||||
- 1 part to the hack scripts
|
||||
- 10 parts to the grow scripts
|
||||
- 2 parts to the weaken scripts
|
||||
|
||||
Meaning if we have space for 100 threads across the entire network 7 threads will go to the hack scripts, 76 threads will go to the grow scripts and 15 threads will go to the weaken scripts.
|
||||
The ratios described here are arbitrary and can be greatly improved through the use of the analyze functions, and later, through the use of Formulas.exe.
|
||||
|
||||
When utilizing this strategy, monitor the amount of money and security on the target server, if the money is not hovering around maximum and the security around the minimum, the ratios should be tweaked until that is the case.
|
||||
|
||||
Utilizing `sleep` or `asleep` to ensure that your scripts do not all start at the same time can decrease the chance of issues associated with overhacking occurring.
|
||||
Both functions have a ram cost of zero.
|
||||
|
||||
## Batch algorithms (HGW, HWGW, or Cycles)
|
||||
|
||||
**Difficulty**: Hard
|
||||
|
||||
Pros:
|
||||
|
||||
- Maximum potential income
|
||||
|
||||
Cons:
|
||||
|
||||
- Very difficult to implement without prior programming knowledge
|
||||
- Very difficult to make work on servers with less than 1TB of RAM
|
||||
|
||||
Batch algorithms utilize a master script that uses `exec` many scripts which utilize a relevant hacking function in batches.
|
||||
|
||||
The scripts used to execute the hacking functions are even simpler than the previous algorithms but a complex controller is required to calculate the effect, time taken, and the necessary delay.
|
||||
|
||||
await ns.sleep(a bit)
|
||||
await ns.hack(target) // or grow, or weaken
|
||||
|
||||
A few things need to be known before this algorithm can be implemented:
|
||||
|
||||
- The effects of hack and grow depend on the server security level, a higher security level results in a reduced effect.
|
||||
You only want these effects to occur when the security level is minimized.
|
||||
- The time taken to execute hack, grow, or weaken is determined when the function is called and is based on the security level of the target server and your hacking level.
|
||||
You only want these effects to start when the security level is minimized.
|
||||
- The effects of hack, grow, and weaken, are determined when the time is completed, rather than at the beginning.
|
||||
Hack should finish when security is minimum and money is maximum.
|
||||
Grow should finish when security is minimum, shortly after a hack occurred.
|
||||
Weaken should occur when security is not at a minimum due to a hack or grow increasing it.
|
||||
|
||||
A single batch consists of four actions:
|
||||
|
||||
1. A hack script removes a predefined, precalculated amount of money from the target server.
|
||||
2. A weaken script counters the security increase of the hack script.
|
||||
3. A grow script counters the money decrease caused by the hack script.
|
||||
4. A weaken script counters the security increase caused by the grow script.
|
||||
|
||||
It is also important that these 4 scripts finish in the order specified above, and all of their effects be precalculated to optimize the ratios between them.
|
||||
This is the reason for the delay in the scripts.
|
||||
|
||||
|= hack ====================|
|
||||
|=weaken 1======================================|
|
||||
|= grow ==========================|
|
||||
|=weaken 2======================================|
|
||||
|
||||
Batches only function predictably when the target server is at minimum security and maximum money, so your script must also handle preparing a server for your batches.
|
||||
You can utilize batches to prepare a server by using no hack threads during preparation.
|
||||
|
||||
Depending on your computer's performance as well as a few other factors, the necessary delay between script execution times may range between 20ms and 200ms, you want to fine-tune this value to be as low as possible while also avoiding your scripts finishing out of order.
|
||||
Anything lower than 20ms will not work due to JavaScript limitations.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Learn to Program in JavaScript
|
||||
|
||||
## For Beginner Programmers
|
||||
|
||||
If you have little to no programming experience, that's okay!
|
||||
You don't need to be a great programmer in order to enjoy or play this game.
|
||||
In fact, this game could help you learn some basic programming concepts.
|
||||
|
||||
Here are some good tutorials for learning programming/JavaScript as a beginner:
|
||||
|
||||
- [Learn-JS](https://www.learn-js.org/en/Welcome)
|
||||
- [programiz](https://www.programiz.com/javascript/get-started)
|
||||
- [Speaking JavaScript](https://exploringjs.com/es5/)
|
||||
This is a bit on the longer side.
|
||||
You can skip all of the historical background stuff.
|
||||
Recommended chapters: 1, 7-18
|
||||
|
||||
## For Experienced Programmers
|
||||
|
||||
The following section lists several good tutorials/resources for those who have experience programming but who have not worked extensively with JavaScript before.
|
||||
|
||||
Before that, however, it's important to clarify some terminology about the different versions of JavaScript.
|
||||
These are summarized in this article:
|
||||
|
||||
[WTF is ES6, ES8, ES2017, ECMAScript...](https://codeburst.io/javascript-wtf-is-es6-es8-es-2017-ecmascript-dca859e4821c)
|
||||
|
||||
An important takeaway from this article is that ES6, also known as ES2015, introduced many major features that are commonly seen in modern JavaScript programming.
|
||||
However, this means that ES5 engines and interpreters will fail if they encounters these ES6 features.
|
||||
You'll see why this is important further down.
|
||||
|
||||
- [MDN Introduction to JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript)
|
||||
- [Eloquent JavaScript (ES6+)](https://eloquentjavascript.net/)
|
||||
Recommended Chapters: Introduction, 1-6
|
||||
- [Modern JavaScript Tutorial (ES6+)](https://javascript.info/)
|
||||
Recommended Chapters: 2, 4-6
|
||||
@@ -0,0 +1,29 @@
|
||||
# How to use React in game
|
||||
|
||||
Since v2.7.0, Bitburner supports React and TypeScript out of the box. You can use the jsx syntax inside `.jsx` and `.tsx` files.
|
||||
|
||||
## Example
|
||||
|
||||
Use `ns.printRaw` and `ns.tprintRaw` to render React elements in the logs and terminal.
|
||||
|
||||
```tsx
|
||||
// timer.tsx
|
||||
function Timer() {
|
||||
const [seconds, setSeconds] = React.useState(0);
|
||||
|
||||
React.useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
setSeconds((seconds) => seconds + 1);
|
||||
}, 1000);
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return <div>Seconds: {seconds}</div>;
|
||||
}
|
||||
|
||||
export async function main(ns: NS) {
|
||||
ns.tail();
|
||||
ns.printRaw(<Timer />);
|
||||
await ns.asleep(10000);
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,174 @@
|
||||
# Remote API
|
||||
|
||||
All versions of Bitburner can use websockets to connect to a server.
|
||||
That server can then perform a number of actions.
|
||||
Most commonly this is used in conjunction with an external text editor or API
|
||||
in order to make writing scripts easier, or even use typescript.
|
||||
|
||||
To make use of this Remote API through the official server, look [here](https://github.com/bitburner-official/typescript-template).
|
||||
If you want to make your own server, see below for API details.
|
||||
|
||||
This API uses the JSON RPC 2.0 protocol. Inputs are in the following form:
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": string,
|
||||
"params": any
|
||||
}
|
||||
|
||||
Outputs:
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": any,
|
||||
"error": any
|
||||
}
|
||||
|
||||
## Methods
|
||||
|
||||
## `pushFile`
|
||||
|
||||
Create or update a file.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "pushFile",
|
||||
"params": {
|
||||
filename: string;
|
||||
content: string;
|
||||
server: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": "OK"
|
||||
}
|
||||
|
||||
## `getFile`
|
||||
|
||||
Read a file and its content.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "getFile",
|
||||
"params": {
|
||||
filename: string;
|
||||
server: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": string
|
||||
}
|
||||
|
||||
## `deleteFile`
|
||||
|
||||
Delete a file.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "deleteFile",
|
||||
"params": {
|
||||
filename: string;
|
||||
server: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": "OK"
|
||||
}
|
||||
|
||||
## `getFileNames`
|
||||
|
||||
List all file names on a server.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "getFileNames",
|
||||
"params": {
|
||||
server: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": string[]
|
||||
}
|
||||
|
||||
## `getAllFiles`
|
||||
|
||||
Get the content of all files on a server.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "getAllFiles",
|
||||
"params": {
|
||||
server: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": {
|
||||
filename: string,
|
||||
content: string
|
||||
}[]
|
||||
}
|
||||
|
||||
## `calculateRam`
|
||||
|
||||
Calculate the in-game ram cost of a script.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "calculateRam",
|
||||
"params": {
|
||||
filename: string;
|
||||
server: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": number
|
||||
}
|
||||
|
||||
## `getDefinitionFile`
|
||||
|
||||
Get the definition file of the API.
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"method": "getDefinitionFile"
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": number,
|
||||
"result": string
|
||||
}
|
||||
Reference in New Issue
Block a user