Пікірлер
@anantsingh1049
@anantsingh1049 Ай бұрын
Massive respect to you for explaining the fundamentals of computing and binary numbers in such an intuitive and simple manner, everybody introduces computer as this machine that understand 0s and 1s but rarely people go into the "Why" of that, why only 0 and 1? why not 0,1 and 2? If only things can be taught in this manner in schools and colleges instead of dumping details that will not make sense initially.
@rustisbae
@rustisbae 2 ай бұрын
I was happy to see a cool programming video, sad to see it was for the web. Then beyond happy once I realized it was made in rust :P Edit: You might wanna check out bevy for some ecs-related stuffs in rust. It does at times feel like overkill, but it works seamlessly with the rust programming language imo. Nonetheless, loved the video!
@aleksitjvladica.
@aleksitjvladica. 2 ай бұрын
Have your parents found out that you are gay?
@VortexTheBreadMan
@VortexTheBreadMan 3 ай бұрын
I've been going through pretty much all the same issues writing this in c++ the past week. It's so simple to get a basic implementation working when you only have a few types. But trying to structure it in a way that is expandable has been a nightmare. I've been trying to use polymorphism but I find in c++ it's very annoying to work with.
@Daaninator
@Daaninator 4 ай бұрын
I made this week something like this too. But with water, wood, stone, lava, glass, acid and smoke. Like Sandboxels (1:35). Coincidence this video showed up in my homepage (or youtube knows ":))
@dylanezell295
@dylanezell295 4 ай бұрын
Hey I think what you're looking for in rust is trait objects
@BladeRunnerEnthusiast
@BladeRunnerEnthusiast 5 ай бұрын
Dan-Ball, the Powder Toy. Classic man.
@swileyhedrick2373
@swileyhedrick2373 5 ай бұрын
now do the impossible. add superfluid
@codinghuman9954
@codinghuman9954 5 ай бұрын
LETS GO TOADPOND!!!!!!!!!! (also ecosystem simulator????? rainworld mentioned??????)
@TodePond
@TodePond 5 ай бұрын
nice
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Thanks for stopping by! I love the blending of creativity and tech in your videos!
@swalscha
@swalscha 5 ай бұрын
Nice video! It's a good start for working with reaction-diffusion equations from fluid dynamics. It's a branch of physics/biochemistry where elements in your biome diffuse themself in the environment through thermodynamic laws (what you have done so far) and react to other elements. For example you can have a fish sand particle that will eat algae and poop seeds. Watchout though, this domain is so vast and rich that you can easily be hooked for a while 😉
@mcpecommander5327
@mcpecommander5327 5 ай бұрын
Traits can in fact have constants in Rust, which seems to be what you meant. If you mean non-constant, why in the world would you want variables in traits? Just have the variables in the struct
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
The real answer is I was too stuck on solving it in a specific way and staring at the problem too long to see more obvious solutions
@mcpecommander5327
@mcpecommander5327 5 ай бұрын
Couldn't you update bottom-up? it even gets rid of the annoying lines for free
@swileyhedrick2373
@swileyhedrick2373 5 ай бұрын
it should update bottom up and switch left right and right left behavior each tick
@Chubercik
@Chubercik 5 ай бұрын
4:00 - THANK YOU!! I also had trouble with my sand being biased to fall on one side or the other, depending on buffer traversal direction, and I couldn't for the life of me find any mention of this on the Internet, let alone a solution.
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
It was an odd bug to track down. I thought I'd messed up the diagonal falling code for a little while. A similar issue happens if you don't randomize the direction the water disperses in as well. You start getting water "pooling" uphill in one direction and very slowly leveling out over time. Assuming you implement it like I did, anyway
@Chubercik
@Chubercik 5 ай бұрын
Haven't gotten to water yet, but I'll keep that in mind :)
@davawen9938
@davawen9938 5 ай бұрын
I really liked how you made this video! I'm also an avid TodePond watcher. It's pretty cool seeing you go through the same bugs and ressources I did when I wanted to create a falling sand game. Much love and encouragement on your future projects! You have talent!
@friendlyoldpieceofapoppedp711
@friendlyoldpieceofapoppedp711 5 ай бұрын
Wow lmao I’ve just started programming one of these for my final IT Practical and this video released the same day I started. Neat coincidence.
@-._Radixerus_.-
@-._Radixerus_.- 5 ай бұрын
I used to play this one falling sand game that would sprout these super complex trees from seeds, and had LSD. If any living creature touched LSD, the whole screen would go into LSD mode.
@kalla103
@kalla103 5 ай бұрын
lmao
@clausluger4570
@clausluger4570 5 ай бұрын
Good video I like
@ittixen
@ittixen 5 ай бұрын
Flushing all those minnows at the end felt surprisingly tragic
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Agreed! It feels really bad doing it!
@lack_of_awareness
@lack_of_awareness 5 ай бұрын
You should use an enum with values to represent the different cells with their specific data
@lack_of_awareness
@lack_of_awareness 5 ай бұрын
the impl keyword isn’t a dynamic type checking. You probably meant trait objects, such as Box<dyn MyTrait>
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Yes, you're right! I didn't catch this in editing. Combination of ignorance and poor wording
@flamearoo7258
@flamearoo7258 5 ай бұрын
Hmm. For the problem about not wanting to store all the data in the grid I would probably just link the id of particles to a list of dyn Particle trait objects which can be a simple lookup that allows access to any abstract function for interaction which means you could simplify the process have introducing more particle types. Realistically u would probably want look up tables to just go from Id to a struct of data references and function pointers that hold all the different functionality. This means both sand and gravel have the same movement criteria by referencing the same function pointer but could have different function pointers for reaction with water for example
@Liebe-Futurel
@Liebe-Futurel 5 ай бұрын
I played dust on a site that had Thursday in the name? I think.
@Kavukamari
@Kavukamari 5 ай бұрын
i think if you're doing an ECS in realtime it might get really slow with like 100000 particles, maybe you could have ECS while you're building the engine and then flatten the structures at compile time so it runs fast and it's not all dynamic (it seems like something that should be possible but I might not know as much as i think i do)
@codinghuman9954
@codinghuman9954 5 ай бұрын
it really depends, while I haven't used ECS all that much beyond making a basic implementation Golang, I would say that it may do better than you may at first think. An ECS's main advantage is its contiguous memory that optimizes for the most cpu cache hits and its very good at storing very little amounts of data on each entity* (I know that entities are only ids you get the idea) and iterating over many thousands of entities very quickly. But beyond just that theirs also other questions that must be asked, how many times do you delete or spawn entities/add or remove components, in the implementation that I went with this was the slowest thing you could do in it, as well as if you want air to act like a particle in which case you would already have an array that you could just loop over without having to worry about wasting time on null tiles like you would have if air did nothing. If you don't want air to act like a particle, how much do you have? If you have a lot of air you may need to optimize around that but if you only have a few pixels you could just skip over it. In an ECS one of the nice things is that you only go over what you need to iterate over for each entity and can chose the update order by changing which systems are called first, do you want to update some particles before others? What about storing data? If you want to store unique data on each particle you will need much more than an id and an ECS would likely be the way to go as at least with most implementations it would store that data in a separate archetype. but its also important to remember that an ECS isnt just one thing, its a whole group of things that are similar in that they have entities, components, and systems but are also different in how they work. Even if an ECS isn't the best solution, I think a system like it would probably be your best bet! (or Timid's best bet) Anyway I have no idea what I just wrote so ima just leave a link to a great GDC talk by one of the Noita devs: kzbin.info/www/bejne/pqO7pqyDeMyVisU
@codinghuman9954
@codinghuman9954 5 ай бұрын
then there's also other things, like if you have a particle that hasn't been acted on in a while, you could make it inactive until a force or particle acts on it and wakes it up. How could something like that be implemented? The easiest way if you were to use an ECS would be to add or remove an "active" component and then only iterate over entities with that active component, but adding and removing components is slow so it may be better to have a list of entities that are active and look them up and iterate over them, but that DESTROYS cache efficiency. So how often do entities change state from active to inactive? Do you want entities to go inactive at all? Is an ECS even a good fit for a cellular automaton? Those are all very hard questions to answer! (and I have no clue)
@Kavukamari
@Kavukamari 5 ай бұрын
powdertoy... save me powdertoy
@Soraphis91
@Soraphis91 5 ай бұрын
8:35 ... I'm by no means a rust developer... but ... just define getter functions in your traits for the properties you need, and in the implementation have a baking field.... (you probably don't even need a baking field, I guess, since most of your values would be quite constant anyways per type!?) but yeah, I guess ECS might even be better in terms of performance, since you do not bloat everything with a lot of potentially-used-fields, and the fields you're using are usually quite good memory aligned if everything is done right.
@RPG_Guy-fx8ns
@RPG_Guy-fx8ns 5 ай бұрын
so far, everything is dependent on gravity falling down, so it would be difficult to add magnets or change the gravity direction. Everything moves at the same speed with a binary pressure. if every type has a density, you can calculate the slope of the density in the direction you are moving, so it works the same moving in any direction. each particle could have an angle of repose. You could also add a panning displacement map, that makes the grass and kelp wave, with a gradient towards their roots so the root doesn't wave as much as the top.
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Hmmm... I wasn't planning on pushing this to be that complex, but these are some cool ideas. I may have to try some of that out! Thanks for the suggestions!
@jamesfenimore174
@jamesfenimore174 5 ай бұрын
I clicked on your video because it made me think of TodePond, lol.
@darqed
@darqed 5 ай бұрын
falling sand games are really nostalgic to me and I love watching stuff about them
@Pockeywn
@Pockeywn 5 ай бұрын
NOOO youre gonna make my game before me :((
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Hahaha, I wouldn't worry too much about that happening, I don't know that I plan on fleshing this out too much. Even if I did, make it anyway! Never be afraid to make cool stuff!
@Pockeywn
@Pockeywn 5 ай бұрын
@@timidautomaton5950 ive got some ideas for a cell life sandbox game that i might call automa but i literally only have it on paper at this point 😅 i look forward to seeing what you do with this channel either way!
@iskda1585
@iskda1585 5 ай бұрын
Todepond mentioned!!!!!
@R74n
@R74n 5 ай бұрын
thanks for mentioning sandboxels!!
@cheesybrik
@cheesybrik 5 ай бұрын
Surreally small world
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Yeah! I played around with it for much longer than I meant to when researching for the video, haha! There was a lot of interesting mechanics, but I really liked the weather effects! I played around with the temperature changes for quite a while too.
@blujay-xyz
@blujay-xyz 5 ай бұрын
my favorite version of a sand game is 'powder game' by dan ball. it came out in 2007 and is a certified classic
@PopeGoliath
@PopeGoliath 5 ай бұрын
I loved that one. Some of my uploads went viral. My first taste of internet fame.
@blujay-xyz
@blujay-xyz 5 ай бұрын
@@PopeGoliath sharing levels was such a cool feature, I remember playing tons of obstacle courses
@OvermasterP
@OvermasterP 5 ай бұрын
Love Danball. His stick figure RPG will live in my mind forever
@blujay-xyz
@blujay-xyz 5 ай бұрын
@@OvermasterP same here man, loved that game
@abra_escaped
@abra_escaped 5 ай бұрын
That's the same one I played!
@eitantal726
@eitantal726 5 ай бұрын
powdertoy
@blipboop5594
@blipboop5594 5 ай бұрын
I'm of a younger demographic, but my main experience of this genre was through this game called Powder Toy which for some reason was installed on all my schools computers. Fun to make H bombs in lol
@thearkmecha4637
@thearkmecha4637 5 ай бұрын
I loved poweder toy
@mekudesu
@mekudesu 5 ай бұрын
It had a steam release just this year!!
@shadesoftime
@shadesoftime 5 ай бұрын
Powder toy is absolutely amazing
@EliasCalatayud
@EliasCalatayud 5 ай бұрын
​@@shadesoftimeindeed
@blipboop5594
@blipboop5594 5 ай бұрын
Algorithm doing good work today
@PokeNebula
@PokeNebula 5 ай бұрын
I think static lists might be exactly what i needed…
@blockshift758
@blockshift758 5 ай бұрын
Algopush
@apotheotic
@apotheotic 5 ай бұрын
TODEPOND MENTIONED 🏳️‍⚧️❤🎉
@bugorgans
@bugorgans 5 ай бұрын
REWALLLL
@flazefeeds381
@flazefeeds381 5 ай бұрын
Rust mentioned 💪
@ar_xiv
@ar_xiv 5 ай бұрын
About your architecture question… did you consider using a bit field / enum flags?
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
I have types as enums, but seeing the comments mentioning bit fields directly gives me some ideas. Seems like a good solution!
@mono9613
@mono9613 5 ай бұрын
This is super fascinating! The only sand physics based game I remember is Sugar, Sugar, but I never thought about the possibilities. Awesome voice btw
@Epicfraxy
@Epicfraxy 5 ай бұрын
One of my first forum bans on the internet was the falling sand game forums. I crashed the server by trying to roll 100000d1000000 dice in the IRC chat.
@Pinkcircleguy
@Pinkcircleguy 5 ай бұрын
lmfao
@gsami1256
@gsami1256 5 ай бұрын
I was banned because I worked a lot with a modder named Pyromaniac who made a game called PyroSand (or something like that?). And he went and created a new forum to compete with the fallingsandgame forums, the admins didn't like that and banned him, and because I worked with him, the admins just assumed I was affiliated with him and banned me too. I ended up going to his forum because of that even though I didn't originally plan to
@Epicfraxy
@Epicfraxy 5 ай бұрын
@@gsami1256 dude seriously its insane to me how many small games projects just have some story like that. where some people are working on a new thing and try to make a different forum and they get banned for it. the discord kids have no clue what sort of feudal shit occurred on The Boards
@AJMansfield1
@AJMansfield1 5 ай бұрын
For a rules manipulation interface, you might consider treating the inputs as a sort of "2d regular expression" -- which gives an obvious answer for how to make it fast, and that's compiling those regexes into FSM kernels.
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
This is an interesting idea, I'll have to look into that
@Quandinis
@Quandinis 5 ай бұрын
i would assume bitflags could help alot
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
Seems like a good solution, I think I was dancing around this idea without realizing it until I read these comments
@physbuzz
@physbuzz 5 ай бұрын
Awesome video, the only way to make it better would be to include more Ark and Kerrigan. Can't help but list my own favorites: dan-ball's powder game includes a basic cellular automata wind simulation! OE-CAKE and phyzios studio still have an active community around them. There's some really good source code on shadertoy if you search for falling sand. My own hunch on how to approach powder sims is that you shouldn't worry about general solutions. Each powder type is going to have its own concerns and code it has to run, and what matters is that the overall effect looks good. So, hacky solutions where the behavior depends on the update order, weird interleaving, bitwise tricks, are all A-OK. But I haven't published a powder game so take that with a grain of salt.
@Ambidextroid
@Ambidextroid 5 ай бұрын
OE-CAKE! Just unlocked a distant memory
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
I hadn't thought of those videos for years before making this, lol. I have a bad habit of abstracting too early in programming. It always feels like there should be a more clever solution and brute forcing is "wrong" haha. I'll have to check out the ones you mentioned!
@Zarth82
@Zarth82 5 ай бұрын
Hell of Sand, now THAT'S something i havent thought about in ages. I mostly spent time exploding things in those sims. Thanks for unlocking that memory 👍
@feluriandelights4156
@feluriandelights4156 5 ай бұрын
looks neat
@frey..
@frey.. 5 ай бұрын
I'm super sorry but unfortunately you're gonna have to make more videos because this one was really nice to watch
@djmouton251
@djmouton251 5 ай бұрын
same but i'm saying it more threateningly
@TheEggToBehold
@TheEggToBehold 5 ай бұрын
Why're you sorry???
@estivale8193
@estivale8193 5 ай бұрын
because the video was so nice to watch, that he has to tell its authour that he's gonna have to make more videos without any concern for his wishes and needs. i think that being very sorry for this kind of statement is quite fitting​, as the author might not want to make videos, and nobody should be able to tell him what to do. would you want to be told, that you made a good video, so make more? anyways, would you mind showing me your fidget spinner?@@TheEggToBehold
@timidautomaton5950
@timidautomaton5950 5 ай бұрын
The comments have spoken
@NolanHOfficial
@NolanHOfficial 5 ай бұрын
​@@timidautomaton5950ur videos are awesome bro
@MyHardyhar
@MyHardyhar 5 ай бұрын
super cool