Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bignum #7

Closed
erosson opened this issue Aug 27, 2014 · 8 comments
Closed

bignum #7

erosson opened this issue Aug 27, 2014 · 8 comments

Comments

@erosson
Copy link
Member

erosson commented Aug 27, 2014

maxing out javascript's numbers isn't impossible here,especially if people manage to produce larvae faster than I planned (reset bonuses later?). use bignums. we're already using mathjs, which has them.

This must be done before 1.0 because it might impact save states, and we can't reset people after that.

@erosson erosson added this to the 1.0 milestone Aug 27, 2014
@erosson
Copy link
Member Author

erosson commented Sep 15, 2014

https://www.reddit.com/r/swarmsim/comments/2g97zf/what_is_your_strategy_for_using_injections/ckhinow

numbers are getting bigger, this is getting more urgent

otoh, with the inject cap coming (#65) this might become less urgent

@erosson erosson modified the milestones: 0.2.0, 1.0 Sep 15, 2014
@erosson
Copy link
Member Author

erosson commented Sep 21, 2014

this'll have to wait for the next reset. #123 makes 0.2.0's release too urgent.

hopefully the new limitations on clone (inject) keep numbers smaller this time. there's lots of other new bonuses though, and more clones are possible than before if games stretch over weeks... we'll see.

@erosson erosson modified the milestones: 0.3.0, 0.2.0 Sep 21, 2014
@erosson erosson modified the milestones: 0.3.0, eventually Nov 25, 2014
@erosson erosson modified the milestones: 1.0 - prestige, eventually Jan 14, 2015
@erosson
Copy link
Member Author

erosson commented Jan 14, 2015

people are getting above 1e180 without prestige bonuses. I think prestige is going to make this more urgent.

erosson added a commit that referenced this issue Jan 15, 2015
no-unit-selected updates fine, and shows numbers bigger than 1e300. problem is, it's unusably slow. need to do some profiling before this is useful.
@erosson erosson modified the milestones: eventually, 1.0 - prestige Jan 15, 2015
@erosson
Copy link
Member Author

erosson commented Jan 15, 2015

good news: bignum wasn't too tough to get functioning. replace all js-math with math.eval().

bad news: it's unusably slow. like, with just meat/drones/larvae, I couldn't get more than 2 fps.

put the changes in their own branch for now. it'll need some profiling and optimization before it's usable - I'm sure there's some overhead to math.eval(). those are big refactorings though, and profiling is misery. it doesn't look like prestige will exceed 1e300 anyway, let's wait and see if testers agree.

@erosson
Copy link
Member Author

erosson commented Jan 26, 2015

took another shot at this with math.js functions and then with decimal.js. both were faster than math.eval, but still very very laggy - not promising enough to spend more time on this.

erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
@erosson
Copy link
Member Author

erosson commented Jan 29, 2015

this is a priority again; it's possible to reach 1e300 legitimately and I'd rather not nerf everything

(finally) got it up to a playable speed! reworked caching everywhere; all memoize() calls are gone, replaced by a Cache class on game with fewer coarse-grained clearers (tick for counts, update for most others). a couple of tests are still upset and some template formatting is still screwy (percents) and some less visible stuff (achievements, analytics, statistics) is still busted, and the 1e300 cap is still (deliberately) in place; nothing showstopping. I now think this is doable after all.

having more types of units active makes a noticeable difference in speed: 80% idle with just drones, to 15% idle with all meat units active. same thing in prod though, so it's okay.

chrome cpu profiler is awesome. (wish I could say the same for memory, #168)

erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 29, 2015
erosson added a commit that referenced this issue Jan 30, 2015
erosson added a commit that referenced this issue Jan 30, 2015
erosson added a commit that referenced this issue Jan 30, 2015
erosson added a commit that referenced this issue Jan 30, 2015
erosson added a commit that referenced this issue Jan 30, 2015
erosson added a commit that referenced this issue Jan 30, 2015
@erosson
Copy link
Member Author

erosson commented Jan 30, 2015

pushed this to publictest, at last. caught everything I could. the 1e300 limit's not yet lifted, but decimal.js is deployed on publictest for real. let's see what people break before raising the limit.

@erosson
Copy link
Member Author

erosson commented Feb 1, 2015

still a few bugs, but we're doing well enough to call this done and raise the cap. start with 1e400, raise it more later.

@erosson erosson closed this as completed in 39b0219 Feb 1, 2015
erosson added a commit that referenced this issue Feb 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant