Difference between revisions of "Talk:Energy Management"

From Robowiki
Jump to navigation Jump to search
m (Discussion: Old wiki)
 
(→‎Improvement: inverse of the bulletpower formula)
 
(8 intermediate revisions by 4 users not shown)
Line 10: Line 10:
  
 
You can only call getXXX methods something like 10,000 times per tick. Maybe you are forgetting to call execute() in the while() loop of your run method? If you really need to do 10,000 things wih a value in one tick, just assign it to a variable instead of using getXXX in your loop. -- Voidious
 
You can only call getXXX methods something like 10,000 times per tick. Maybe you are forgetting to call execute() in the while() loop of your run method? If you really need to do 10,000 things wih a value in one tick, just assign it to a variable instead of using getXXX in your loop. -- Voidious
 +
 +
== Merge with [[Selecting Fire Power]] ==
 +
 +
To me, it seems this page and [[Selecting Fire Power]] are rather redundant and should be merged in one direction or another. Any thoughts? --[[User:Rednaxela|Rednaxela]] 12:41, 20 May 2009 (UTC)
 +
 +
Agree, only if energy management is just fire power (which it is now), but if anyone can figure out energy management to be used in other part (such as dodging), then I'll disagree. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 13:09, 20 May 2009 (UTC)
 +
 +
With Robocode 2, maybe they could be separate, but in Robocode 1, there is only one way to spend energy, and that's by firing bullets. I'd also vote for merging them. --[[User:Voidious|Voidious]] 14:04, 20 May 2009 (UTC)
 +
 +
: (off-topic) Will Robocode 2 happen? It seem to be abandoned for a really long time (if I remember correctly, since 2004) I'm actually waiting for it, and knowing that current generation bot will not be able to fight effectively (if it still use that speed-strength-damage thing, some VCS-GF robot may get some error from GF 1.3) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:36, 20 May 2009 (UTC)
 +
 +
:: I have no idea if/when Robocode 2 will actually come out, but we have discussed it a lot more recently than that (late '07 / early '08, maybe?). Basically brainstormed some ideas and discussed with [[User:FlemmingLarsen|Fnl]]. Some ideas included other ways to spend energy, like a secondary fire or a temporary boost of speed. --[[User:Voidious|Voidious]] 14:42, 20 May 2009 (UTC)
 +
 +
::: Not early'08 I think since I'm here that time and I haven't saw any discussions (either on google groups or robowiki) about it. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 15:04, 20 May 2009 (UTC)
 +
 +
:::: OK, ok, you just migrate the page, it late'08 (I'm confusing with time here, thinking '07 is '08 and '08 is '09) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 15:17, 20 May 2009 (UTC)
 +
 +
== Improvement ==
 +
The calc to fire just enough energy to kill an opponent is not trivial and <code>enemyEnergy / 4</code> is not the best option. Anyone could post the right calc here? --[[User:Hvilela|Henrique Vilela (Hvilela)]] 23:52, 3 November 2009 (UTC)
 +
 +
As [[Robocode/Game Physics]] says, damage is <code>(4 * firepower)</code>, plus <code>(2 * (power - 1))</code> when firepower is greater than 1. That means <code>(4 * firepower)</code> when firepower is 1 or less, and <code>(6 * firepower) - 2</code> when firepower is above one. Firepower above 1 means damage above 4 due to the formula. Thus the inverse formula is <code>firepower = (energy <= 4) ? (energy / 4) : ((energy + 2) / 6)</code>. Hopefully my explaination makes sense. --[[User:Rednaxela|Rednaxela]] 02:19, 4 November 2009 (UTC)

Latest revision as of 03:19, 4 November 2009

Credits - Energy Management
Old wiki page: EnergyManagement
Original author(s): Albert

Old Wiki

Out of curiousity, does anyone know the most commonly called getXXX() methods?--Starrynte

I'm not really sure what you mean. You call those methods in your bot, so it really depends which ones you decide to call the most. Also, what does this have to do with EnergyManagement? --wcsv

Maybe...because if you call getXXX() you can get disabled. I'll post on Starrynte then (my reason is a lame one)--Starrynte

You can only call getXXX methods something like 10,000 times per tick. Maybe you are forgetting to call execute() in the while() loop of your run method? If you really need to do 10,000 things wih a value in one tick, just assign it to a variable instead of using getXXX in your loop. -- Voidious

Merge with Selecting Fire Power

To me, it seems this page and Selecting Fire Power are rather redundant and should be merged in one direction or another. Any thoughts? --Rednaxela 12:41, 20 May 2009 (UTC)

Agree, only if energy management is just fire power (which it is now), but if anyone can figure out energy management to be used in other part (such as dodging), then I'll disagree. » Nat | Talk » 13:09, 20 May 2009 (UTC)

With Robocode 2, maybe they could be separate, but in Robocode 1, there is only one way to spend energy, and that's by firing bullets. I'd also vote for merging them. --Voidious 14:04, 20 May 2009 (UTC)

(off-topic) Will Robocode 2 happen? It seem to be abandoned for a really long time (if I remember correctly, since 2004) I'm actually waiting for it, and knowing that current generation bot will not be able to fight effectively (if it still use that speed-strength-damage thing, some VCS-GF robot may get some error from GF 1.3) » Nat | Talk » 14:36, 20 May 2009 (UTC)
I have no idea if/when Robocode 2 will actually come out, but we have discussed it a lot more recently than that (late '07 / early '08, maybe?). Basically brainstormed some ideas and discussed with Fnl. Some ideas included other ways to spend energy, like a secondary fire or a temporary boost of speed. --Voidious 14:42, 20 May 2009 (UTC)
Not early'08 I think since I'm here that time and I haven't saw any discussions (either on google groups or robowiki) about it. » Nat | Talk » 15:04, 20 May 2009 (UTC)
OK, ok, you just migrate the page, it late'08 (I'm confusing with time here, thinking '07 is '08 and '08 is '09) » Nat | Talk » 15:17, 20 May 2009 (UTC)

Improvement

The calc to fire just enough energy to kill an opponent is not trivial and enemyEnergy / 4 is not the best option. Anyone could post the right calc here? --Henrique Vilela (Hvilela) 23:52, 3 November 2009 (UTC)

As Robocode/Game Physics says, damage is (4 * firepower), plus (2 * (power - 1)) when firepower is greater than 1. That means (4 * firepower) when firepower is 1 or less, and (6 * firepower) - 2 when firepower is above one. Firepower above 1 means damage above 4 due to the formula. Thus the inverse formula is firepower = (energy <= 4) ? (energy / 4) : ((energy + 2) / 6). Hopefully my explaination makes sense. --Rednaxela 02:19, 4 November 2009 (UTC)