Is this a good ECS like approach?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Is this a good ECS like approach?

Post by Plu »

It's also easy enough to go around the safety mechanisms and create more problems, which is actually one of the concerns I had in mind earlier. I mean, if supplying "x" and forgetting "y" is a concern, then removing "x" or "y" the usual way and forgetting to use the safety mechanism should be just as much of a concern, shouldn't it?
Obviously. That's really a convention thing in the end, to remember that you had a good reason to do things a certain way and not try to cheat your way around a problem and make your own life harder.

I'm not sure what's "training wheels" about having your code try and help you when you are about to make a mistake. I would say it's more about how good you are at remembering all the names you set for things. If you have a really good memory, you won't make the mistake and you don't need the extra help. Personally, I have a crap memory so I like having the code remind me that I already used a name for something else.

I'm always torn between the development speed of dynamic languages and the strong IDE support of fixed-type languages precisely because I like to quickly try things out to see what works best (which is easy in dynamic languages) but lack the mental memory capacity to remember the names of variables and need the code to help me with that (which is easy in strict languages).
User avatar
Party member
Posts: 2596
Joined: Sun Oct 18, 2015 2:58 pm

Re: Is this a good ECS like approach?

Post by pgimeno »

I still don't get the ECS model, so I can't help. But there's something I'd like to point out.
Tjakka5 wrote:

Code: Select all

      if entity.hasComponents({"Position", "Size"}) then
That's creating a table every time a rectangle is going to be drawn. That generates garbage unnecessarily, and Lua is very bad at garbage collection (as is the LuaJIT version used by LÖVE, though that is changing).
Post Reply

Who is online

Users browsing this forum: Drewena and 34 guests