Difference between revisions of "User talk:AW"
(help with ticks until bullet gunHeat equals 0) |
|||
(One intermediate revision by one other user not shown) | |||
Line 23: | Line 23: | ||
I know that is redundant, but I will optimize later. Anyone know what I am doing wrong?--[[User:AW|AW]] 01:06, 3 June 2011 (UTC) | I know that is redundant, but I will optimize later. Anyone know what I am doing wrong?--[[User:AW|AW]] 01:06, 3 June 2011 (UTC) | ||
+ | |||
+ | I believe that at the beginning of rounds, robots start out with a gun heat greater than that generated by a power 3 bullet. That could be your problem--[[User:CrazyBassoonist|CrazyBassoonist]] 01:31, 3 June 2011 (UTC) | ||
+ | |||
+ | Yep, robot start with 3.0 gun heat, which is more than power 3 bullet. --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 11:25, 3 June 2011 (UTC) |
Latest revision as of 12:25, 3 June 2011
Welcome! Hello, AW, and welcome to RoboWiki! This place contains a wealth information about Robocode, from basic to more advanced. I hope you enjoy creating robots and being a robocoder! If you are posting a comment on this wiki, please sign your messages using four tildes (--~~~~); this will automatically insert your username and the date stamp. If you are not familiar with MediaWiki, these links might help you out:
If you need help, check out the frequently asked questions or ask it on this page. Again, welcome! |
Thought you might like :-) --Nat Pavasant 11:13, 4 March 2011 (UTC)
I have a problem with my code, but I cannot figure out what it is. I am calculating the ticks left until my gun heat is 0, which should be (gunHeat / gunCoolingRate). Then I normalize this from 0 to 1 by dividing by the maximum possible ticks until gun heat equals zero (maxGunHeat / gunCoolingRate), but I am getting values of 1.4 and 1.3 sometimes. Here is my code:
double ticksUntilFire = (robot.getGunHeat() / robot.getGunCoolingRate()) /
(Rules.getGunHeat(Rules.MAX_BULLET_POWER) / robot.getGunCoolingRate());
I know that is redundant, but I will optimize later. Anyone know what I am doing wrong?--AW 01:06, 3 June 2011 (UTC)
I believe that at the beginning of rounds, robots start out with a gun heat greater than that generated by a power 3 bullet. That could be your problem--CrazyBassoonist 01:31, 3 June 2011 (UTC)
Yep, robot start with 3.0 gun heat, which is more than power 3 bullet. --Nat Pavasant 11:25, 3 June 2011 (UTC)