« first day (3331 days earlier)      last day (1674 days later) » 

1:44 AM
0
Q: Good or not question about Android mini game

Niklas RosencrantzIs this question "too broad" or otherwise not a good fit for the site? If I start a new Android mini game project today, is it a good idea to use (and learn) Kotlin if I already know Java and I already have quite a lot of Android boilerplate re-usable game code in Java? I had a new i...

 
 
10 hours later…
11:33 AM
Sanity check, I'm going to start working on my game with an ECS architecture, and I think I'd prefer pretty much everything to be in the entity pool (squads, each unit, each of their weapons, etc).. will that slow down my game as it loops through thousands of entities each frame dozens of times?
 
nwp
That question is so confusing.
 
11:52 AM
Mine?
 
nwp
Yes.
 
Ok, let me try to rephrase. If I throw literally everything into a pool of data objects, every soldier, every town, every weapon, every item, everything.. and simulate an inventory system through an "ownedBy" field, is it a valid way to work with ECS?
 
nwp
It is.
Well, depends on how you do it. If you give your items a specific type of tag and iterate over the tags that's fine. If you iterate over every entity to check if the tag has a specific value then that is not ideal, but probably doesn't matter.
 
Alright, thanks :D
 
12:45 PM
And for single-value components, like
species: "oak"

I don't need to create a whole object right? Like
species: {
value: "oak"
}
 
nwp
What language is that? JavaScript? And are you confusing components with data members?
 
Yeah, JS. And I'm not so much confusing them as wondering if they can be interchangeable
I mean some components might have only one data member, like

myTree.species.value
whereas myTree.position.x and myTree.position.y... ok I think I see the point, I should always pass objects to component processors right
 
nwp
I don't know if an ECS makes sense in JavaScript.
 
Hm, why not?
What does it have to do with the language?
 
nwp
The whole idea is to have all the objects in an array for fast processing and that's just not what JavaScript does. I think. I'm the wrong person to ask.
Not all languages can express real arrays or are made for performance.
I would assume there are different ways to make JS faster and my knowledge from C++ is probably useless for that.
 
12:57 PM
I feel like I'd go for ECS mostly for the sake of designing complex systems though, not so much for performance
Things feel less... tangled
 
nwp
Regular OOP should be much easier. Unfortunately it distributes objects all over the memory which is what an ECS is there to fix. But with JS you probably don't have enough control over memory layout anyways.
Like, in JS there should be no reason not to just have player.inventory[index] to get an item.
It's easy and you probably can't make it any faster.
But yeah, wait for someone who has written more than 20 lines of JS in their life.
 
 
4 hours later…
5:17 PM
I don't like JS.
 

« first day (3331 days earlier)      last day (1674 days later) »