Talk:RobocodeGL

From RoboWiki
Jump to: navigation, search

Contents

Thread titleRepliesLast modified
Preview 8916:40, 30 January 2020
Preview 9106:09, 24 January 2020
RobocodeGL Preview 7017:29, 8 January 2020
RobocodeGL Preview 6306:54, 5 January 2020
RobocodeGL Preview 5508:13, 4 January 2020
RobocodeGL Preview 4621:09, 3 January 2020
RobocodeGL Preview 3709:00, 2 January 2020
RobocodeGL Prealpha Preview 0.00000000001 Released1005:51, 31 December 2019
RobocodeGL Preview 2715:42, 30 December 2019
Recreating entire robocode UI612:57, 19 December 2019
Rendering of hundreds of robots with highest quality302:22, 15 December 2019
any suggestions about OpenGL version robocode UI? 1019:34, 8 December 2019
thanks for this effort615:49, 5 December 2019

Try it here: robocodeGL-1.9.3.7-preview8-setup.jar

Updates:

  • Increase default window size
  • Refined robot graphics
  • Fix robot console
  • Several improvements in UI
  • Support dark titlebar on macOS
  • Fix score display (partially merged into official 1.9.3.8)

RobocodeGL Preview8 001.png

Xor (talk)14:10, 13 January 2020

Hi Xor,

Everything seems to be fine with one minor glitch: in the preference menu the background without text become somewhat blue and does not match the color of background for labels of the checkbox. How to see: Go to Options -> Preferences

I am not sure if it was introduced in preview 7 or 8, since I did not check the 7.

Beaming (talk)14:17, 14 January 2020

Hi, thanks for testing. It works fine here on windows and mac, so could you provide a screenshot for diagnosing?

Xor (talk)08:07, 15 January 2020

Here the screenshot

Beaming (talk)17:51, 15 January 2020

Hi, thanks for the info! You can see whether this is fixed in preview 9 ;)

Xor (talk)06:08, 24 January 2020

Hi preview 9 did not fix it.

It does looks slightly better in preview 9: i.e highlighted tab has overall uniform bluish color (same as in the above screenshot) and labels for the checkbox are now have the same blue background. But the old Robocode did not have the bluish background color, it was all grey as in the finish/cancel buttons or unselected tabs background color.

Beaming (talk)18:23, 29 January 2020
 
 
 
 

I also think that hiding controls by default is a bad idea. Looking at the bot logs and being able to enable robots painting is crucial and should be done with ease. This is coming from the guy who discovered "Main battle log" button after 7 years of robocoding :)

Beaming (talk)14:27, 14 January 2020

I also discovered Main battle log recently, when I’m reading code ;)

I also find that the robocode source editor is even able to customize font ;) when reading code, recently.

The controls are very useful when debugging, especially when you frequently switch from max speed and normal speed. Accessing Robot logs easily is also very important when debugging.

However, you generally only need to enable the log dialog once, so taking up so much space on screen isn’t very handy.

All controls are now also accessible via menus & keyboard shortcuts, say, press ctrl (command for mac) + 1 for the first robot, ctrl + 2 for the second, etc. It needs some learning but I believe it will be more handy after getting used to it.

The only lack in the battle menu approach is that, scores are no longer easy to see. But scores (on robot buttons) are broken for 2 years without anyone else noticing (at least reporting) so I wonder usage frequency of it.

Xor (talk)08:05, 15 January 2020
 

Note that all controls are also available in “Battle” menu ;) As seen from preview 7’s screenshot.

Xor (talk)08:09, 15 January 2020
 
 

Try it here: robocodeGL-1.9.3.7-preview9-setup.jar

Updates:

  • Keyboard battle speed control
  • Various improvements in UI

RobocodeGL Preview9 001.png

Xor (talk)06:08, 24 January 2020

A confirm is added to robocode window close button, so no longer exiting robocode by accident!

Xor (talk)06:09, 24 January 2020
 

RobocodeGL Preview 7

Try it here: robocode-1.9.3.7-gl2-preview7-setup.jar

Java 11 is recommended for best experience.

Updates:

  • Full function battle menu, controls are now hidden by default
  • Press space bar for single tick mode, long press to run battle slowly
  • Press enter key to pause/resume
  • Make UI more responsive
  • Fix intro battle

RobocodeGL Preview7 002.png

Xor (talk)17:25, 8 January 2020

RobocodeGL Preview 6

Edited by author.
Last edit: 08:33, 4 January 2020

Try it here: https://drive.google.com/open?id=1dfTf1JLC5TdAs0RcAx9nmD16xzmpDYSM

Updates:

  • Introducing Immersive Mode, enabled from option menu (keyboard control not implemented yet...)
  • Be able to set to any value in TPS slider, e.g. 60, no gaps any more
  • "Default window size" in option menu now respects battle field size
  • Several redundant borders are removed to reduce cumbersomeness
  • Make battle field edge more visible, but still less annoying than red
  • Fix not-exiting bug on Linux

RobocodeGL Preview6 001.png

Xor (talk)08:17, 4 January 2020

Worth mention that for all preview versions, you can drag a lot of robot jars at once into robocode window,
and they'll all get imported instantly in a batch!

Xor (talk)08:22, 4 January 2020
 

Tested on linux. Happy to report no visible bugs

  • The exit button, closing window, and Ctrl-C finish the game correctly.
  • immerse button works as expected
  • drag-and-drop of bots works as well, though it is a bit counter intuitive: since new bot is imported but not appearing at the battle field. I would expect a new battle created with new bot added. But this a minor thing.

Minor annoyances

  • with all scaling and dpi tracking, the pop up preferences are not always optimally sized. I think in low DPI default window size is a bit small. It was easy in the old days when everything was measured in real pixels, but now it need some more advance logic.
  • the FPSmeter menu option, probably does not need to be in another column in the preference menu.
Beaming (talk)15:05, 4 January 2020

Thanks for testing! And yes, I was considering dragging jars as creating battles, which is the most intuitive way, however this only applies when you drag in a few bots, not 1000 bots ;)

I think there will be a way to properly resize the preferences dialog, and the added options surely needs some clean up ;)

Xor (talk)06:52, 5 January 2020
 
 

RobocodeGL Preview 5

Try it here: https://drive.google.com/open?id=1M_M13t88DcsoFs8lTiZT6dSpQjj4jmeu

Updates:

  • Robots mouse events now work correctly.
  • Full HiDPI support for JDK > 8 (JDK 8 supports only macOS HiDPI). Now it's no longer blurry under macOS Java 11!
  • A FPSMeter is available to be enabled in preferences

Note: to get as smooth as possible animation, macOS users should use JDK 11. It has some problems under JDK 8 macOS.

Screenshot: RobocodeGL Preview5 001.png

Xor (talk)19:24, 2 January 2020

Confirming the proper size of the preference menu

sorry for bugreports :( but

  • FPS meter is not consistent with numbers reported in the window title bar. I.e. I see about 30 FPS in the titlebar and around 60 in the meeter. Same can be see in your own screenshot.
* It would be nice to move the meter to the right hand side above or under the column with bot names and their energy bars. I.e. above "Main battle" buttons. 
  • Big bug: click on "Exit" in the menu leaves java machine running in the backround, I have to use "kill -9" command to stop it.
  • Judging by the FPS meter, the battlefield is updated even when the game in stopped/paused state. Not sure if it is important or not to fix.

Feature request. Is it possible to enlarge bots name/energy bar column to fit bots names fully? Quite often, there is plenty of the unused battle field margins to do so.

Beaming (talk)19:59, 2 January 2020

Thanks for bug reports! And I'm so happy that you tried it so careful!

The FPS meter reports actual, realtime FPS, while the FPS in titlebar reports non-interpolated frames in per second basis. Both are useful, I just need to make the names less confusing ;)

You can drag the FPS meter to wherever you want – as long as within the battle view. Sorry for forgetting mentioning it ;)

Exit and Quit (macOS builtin feature) is not tested at all (and buggy), which is what to fix next, thanks for reminding!

I was planning to pause actual drawing when there isn't any need to it, but it's not high priority huh ;)

The bots name/energy bar column has some bugs since around ~1.9.3.5, but I think making the column with customizable width best fit the request ;)

Xor (talk)04:24, 3 January 2020
 

Btw, is simply closing the main window working? meaning robocode exits completely without background process.

Xor (talk)04:26, 3 January 2020

By the way, non exiting bug was introduced in preview 5, before everything worked as expected.

Simply closing also leaves java running, same for Ctrl-C. I think they both send QUIT signal, which is not enough. The 'kill -9' sends KILL signal which is much stronger and really kills java.

Here is the console output after window close/Ctrl-C signals.

jogamp.opengl.GLO  ffscreenAutoDrawableImpl$FBOImpl not recognized. 
X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 2/2, reusable (open, marked uncloseable): 0, pending (open in creation order): 2)
X11Util: Open X11 Display Connections: 2
X11Util: Open[0]: NamedX11Display[:0, 0x7fa2f054d410, refCount 1, unCloseable false]
X11Util: Open[1]: NamedX11Display[:0, 0x7fa2fc24aae0, refCount 1, unCloseable false]

