Thank you Eleanor. That was a lot of intriguing info you provided.
Notes/Questions
1. Use self-referencing as much as possible.
2. Arrays are slow (I generally agree here, would this be irrelevant for direct lookups (Array.At(0,0))?
3. Should the storage of data in arrays be preserved solely for when there is a need to sort data? If so, what is your preferred method of storing data when performance is concerned? (You ended up answering this in your collision method explanation: Dictionaries, referring to the unused space of an array as another pitfall)
4. Static variables, I’ve been down this road in another project, but stopped due to some posts I read, such as: construct.net/en/forum/construct-2/general-discussion-17/difference-constant-static-108524, Toby refers directly to constants in this case, but they would theoretically have even less overhead than static as they would not be accessible during run-time. If constants hold no performance benefit, I am curious how static variables would.
5. You prefer to use ternary operators rather than the if else condition blocks due to overhead, this is interesting. I need to test this out.
6. If a calculation needs to be completed more than once in an event chain, set it in a variable so the calculation is performed only once.
7. Can you explain your collision method a bit more? Are you stating that you check if a coordinate of a player, stored as a dictionary key, is already in the dictionary (has key) to determine if a collision check has occurred?
8. Speaking of collision checks, do you have any experience with relying solely on distance checks rather than collision polygons?
9. Use containers when possible, I investigated this earlier, but I did not feel in “control” of picking the objects in events due to the automatic nature of referencing all objects in the container when one is selected. I will look back into this.
10. Pick by UID is a preferred pick method.
11. Using pins created big slowdowns for you, this one was surprising to me. What is your take on the set as a child manner of positioning vs set position vs Pin? (https://www.construct.net/en/forum/construct-2/general-discussion-17/pin-behavior-set-position-72028)
12. You mention using events in favor of behaviors however: construct.net/en/forum/construct-3/general-discussion-7/picking-performance-132709 (scrolling down a bit refers to behaviors running faster than events due to the overhead, nonetheless I think I understand your point, behaviors can sometimes be general purpose, with a portion of its cost not being utilized and thus essentially serving as a form of overhead. So perhaps this is a case-by-case basis.
13. Pick by evaluation is one of your preferred methods of picking, I used this quite often in a previous project, but I came across a post (cannot find it now) that mentioned directly checking an instance variable through the object is faster than checks through the system (compare two values, pick by comparison, evaluate), now this does not consider the benefits of ternary operators, so this might be moot.
General questions for you:
1) What is your take on physics? I tend to disable most collision-based physics and apply physics forces on collision instead, perhaps it is better to work with a more custom system for physics like outcomes?
2) What is your current main bottleneck in performance? (I have watched gameplay of your project, several sprites running around, the main thing that impresses me is the multiple accessories that are also present on the characters, I have made a project with this feature in the past and that tended to be one of the major consumptions of CPU.)
3) Is your target FPS 60? If so, how many characters are you able to have running around until you start to drop from that target.
4) What is true scale pixel size of your characters? (16 x 16 for example)