Friday 25 November 2016

Crash Algorithm help

If you've seen a CS:GO gambling site, then it might have the mini-game "Crash". There is a counter that goes up, but it increments by 0.01 each count. The counter speeds up exponentially, so it might take around 3 seconds to get 1.2 (the counter starts out at 1), and speeds up. My problem is I need an algorithm that can calculate the speed that the counter needs to go at each loop. The data I can supply the algorithm is an integer. Also, the algorithm needs to work with a server-side count, that sends a socket request that says "round end/round start". They need to line up, so that if the round ends at say, 3.24, then the client will have 3.24, or something very close. I pre-define the number it will count up to using my own algorithm. The code for client side: setInterval(function() { count +1 0.01; },[time algorithm here (ms)]); And the client side will have a setTimeout. All I need is an algorithm that calculates how long it will take for the round to end.

Submitted November 26, 2016 at 06:10AM by bluebird173

No comments:

Post a Comment