Vehicle behaviour fix, generic merge env, Gymnasium-compliant render behaviour, and docs refresh
LatestHighwayEnv v1.12.0
This is a big release that brings:
- a new generic version of the
mergeenvironment - major documentation updates
- reduction in startup latency
- improvements in dependency situation (replacing
pygamewithpygame-ce, removingscipy) - multiple new environment versions due to a bug discovered in neighbouring vehicle detection in environments with multiple road segments (causing non-player vehicles to have a higher likelihood of crashing than they should, as shown here).
Minor breaking change
Previously, HighwayEnv did not implement render mode according to Gymnasium; instead, whether the environments are actually rendered is set with the offscreen_rendering config key. #700 introduced correct behaviour for treating different values of render_mode, while still keeping old config keys as overrides:
render_mode="human"-> render to window by default,render()returnsNonerender_mode="rgb_array"-> headless render by default,render()returns image array- Keeping
offscreen_renderingin config as an override - The
OFFSCREEN_RENDERINGenvironment variable is now ignored because explicit is better than implicit
So, basically, you can set render_mode="rgb_array" and pass offscreen_rendering=True in the config dict to get both an RGB array returned by render() and pygame rendering in a new window for your viewing pleasure (note that you still need real_time_rendering=True to render at the intended fps).
New environment variant
- Generic version of the
mergeenvironment (merge-generic-v0,merge-generic-v1) by @Minipoloalex (#694)
New environment version
- With neighbour vehicle detection fix:
exit-v1,intersection-v2,intersection-multi-agent-v2,merge-v1,racetrack-v1,racetrack-large-v1,racetrack-oval-v1,roundabout-v1,roundabout-generic-v1,u-turn-v1by @Lidang-Jiang (#667)
Bug fix
- Fix
neighbour_vehiclesnot detecting vehicles on connected lanes by @Lidang-Jiang (#667) - Ensure compliance with Gymnasium's definition of
render_modeby @Trenza1ore (#700) - Minor typing and NumPy 2.x compatibility fixes by @Trenza1ore (#698, #705)
- Call
superinLinearVehicle.randomize_behaviorby @m-walters (#614)
Dependencies
- Replaced
pygamewithpygame-ceby @Trenza1ore (#678) - Removed dependency on
scipyby @Trenza1ore (#691)
Performance
- Reduced startup latency by initializing only the needed
pygamemodules by @Trenza1ore (#687)
Documentation
- Docs added for 4 existing environments (
exit,lane_keeping,two_way,u_turn) by @Trenza1ore (#697) - Docs added for rendering modes and configurations by @Trenza1ore (#700)
- Docs added for neighbour vehicle detection issue by @Trenza1ore & @Lidang-Jiang (#667)
- Release notes section by @Trenza1ore (#706)
- Update outdated sections in docs by @Trenza1ore (#699)
- Fixed warnings in documentation build process by @Luzijano & @Trenza1ore (#690, #695)
Community
- Readme rewritten for compactness by @kydrahul & @Trenza1ore (#682)
- Contributing guideline written by @kydrahul & @Trenza1ore (#702)
- Issue & pull request templates by @Trenza1ore (#679)
- Unit test coverage requirements for pull requests by @Trenza1ore (#705, #707)
CI and build
- General CI improvements by @mwydmuch & @Trenza1ore (#680, #681, #683)
New Contributors
- @Trenza1ore made their first contribution in #678
- @mwydmuch made their first contribution in #680
- @kydrahul made their first contribution in #682
- @Luzijano made their first contribution in #690
Full Changelog: v1.11...v1.12