Travel Speed

General out-of-character discussion among players of Cantr II.

Moderators: Public Relations Department, Players Department

Andu
Posts: 685
Joined: Wed Aug 06, 2008 5:29 pm
Location: Finland

Travel Speed

Postby Andu » Fri Nov 23, 2012 12:54 pm

If a guy walking on a road carries 1000 grams, his speed is calculated (10 - (1000/5000)) = 9,8

Is his speed rounded down, to the closest whole pixel or stay at that exact number?

The speed is:
a. 9
b. 10
c. 9.8

Would be interesting to know how it is.
"An those with little fuel, could tie a pack of bears in front of their limousine, with whip and crossbow in hands to keep them in line."
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: Travel Speed

Postby EchoMan » Fri Nov 23, 2012 3:51 pm

The "speed" variable in the db is an integer, but the code doesn't round anything, so default rounding behaviour of MySQL applies. E.g:

Code: Select all

9.49999999999... is rounded down to 9
9.50000000000... is rounded up to 10
Andu
Posts: 685
Joined: Wed Aug 06, 2008 5:29 pm
Location: Finland

Re: Travel Speed

Postby Andu » Sat Nov 24, 2012 12:13 pm

Yay, thanks! :lol:
"An those with little fuel, could tie a pack of bears in front of their limousine, with whip and crossbow in hands to keep them in line."

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest