Multiagent CPP API - #584
Draft
jjshoots wants to merge 315 commits into
Draft
Conversation
Previously, ROM-modified settings could only affect a subset of keys, since the emulator was already set up before the modifications were even applied (by way of ALEInterface::loadRom). This change improves on 80783f5, where it should have belonged.
This change adds observer functions to StellaEnvironment and ALEInterface to retrieve the current "difficulty" and "mode" settings. Previously, these values could be set, but not queried.
Fixes const correctness, removes user-defined special members (the implied definitions already copy and assign arrays); replaces a macro with a member constant.
ale-py 3/3: Deployment
Previously, those were leaked when their only reference was overwritten as part of reloading the ROM.
The call was moved unconditionally by 3bee0b6, which left the Console (and its properties) uninitialized on the error path "wrapper == NULL". This change reinstates that call locally only on this path, which ends in program exit.
The default argument was not used and not useful in the .cpp file; it is reasonable and useful in the interface. The relevant documentation is also moved.
* Cartridge::create did not check whether a catridge had been created before using it (introduced by 2121bf7). * Cartridge::autodetectType did not check that the "AR" cartridge ROM had non-zero size. * Cartridge::autodetectType did not check that the fallback choice of "4K" cartridge had the correct ROM size. Since the size-checked case is already handled earlier, we remove the entire fallback case. * Cartridge::searchForBytes did not check whether the search term was within the bounds of the search range. * OSystem::createConsole and OSystem::getROMInfo failed to deallocate the image memory in case of a cartridge loading error. Note that this change does not provide complete checking for ROM validity: if the conditional block at Cart.cxx:79 is skipped, no autodetection is performed and the provided ROM data is assumed to be valid for the specified cartridge type (with potential out of bounds accesses otherwise). The block is skipped if the "rominfo" setting is not set to true and if the cartridge type has been set to something other than its default of "AUTO-DETECT".
This change adds support code for the following games: * Atlantis2 * Backgammon * BasicMath * Blackjack * Casino * Crossbow * DarkChambers * Earthworld * Entombed * ET * FlagCapture * Hangman * HauntedHouse * HumanCannonball * Klax * MarioBros * MiniatureGolf * Othello * Pacman * Pitfall2 * SpaceWar * Superman * Surround * TicTacToe3D * VideoCheckers * VideoChess * VideoCube * WordZapper All available game difficulty settings and single-player game modes should be advertised.
…ut-v2 Bump Github Actions actions/checkout to v2
* Removed RLGlue interface. Its own website says it's deprecated, it hasn't been updated in over a decade and I searched Github and couldn't find a project which actually used it. * Removed FIFOInterface. It seemed to be in a dire state, the examples didn't work, the interface segfault's, and I couldn't find a single project using this interface. This also means I removed the Java example we previously had. * Since I removed both the interfaces I also removed the CLI build along with its corresponding functions in emucore/Settings.
With the removal of controllers many of the examples are no longer relevant. The remaining Python and C++ examples have been updated accordingly.
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
jjshoots
marked this pull request as ready for review
December 14, 2024 11:02
pseudo-rnd-thoughts
left a comment
Member
There was a problem hiding this comment.
Is it necessary to change the actions? I don't see where that is necessary?
Could you add tests that PettingZoo can work with this?
Contributor
Author
|
@pseudo-rnd-thoughts Roger on the PZ tests. |
Member
|
@jjshoots I took your PR and worked out the issue, pybind is a mess - https://github.com/pseudo-rnd-thoughts/Arcade-Learning-Environment/tree/multiagent_api-new |
jkterry1
marked this pull request as draft
July 9, 2026 22:22
Kallinteris-Andreas
force-pushed
the
main
branch
from
July 13, 2026 04:59
a42e8ad to
4642385
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the CPP interface to allow a 2 player interface. Work for the 4 player interface is left as a future PR because that's quite a bit more complicated.
AFAICT, these are the 2 player games available:
And these are games with 4 players:
I believe we should be able to just copy the games that support multiplayer from the MALE repo since they already have the modifications required. I have modified Surround to support 2 player mode for the testing script below.
The more difficult question is how the Python interface for this should look, since, I presume, the gymnasium API is not sufficient.
Testing
Expected Behaviour:
Since the gymnasium API by default makes player B's actions NOOP, setting
mode=4means that player B won't have any actions.Conversely, setting
mode=2would mean that player B will be controlled by the emulator, therefore moving in random directions.