and here is the rest after 'kill -9' signal

./robocode.sh: line 12: 21852 Killed java -Xmx512M -cp libs/robocode.jar -XX:+IgnoreUnrecognizedVMOptions "--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED" "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED" "--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED" "--add-opens=java.desktop/sun.awt=ALL-UNNAMED" robocode.Robocode $*
Beaming (talk)16:09, 3 January 2020

Thanks for the precious info! you can try preview 6 to see whether it's resolved.

The bug is introduced when resolving crash on macOS Java 11, now the resolution is only enabled when mac is detected.

Xor (talk)08:13, 4 January 2020
 
 
 
 

RobocodeGL Preview 4

Try it here: https://drive.google.com/open?id=1DMUP2MB7-OfxvcaQs2S6qCx_JgMhHn-m

Preview4 Updates:

  • Interpolated animation, smooth robots & bullets even on TPS = 10.
  • Less annoying battle field edge color (black instead of red).
  • Fix HiDPI support on some platforms when using JDK > 8. (tested on windows)

Known issues:

  • HiDPI broken on mac
Xor (talk)09:05, 2 January 2020

Yey. What a nice New Year gift: working hi-DPI version!!!

linux jdk versions summary for hiDPI screens:

  • jdk-11: works perfectly. The battle field scaled to the window size. Menu fonts are a bit large but this is OK.
  • jdk-8: the battle field scaled to the window size, the menu font are not scaled up and still given in a physical pixels, i.e. behaves as in preview 3 version

Some minor annoyances: with jdk-11 the preference dialog is a bit small to see all labels in the dialog, requires initial manual floating window resize to fix it. No big deal but would be nice to fix.

Feature request: the font size change for the menu.

I am not sure that black border is a good choice. The default is to run robocode without ground painted, it might confuse a novice when she see that bots do not go in some areas. It might be better to make background lighter (but not as light as painted ground). Though, I agree that the red color was too strong.

Beaming (talk)17:59, 2 January 2020

Thanks! Just enjoy the new year gift ;)

JDK > 8 have native support for HiDPI, so one have to resort to his own solution for Swing under JDK 8.

Robocode was disabling this behavior for JDK > 8, so I think this is what makes the preference dialog small. This should get fixed in preview 5. I'm not sure the default look and feel allows changing for font size of menus, but there should always be a way to do that.

I'm also not feeling black edges the best choice, it's too hard to see under dark background. Maybe I could make the colors configurable, and make the default friendly to novices.

The ground paint is disabled by default because it's not yet adapted to HiDPI & scale up (and hard to doing so due to non-vector nature). And I'm personally preferring black ground because it makes debug graphics easier to see ;)

Xor (talk)19:06, 2 January 2020
 

I think the font is too large because Java defaults to some too high DPI scale on your display (which seems to be 3).

maybe adding -Dsun.java2d.uiScale=2 manually into robocode.sh should fix this particular issue.

Xor (talk)07:48, 3 January 2020

Confirming that adding '-Dsun.java2d.uiScale=2' does adequate results on the user interface (menu, etc) fonts.

Note for the others, apparently the scale could be fractional as well, for example '-Dsun.java2d.uiScale=2.5'

Beaming (talk)21:09, 3 January 2020
 
 

I was able to recreate the battle field freeze after window resize to leading to the zero pixel tall battle field. It happens on hi-DPI and normal-DPI linux computers with jdk-11 (did not check jdk-8). The console log is below.

Loaded net.sf.robocode.api
Loaded net.sf.robocode.core
Loading plugins from /home/evmik/robocode/libs
Loaded net.sf.robocode.repository
Loaded net.sf.robocode.sound
Loaded net.sf.robocode.host
Loaded net.sf.robocode.battle
Loaded net.sf.robocode.ui.editor
Loaded net.sf.robocode.ui
Loaded net.sf.robocode.gl2
before Parse
after Parse
Reading robot database
force update takes 0.082375326s
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/evmik/robocode/./libs/gluegen-rt-2.3.2.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Creating window.properties file
update takes 0.030204256s
Preparing battle...
----------------------
Round 1 initializing..
Let the games begin!
..
force update takes 0.038383916s
com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: java.lang.RuntimeException: com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-13) and height (-10) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:92)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.Animator$MainLoop.run(Animator.java:204)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-13) and height (-10) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
	at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
	at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:201)
	at com.jogamp.opengl.Threading.invokeOnOpenGLThread(Threading.java:202)
	at com.jogamp.opengl.Threading.invoke(Threading.java:221)
	at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	... 3 more
Caused by: com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-13) and height (-10) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IllegalArgumentException: Width (-13) and height (-10) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:324)
	at net.sf.robocode.ui.battleview.BattleView.createGroundImage(BattleView.java:252)
	at net.sf.robocode.ui.battleview.BattleView.initialize(BattleView.java:221)
	at net.sf.robocode.ui.battleview.BattleView.access$1300(BattleView.java:71)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.update(BattleView.java:857)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.paint(BattleView.java:847)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.paintGL(GLG2DSimpleEventListener.java:124)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.display(GLG2DSimpleEventListener.java:67)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	... 15 more
com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
	at com.jogamp.opengl.Threading.invoke(Threading.java:223)
	at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
	at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:559)
	at java.desktop/sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
	at java.desktop/sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:66)
	at java.desktop/sun.awt.RepaintArea.paint(RepaintArea.java:240)
	at java.desktop/sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:555)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5069)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:324)
	at net.sf.robocode.ui.battleview.BattleView.createGroundImage(BattleView.java:252)
	at net.sf.robocode.ui.battleview.BattleView.initialize(BattleView.java:221)
	at net.sf.robocode.ui.battleview.BattleView.access$1300(BattleView.java:71)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.update(BattleView.java:857)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.paint(BattleView.java:847)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.paintGL(GLG2DSimpleEventListener.java:124)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.display(GLG2DSimpleEventListener.java:67)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	... 28 more
com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
	at com.jogamp.opengl.Threading.invoke(Threading.java:223)
	at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
	at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:559)
	at java.desktop/sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
	at java.desktop/sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:66)
	at java.desktop/sun.awt.RepaintArea.paint(RepaintArea.java:240)
	at java.desktop/sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:555)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5069)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:324)
	at net.sf.robocode.ui.battleview.BattleView.createGroundImage(BattleView.java:252)
	at net.sf.robocode.ui.battleview.BattleView.initialize(BattleView.java:221)
	at net.sf.robocode.ui.battleview.BattleView.access$1300(BattleView.java:71)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.update(BattleView.java:857)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.paint(BattleView.java:847)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.paintGL(GLG2DSimpleEventListener.java:124)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.display(GLG2DSimpleEventListener.java:67)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	... 28 more
com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
	at com.jogamp.opengl.Threading.invoke(Threading.java:223)
	at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
	at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:559)
	at java.desktop/sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
	at java.desktop/sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:66)
	at java.desktop/sun.awt.RepaintArea.paint(RepaintArea.java:240)
	at java.desktop/sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:555)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5069)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:324)
	at net.sf.robocode.ui.battleview.BattleView.createGroundImage(BattleView.java:252)
	at net.sf.robocode.ui.battleview.BattleView.initialize(BattleView.java:221)
	at net.sf.robocode.ui.battleview.BattleView.access$1300(BattleView.java:71)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.update(BattleView.java:857)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.paint(BattleView.java:847)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.paintGL(GLG2DSimpleEventListener.java:124)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.display(GLG2DSimpleEventListener.java:67)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	... 28 more
com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
	at com.jogamp.opengl.Threading.invoke(Threading.java:223)
	at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
	at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:559)
	at java.desktop/sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
	at java.desktop/sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:66)
	at java.desktop/sun.awt.RepaintArea.paint(RepaintArea.java:240)
	at java.desktop/sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:555)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5069)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IllegalArgumentException: Width (-20) and height (-15) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:324)
	at net.sf.robocode.ui.battleview.BattleView.createGroundImage(BattleView.java:252)
	at net.sf.robocode.ui.battleview.BattleView.initialize(BattleView.java:221)
	at net.sf.robocode.ui.battleview.BattleView.access$1300(BattleView.java:71)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.update(BattleView.java:857)
	at net.sf.robocode.ui.battleview.BattleView$MyPanel.paint(BattleView.java:847)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.paintGL(GLG2DSimpleEventListener.java:124)
	at org.jogamp.glg2d.GLG2DSimpleEventListener.display(GLG2DSimpleEventListener.java:67)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	... 28 more
X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 1/1, reusable (open, marked uncloseable): 0, pending (open in creation order): 1)
X11Util: Open X11 Display Connections: 1
X11Util: Open[0]: NamedX11Display[:0, 0x7f39984078c0, refCount 1, unCloseable false]
Beaming (talk)18:04, 2 January 2020

Thanks for the detailed info, will try to fix ;)

Xor (talk)19:20, 2 January 2020
 
 

RobocodeGL Preview 3

