altf4 / SmashBot

The AI that beats you at Melee
GNU General Public License v3.0
548 stars 72 forks source link

WARNING: Exception thrown: 'Stage' object has no attribute 'stage' when running `example.py` #152

Open anandijain opened 11 months ago

anandijain commented 11 months ago

python .\smashbot.py -e "C:\Users\anand\AppData\Roaming\Slippi Launcher\playback" -i 4

was what was used to run smashbot, not sure why this WARNING: Exception thrown: 'Stage' object has no attribute 'stage' when runningexample.py`` is happening but it does seem to be affecting its play since fox just seems to stall

thanks a ton for all of the work put into these packages btw, super cool

any hints on where to look to debug?

TheShinobiX commented 6 months ago

The easiest solution is to downgrade our version of Libmelee to 0.37.0

We can perform this downgrade with the following command pip install --upgrade melee==0.37.0

OR the following commands

pip uninstall melee
pip install melee=="0.37.0"

The reason for this bug is because the methods in Libmelee's "stages.py" was updated to use the gamestate object itself instead of just the gamestate.stage. Previous versions of Libmelee used just the "stage" object. The code for SmashBot has not been updated for newer versions of Libmelee so it passes only the "stage" object to those methods.

Do note that this workaround solution causes Foutain of Dreams (FOD) to not be properly playable by the bot, but I don't even know if FOD is playable if everything was properly implemented.

I am very new to Melee, but I was fascinated by @altf4 and his SmashBot, so I spent a lot of time understanding this code. It took me quite a while to debug this problem myself. I am a bit shy to play against real people yet (as I suck), so I thought practicing against a bot would be nicer.

Let me know if this solution works for you.