You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[This is to encourage Programming Best Practices, as well as bring us closer to offering localization in the future. It also helps enable us to change strings once they've been in the wild for some time.]
We have a bunch of constants made available in the API, some of which are available in ns.enums, many of which are locked behind functions like getSkillNames(), and many of which have RAM costs associated, for what is essentially just getting a list of API-recognized strings for a given function. They don't provide logic, and their scattered use encourages people to just hardcode names and numbers. This also makes it difficult in case we ever want to change strings for any reason at all. Because there are not player-facing methods to avoid problems, any player-facing strings and IDs become permanent fixtures that cannot be later changed. I'd like to, well, fix that.
After a brief discussion in Discord, I've been given the clear to reduce the string-constant functions to 0 RAM:
The first change will, very simply, be an API cost reduction for the pre-existing functions. This is the lowest lift.
After reducing the above RAM costs, I want to present a lot of this information to the player in the form of enums, and deprecate many of the existing functions (in a similar way to how the console warns a player who uses timeSinceLastAugInstall and similar.
I want to enum-ify or otherwise make available the following static information:
Right now this is an unsorted list of strings, which is pretty difficult to make useful. Array-indexing is never going to be used by a player (there's no formulaic value for iterating across their functionality by index), so I'd like to turn this into ns.hacknet.hashUpgrade.SELL_FOR_MONEY => 'Sell for money' etc.
Similar to the hacknet upgrades, right now this is just a list of strings thrown into an array. I'd like to make them available as ns.codingcontract.type.ALGORITHMIC_STOCK_TRADER_I etc.
I also have marked the following Corporation constants that appear to be in a similar position:
Employee positions
Industry names
Material names
Research names
Smart supply options
State names
Unlock names
Upgrade names
If there are others, or if any of the above are dynamic, then let me know. Otherwise I'd like to turn those into string enums as well.
The text was updated successfully, but these errors were encountered:
One thing I'll point out is that for many of these APIs, the strings are effectively frozen and cannot be changed anyway. But it's still useful to make enums for them.
[This is to encourage Programming Best Practices, as well as bring us closer to offering localization in the future. It also helps enable us to change strings once they've been in the wild for some time.]
We have a bunch of constants made available in the API, some of which are available in
ns.enums
, many of which are locked behind functions likegetSkillNames()
, and many of which have RAM costs associated, for what is essentially just getting a list of API-recognized strings for a given function. They don't provide logic, and their scattered use encourages people to just hardcode names and numbers. This also makes it difficult in case we ever want to change strings for any reason at all. Because there are not player-facing methods to avoid problems, any player-facing strings and IDs become permanent fixtures that cannot be later changed. I'd like to, well, fix that.After a brief discussion in Discord, I've been given the clear to reduce the string-constant functions to 0 RAM:
The first change will, very simply, be an API cost reduction for the pre-existing functions. This is the lowest lift.
After reducing the above RAM costs, I want to present a lot of this information to the player in the form of enums, and deprecate many of the existing functions (in a similar way to how the console warns a player who uses
timeSinceLastAugInstall
and similar.I want to enum-ify or otherwise make available the following static information:
ns.stanek.fragment.HACK_S
=> Fragment<id=0, ...>ns.stanek.fragment.HACK_Z
=> Fragment<id=1, ...>ns.stanek.fragment.POWER_F
=> Fragment<id=100, ...>ns.stanek.fragment.POWER_J
=> Fragment<id=101, ...>ns.hacknet.hashUpgrade.SELL_FOR_MONEY
=>'Sell for money'
etc.ns.codingcontract.type.ALGORITHMIC_STOCK_TRADER_I
etc.I also have marked the following Corporation constants that appear to be in a similar position:
If there are others, or if any of the above are dynamic, then let me know. Otherwise I'd like to turn those into string enums as well.
The text was updated successfully, but these errors were encountered: