The format is modified from Keep a Changelog.
Changed
- The recorded game progress for the inactivated ml client will be an empty list.
Added
- Add
"record_format_version"
field to the log file
Changed
- Change the data structure received from or sent to the game class: use a dict to store the information of each ml client. For example, the game has two players and defines the name of them as
"ml_1P"
and"ml_2P"
in theconfig.py
.- The scene information returned from
get_player_scene_info()
will be:{ "ml_1P": scene_info_for_ml_1P, "ml_2P": scene_info_for_ml_2P }
- The command sent to the
update()
will be:{ "ml_1P": command_sent_from_ml_1P, "ml_2P": command_sent_from_ml_2P }
- And the command returned from
get_keyboard_command()
should also be:{ "ml_1P": command_for_ml_1P, "ml_2P": command_for_ml_2P }
- The scene information returned from
- Record the scene information and command individually for each ml client in the log file
- Update the version of built-in games
- arkanoid: 1.0 -> 1.1
- pingpong: 1.1 -> 1.2
- snake: 1.0 -> 1.1
Fixed
- The game could not be closed when running non-python client
Changed
-i/--input-script
supports specifying the file in the subdirectory- For example,
-i foo/ml_play.py
means the file is atgames/<game_name>/ml/foo/ml_play.py
- For example,
Removed
- Remove
--input-module
flag
Fixed
- Handle the exception of
SystemExit
- Handle the situation of reseting the ml executor before the game ends
- The game executor will ignore the ready command.
Changed
- Optimize the checking of the received object from either side
Fixed
- Use wrong value to chack frame delay
Changed
- Modify the game "snake" for the game development tutorial
- The
ml_play_template.py
of the game "snake" contains simple rule-based algorithm.
- The
Changed
- ML process doesn't send the command only when the returned value of
MLPlay.update()
isNone
.
Fixed
- Handle the exception of
BrokenPipeError
Added
- Add "dynamic_ml_clients" to the "GAME_SETUP" of the game config
This update is compatible with Beta 7.0.
Fixed
- Hang when the game exits on Linux
Added
- Add
errno.py
to define the exit code of errors - Handle the exception occurred in manual mode
Changed
- Change the exit code of errors
Added
- Use executors to control the execution loop
- The game and the ml script only need to provide "class" for the executor to invoke (like an interface).
- The game doesn't need to provide manual and ml version. Just one game class.
- Replace
ml_loop()
withMLPlay
class in ml script
- Add commnuication manager
- The manager for the ml process has a queue for storing the object received. If the queue has more than 15 objects, the oldest object will be dropped.
Changed
- Change the format of the recording game progress
- Replace
PROCESSES
withGAME_SETUP
inconfig.py
of the game to setup the game and the ml scripts - Rename
GameConfig
toExecutionCommand
- Simplfy the
communication
package into a module
Removed
- Remove
record.py
and ml version of the game in the game directory
Changed
- Pingpong - version 1.1
- Shorten the ball speed increasing interval
- Randomly set the initial position of the blocker, and speed up the moving speed of it
Added
- Add
-l
and--list
flag for listing available games - Use
config.py
in games to set up the game parameters and the game execution - Use
argparse
for generating and handling game parameters- List game parameters of a game by using
python MLGame.py <game> -h
- List game parameters of a game by using
- Exit with non-zero value when an error occurred
Changed
- The game execution flags must be specified before the game name, including
-i/--input-script/--input-module
flags -i/--input-script/--input-module
flags carry one script or one module at a time.- Specify these flags multiple times for multiple scripts or modules, such as
-i script_1P -i script_2P
.
- Specify these flags multiple times for multiple scripts or modules, such as
- Games: Use dictionary objects as communication objects between game and ml processes for flexibility
- The record file only contains dictionay objects and built-in types, therefore, it can be read outside the
mlgame
directory.
- The record file only contains dictionay objects and built-in types, therefore, it can be read outside the
mlgame.gamedev.recorder.RecorderHelper
only accepts dictionary object.- Code refactoring
Removed
- Games
- Remove
main.py
(replaced byconfig.py
) - Remove
communication.py
- For the ml script, use
mlgame.communication.ml
module to communicate with the game process. Seeml_play_template.py
for the example.
- For the ml script, use
- Remove
- Remove
CommandReceiver
from themlgame.communication.game
- The game has to validate the command recevied by itself.
Fixed
- Fix typo in the README of the arkanoid
- Arkanoid: Add additional checking condition for the ball bouncing
Added
- Arkanoid and Pingpong:
- The serving position and direction of the ball can be decided
- Add difficulties for different mechanisms
- Add ball slicing mechanism
- Arkanoid: Add hard bricks
- Pingpong: Add blocker
Changed
- Update the python from 3.5 to 3.6: For the
auto()
of the customEnum
- Optimize the output of the error message
- Refactor the game classes: Extract the drawing and recording functions
- Add prefix to the filename of the record files
- Physics: Optimize the ball bouncing algorithm
Added
- New game - Snake
- Add README to the game Arkanoid and Pingpong
Changed
- Update pygame from 1.9.4 to 1.9.6
- Arkanoid and Pingpong (Follow the structure of the game Snake):
- Move
SceneInfo
to thegamecore.py
- Rename
GameInstruction
toGameCommand
- Move
- Arkanoid: Add
command
member toSceneInfo
- Trying to load the record files generated before beta 4.1 will get
AttributeError: 'SceneInfo' object has no attribute 'command'
error.
- Trying to load the record files generated before beta 4.1 will get
- Code refactoring
Added
mlgame
- MLGame development API--input-module
flag for specifying the absolute importing path of user modules
Changed
- Use 4 spaces instead of tab
- Support one shot mode in the manual mode
- Fit the existing games to the new API
- Move the directory of game to "games" directory
- Arkanoid: Wait for the ml process before start new round
- Arkanoid: Change the communication API
Changed
- Pingpong: Exchange the 1P and 2P side
- Code refactoring
Changed
- Pingpong: Set the height of the platform from 10 to 30
- Optimize the collision detection algorithm
Added
- 2P game "pingpong"
Changed
- Optimize the call stack message of ml process
- Use
argparse
instead ofoptparse
Fixed
- The game doesn't wait for the ready command
Fixed
- The game hangs when the exception occurred before
ml_ready()
Changed
- Some code refactoring and optimization
Added
-i
and--input-script
for specifying the custom ml script
Added
- Print the whole call stack when the exception occurred
Fixed
- Quit the game automatically when an exception occurred
Added
-1
and--one-shot
for the one shot mode in ml mode- Version message
Changed
- Use function call instead of class instance to invoke use code
- Optimize the collision detection algorithm
- Increase the difficulty of the game "arkanoid"
Added
-r
and--record
to record the game progress