Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed prog_color visualization bugs #127

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AndreBurkett
Copy link

I couldn't get this file to run with the current version of the repository. I've made several changes to fix bugs that I encountered. Here's a rundown of the changes:

  • The background map wasn't being combined with the sprite overlay. This has been fixed.
  • I've added coordinates to location 193 (Route 22 check gate) to avoid a type error when entering that area. Side note: This room doesn't line up with the coordinate grid very well. If someone with photoshop skills could move it to the right a few pixels, that would be awesome!
  • Added the session name to the base_coords.npz and video file names
  • Altered paths to allow this to run from the root directory. You will need to create 2 folders named 'coords' and 'videos' inside the visualization folder
  • Replaced Pool.starmap() with a for loop. Pool.starmap() was giving me a broken pipe error while trying to create the videos. This is a temp fix until I can find a better solution.
  • I changed the codec to h264 to get the video to play on windows using vlc. However, h264 doesn't support rgba, so the sprite colors are a little wonky for now until I have time to mess with the color scheme.
  • Changed run_steps to 20480 to match the default episode length

The script still isn't perfect, but you should be able to run it now with minimal hassle.

@PWhiddy
Copy link
Owner

PWhiddy commented Oct 30, 2023

Hi! Thanks for sharing these fixes. Some of them are things that I would like to merge like updating the paths to the new directory structure. Other things like baking in the background compositing and eliminating transparency I don't think I can merge as is. It's useful to have the background separate, for example in the video I need to do adjust the background separately from this layer. I used prores because it was the only format for which my video editing software supported transparency, but the files are huge and don't play on windows as you point out. A possible workaround for this could be to render h264 with a solid background color and key this out later.

@AndreBurkett
Copy link
Author

Hi PWhiddy,

I agree with your concerns over some of the changes. If I can find the time, I will try to combine this file with the other visualization scripts and then tie them together with a set of commented config options. That should enable you to choose whether or not to bake in the background, among other things.

In regards to prores and RGBA, I do have concerns about file size, particularly as the AI becomes able to explore further and further. I suspect that the full map will be roughly 8000x8000 pixels in size so reducing file size will likely become more important over time. Other than changing the background color, is there any other reason you want to keep using RGBA? If that's your only use case for the alpha channel, it should be pretty simple to set up an np.where() that replaces any pixel where alpha = 0 to a color of your choice.

@PWhiddy
Copy link
Owner

PWhiddy commented Nov 2, 2023

RGBA isn't strictly necessary as long as it can be replaced with a solid background color that can be removed cleanly. This will also be a win because prores files are quite cumbersome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants