jdoleary / Spellmasons

https://store.steampowered.com/app/1618380/Spellmasons/
Other
3 stars 1 forks source link

Edit: Stress test arrow prediction duration #906

Open jdoleary opened 1 month ago

jdoleary commented 1 month ago

Edit: We can't think of a way to optimize so instead we'll just stress test it to make sure it's not too bad.

Arrow Prediction needs heavy optimization I think due to arrows now being entirely physics based, their predictions are slower.

I was able to absolutely cripple the game (in prediction) with a large stack of bounce and a arrows. I just froze for a long time.

I think it's because each arrow is now many loops of calculation instead of one calculation.

Let's discuss the best way to do this. Arrows fired in a single direction can probably be optimized to now have to "start over" but when you use Triple Arrow, Five Arrow or target multiple targets and then arrow that optimization wouldn't help.

I'm not sure how to best do this. Maybe we need to take measurements to compare past perf with current perf to make sure.

jdoleary commented 1 month ago

See

  // Limit bounces remaining until we can optimize:
  // https://github.com/jdoleary/Spellmasons/issues/906
  forceMoveInst.bouncesRemaining = Math.min(3, forceMoveInst.bouncesRemaining);

in src\jmath\moveWithCollision.ts