crowdAI / marLo

Multi Agent Reinforcement Learning using MalmÖ
MIT License
244 stars 46 forks source link

multi-agent problem #84

Open Tsbuild74 opened 5 months ago

Tsbuild74 commented 5 months ago

Sorry to bother you guys, but when I run the example of multi_agent, I always get the ‘not enough clients in the client pool’ error. And I checked the Issues for a solution. But I still don't know how to solve the problem that running the role0 first. So how can I run the multi-agent successfully? Thank you!

XgatorX commented 4 months ago

Did you find a Solution for the Problem ?

Tsbuild74 commented 4 months ago

Sorry, I did not found a solution yet.

XgatorX commented 4 months ago

I solved the problem. The issue was that I didn't start two separate instances of Minecraft on different ports. I'm not sure if it helps you, but try starting one instance on port 10000 and another on port 10001. I did it using the Anaconda Prompt tool. Go to your installed Minecraft directory (if you use the Conda environment, it's set to %MALMO_MINECRAFT_ROOT%, so use: cd %MALMO_MINECRAFT_ROOT% launchClient.bat -port 10000 In another window, do the same: cd %MALMO_MINECRAFT_ROOT% launchClient.bat -port 10001

These steps are also described in the tutorial on the website, but I overlooked them too.

hope this helps you !

(all this is done on an Windows System)

Tsbuild74 commented 4 months ago

It works! Thank you very much! But I had other problems. Is it right that I can't see how Minecraft works when the program is running? And I was only able to run the multi_agent.py. When I modified the code like changing the env or adding my own code, the terminal always sent errors like INFO:marlo.base_env_builder:Agent missed 4 observation(s). Have you ever encountered the similar problems?

XgatorX commented 3 months ago

no i try to figure out at the moment how to get the Observations and how many actions are in the Action space. Have you some info about that ? I see in both Minecraft instances the Agents but they only look eacht other in the face and doing nothing. At the end of the countdown i see both in full Size. Idk why.

Tsbuild74 commented 3 months ago

Sorry i get the same situation that the agents only look eacht other too. But when i printed the observations, they are changed. So maybe that's what happens when the code runs?You can find some information about the envs in 'marLo-master\marlo\envs' . I get some information in there and hope it'll help you.

XgatorX commented 3 months ago

Could be possible. Yeah i found the Infos about the envs. But the problem is that i dont find a Proper Doc where the functions to Extract Observations are Explained. Do you know where to look for that ?

Tsbuild74 commented 3 months ago

Sorry I do not find the doc too. And I have no idea about how to extract the infos. Sorry that I can't help you about this.

XgatorX commented 3 months ago

observation = env.reset() observation, reward, done, info = env.step(action)

Thats the normal way. The Observation is a Picture from the Actual game taken at the step. so based on that you can train your agent. action = np.argmax(action_outputs) with that i give actions to the Api. but i didnt get Continouse Movements to work i dont know why. so my agent is really stupid at the moment. There is a kind of hidden doc if you go to Examples and Look how they are Implemented. Hope thats help.