Depends, for some people (specially unexperienced ones) 60,000 lines written by themselves are more manageable than 10,000 written by a stranger. That's what I was trying to say, no point in bringing changes to the code for the single purpose of making it look better if it's going to take the dev days to adapt to it. As I said working as a group on a code requires to be well coordinated otherwise it is quickly counterproductive.On the other hand 60,000 lines of code to do what you could do with 10,000 is a lot more manageable. Less areas for something to get copied wrong, adjusted wrong, or type every time something new comes in.
Yes it is faster. For the reason that state is saved in each savestate (history) while setup isn't. So if you have 10 saves in your browser cache and each save keeps 10 savestates, each variable that is stored in state is stored 100 times. I don't think I have to explain why storing 100 times a variable whose value never change is bad.Is this actually faster though? Both are kept in memory so I don't imagine one would be more lightweight than the other, and is there some performance penalty when accessing the property of an object? Pulling a global var into cache would only be pulling that single variable but wouldn't an object property require the object to me moved into cache, thus being slower? I don't know the answer to this.
To give you an idea, the game stores around 840 variables in state. I have identified 590 (so 70%) that are constant. And 95% of them are either large strings or arrays. Try this version of the game with all those variables stored in setup instead. Note that I have set the history to 10 (v1.2 use 5) and it is still faster. (this version might have visual bugs as I have heavily used regex to edit it)
Last edited: