Facing issues while running python -m tmrl --test
#104
-
|
Beta Was this translation helpful? Give feedback.
Replies: 19 comments
-
Hi, hmm it looks like your OpenPlanet stopped communicating with In which situation did you encounter this exception? |
Beta Was this translation helpful? Give feedback.
-
Closing for inactivity, please feel free to reopen if you encounter a similar issue. |
Beta Was this translation helpful? Give feedback.
-
Hey i have quite literally the same exact issue, tried running trackmania and cmd in administrator. C:\Windows\system32>python -m tmrl --test |
Beta Was this translation helpful? Give feedback.
-
Hi @PorkDevMode , does this happen after a while or are you entirely unable to run the AI at all? I see this in your traceback:
This seems to indicate that the localhost TCP connection with OpenPlanet could not be established. |
Beta Was this translation helpful? Give feedback.
-
nope just happens every time |
Beta Was this translation helpful? Give feedback.
-
Did you double check that the OpenPlanet script is running properly? If it is, probably there is some app that is using port 9000. Sadly at the moment there is no way of customizing this port other than changing the OpenPlanet script directly. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am trying to test the pre-trained ai however the ai never moves and am instead greeted with the time out message. INFO:root:05/27/24 23:59:38 server IP: 127.0.0.1 User insights and some troubleshooting I tried: I don't know if my pc has bad specs but I don't think that's the problem since It runs trackmania smoothly on any fps. I believe the problem is most likely that the ai never receives information from trackmania. I do have some doubts on how the grab data plugin should be set up. The setup instructions indicated that the plugins folder from tmrl data should be copied into the plugins folder of the openplanet directory. However, this didn't make much sense since that would mean to put a plugins folder inside another plugins folder. The openplanet menu can't load the plugins folder which led me to believe I should copy only the contents of the folder, which I did. However even after restarting, unloading and reloading the grab data plugin and running as administrator either/both my terminal and trackmania, the ai still never moves. Any insight is appreciated, thank you. |
Beta Was this translation helpful? Give feedback.
-
Hi, First, it is usually not required to copy this plugin folder manually on Windows. When you install You don't want to copy the Plugins folder inside the OpenPlanetNext/Plugins folder. Instead, you want to copy the content of the Plugins folder inside OpenPlanetNext/Plugins, as you correctly guessed. If you receive this timeout rightaway, it means that Usually, when the So, one hypothesis is that something other than the One other hypothesis is that the TrackMania python environment correctly connected to the |
Beta Was this translation helpful? Give feedback.
-
Hello I got that error message you mentioned but also an additional Deprecated warning. See the pasted image: No errors appeared in the log after running the python -m tmrl --test I also tried checking port 9000 using the netstat -an | grep 9000 command whilst running the python -m tmrl --test command and got the following output: TCP 127.0.0.1:9000 0.0.0.0:0 LISTENING (appears even when not running the test) I don't know about ports or if this information is even useful however from your response I can see that the program is probably incorrectly using that default listening server. Let me know if there are any other commands I should try, particularly any that would tell me what the listening server belongs to. |
Beta Was this translation helpful? Give feedback.
-
Hmm, it looks like there is a server listening to this port indeed. According to this page, you can do That being said, since this current fixed 9000 port strategy is causing this type of issues, we should come up with a better version of the |
Beta Was this translation helpful? Give feedback.
-
I looked up the PID and got the result shown in the next image: If I manage to find an alternative solution which I believe would be uninstalling Ubisoft connect and trying to find some other way to use trackmania, then I will post it here. Thanks for all the help. |
Beta Was this translation helpful? Give feedback.
-
Wait, UPlay is using this port? 😂 This would be notoriously unfortunate. Maybe it is just the OpenPlanet plugin that is running in the background? PS: It is normal that the server runs even when not launching So I believe your issue is somewhere else. Do you have club access to modify the plugin by any chance? (Only club members can run unsigned plugins, and it takes me several days/weeks to get each new version signed by the OpenPlanet team) |
Beta Was this translation helpful? Give feedback.
-
It is quite ironic that Uplay is using the port 😂 It is possible that it’s OpenPlanet however I can no longer check by uninstalling the plugin since I’ve just left and won’t returning until after summer. However I will try to use tmrl on another computer. I believe mine is cursed. You may very well see me return with the same or some other issue. Thank you for all your help troubleshooting. |
Beta Was this translation helpful? Give feedback.
-
So, to give more info, if you unzip the openplanet plugin you will find that the code starts like this: // This plugin ships with the TMRL framework.
// It sends game data to the default TrackMania Gym environments.
// send the content of buf over socket sock:
bool send_memory_buffer(Net::Socket@ sock, MemoryBuffer@ buf)
{
if (!sock.Write(buf))
{
// If this fails, the socket might not be open. Something is wrong!
print("INFO: Disconnected, could not send data.");
return false;
}
return true;
}
// cast val to a float when necessary and append it to buf:
void append_float(MemoryBuffer@ buf, float val)
{
buf.Write(val);
}
// entry point:
void Main()
{
while(true)
{
// open localhost TCP connection on port 9000:
auto sock_serv = Net::Socket();
if (!sock_serv.Listen("127.0.0.1", 9000))
{
print("Could not initiate server socket.");
return;
}
print(Time::Now + ": Waiting for incoming connection...");
while(!sock_serv.CanRead())
{
yield();
}
print("Socket can read");
auto sock = sock_serv.Accept();
print(Time::Now + ": Accepted incoming connection.");
while (!sock.CanWrite())
{
yield();
}
print("Socket can write");
print(Time::Now + ": Connected!");
(...) You were stuck at the "Waiting for incoming connection..." stage for some reason, which seems to imply that |
Beta Was this translation helpful? Give feedback.
-
Yes this is definitely it. Whichever library the CanRead function is from must have updated and made CanRead obsolete/deprecated. The code will probably run on an older version of this library. I don’t know if one can tell pip to install a specific older version. Another solution would be to update the script so that it uses one of the two new options: Available() or IsReady, whichever works. |
Beta Was this translation helpful? Give feedback.
-
The I just tested on my PC right now with the new version of OpenPlanet, and I get the same issue, so it is definitely this new OpenPlanet version that is the problem. |
Beta Was this translation helpful? Give feedback.
-
Here is a hot fix for club members. It requires enabling the developer signature mode in OpenPlanet. I'll try to get this signed and make a new |
Beta Was this translation helpful? Give feedback.
-
OK, the OpenPlanet team was super reactive and signed it last night, I have updated the resources file. If you encounter this problem:
And you should be good :) |
Beta Was this translation helpful? Give feedback.
-
(Note: the script for saving replays is not signed ATM, it needs some updating before I send it for signing, so for now if you want to save replays you'll have to use the developer signature mode and activate the Save_Ghost plugin manually in OpenPlanet) |
Beta Was this translation helpful? Give feedback.
OK, the OpenPlanet team was super reactive and signed it last night, I have updated the resources file.
If you encounter this problem:
python -m tmrl --install
And you should be good :)