Battles are running at 0-3 fps

441 views
Skip to first unread message

Blah doo blah

unread,
Aug 12, 2023, 5:41:36 PM8/12/23
to Robocode
Just redownloaded robocode for the first time in years, and when I try to run a battle with sample bots it's running at 0-3 fps which is not watchable at all. Is there any fixes for this. My PC is good enough that I am getting at least 100 fps on most modern games and my pc isn't under any strain at all from robocode, so it doesn't seem to be using anything

fnl

unread,
Aug 12, 2023, 6:05:58 PM8/12/23
to Robocode
Robocode is definitely running faster than ever when it comes to both CPU power and also 2D capabilities delivered through OpenGL or Direct Draw.
I haven't received any reports lately about a low FPS like that. You should be able to 1000 and even more FPS without any problem with a modern PC.

Robocode is using Java 2D that typically use either Direct Draw or Open GL on a Windows-based PC (you did not write anything about your system).
Robocode does not set up anything special but comes with some default settings that you can change yourself.

On the newest version of Robocode you'll find a Java2d.bat file, where you can change the settings as you wish.
And you should have a look at the Java 2D Pipeline Renderings options to figure out which ones that are optimal for your system here:


You can make a copy of the java2d.bat, and replace the settings/options in the java2d.bat as you want to see what works best for your system.
Most PC users have Direct 3D/Draw on their system. Hence these options are set:

set J2D_D3D=true
You could try to set this to false to disable Direct3D, and use the GDI pipeline instead.

You could also try to enable the OpenGL pipeline instead of the Direct 3D one by this option:

set sun.java2d.opengl=true

At the end of the day, the settings depend on your operating system, and also graphics card (or lack of one).

I hope you'll figure out what cause the extreme lack on your system for Robocode.

Best regards,
- Flemming

Blah doo blah

unread,
Aug 15, 2023, 7:52:09 AM8/15/23
to Robocode
Thanks, I'll try that.

Keynõan _

unread,
Aug 22, 2024, 1:15:15 PM8/22/24
to Robocode
Im having this same problem, my pc has a i7, 16gb Ram and RTX3060, and continue rendering the game in 0-3 fps

fnl

unread,
Aug 22, 2024, 1:33:21 PM8/22/24
to Robocode
I don't know what is wrong. It could be an issue between Java and the graphics drivers. 🤔
Or it could be the Java implementation coming from a specific vendor or some settings on your system.

The newest version of Robocode comes with a java2d.bat file (Windows) and java2d.sh file (Linux / macOS) that is run when using robocode.bat for running Robocode.
The content of this file looks like this (java2d.bat):

@rem
@rem Copyright (c) 2001-2023 Mathew A. Nelson and Robocode contributors
@rem All rights reserved. This program and the accompanying materials
@rem are made available under the terms of the Eclipse Public License v1.0
@rem which accompanies this distribution, and is available at
@rem

@echo off

@rem ------------------------------------------------------
@rem Setup Java 2D Pipeline Rendering options
@rem ------------------------------------------------------

@rem Read about settings here:

@rem Enable or disable Direct3D acceleration (true/false)
set J2D_D3D=true

@rem Get detailed information about the startup procedures of the Java 2D pipeline when using
@rem OpenGL or Direct3D acceleration. Remove the @rem from next line to enable the tracing:
rem set J2D_TRACE_LEVEL=4

@rem Set the Direct3D rasterizer to one of the following: ref, rgb, hal, or tnl
@rem Use ref to use the rasterizer from Microsoft
set J2D_D3D_RASTERIZER=ref

Try to adjust these settings. You might also try to add settings for OpenGL, or other options.

Have a look at this homepage to see, if some properties changes anything for you?
https://docs.oracle.com/javase/10/troubleshoot/java-2d-pipeline-rendering-and-properties.htm#JSTGD428

If you find a solution, don't hesitate writing back with what worked out for you. Then I will incorporate this into Robocode as default. 😊

Best regards,
- Flemming

lørdag den 12. august 2023 kl. 23.41.36 UTC+2 skrev Blah doo blah:

Abraham Boulter

unread,
May 27, 2025, 12:25:10 AMMay 27
to Robocode
Hello,
In case anyone is still having this problem. For me I used "set sun.java2d.opengl=true" and disabled the Direct3D by using "set J2D_D3D=false" instead of "true."

Message has been deleted

Yongchao Song

unread,
Jul 4, 2025, 3:50:57 PMJul 4
to Robocode
I just  "set J2D_D3D=false",   it worked!
Reply all
Reply to author
Forward
0 new messages