Search
Wednesday
Oct302013

Floats

You know what I love about floats? 9.0 - 5.0 can sometimes = 4.00001! Gahh!

I spent most of my game dev time today reworking the code to gracefully handle float values. While I could have just converted everything to integer values, I wanted to maintain support for floats due to things such as critical hits (base damage x critical damage of 150%), which may result in a fractional value. After speaking to our game designer about this, I implemented a simple solution of rounding up at .5, else rounding down. The player will only ever see integer values despite some rounding happening in the background.

Tomorrow I plan on re-implementing system state logic based on the game design changes. For example, when a ship system is disabed, weapons will no longer be usable. If there's time, I can finally start on a long-waited feature: xml support! Once that's in, our game designer can dive in with modifying enemies and equipment stats, and see how much potential the combat has in terms of fun.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« Xml Support In! | Main | 10/26 Progress + Pokemon »