Try it here: https://drive.google.com/open?id=1co2bksUSNr8JSUSnG3mxhXTFXiVhRO4W

Preview 3 Updates:

  • Support scaling up battle view to fit the window (optionally disable in preferences)
  • Crisp fonts by aligning with pixel

Known issues:

  • Restart battle skips the first few turns (already fixed in next preview)

RobocodeGL Preview3 001.png

Xor (talk)12:42, 30 December 2019

Hi Xor,

The game look gorgeous. Cristal clear fonts on the battle field, scaling size up and down. It is fun to see bots on 100x100 pixel tiny battlefield :)

However, this works only on normal DPI screen.

On a hi-DPI screen, the battlefield is still small. What is strange it clearly responds to the window size change, by drawing the grey margins either on left/right side or top/bottom sides. But the physical size of the battle field is still about a quater of actual window size. Looks like there is somewhere a hiddien scaling coefficient which uses DPI number. The rest of the menus and fonts are looking properly, i.e. they have proper (large in pixels, normal in screen size) size.

One more glitch which I caught on a normal DPI display. When battle was running I resized window size so the battle field shrank to zero (vertically). The console showed

com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: java.lang.RuntimeException: com.jogamp.opengl.GLException: Caught IllegalArgumentException: Width (-4) and height (-3) cannot be <= 0 on thread AWT-EventQueue-0
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:92)

This triggered something which stopped updates on a battlefield. The menu button were responding but no battle field updates at all. For example the reset button did not change the halted battle field. This is all true for window resized to a normal state.

Beaming (talk)17:33, 30 December 2019

Thanks for the detailed test!

HiDPI works perfectly on mac, maybe on Linux some extra work needs to be done. Could you provide a screenshot showing 1/4 sized battle field? It will be useful with extra information.

I once saw same exception showing invalid battle view size, but I couldn't reproduce it any more now. Could you please provide the full stack trace?

Xor (talk)05:33, 31 December 2019
 

Btw which version of Java are you using on the HiDPI machine?

Xor (talk)05:33, 31 December 2019

Strangely, I could not recreate the crash.

As for versions of java. I am using openjdk v8 and v11. On normal DPI machines, they both seems to behave correctly.

On hi-DPI machine they produce different results:

  • with openjdk-8 the battlefield scales correctly but menu font is very small, i.e. not scaled/done in pixels.
  • with openjdk-11 the battlefield is physically small, like if it is done in actual pixels, but the menu font is scaled so it is easy to read.

I am attaching full size (on click) screenshots to show the difference

Beaming (talk)17:56, 31 December 2019

Thanks for the detailed test! It seems that Jogl 2.3.2 doesn’t support java > 8 hidpi yet. However this seems to be fixed in not released 2.4.0. maybe i can release a version using 2.4.0 snapshot to see if it’s solved.

Xor (talk)10:45, 1 January 2020

If you bundle it in, I would be happy to try next version.

Beaming (talk)17:27, 1 January 2020
 
 
 
 
 

RobocodeGL Prealpha Preview 0.00000000001 Released

Edited by author.
Last edit: 05:51, 31 December 2019

I finally got OpenGL to work with AWT/Swing with the help of JOGL & GLG2D,
so that I can keep the original robocode UI. (And giving up LibGDX/LWJGL3 based version)

This version is buggy, e.g.

  • alpha part of images looks black Fixed in preview2
  • maximizing window doesn't work Fixed in preview2
  • No Hi-DPI support (Fixed for mac in preview2, Linux in question)
  • No recreated Hi-Resolution graphics Fixed in preview2
  • No smooth animation support. Partially fixed in preview2, fixed in preview4
  • No upscaling support Fixed in preview3
  • No font antialiasing. Fixed in preview2
  • No align battle engine with VSync Fixed in preview2
  • Update: Doesn't work on Linux? Fixed under an environment variable

However it is at least a working start for further development.

Try it here https://drive.google.com/open?id=1llACiSHqAj4XPdSUtKKtCJKdDTvXMIQl

No screenshot, it looks exactly the same as original robocode (hopefully), just with more bugs. So if you find bugs, please tell me.

Xor (talk)07:49, 23 December 2019

Hi Xor,

I just tried it on linux. It started up once: I saw the upper menubar but no game graphic was visible. On a second run attempt, even this much was not shown. I.e. I just got an empty window.

Beaming (talk)20:48, 23 December 2019

Thanks for the report, I haven't tried this on anything with hi-dpi screen, is that your case with Hi-DPI screen?

Xor (talk)02:40, 24 December 2019
 

HiDPI support is partially fixed (font looks blurry, but size is correct) now, so I think this bug has nothing to do with it.

