- Sep 6, 2017
- 1,063
- 1,263
Rewrote a huge chunk of the NPC and player generation script, that gave me a major headache.
The save size for 1000 NPCs on game start is now 94k instead of ~270k for 1000 NPCs, not quite done yet, if I could set integer sizes could probably save more space still learning this javascript stuff. Almost everything is saved as numbers now instead of strings, have made another script to read the information back from the arrays on request.
Edit : (01/07/2019): Rewrote part of the scheduler and improved the map NPC array script, Everything is now fixed and functions like before but with the ability to keep track of NPC's at locations, it currently does not account for NPCs being present at multiple locations at once (which should not happen), should in theory be possible to prevent that along with the ability to generate more NPCs if there are not enough to populate an area, with have to write some logic to make sure the same NPCs don't show up all the time, maybe have a last seen timer or something.
The save size for 1000 NPCs on game start is now 94k instead of ~270k for 1000 NPCs, not quite done yet, if I could set integer sizes could probably save more space still learning this javascript stuff. Almost everything is saved as numbers now instead of strings, have made another script to read the information back from the arrays on request.
Edit : (01/07/2019): Rewrote part of the scheduler and improved the map NPC array script, Everything is now fixed and functions like before but with the ability to keep track of NPC's at locations, it currently does not account for NPCs being present at multiple locations at once (which should not happen), should in theory be possible to prevent that along with the ability to generate more NPCs if there are not enough to populate an area, with have to write some logic to make sure the same NPCs don't show up all the time, maybe have a last seen timer or something.
Last edited: