jdmonin / JSettlers2

Java Settlers project home, downloads, and GPLv3 source code. To download the latest version as a JAR, see https://github.com/jdmonin/JSettlers2/releases/latest .
http://nand.net/jsettlers/
GNU General Public License v3.0
157 stars 63 forks source link

Game against 3 robots freezes after clicking "Start game" #82

Closed acardona closed 3 years ago

acardona commented 3 years ago

The log so far:

$ java -Djsettlers.uiScale=2-Djsettlers.startrobots=3 -jar JSettlers-2.2.00.jar 
Java Settlers Client 2.2.00, build JM20200229, (C) 2001-2004 Robb Thomas, portions (C) 2007-2020 Jeremy D Monin and contributors
Network layer based on code by Cristian Bogdan; Practice Net by Jeremy Monin.
L549: checkDisplayScaleFactor got screenHeight=1440 -> scale=1
Java Settlers Server 2.2.00, build JM20200229, (C) 2001-2004 Robb Thomas, portions (C) 2007-2020 Jeremy D Monin and contributors
Network layer based on code by Cristian Bogdan; Practice Net by Jeremy Monin.
Warning: No user database available: JDBC driver is unavailable: com.mysql.jdbc.Driver: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Users will not be authenticated.
The server is ready. Listening on port 8880

Connecting to localhost:8880
Robot arrived: robot 7: built-in type
Robot arrived: robot 6: built-in type
Robot arrived: robot 3: built-in type
Robot arrived: robot 5: built-in type
Robot arrived: droid 2: built-in type
Robot arrived: robot 4: built-in type
Robot arrived: droid 1: built-in type
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
localhost came (7,8)  Sat Dec 26 23:22:54 GMT 2020
*** leafwind joined the game first at 11:23 PM
*** robot 3 joined the game first at 11:23 PM
*** robot 6 joined the game first at 11:23 PM
*** droid 1 joined the game first at 11:23 PM

Using openjdk-8 at its latest.

Notice I specify uiScale=2 and only 3 robots, yet the ui is not scaled, and there seem to be a lot more robots according to the log above.

Is there something that I am doing wrong when launching the game? Thanks very much.

jdmonin commented 3 years ago

Hi,

I see your command line is java -Djsettlers.uiScale=2-Djsettlers.startrobots=3 -jar JSettlers-2.2.00.jar

Please try adding a space between 2 and -Djsettlers.startrobots=3 or it will think all that is for uiScale, and ignore it as not an integer. So it's using the default number of robots and "auto-detect" for uiScale.

Would you also mind trying with the latest version 2.4 from https://github.com/jdmonin/JSettlers2/releases/tag/release-2.4.00 instead of 2.2, please?

Thank you, -Jeremy

acardona commented 3 years ago

Thank you Jeremy, my apologies: indeed -Djsettlers.uiScale=2 -Djsettlers.startrobots=3 was in need of a space. Now the UI properly scales by 2.

Will try 2.4 as soon as I figure out how to compile it, as I've only so far found jar files for 2.2.

The freeze persists.

jdmonin commented 3 years ago

Thanks, glad to hear scaling works for you now.

I suggested 2.4 because you won't need to compile it: You can download its jars from this project's Releases section: https://github.com/jdmonin/JSettlers2/releases/tag/release-2.4.00 -> assets -> jsettlers-2.4.00-full.jar

jdmonin commented 3 years ago

Also: When you click "start game", does any error text appear in the text area in the top center of the game window? Thanks

acardona commented 3 years ago

With 2.4.00, still freezes:

$ java -Djsettlers.uiScale=2 -Djsettlers.startrobots=3 -jar JSettlers-2.4.00.jar 
Java Settlers Client 2.4.00, build JM20200704, (C) 2001-2004 Robb Thomas, portions (C) 2007-2020 Jeremy D Monin and contributors
Network layer based on code by Cristian Bogdan; Practice Net by Jeremy Monin.
L678: checkDisplayScaleFactor prop override -> scale=2
Java Settlers Server 2.4.00, build JM20200704, (C) 2001-2004 Robb Thomas, portions (C) 2007-2020 Jeremy D Monin and contributors
Network layer based on code by Cristian Bogdan; Practice Net by Jeremy Monin.
Warning: No user database available: JDBC driver is unavailable: com.mysql.jdbc.Driver: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Users will not be authenticated.
The server is ready.

*** Player joined the game Practice at 10:02 PM
Robot arrived: robot 4: built-in type
Robot arrived: robot 5: built-in type
Robot arrived: robot 7: built-in type
Robot arrived: robot 6: built-in type
Robot arrived: droid 2: built-in type
Robot arrived: droid 1: built-in type
Robot arrived: robot 3: built-in type
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
localhost came (8,8)  Fri Jan 01 22:02:41 GMT 2021
*** robot 5 joined the game Practice at 10:02 PM
*** robot 4 joined the game Practice at 10:02 PM
*** droid 2 joined the game Practice at 10:02 PM

Regarding any messages in the text area in the top center of the game window: says "*** Player has joined this game."

For completeness:

$ java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
acardona commented 3 years ago

Turns out, with java 11, it works: no more freezes.

jdmonin commented 3 years ago

I wanted to see why this was happening, so I've been trying to repro the problem on ubuntu 20.04 with openjdk 1.8.0_275, I haven't been able to make it freeze, unfortunately.

I'm glad things are working fine in java 11. Thanks for the news!