I guess this problem is related to the maximizing window bug, have you ever tried resizing the window?

And does it output any errors in the console?

And what do you mean by empty window, is it black, red, or in default window background (gray)?

Xor (talk)06:17, 25 December 2019

Hi,

I was running it on a standard non-hiDPI monitor. I do it on a tiling window manager (i3wm) so it might be an issue, since it forces a particular size. Though, I switched to a floating window mode as well with the same (negative) result.

I see a lot of output in the terminal. I quick look did not yield anything specific. There is a lot, so it is hard to analyze.

By an empty window, I meant a window with the gray background.

Beaming (talk)19:15, 26 December 2019

Some additional info. I also ran new robocode at hi-DPI linux machine. Strangely, it worked fine with exception that the battle field is small, i.e. uscaled to the window. It seems to be in physical pixels. But I think this is what you said is suppose to be in this alpha.

Also, there is strange quirk common to all installation. As soon as it started for the very first time, it shows the resulting score table as there was a battle ran. It does not do it on a consequent runs.

As for another non-hi-DPI linux machine, I see the following error at start up

com.jogamp.opengl.GLException: AWT-EventQueue-0: createImpl ARB n/a but required, profile > GL2 requested (OpenGL >= 3.1). Requested: GLProfile[GL3bc/GL3bc.hw], current: 3.0 (Compat profile, compat[ES2], FBO, hardware) - 3.0 Mesa 18.3.6

Maybe the issue is in the missing driver. I will investigate further.

Beaming (talk)21:23, 26 December 2019

Thanks for the detailed info! The issues with HiDPI should be fixed, at least on mac; The complain about missing GL2 is that the driver doesn’t support the version it is asking for, I’ll try to see if it works with some lower version.

Xor (talk)11:52, 27 December 2019
 

I'm still not knowing how to support wider range of drivers (hopefully all newer devices are supported anyway)

But the HiDPI behavior should be fixed! And with recreated larger graphics, it should looks even better on HiDPI screens.

Xor (talk)07:23, 28 December 2019
 
 
 
 

Hi, I just downloaded it on Windows 10. When I maximized the screen, the Robocode logo in the center would not load for about three quarters of the screen. Here's a screenshot. https://drive.google.com/open?id=1GWgbibNlQR76Fomh_Vhz3hV-udToFmvD However, by pressing Battle-New, the issue resolves itself. I started up a battle and the graphics are SUPER smooth! It's a lot of fun to watch. Thanks for the effort you are putting in to this!

Slugzilla (talk)02:40, 28 December 2019

thanks!! the maximize bug is known, however I yet don’t how to fix.

the graphics can be even smoother, which will be in the next preview, by taking full advantage of VSync & interpolating.

Xor (talk)03:33, 28 December 2019
 

It's now fixed! Time to try the new version.

Xor (talk)07:21, 28 December 2019
 
 

RobocodeGL Preview 2

Here is the second preview of RobocodeGL: https://drive.google.com/open?id=1zqQ6QKwe_uyZMQzxE9j7QPKTgSOrzQPR

Known issues:

  • No interpolation animation (so when FPS <= 60, it can only be set to 60, 30, 15, 10, etc...)
  • No upscaling support (so it remains original robocode behavior when enlarging window)
  • Linux support in question (some older drivers seems not to be supported)

If you find any suggestions or issues, feel welcome to report ;)

Xor (talk)07:19, 28 December 2019

Here's a screenshot ;)

RobocodeGL Preview2 001.png

Xor (talk)07:28, 28 December 2019

Hi,

I figure out how to fix/hack the driver issue. The receipy is lifted from Ubuntu forum. One needs to set MESA_GL_VERSION_OVERRIDE variable before running robocode. For example

MESA_GL_VERSION_OVERRIDE=4.3 ./robocode.sh
Beaming (talk)17:27, 28 December 2019

One thing which seems to be very different from original robocode version on normal non-hiDPI displays: the fonts clearity (as labels and energy of robots on the battlefield).

It seems that anti-aliasing is on, but this does not look as sharp as old fixed fonts.

Beaming (talk)18:41, 28 December 2019

it should be, the fonts are painted with the same method as the battlefield of the original robocode. It’s just dumped to OpenGL. maybe some bugs (possibly jogl side) causes it to be blur, will check.

Xor (talk)03:30, 29 December 2019
 

Done. The blur text is because robocode sometimes sets a non-integer translate, causing the text being interpolated. This only happens when robocode window is not perfectly fitting battle field.

Xor (talk)07:18, 30 December 2019
 

You can try preview 3 to see whether this is fixed ;)

