Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
[1.6.3] - 2024-12-27
Fixed
The
make_decisions_randomproperty is now correctly initialized.
[1.6.2] - 2024-12-07
Fixed
Alerts are now shown even if they’re created from the web worker. In particular, bot exception alerts are now visible.
[1.6.1] - 2024-11-16
Added
The
GameCanvashas a newdraw_rectanglemethod which can fill/stroke a given rectangle.
[1.6.0] - 2024-11-15
Added
You may now
pauseinmake_decisionsto let the bots pause the simulation in interesting frames!You may now use the
download_imagemethod instead ofdownload_imagesto download a single image.
Changed
No UI simulations are now non-verbose by default, meaning alerts shouldn’t be shown and sounds are not played (unless the new
forceparameter is specified).
Fixed
Canvas dimensions are now slightly improved.
Documentation of web-only methods is now accurate by using
functools.wraps.
[1.5.8] - 2024-11-14
Fixed
Logs added immediately one after another now correctly added.
Peer dependency on
dayjsnow specified correctly.
[1.5.7] - 2024-11-12
Fixed
If the simulation randomness seed is set to “-” it still succeeds.
useLocalStoragenow updates falsy variables.Log viewer now doesn’t reset all of the time.
[1.5.6] - 2024-11-08
Fixed
Second simulation not working because start button would not bind to Python simulation start.
Running simulation files which were generated locally now works because previous they did not have the correct
_logs.
[1.5.5] - 2024-11-08
Added
Support for output file in the CLI.
[1.5.4] - 2024-11-08
Fixed
Random differs on the browser (pyodide) and local (python) because of floating point stuff.
[1.5.3] - 2024-11-08
Fixed
Infinite loop of
is_web.
[1.5.2] - 2024-11-08
Fixed
The CLI now works again and supports the new randomness seed option and execution from a file.
[1.5.1] - 2024-11-07
Fixed
Log function now automatically casts to
striftextis not a string.Logs are now persistent across rerenders, instead of previously being unstable.
Round page fixes.
[1.5.0] - 2024-11-07
Added
Simulation files are now seeded.
When running a simulation, you may now choose a specific randomness seed.
Changed
You should now use
self.make_decisions_randomfor any randomness usage inmake_decisions.The
randomglobal for bots is now a seeded pseudorandom generator initialized from the simulation seed by default (this can be customized withconfigure_bot_globals).You should now use
self.randomto make your game deterministic for a given seed.
Fixed
Running N times now resets the
Resultsto make sure the alert at the end is of exactly N times.
[1.4.0] - 2024-11-06
Breaking Changes
You must now add
@mantine/dropzoneto your dependencies.
Added
You can now download and upload simulation files. You may also use
configure_versionto invalidate previous simulation files, and choose a custom name for your main class (inheriting fromCodeBattles) so your website can check that simulation files are of your game.You may now specify a varying render rate with
configure_render_ratefor render-intensive code battle games.The web worker rendering time is now shown.
Changed
The error when
play_soundfails is now more readable.
Fixed
The canvas dimensions in showcase mode are now more accurate (with regard to the height).
[1.3.0] - 2024-11-01
Breaking Changes
You must now add the following to your
index.htmlinsidebody:<script type="py" src="/scripts/main.py" config="/config.json" worker name="worker" ></script>
Added
The
make_decisionsmethod is now called in a web worker and the entire game is able to be rendered before playing. If a frame’s decisions hadn’t been made and the user tries to play, the browser will sleep until it’s ready (currently a fixed amount of time).The
GameCanvashas a newdraw_linemethod which can draw a given line.
[1.1.0] - 2024-10-21
Added
You can now configure the globals given to each bot (e.g.
time,math,random, etc.) withconfigure_bot_globals().You may now also specify extra width with
configure_extra_widthwhich works similarly toconfigure_extra_height.The
GameCanvashas a newdraw_circlemethod which can fill/stroke a given circle.
[1.0.0] - 2024-09-27
Added
The Python library and pdoc template are now part of the library.
There is a new vite plugin to include the Python library, update PyScript configuration etc. named vite-plugin-code-battles.
The documentation now also has a reference of the Python library.
Breaking changes will now be versioned correctly.