duyminh1998 / pycmo Goto Github PK
View Code? Open in Web Editor NEWCommand Modern Operations Learning Environment
License: Other
Command Modern Operations Learning Environment
License: Other
User of pyCMO
to be able to easily train RL agents in pyCMO
I can develop RL agents that can solve pyCMO
scenarios
that it is currently unclear how we can train RL agents in pyCMO
we convert pyCMO
into an OpenAI Gym environment (or at least make an interface that will make pyCMO
behave like a Gym environment
we open up pyCMO
to more collaboration and we can leverage a vast repository of RL agents that are compatible with Gym environments
user of pyCMO
to be able to use more actions in the game
I can train agents that use a wider variety of actions
we currently only support 8 actions (i.e. no action, launch aircraft, attack contact, refuel, rtb, etc.) in AvailableFunctions
we add more actions to AvailableFunctions
we can have more actions to play with
Reference Command Lua Docs
clean up and optimize the floridistan
scenario
the scenario currently takes a long time to complete due to the distance between the target and the attacker. In addition, we have no rewards baked into the scenario
Easy
floridistan
now has a reward system (i.e. for destroying the target, or penalization when an aircraft is lost)floridistan
takes a shorter amount of time to complete (reduce transit times)floridistan
has a time limit that is shorter than 24 hoursmake the data types that are exported in the features object consistent (from the Lua library that outputs the observations to xml to the FeaturesFromSteam
class that parses it)
currently we do not have a consistent agreement of the data types of each field (e.g. an aircraft's heading is a string rather than a float)
Easy to medium.
namedtuple
objects in features.py
to NamedTuple
from typing
to add typing.features.py
and pycmo_lib.lua
and fix any tests or demos that might be broke.SteamClientProps
from a data class to a NamedTuple
class.refactor actions.py
to handle the Steam edition of Command
currently actions.py
is written to be only compatible with the premium edition of Command, which requires an expensive license to which many users do not have access
Easy to medium. We just need to re-write some of the Lua functions that gets returned.
Users can get a list of valid actions per scenario.
Hi,
First of all, thanks for sharing the code in Github. Before I purchase the game and try out your code, I would like to ask a question.
In the config file, you used the Professional edition. Is this required? I wonder if Steam edition is also supported.
Thanks.
improve the reliability of protocol.py
when it executes scripts that are meant to click on and close windows (e.g. closeScenarioEndMessage.bat
and MoveMouseEnterScenario.ps1
)
we currently rely on timing (i.e. sleep
) in the scripts themselves to ensure correct timing. This is not always going to be reliable per the discussion in this comment. We need to create a module in protocol.py
that will check the existence of the window to be closed, and restart the script to close the window as necessary.
Easy to medium
We have more certainty that when we run scripts that close windows they actually finish and can verify that the windows have been closed
user of pyCMO
to be able to work with the Steam/commercial version of Command
I save tens of thousands of dollars in license fees
pyCMO
currently only supports the Premium edition of Command
we research alternative ways to send agent commands to the Steam/commercial version of Command and implement this functionality
pyCMO
will be compatible with the Steam/commercial version of Command
Notes from past related issues
user of Command: Professional Edition (CPE)
the latest versions of pyCMO
to still work with CPE
I can use pyCMO
with CPE
we made a lot of changes from pyCMO
v1,1.0 onwards to support the Steam version of Command
we validate that pyCMO
still works with CPE
we can ensure that CPE users can also use pyCMO
Blocked until we have access to CPE
Describe the bug
MoveMouseEnterScenario.ps1
does not work on computers with a screen resolution smaller than 1920x1080 (e.g. a laptop). Thus, we cannot enter the scenario when we restart
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We can use the MoveMouseEnterScenario.ps1
script on any system (regardless of screen size) to enter the scenario.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
As a temporary fix, users can edit lines 78-79 of the MoveMouseEnterScenario.ps1
script:
$MOVEMENTSIZEY = 600
$MOVEMENTSIZEX = 500
These values are the xy distance from the top of the "Side selection and briefing" to the "Enter scenario" button.
simplify the code needed to create demos
we currently have three demos and they share a lot of repeated code
Easy to medium. We just need to move all the repeated code into a module like run_loop
. We are basically simplifying the process of creating a training loop. Currently this is only used for demos but in the future this is useful for actually training agents.
We have a module that can be called to set up and run demos
develop a CMO scenario that can be used to train and demonstrate a reinforcement learning agent
we currently do not have a demonstration of how pyCMO
can be used to train an RL agent
Creating the scenario should not be hard, but developing one that would be tractable to train an agent in while also demonstrating the capabilities of the framework might be challenging
We have a scenario that we can use to train and test RL agents
When the Client sends data to the game, program execution will be frozen if the game raises an error due to poorly formatted Lua code. Thus, the scenario will not be able to move forward.
See CMOENV.step()
refactor pycmo
to handle both Premium and Steam editions of Command
currently pycmo
are written to be only compatible with the premium edition of Command, which requires an expensive license to which many users do not have access
Medium to hard. We can proceed in two phases of work. First, we can refactor the current codebase and note pieces of code that are exclusive to the premium edition of the game. We can then add the codebase to support the Steam edition of the game.
Users are able to specify and use pycmo
for both the premium and Steam editions of Command. More emphasis will be placed on the latter because we do not have access to the premium version of the game (and this codebase has already been developed previously).
I am playing with reference to your pycmo.
About the random agent, the number of steps cannot exceed 50, Have you tried solving this problem?
(and the reason for this is believed to be an issue with storing up to 200 variables on the main function in Lua.)
Do you have experience performing more than 50 steps?
In the case of Q-learning agent, it appears to be a Q-learning algorithm rather than a code for CPE, so I would like to ask if you are interested in developing ML Agent.
user of pyCMO
to be able to check when a scenario is running or paused
I can make decisions to either resume or pause the scenario. In addition, the pyCMO
environment would also benefit from knowing this information more explicitly.
we currently do not check when a scenario is running or paused (we make certain assumptions about the state). The closest we get is the script to check if the "Incoming message" window exists, which implies the scenario is paused.
we implement a check for whether the scenario is running or paused
we will improve the reliability of the pyCMO
environment
whether we can replace the batch and Powershell scripts that are currently being used to restart a scenario with the Python module ahk
we can potentially improve the performance of pyCMO
user of pyCMO
to be able to export a side's contacts from the Steam version of Command
I can use contacts information to target enemy units
ScenEdit_ExportScenarioToXML
currently does not support a side's contacts
we add the ability to export contacts to the ExportSidesToXML
function
we can export contacts from the game and use it for our RL agents
user of PyCMO
to train an RL agent to solve the floridistan scenario using the PyCMO Gym environment provided in update 1.4.0
I finally have RL agents in CMO
we currently only have a scripted agent solving floridistan
we refine gym_demo.py
and train an RL agent to solve floridistan
we will prove that PyCMO can be used to train RL agents for CMO
user of pyCMO
to see release notes
I can keep track of new features that are added to the main branch of pyCMO
we currently do not use release notes to track new features that are added
we add release notes and update them whenever we merge develop
into main
we can track features as they are added
user of PyCMO
to visually see PyCMO"s capabilities and how to use the tool
I can use PyCMO
we currently rely on written documentation for tutorials
we create some demo videos for PyCMO
we can better communicate the purpose and capability of the tool
look into upgrading to the latest Python version (maybe 3.12)
the project is using an old version of Python
Easy - Medium. The only difficulty would come from dependencies that break after the upgrade.
We have upgraded to a newer version of Python than 3.9
Hello, Thanks a lot for your great work! Do you know if there is any way of recording the game while an agent is playing to be able to visualize it later?
user of pyCMO
to be able to restart a scenario, end a scenario, and check when a scenario has ended in the Steam version of Command
I can develop training procedures for RL agents (which depends on ending a scenario and restarting it)
we currently do not have a way for pyCMO
to check that a scenario has ended, end a scenario, and restart a scenario
we implement these features
we can start to write training procedures for RL agents
Hello,
First of all I would like to thank you for sharing your very interesting work! I would like to ask whether development on the NeuralNetworkAgent is still in progress or its abandonned.
Thanks!
refactor features.py
to handle the Steam edition of Command
currently features.py
is written to be only compatible with the premium edition of Command, which requires an expensive license to which many users do not have access
Medium to hard. The Steam edition of the game does not have built-in data export capabilities, which means we will have to do a lot of Lua scripting.
Users can export data from the Steam edition of Command using features.py
, and the types of data being exported should match with what is possible to export from the Premium edition of Command.
user of pyCMO
to be able to specify different reward models for my scenarios
I can train RL agents
we currently only export the player's side's total score as the reward
we implement a way for users to specify a reward model
we get closer to being able to train RL agents
One idea is to create a custom RewardHandler
class that gets passed into CMOEnv
that can calculate the reward based on the current observation
Describe the bug
The restartScenario.bat
script does not work when the game first loads because the "Load recent" option in the game's "File" menu is not initialized correctly. We have to hover our mouse and click on "Load recent" before the list of recent game files (which restartScenario.bat
relies on) can show up. It is not a critical bug though because we just need to remember to click on "Load recent" when we first open the game, but it is annoying.
To Reproduce
Steps to reproduce the behavior:
restartScenario.bat
file or the scripts/floridistan/restart_demo.py
demo.Expected behavior
restartScenario.bat
should restart the scenario when Command first loads without needing the user to click on the "Load recent" button once.
Describe the bug
The "Scenario End" message can appear repeatedly when a scenario is run on turbo mode and the observation export event trigger is set to a low duration.
To Reproduce
Steps to reproduce the behavior:
floridistan
scenario.Export observation every seconds
trigger to 5 seconds.scripts/floridistan/restart_demo.py
demo and see the error during iteration 25.Expected behavior
The Scenario End
message should not popup repeatedly, or we should be able to catch this and address it as needed.
As developers, we should set up an environment that controls the required packages and dependencies so that we minimize the time required to start developing. Poetry is one popular environment and dependency manager
Developers can set up an environment on their local machine and run the repository
how the in-game time compression interacts with the regular time triggers that are set
we can increase the speed of the game safely (ensuring that important events are still fired correctly) and minimize training times
Sometimes when we restart the scenario through pyCMO
, the time compression is not correctly set, or it resets to x1 time
floridistan/restart_demo.py
script and notice that sometimes when the scenario restarts and loads, the time compression is reset to x1 instead of the correct x15.The time compression is reset after the scenario restarts and loads
The time compression is correctly set to whatever was specified in the Export observation initially
event in the game when the scenario restarts and loads.
I was wondering whether the library strictly requires a professional edition or it can also be used with commercial version on Steam. If yes, do you have a setup guide to interact with CMO ?
Thank you in advance for your help!
Describe the bug
Related to issue #25, when a scenario ends in-game, the Scenario has Ended
event might not fire properly and the environment might not know that the scenario has ended and get stuck.
To Reproduce
Steps to reproduce the behavior:
scen/steam_demo_restart.scen
scenario.Scenario has Ended
event.Expected behavior
We need to know when the Scenario has Ended
event has not fired properly and handle it accordingly. Currently, we can also use the CMOEnv::end_game()
function to end the game.
Sometimes the MoveMouseEnterScenario.ps1
script is flaky and we miss the "Enter scenario" button
floridistan/restart_demo.py
several times and you might see the mouse gets moved beyond the "Enter scenario" button.MoveMouseEnterScenario.ps1
does not always guarantee the movement of the mouse to the "Enter scenario" button and click on it
MoveMouseEnterScenario.ps1
will always move the mouse to the "Enter scenario" button and click on it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.