Integer arithmetic and averages in haven.

Ask, answer and discuss any and all topics about the hows, whys, wheres and whens of playing Haven & Hearth.

Integer arithmetic and averages in haven.

Postby Sitting_Bill » Thu Jun 09, 2011 4:37 pm

Hi -

A simple question for those who know. When calculating the "average" quality, say if I'm making a kiln, does the game round to the nearest integer, or take the integer part?

i.e. if I build, say, a kiln, with 44 pieces of q35 clay and 1 piece of q34, will the kiln quality be q35 or q34?

I'm guessing this comes down to how quality is represented in the code, as integers or floats or whatever.
in game character: Gunnar of Hlidarendi
Sitting_Bill
 
Posts: 503
Joined: Tue Mar 15, 2011 12:35 am

Re: Integer arithmetic and averages in haven.

Postby Tonkyhonk » Thu Jun 09, 2011 4:39 pm

Sitting_Bill wrote:i.e. if I build, say, a kiln, with 44 pieces of q35 clay and 1 piece of q34, will the kiln quality be q35 or q34?

iirc, its rounded down to q34.
User avatar
Tonkyhonk
 
Posts: 4501
Joined: Fri Sep 10, 2010 6:43 am

Re: Integer arithmetic and averages in haven.

Postby Potjeh » Thu Jun 09, 2011 5:06 pm

Yup, rule of thumb is that q gets rounded down.
Image Bottleneck
User avatar
Potjeh
 
Posts: 11811
Joined: Fri May 29, 2009 4:03 pm


Return to How do I?

Who is online

Users browsing this forum: Ahrefs [Bot], Claude [Bot], PetalBot [Bot] and 0 guests