- Added missing package in
requirements.txt
- Changed the
game_state
dictionary that is passed to controllers to be typeimmutabledict
. This prevents changing ofgame_state
values by controllers to prevent tampering/affecting controllers later in the loop where it is passed. This is faster than passing copies of the dict and is still passed by reference.
- Added optional Boolean setting
random_ast_splits
for game object instantiation. IfTrue
, left and right asteroid child asteroid vectors will be be random within a bounded range about the main child asteroid vector. By default is set toFalse
.
- Changed
stop_if_no_ammo
condition to also check mines. Also changed condition such that sum of mines and bullets remaining has to be > 0 since negative values are considered true.
- Added
Mines left
to TK graphics - Added
mines_remaining
to team and score classes to get updated - Added conditions for
no_ship
stop condition to wait until there aren't bullets or mines left - previously this wasn't the case and gave a slight advantage to a ship if it died first because its bullets and mines would persist and accumulate score but the ship that died second would not get the same persistence/score accumulation
- Fixed issue with ship sprite indexing
- Added
custom_sprite_path
property toKesslerController
to automatically grab and load custom ship sprites from thegraphics/images
directory
- Added mypyc compilation for performance increases. Credit to Jie Fan for the code + testing
- Fixed bug with only a single ship getting mine blast damage within the blast radius
- Fixed error in mine cooldown
- Added invincibility for mines during respawn
- Multiple changes to enhance/optimize calculations
- Reduction in calls to transcendental functions in math/numpy
- Reduced numpy calls for non-vector/less inefficient implementations
- Refined collision checks
- Changed destruct order to asteroids before ships
- Added
time_limit
to game state info passed to controller - Fixed bug in mine detonation where coincidence with asteroids/ships caused undesired destruct behavior
- Changed such that if coincident with asteroid with 0 speed, momentum is imparted and split angles are uniform
- Changed
game_state
dictionary information to include an explicitdelta_time
entry representing the difference in simulation time from one frame to the next as well as renamingtime_step
to a more accuratesim_frame
which represents the frame number that the sim is currently on.- I.e. the default frequency is 30 Hz, and
delta_time
is constant so in this case has a value of 1/30. sim_frame
will be 0 on the first frame of the sim and then increment to 1, 2,..., etc. until the sim reaches termination criteria
- I.e. the default frequency is 30 Hz, and
- Added mine objects that can be placed by ships. Mines cannot move once placed, detonate after a fixed amount of time, inflict a "hit" on any object within the blast radius (asteroids and ships), and impart momentum on asteroids based on blast strength which is a function of the distance of the asteroid from the mine placement point. The blast momentum imparted is a linearly decreasing amount with the maximum at the mine location and goes to 0 at the edge of the blast radius.
- Added pause functionality for gamepad controller
- Added small dead zones to joystick and trigger inputs from gamepad controller for better human playability
- Fixed bug in ship-ship collisions where deaths were not properly counted for both ships.
- Fixed bug in relative imports of
GamepadController
class - Updated
__init__.py
insrc
withGamepadController
- Fixed bug with
out_of_bullets
stop condition not covering all cases - Fixed bug in
GraphicsTK
whenui_settings
areNone
- Added gamepad functionality for human players. To do so import
GamepadController
fromsrc.kesslergame. controller_gamepad
and use when passing to game object just likeKesslerController
. Requires a Windows compatible controller such as a wired X360 controller.
- Fixed bug where controller thrust and turn rate commands were not clamped to allowable range before being applied.
- Fixed bug where perferormance metrics were not returned after using
KesslerGame.run()
- Added finalized controller references to
Score
object returned fromKesslerGame.run()
. Allows user to access saved characteristics of controller after simulation.
- Fixed bug in 1.3.0 where sprites used in Tkinter graphics would not be packaged into release wheel
- Added
KesslerGraphics
class to allow for the creation of custom graphics display interfaces
- Project name refactor for PyPI. Breaking change for imports, now named
kesslergame
instead ofkessler_game
.
team_name
property added for teams- Controller property
name
now used in graphics
- Added name property to
KesslerController
base class. This property must be defined on any derived controller or aNotImplementedError
will be raised - Tkinter graphics now displays simulation time in the top left
- Bullets remaining metric has been added to default Tkinter UI settings
- Initial release with support for python 3.10+