Threads for rossimo

  1. 1

    Yeeeeeaah!!!

    1. 1

      I haven’t ever done anything with entity-component systems. I am curious about how broadly this could be applied.

      So I understand you having an entity and you give it a position, so presumably this component is like a property of the entity. So why not just give the entity a position directly?

      1. 2

        There’s a few reasons. On the software engineering side of things, it avoids a lot of issues where class hierarchies are too rigid or code becomes too tightly coupled, but there are also performance benefits which is largely why the game development universe is so into the idea.

        If you have a system that is calculating collisions, for example, perhaps you only need that position to do the calculation. If you “just” give the entity a position “directly” (assuming Entity is a class and you just jam fields in there), then you will also “just” give it other things directly, and eventually it grows to have a huge number of fields. So, your collision algorithm is scanning huge chunks of fragmented memory only to read a single position variable, which is extremely cache-inefficient.

        In contrast, with an ECS you can implement that so that scanning all of the positions is just a linear scan of a contiguous array. Depending on the data type it may even be vectorized. The way you realize this is to not make the component a property of the entity in the sense that it is stored “in” the entity, but to instead store the components by type, completely separate from entities, and associate them with IDs. In the simplest ideal vision, there is no Entity class at all, an entity is simply an integer.

        1. 1

          In contrast, with an ECS you can implement that so that scanning all of the positions is just a linear scan of a contiguous array. Depending on the data type it may even be vectorized.

          I definitely get this along with the cache argument.

          The thing I am not really sure about is perhaps more generally, outside of games. I don’t really do game design, but I do things with web applications (angular).

          1. 1

            It’s a technique that’s mainly for performance–it also is kinda specific to languages (read: C/C++/Java/C#) that don’t have an easy way of doing dynamic compositions/mixins. Like, in Ruby or JS I don’t think it’s as big a win.

        2. 1

          Its a framework that helps reinforce a good separation of concerns. You can mix and match any type of components across your entities, and your systems only care about their specific types of components. It’s a lifesaver in instances where you need an oddball case later in development. “Gee, I really need this Sword Item class to be able to talk to the player, but only the Character class has “Talk()”! Rather than trying to figure out how to shoehorn your Sword into a different class hierarchy, you would start by just adding a Talk component to the Sword entity.

          It flattens out the logic, any “thing” in your world has the capability to do any action.

        1. 4

          Man, I love the Dolphin reports. To be honest, I probably truly understand 10% of what’s going on. But the technical magic that happens in the reports is too good to pass up.

          1. 2

            I’m just amazed that there are still bugs left for them to do these writeups… But I’m not complaining, it’s a monthly delight to read these reports!

          1. 34

            I had to stop coding right before going to bed because of this. Instead of falling asleep, my mind would start spinning incoherently, thinking in terms of programming constructs (loops, arrays, structs, etc.) about random or even undefined stuff, resulting in complete nonsense but mentally exhausting.

            1. 12

              I dreamt about 68k assembly once. Figured that probably wasn’t healthy.

              1. 4

                Only once? I might have gone off the deep end.

                1. 3

                  Just be thankful it wasn’t x86 assembly!

                  1. 3

                    I said dream, not nightmare.

                    1. 2

                      Don’t you mean unreal mode?

                      being chased by segment descriptors

                      only got flat 24bit addresses, got to calculate the right segment bases and offsets, faster than the pursuer

                2. 6

                  One of my most vivid dreams ever was once when I had a bad fever and dreamed about implementing Puyo Puyo as a derived mode of M-x tetris in Emacs Lisp.

                  1. 19

                    When I was especially sleep-deprived (and also on call) in the few months after my first daughter was born, I distinctly remember waking up to crying, absolutely convinced that I could solve the problem by scaling up another few instances behind the load balancer.

                    1. 4

                      Oh my god.

                      1. 2

                        Wow that’s exactly what tetris syndrome is about. Thanks for sharing!

                    2. 5

                      Even if I turn off all electronics two hours before bed, this still happens to me. My brain just won’t shut up.

                      “What if I do it this way? What if I do it that way? What was the name of that one song? Oh, I could do it this other way! Bagels!”

                      1. 4

                        even undefined stuff

                        Last thing you want when trying to go to sleep is for your whole brain to say “Undefined is not a function” and shut down completely

                        1. 4

                          Tony Hoare has a lot to answer for.

                        2. 2

                          Different but related: I’ve found out (the hard way) that I need to stop coding one hour before sleeping. If I go to bed less than one hour after coding, I spend the remaining of the said hour not being able to sleep.

                          1. 1

                            I know this all too well. Never heard of the tetris syndrome before. I need to investigate this now right before going to bed.

                          1. 9

                            Teaching myself the ECS pattern for game development. Fell down the OOP hole with my previous attempt, and built something that eventually became difficult to maintain, since all logic lived in a hierarchy. Hopefully I’ll learn some things to remove the friction of development, and let me focus more on gameplay.

                            1. 2

                              I could not figure out how to program a game until I learned about ECS.

                            1. 4

                              Finally closing in on the UI rewrite of a game I’ve been working on (https://twitter.com/stratagemstudio). After some testing, the previous iteration left players confused. So, after several months of pulling the UI code apart (and introducing immutability into the code), the tactical interface is making a lot more sense.

                              1. 1

                                The animations (incl. during rotation) and vibrant colors make it look super alive for a turn-based game! So subtle yet so magical, impressive, congratulations!

                                1. 1

                                  Thanks a lot! The positive feedback is really encouraging. A team of us have been working on a playable prototype to nail down the experience before going in full-blown production mode, so it’s relieving to know the work heading is a good direction.

                              1. 1

                                What would be the way for Dream to completely dispell the suspicion of cheating, if in fact he is innocent? If the entire setup and software of his runs can be verified ahead of time, and monitored, it would create legitimacy for his success. That is, if he could replicate his runs.

                                1. 3

                                  Replicating such an unlikely run would presumably be further evidence of undetected cheating, I would imagine.

                                  1. 2

                                    I expect the community to publish more stringent lists of permissible client modifications. Right now, modifications are usually only allowed for improving game performance, but even that may be brought into question as we learn more.

                                    However, stricter verification is not what will save Dream’s reputation. Rather, I would hope that he can help reveal something which is not yet understood about the behavior of Minecraft. If his runs are legitimate, then there must be some way, however unlikely, for other runners to replicate his circumstances.

                                  1. 2

                                    Making some more progress on the UI for the game I’m working on at https://twitter.com/stratagemstudio.

                                    Will probably add some more abandonware to a DOS emulation site I built for my daughter over the Thanksgiving break at https://d3bxh8em3eeey6.cloudfront.net.

                                    1. 2

                                      !$work - Continuing a rewrite of the UI for a tactical game I’m working on (https://twitter.com/stratagemstudio). We got feedback that our current UI paradigm is still confusing. Ripping out some smaller features, and reorganizing the ability placement to give players a clearer understanding of what’s going on.

                                      1. 1

                                        I gotta say, that game looks super interesting from an art standpoint. Do you have a place (other than twitter), where I can sign up to get updates? Perhaps an itch.io page or a place where I could wishlist it on steam?

                                        1. 1

                                          There’s an Instagram account as well, but it’s usually the same content. You can follow the artist at https://instagram.com/greatseamonster, he’s really great!

                                          1. 1

                                            It’s nice to see Godot devs working on cool stuff. I’ve used it some on the side, and it seems to hit a nice spot, at least for smaller projects. I’m still learning a lot of the knobs and how to do certain things. (I just figured out how to work with repeating a sprite this weekend).