GithubHelp home page GithubHelp logo

neuralmmo / environment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openai/neural-mmo

483.0 483.0 66.0 1.5 GB

Neural MMO - A Massively Multiagent Environment for Artificial Intelligence Research

Home Page: https://neuralmmo.github.io

License: MIT License

Python 99.30% Shell 0.70%

environment's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

environment's Issues

[Feature Request] Update PettingZoo version

Eventually, feature requests will be treated as a scrum board for open-source contributors. At the current scale, you should come chat with us on the Discord #development channel before writing one of these.

Hi, would it be possible to update this repo to use the most recent version of PettingZoo? This project is listed in PettingZoo's third-party-environments, but we only want to include environments which work with the current version.

If you need any help working out issues due to different versions feel free to ask, there were some breaking changes in version 1.2, so it requires a bit of code changes to adapt. The previous API returned done in the step() function, whereas the new one returns truncated and terminated (matching gymnasium). There is a migration guide for gymnasium explaining the changes further, the steps should be basically the same (we're working on making resources for updating old PettingZoo repositories as well): https://gymnasium.farama.org/content/migration-guide/

I am trying to: Use NeuralMMO with current PettingZoo/Gymnasium versions

**It is hard/impossible because:" There have been breaking changes since the version used (v1.19.0 of PettingZoo)

The solution should look like: The internal logic needs to switch to using terminated and truncated instead of done.

[Enhancement] Dead code: Argument proposals

Argument generation code in forge/blade/io/action/static.py is not being used. This is leftover from the old IO. Some of it should be integrated into the new argument code (e.g. to prune the number of arguments per action) and some should be deleted

[Bug Report]

Circular import in v1.5: Cannot import forge.trinity.env without importing forge.blade.core.terrain first

[Enhancement] Poor performance: Overlay communication

Hard to time, but the server currently communicates a crop of every overlay to the server at every time step. It should only communicate the current overlay. This would reduce communication bandwidth by 2-3x now and more as we implement additional overlays

Unity Render Error

2020-05-31 10:42:50+0800 [-] Created a server
2020-05-31 10:42:50+0800 [-] WebSocket connection request: {"peer": "tcp4:127.0.0.1:65079", "headers": {"user-agent": "websocket-sharp/1.0", "upgrade": "websocket", "connection": "Upgrade", "host": "localhost:8080", "sec-websocket-key": "UYVAiLHt7EFsyf7BZ/VJbQ==", "sec-websocket-version": "13"}, "host": "localhost", "path": "/ws", "params": {}, "version": 13, "origin": "", "protocols": [], "extensions": []}
2020-05-31 10:42:50+0800 [-] Unexpected exception in onConnect [''LocalModeObjectID' object has no attribute 'clientData'']
2020-05-31 10:42:50+0800 [-] Traceback (most recent call last):
File "/Users/xxxxxxxx/anaconda3/envs/xxxxx/lib/python3.6/site-packages/autobahn/websocket/protocol.py", line 1182, in _dataReceived
self.consumeData()
File "/Users/xxxxxxxx/anaconda3/envs/xxxxx/lib/python3.6/site-packages/autobahn/websocket/protocol.py", line 1211, in consumeData
self.processHandshake()
File "/Users/xxxxxxxx/anaconda3/envs/xxxxx/lib/python3.6/site-packages/autobahn/websocket/protocol.py", line 2801, in processHandshake
f = txaio.as_future(self.onConnect, request)
File "/Users/xxxxxxxx/anaconda3/envs/xxxxx/lib/python3.6/site-packages/txaio/tx.py", line 366, in as_future
return maybeDeferred(fun, *args, **kwargs)
--- ---
File "/Users/xxxxxxxx/anaconda3/envs/xxxxx/lib/python3.6/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
result = f(*args, **kw)
File "/Users/xxxxxxxx/source/env/my_world/neural-mmo/forge/embyr/twistedserver.py", line 64, in onConnect
data = self.serverPacket()
File "/Users/xxxxxxxx/source/env/my_world/neural-mmo/forge/embyr/twistedserver.py", line 74, in serverPacket
data = self.realm.clientData()
builtins.AttributeError: 'LocalModeObjectID' object has no attribute 'clientData'

2020-05-31 10:42:50+0800 [-] failing WebSocket opening handshake ('Internal server error: 'LocalModeObjectID' object has no attribute 'clientData'')
2020-05-31 10:42:50+0800 [-] dropping connection to peer tcp4:127.0.0.1:65079 with abort=False: Internal server error: 'LocalModeObjectID' object has no attribute 'clientData'
2020-05-31 10:42:50+0800 [-] Connection closed

[Docs] How does this communication system work?

First, I see there is a comm action defined in the action space. The action can send 50 tokens. So is it like a string with a length of 50? And is the message sent to a public channel that everyone can receive or a local channel? And I also can not find any description of the communication in the observation space.

Second, the config on the document is not updated with the communication config.

[Enhancement] Dead code: Model checkpointing

Model checkpointing code duplicated in forge/ethyr/torch/save.py and projekt/rlutils. The core save/load functionality should be specific to torch but not to RLlib. Projekt/rlutils should only contain a small RLlib-specific wrapper

[Bug Report] Rollout.run() doesn't work with render=True

I can run the minimal example with render=True just fine, but doing the same using RollOut.run() gives the following error:

  File "/home/karolis/k/neuralMMO/nmmo-neurips-2022-submission/neurips2022-nmmo-starter-kit-test/tmp.py", line 18, in <module>
    ro.run(n_episode=1, render=True)
  File "/home/karolis/k/neuralMMO/nmmo-neurips-2022-submission/neurips2022-nmmo-starter-kit-test/venv/lib/python3.9/site-packages/neurips2022nmmo/evaluation/rollout.py", line 90, in run
    self.env.render()
  File "/home/karolis/k/neuralMMO/nmmo-neurips-2022-submission/neurips2022-nmmo-starter-kit-test/venv/lib/python3.9/site-packages/nmmo/core/env.py", line 737, in render
    packet = self.packet
AttributeError: 'Env' object has no attribute 'packet'

The code used comes from the starter kit, with render=True added by me in the last line of code:

from neurips2022nmmo import CompetitionConfig, scripted, submission, RollOut

config = CompetitionConfig()

my_team = submission.get_team_from_submission(
    submission_path="my-submission/",
    team_id="MyTeam",
    env_config=config,
)
# Or initialize the team directly
# my_team = MyTeam("Myteam", config, ...)

teams = [scripted.CombatTeam(f"Combat-{i}", config) for i in range(5)]
teams.extend([scripted.MixtureTeam(f"Mixture-{i}", config) for i in range(10)])
teams.append(my_team)

ro = RollOut(config, teams, parallel=True, show_progress=True)
ro.run(n_episode=1, render=True)

[Bug Report] 'pufferlib.policy_ranker' has no attribute 'PolicyRanker'

Fill out as much of the below as you can. A partial bug report is better than no bug report. After submitting, link your issue on our Discord #support channel

OS: Ubuntu 22.04

Description: I follow the NeuralMMO documentation and install the environment through source by "cd environment && pip install -e .[all]". Then, I go to the baselines folder and run "python train.py --local-mode true". However, I get the error:


Traceback (most recent call last):
File "/home/nmmo/baselines/train.py", line 12, in
from reinforcement_learning import clean_pufferl, policy, config
File "/home/nmmo/baselines/reinforcement_learning/clean_pufferl.py", line 43, in
class CleanPuffeRL:
File "/home/nmmo/baselines/reinforcement_learning/clean_pufferl.py", line 68, in CleanPuffeRL
policy_ranker: pufferlib.policy_ranker.PolicyRanker = None
AttributeError: module 'pufferlib.policy_ranker' has no attribute 'PolicyRanker'


It seems that the latest pufferlib.policy_ranker has no PolicyRanker. I only see the class "Ranker" instead. Also, the "clean_pufferl.py" in baselines/reinforcement_learning also uses PolicySelector and OpenSkillRanker, which cannot be found. How to resolve it? Looking forward to the reply. Thanks!

Duplicated files in client/UnityClient/CubeObjs folder

Hi, I am checking out the client project to my Windows laptop, and there's an error says:
UnityClient/CubeObjs/lava.mtl and UnityClient/CubeObjs/grass.mtl already exist.

It turns out that there are duplicated files with Capital letter filenames: Lava.mtl and Grass.mtl.
I guess it'll be better to eliminate them two.

Sorry I didn't find Issues tab on that repo, so I create it here.

How to respawn agents

Hi, is it possible to respawn an agent immediately after it dies in the environment?
When running the environment with a certain number of agents, I experience that the environment resets after some amount of agents dies. I would like to prevent this reset and just respawn an agent right after it dies.
I tried to clear the dead_this_tick and dead_agents sets and add the dead agents back to alive_agents, but it didn’t seem to work. It prevented the reset of the environment but the agents were still dead and never acted again.
Is it possible to respawn agents when they die?

Using with realtime game server

If this is possible, I would appreciate it very very much if in couple of words, you could outline if it is possible to use this project with a different game API, provided this game has Python lib?

I understand all skills and other game-specific things I will have to re-write, but was hoping I could re-use parts of NeuralMMO code, since I'm very new to both Python and OpenAI itself.

strange agent action

problem

Hi, the agent always do the same stupid action of moving from one place to another and there is only one agent, Is this Correct?

Surpport for large-scale virtual environment.

I note that in the 3-layer cluster-server-client architecture, a server must be able to run at least one whole environment. Howerver, we may has little chance to meet this condition in some cases. For instance, if we stimulate the traffic systm of a large city, every single step in this env will take a long time to compute. Thus, it should be better to stimulate this env using several severs, and this may lead to sync problems between severs. Do you have any plan to add such a new feature?
What's more, it seems that neural-mmo lacks a mechanism to train agents online(i.e. update the action policy through the trajectory).
I am interested in finding/designing a framework for massive multiagent environment stimulating. I will appreciate it if you have any idea to share.
Thanks!

Stuck at pending status during evaluation

When I am running python3 Forge.py evaluate --config=CompetitionRound1 however the status of the trial is stuck at pending forever. How do I solve this problem?

+----------------------------+----------+-------+
| Trial name                 | status   | loc   |
|----------------------------+----------+-------|
| PPO_Neural_MMO_d528e_00000 | PENDING  |       |
+----------------------------+----------+-------+

Thanks
Jason

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.