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

Particle Automata section #159

Closed
sidwellr opened this issue Oct 30, 2022 · 3 comments
Closed

Particle Automata section #159

sidwellr opened this issue Oct 30, 2022 · 3 comments
Labels

Comments

@sidwellr
Copy link

You already have so much to do you probably don't want to add more topics! But Particle CAs mesh so well with the rest of the book topics I thought I should at least suggest it. It's a great solution when you need a particle system that detects collisions but don't want to use a physics library. The technique has been around for years, but it has become popular in the last couple of years with games like Sandspiel and Noita.

Although you could dedicate an entire chapter to Particle CAs, I think all the book really needs is a section in the Cellular Automata chapter to introduce the topic. The section should just explain the basic concept and code a simple falling sand simulation, where each sand particle moves down if it can (i.e., the cell below it contains air); if not it moves diagonally down/left or down/right if one of those cells contains air. Add an exercise to change the sand to water, which behaves the same except that water flows out more than sand so it tries to move straight left or right if it can't move down. Maybe a second exercise to implement both sand and water together (sand sinks in water).

There is a lot more to Particle Automata, but this would at least let readers know they exist and what they do so they can seek out more detailed information if they are interested.

@shiffman
Copy link
Member

I think maybe what i'd like to do is have this as a coding challenge video on my youtube channel and maybe reference it as an exercise in the chapter? I'll leave this open as a reminder!

@sidwellr
Copy link
Author

Particle CA implementations have some interesting subtleties that may be frustrating if just left as an exercise, but referencing a coding challenge video where you can explain them might work. If you can make the video before finalizing the book, you can decide whether to reference it as an exercise then. Otherwise, I'd leave it out.

@shiffman
Copy link
Member

shiffman commented Oct 8, 2023

Won't have time to do this before book is finalized but still would like to in the future!!!

CodingTrain/Suggestion-Box#1813

@shiffman shiffman closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants