Talk:Robocode/Graphical Debugging

From RoboWiki
< Talk:Robocode
Revision as of 06:37, 22 March 2010 by Urgood2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Contents

Thread titleRepliesLast modified
Slow Debug Graphics1207:03, 27 July 2018
Slow Debug Graphics110:41, 24 July 2018
Graphics are not really mirrored, or is it just me?220:35, 15 April 2013
Debugging waves with onPaint()1102:23, 19 May 2012
Lib files on linux104:23, 11 May 2012

Slow Debug Graphics

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)10:40, 24 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Xor (talk)16:58, 24 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)17:10, 24 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Rsalesc (talk)02:11, 25 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)07:58, 25 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Xor (talk)13:54, 25 July 2018
 
 
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Rsalesc (talk)11:26, 25 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Xor (talk)13:58, 25 July 2018
 
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Beaming (talk)13:18, 25 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)07:03, 27 July 2018
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Xor (talk)14:03, 25 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)16:25, 25 July 2018
 
 

Slow Debug Graphics

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)10:40, 24 July 2018

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Dsekercioglu (talk)10:41, 24 July 2018
 

Graphics are not really mirrored, or is it just me?

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Kenran14:47, 15 April 2013

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Kenran20:20, 15 April 2013
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Voidious20:35, 15 April 2013
 

Debugging waves with onPaint()

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Tkiesel13:39, 17 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Skilgannon14:39, 17 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Tkiesel15:11, 17 May 2012
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Voidious15:29, 17 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Rednaxela16:12, 17 May 2012
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

MN16:14, 17 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Rednaxela16:34, 17 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

MN18:03, 17 May 2012
 

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Chase-san22:55, 17 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

MN13:29, 18 May 2012
 
 
 
 
 

Lib files on linux

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Rimp03:42, 11 May 2012

Anybody else running into these two issues?

RobertWalker 04:01, 13 May 2009 (UTC)

No, but I'm running into a different one. I just haven't taken the time to troubleshoot it and file a report yet.

java.nio.BufferOverflowException
	at java.nio.Buffer.nextPutIndex(Buffer.java:501)
	at java.nio.HeapByteBuffer.putInt(HeapByteBuffer.java:347)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.put(Graphics2DSerialized.java:1760)
	at net.sf.robocode.robotpaint.Graphics2DSerialized.setColor(Graphics2DSerialized.java:204)
	at voidious.utils.RoboGraphic$Dot.render(RoboGraphic.java:45)
	at voidious.move.<CENSORED>.onPaint(<CENSORED>.java:390)
	at voidious.<CENSORED>.onPaint(<CENSORED>.java:103)
	at robocode.PaintEvent.dispatch(PaintEvent.java:61)
	at robocode.Event$HiddenEventHelper.dispatch(Event.java:249)
	at net.sf.robocode.security.HiddenAccess.dispatch(HiddenAccess.java:195)
	at net.sf.robocode.host.events.EventManager.dispatch(EventManager.java:486)
	at net.sf.robocode.host.events.EventManager.processEvents(EventManager.java:459)
	at net.sf.robocode.host.proxies.BasicRobotProxy.executeImpl(BasicRobotProxy.java:403)
	at net.sf.robocode.host.proxies.BasicRobotProxy.execute(BasicRobotProxy.java:119)
	at robocode.AdvancedRobot.execute(AdvancedRobot.java:565)
	at voidious.<CENSORED>.run(<CENSORED>.java:48)
	at net.sf.robocode.host.proxies.HostingRobotProxy.run(HostingRobotProxy.java:250)
	at java.lang.Thread.run(Thread.java:619)
SYSTEM: Exception occurred on robocode.PaintEvent

I get this when I enable paint, but then if I restart the match, everything works and paints fine. --Voidious 05:17, 13 May 2009 (UTC)

I bet this is your new robot, isn't it? Or you need not to <CENSORED> =D I myself sometimes get BufferOverflowException, but I got it when DrawingBot overflow its renderables ArrayList. » Nat | Talk » 05:41, 13 May 2009 (UTC)

Actually I just like to use a lot of swear words in my development version class names. =) Just kidding. --Voidious 14:22, 13 May 2009 (UTC)
Then you will need to either use java obfuscater or rename them, along with its reference, to hide the swear words =D Come on, why it is so secret? » Nat | Talk » 14:32, 13 May 2009 (UTC)

Wow, the two bugs I reported have already been fixed! I guess I'll see the fixes in the next version of Robocode. RobertWalker 16:05, 14 May 2009 (UTC)

Not so surprised. If it isn't hard, Flemming will get it in one night actually. Even if it is hard, having stack trace reported along will make his life a lot easier (even the hard one I've reported fixed in 3 days, but by Pavel Savara) » Nat | Talk » 16:22, 14 May 2009 (UTC)

[edit] Complete Code

I think that we should have the completed robot code posted because for the life of me i can't figure it out. And there are newbies who won't either. —Preceding unsigned comment added by Oldtopman (talkcontribs)

Well... I'm not sure what you want exactly. A "complete robot" of sorts could be created by simply putting public class SomeRobot extends Robot { ... } around the code in the 'Simple Example' section. Could you explain what it is you feel is not explained/demonstrated clear enough? --Rednaxela 01:55, 28 January 2010 (UTC)

Question!! Shouldn't scannedX be (int)(getX() + Math.cos(angle) * e.getDistance())? In the article, sin is used... ---- urgood2 08:14, 21 March 2010 (UTC)

Well, no. In Robocode uses compass system, which zero degrees is at top and count clockwise, while in maths, the zero degrees is at right and count anticlockwise. So in Robocode, use sin for X and cos for Y, instead of cos for X and sin for Y. --Nat Pavasant 10:03, 21 March 2010 (UTC)

OK.. So how does that make us switch those two? ---- urgood2 01:33, 22 March 2010 (UTC)

If you draw a rectangle, like:

A      B
 +----+
 |   /|
 |  / |
 | /  |
 |/   |
 +----+
D      C

Let say we are at D, and enemy at B, so AC is our distance. Let make angle ADB = 30 degrees. In Robocode angle, the angle would be 30 degrees, but in normal Maths, the angle would be 60 degrees.

In normal maths, we use cos(angle), which is CD/BD. But in robocode angle, we need to use sin(angle), so it can be AB/DB. Hope you get it. Again, I am not good in explanation of Maths in English =) --Nat Pavasant 06:04, 22 March 2010 (UTC)


Thanks for the explanation, Nat. I'll try to figure it out with that. ---- urgood2 06:37, 22 March 2010 (UTC)

Rednaxela04:23, 11 May 2012
 
Personal tools