Xor (talk)15:42, 30 December 2019
 

Thanks for the fix! Maybe I should add

 export MESA_GL_VERSION_OVERRIDE=4.3

to robocode.sh, if it doesn’t break other linux hardware combinations.

Xor (talk)03:31, 29 December 2019
 
 
 

Recreating entire robocode UI

I was planning to add OpenGL rendered canvas to original robocode UI, but it seems that there's no reliable solution to doing so.

So now only two options left:

  • a buggy separated window (that you can only resize it manually) with original UI aside
  • a whole new UI with completely new design (and recreate everything in OpenGL)

The former is the cheapest solution, and is almost done (with some wont-fix bugs). The latter is more expensive, and can exist as a separated version, but I think it doesn't make sense if I just copy the style of the original UI with this roadmap.

Here is the candidate of the style of the new UI (imgui):

code_sample_02.png

Worth mention that no original code is able to be reused in this approach, so I need to focus on the most important functions for now.

So in this separate roadmap, many functions may be removed (at least for now):

  • source editor: I wonder how many people are using this, there are plenty of alternative editors. Maybe some scripts to setup the dependencies automatically is better than an IDE that lacks modern features. Or maybe implement some automated integration with modern IDEs.
  • splash screen: Maybe making robocode main UI appearing instantly is better than waiting for a splash screen.
  • configuration dialog: what do you prefer, editing config file (with searching for free), or manually browsing through tons of options page by page.

Any suggestions?

Xor (talk)07:18, 17 December 2019

I got a new point. Currently roborunner and robocode is completely separated, why not integrate this directly into robocodeGL?

So you could manage roborunner with GUI, and watch whichever battle you want directly.

Xor (talk)11:54, 17 December 2019
 

I am fine with old style, it is not used that often: tune and forget.

One page configuration is probably a good thing. There is not that many options to have separate tabs as we have now.

Speaking of fixes. Is there a way to make CPU constant aware of multithreading and CPU frequency load dependent changes?

Not sure that we need a source editor. I personally do everything in VIM and then compile with make. But it is probably the "must" for uninitiated.

I would say that splash screen is unnecessary. If the engine boots in a split of a second (as it should) one will see it very briefly. Beside it does not add any functionality.

Beaming (talk)02:42, 18 December 2019

Thanks for the comment.

I would really like to keep the old UI while integrating modern OpenGL features as well as supporting HiDPI.

However it seems that the technical debt of AWT/Swing is so high that rewriting entire UI is actually more feasible than fixing bugs it causes.

Now maybe I can find a way to rewrite the old UI in SWT, which is fully compatible with OpenGL and HiDPI.

Xor (talk)15:38, 18 December 2019

If you are struggling with direct OpenGL window integration have you considered bypassing the issue with a slightly cheeky work around? I would have thought it would be possible to use OpenGL to render to an off screen texture in memory, and then simply use the standard AWT/Swing image rendering to render that like any other image to the battlefield area?

Wolfman (talk)18:45, 18 December 2019

Thanks for the tip! However, to my knowledge, awt Graphics2D canvas is already using this technique where possible, which is used by robocode (it’s unreasonably slow on mac when AA is enabled anyway). However it’s impossible to support VSync and all modern features of OpenGL with this approach.

Btw, AWT/Swing support of HiDPI is broken, so HiDPI support will be lost with this approach as well.

The whole point of rewriting with OpenGL is not rendering an image, but direct integration with hardware & operating system, so that the graphics is smooth like butter.

Xor (talk)03:24, 19 December 2019
 
 
 

Here comes a better solution — jogl & glg2d, which enables drawing AWT/Swing directly on full featured OpenGL canvas, with this, all features of robocode can be fully supported without even writing code. And one can take advantage of HiDPI & VSync for better graphics then.

Let’s have a try.

Xor (talk)12:56, 19 December 2019
 

Rendering of hundreds of robots with highest quality

Robocode OpenGL Alpha 02.png The preview version is mostly done, with recreated Hi-Res graphics for HiDPI support & scaling up to window size. Don't wait too much about that! ;)

Xor (talk)09:13, 13 December 2019

Graphics looks great!!! But how come that they all aiming at one bot?

Beaming (talk)14:29, 13 December 2019

That's on a test engine ;)

Now it runs on real robocode! Time to release a preview once some bugs are fixed.

Robocode OpenGL Alpha 03.png

Xor (talk)15:41, 14 December 2019

Looks awesome!

Slugzilla (talk)02:22, 15 December 2019
 
 
 

any suggestions about OpenGL version robocode UI?

