Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battle does not restart #10

Closed
dEgolf opened this issue Apr 3, 2022 · 12 comments
Closed

Battle does not restart #10

dEgolf opened this issue Apr 3, 2022 · 12 comments
Assignees
Labels
bug Something isn't working that should be fixed

Comments

@dEgolf
Copy link

dEgolf commented Apr 3, 2022

Describe the bug
When battling the "Target" and "Walls" C# sample robots, hitting "Restart" does not restart the battle. Instead the battle ends but does not restart. In the resulting state, hitting Ctrl+B to start a new battle does not open up the appropriate menu. To start a new battle, I had to close and reopen the GUI.

To Reproduce
Steps to reproduce the behavior:

  1. Run robocode-tankroyale-gui-0.11.0.jar
  2. Press Ctrl+B.
  3. Run Target and Walls (from sample-bots-csharp-0.11.0)
  4. Click "Add All"
  5. Click "Start Battle"
  6. Click "Restart"
  7. Observe that the battle does not restart

Error info
No error message is displayed, as far as I can tell.

Expected behavior
The battle restarts when I click "Restart".

Desktop (please complete the following information):
-Windows 10

Java info:
openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment Temurin-11.0.14.1+1 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.14.1+1 (build 11.0.14.1+1, mixed mode)

Additional context
This reproduces pretty consistently for me, but the issue does not occur every single time. While typing the steps up for this issue, I reproduced the problem several times. However, there was one time where the restart button did work correctly. This occurred when I had left the battle creation menu open for some time before actually starting the battle.

Some configuration options I used:
initial-position-enabled=false
tps=30

@flemming-n-larsen
Copy link
Contributor

Thank you for reporting and providing the detailed decription. 👍

I will have a look into this.
At first look, I have no problem restarting the battle when clicking the "Restart" button on the control panel, but the GUI does seem to have an issue when I select "Restart" from the menu.

I will have a look into this and fix it.

@beamer159
Copy link

beamer159 commented Apr 6, 2022

I had the same problem. Even with no robots loaded.

From a fresh install (no .properties files):

  1. Run robocode-tankroyale-gui-0.11.0.jar
  2. Select Battle > Start Battle
  3. Select OK on the Error window reporting no bot directory root
  4. Select Dismiss on the Bot Root Directories Config window. No need to add anything to reproduce this error
  5. Select Cancel on the Select Bots for Battle window
  6. Select Battle > Start Battle. The window does not reappear for me

@flemming-n-larsen
Copy link
Contributor

@beamer159 I found this issue as well and is working on a fix with version 0.11.1.

@flemming-n-larsen
Copy link
Contributor

@dEgolf and @beamer159: I have now made a patch release for fixing the GUI.

Try out the patched GUI here: robocode-tankroyale-gui-0.11.1.jar

@dEgolf
Copy link
Author

dEgolf commented Apr 8, 2022

I tried out the new GUI (0.11.1) without updating the sample robots. Maybe I'm doing something simple wrong, but when I run a bot it doesn't seem to join anymore. For example, running Walls (from the 0.11.0 C# sample bots) adds Walls to "Running bots", but Walls never seems to show up in "Joined bots" afterwards for me. (I waited for about two minutes.)

@beamer159
Copy link

I am having the same problem as @dEgolf

https://i.imgur.com/qAL93Fq.gif

@flemming-n-larsen
Copy link
Contributor

@dEgolf and @beamer159:
Sorry about that guys. 😳
I have now uploaded a new version of the jar file (overwritten the jar file), and it seems to work now.🙂

For some reason, I managed to compile this for Java 17 instead of Java 11, which causes the trouble. I will need to figure out a way to get a warning when I compile with a never version of Java.

@beamer159
Copy link

The problem seems to be better, but not 100% fixed. I can create a new battle, adding 2 sample robots, MyFirstRobot and SpinBot for example. While the battle is running, I can usually restart the battle successfully. However, maybe 1-5% of the time, clicking the restart button does not restart the battle, but instead stops the battle, and I cannot create new battles without closing the program.

When the program gets into this error state, I cannot "unjoin" robots. Stopping them from running locally does not remove them from the "Joined Bots" or "Selected Bots" window. Normally, the program is able to do this.

Additionally, after starting a new battle, clicking the restart button the first time consistently stops the battle instead of restarts the battle. Clicking the restart button subsequent times restarts the battle as expected.

Video demonstrating all three issues: https://i.imgur.com/GPrREhH.mp4

  1. Restarting the battle the first time stops the battle instead of restarts
  2. Sometimes, restarting the battle stops the battle and cannot be restarted afterwards
  3. When the above error occurs, bots cannot unjoin

@flemming-n-larsen
Copy link
Contributor

@beamer159 Thank you for the video. I really helps to see the problem. 👍🙂
I guess the is some raise condition between the GUI and the client handling connections with the bots.

I will look into this, as it needs to be fixed.

@flemming-n-larsen flemming-n-larsen added the bug Something isn't working that should be fixed label Apr 11, 2022
@flemming-n-larsen
Copy link
Contributor

@beamer159 and @dEgolf
I fixed a couple of issues with the restarting with the new v0.11.2

@dEgolf
Copy link
Author

dEgolf commented Apr 12, 2022

Great! I don't seem to experience this problem anymore when using v0.11.2. The battles seem to stop and restart as desired now, at least for me.

@flemming-n-larsen
Copy link
Contributor

I am happy to hear that. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working that should be fixed
Projects
None yet
Development

No branches or pull requests

3 participants