Currently the implementation is using pure OpenGL window, so any issues with Java AWT go away automatically (hopefully).

But adding other controls, at least menu back is unavoidable for a more complete implementation. So does anyone have some suggestions about the new UI? Anyway the default approach will be reusing original AWT UI of robocode.

I personally like the “Immersion UI” which hides all controls by default (as shown in the demo pic), and scales the battlefield to always take up the entire window. This approach uses keyboard as control, e.g. Space is for pause & Single-tick mode, very useful when debugging robots.

Some hi-res graphics of robocode is created by the way, so it always looks sharp even scaled up.

Xor (talk)11:03, 5 December 2019

I am a big fan of keyboard driven UI, once someone learnt the basic there is no need to see the menu.

Is there a way to bypass clipping the console output? I.e. if a bot prints too much the console starts to truncate. I am sure that we all have enough memory to keep a MB or more worth of the text output.

Beaming (talk)15:52, 5 December 2019

I think that’s an issue of Java AWT’s text field, which may have some issues when underlying test is too much.

I’ll try to remove the limit and see what happens.

Btw I’m also a big fun of keyboard driven UI, however I think for most applications, menu provides best discoverability.

It may be hidden by default, though.


Edit: Confirmed, JTextField has performance issues with large text files. And the code processing robot console output is extremely inefficient.

I think this part needs a full rewrite, or no one helps.

Xor (talk)17:13, 5 December 2019

I created a new version of robot console that supports up to 2G robot logs. However this approach uses tables so it will no longer be able to select logs as if it were textfields. Not a perfect choice anyway.

Xor (talk)17:44, 5 December 2019
 

I created a PR that stops trimming robot console logs.

https://github.com/robo-code/robocode/pull/25

You can clone this branch and compile it your self, or download here

https://drive.google.com/open?id=10g3NlFXzf0yDwKMPrTqc_H00MVO9RK6S

Xor (talk)20:55, 5 December 2019

Just tried it. It is nice to see untrunkated logs. Everything seems to be fine, but I did not stress test it for large/long logs.

Beaming (talk)21:52, 5 December 2019

I tried it with a battle of 10000 rounds and ~1000000 line of log, approximately 100M log size.

it works, and feels as if it were only 10 rounds, and 30 lines of log, less than 1K.

And as long as your JVM has enough memory, you can select all and copy the 100M log to clipboard, paste it to another app.

So with this test, I think the only limit is memory size.

Xor (talk)04:21, 6 December 2019

Wow. :)

Is there a way to try OpenGL version?

Beaming (talk)20:55, 6 December 2019
 
 
 
 

This looks awesome! If possible, could you make it so that you can adjust the TPS by just typing in numbers into the keyboard instead of moving the scroll bar? Immersion UI sounds great, thanks for this creation!

Slugzilla (talk)03:11, 8 December 2019

a great suggestion! I think I can add this feature directly into the current robocode, so that everyone is able to use it NOW.

Xor (talk)04:20, 8 December 2019

Way cool!

Slugzilla (talk)19:34, 8 December 2019
 
 
 

thanks for this effort

Hi Xor,

Thanks a lot for this push. I especially happy to hear about HiDPI effort. I had to switch the scale up to use it on my laptop, hopefully I will not have to do it anymore.

Beaming (talk)14:55, 3 December 2019

Robocode looks blurry but not too small here (mac).

On windows, I turn on compatibility mode or it looks extremely small, then it became blurry.

Is your case robocode is looking too small?

Xor (talk)15:52, 3 December 2019

Hi,

I run it on linux machines (Debian stable) with open JDK. But I notice similar issues with other java based GUIs on the hiDPI machines: fonts are too small and graphics is not scaled up. So it practically impossible to read/see what is going on.

Beaming (talk)18:27, 4 December 2019

Not having linux desktop environment here, so don’t know what’s wrong in the code. Hope LibGDX & Lwjgl is not having same issue.

Anyway it shouldn’t at least for now, as logic unit and display unit is completely separated. But if I want to use original AWT for the rest of UI, maybe the problem persists.

Xor (talk)10:55, 5 December 2019
 
 

Yup looking good! Nice work! Can we have it scaling the battlefield to the window too so that it fills the space rather than having a massive border at high resolution windows? Or was this the plan already?

Wolfman (talk)13:11, 4 December 2019

Actually that’s the default way OpenGL applications go. So I no longer need to match robocode behavior if people are happy about this new behavior ;)

Xor (talk)10:57, 5 December 2019

Yes, I like stretching to window size too. It was long overdue.

Beaming (talk)15:49, 5 December 2019
 
 
 
Personal tools