1StepCloser's Forum Posts

  • You do not have permission to view this post

  • Good point, I opted to just use the storage of the data object itself, but tokenat is another route I could take, thanks.

  • Do the instance variables of an array get stored in the AsJSON method?

    Problem: When I load an array from JSON the instance variables don't seem to load.

    Considering that the JSON only shows object type, array size, and the cell values, I'm not too surprised.

    Suggestion: Considering we have scenarios such as tile-maps where you can save the object as JSON(.AsJSON) or the tile state as JSON (.TilesJSON) is there a reason this can't be done for arrays? As of now it seems to act as a TilesJSON method of saving rather than the full object state.

    This suggestion assumes that my problem is a global occurrence and not a result of an error in my events.

  • You do not have permission to view this post

  • Understood, can you be even more specific, text/graph based game, ok now what do you want in your text/graph based game? What is the general game design/flow?

  • What exactly are you struggling with?

    Please be specific, the more specific, the more likely someone will be able to give more than general recommendations of how to better understand C3.

  • That makes sense. Probably the case.

  • Hello for those more well versed in TileJSON, I'd like to know how to read this: (particularly when the x is involved).

    {"c2tilemap":true,"width":25,"height":12,"data":"146,158,156,98,110,104,150,4x158,3x154,152,98,6x106,104,54,60,52,147,159,156,101,150,4x159,157,96,54,60,100,150,154,152,54,4x62,63,61,55,60,147,157,97,151,2x159,155,159,157,54,63,61,97,145,98,104,55,5x63,57,55,63,60,147,154,2x159,153,96,151,153,55,2x63,56,96,150,156,51,4x63,61,100,55,59,63,60,96,147,157,96,150,157,96,51,63,57,150,158,2x159,156,51,3x63,61,97,49,100,51,59,60,96,147,158,159,155,156,96,49,150,159,2x155,159,157,100,55,3x63,60,102,111,110,108,51,58,60,147,153,96,151,2x158,159,153,102,108,151,157,97,55,63,2x59,61,103,2x111,107,106,108,51,2x62,60,151,2x159,157,102,111,109,151,159,156,55,61,102,108,53,103,111,105,150,156,99,104,51,59,61,147,2x159,157,103,111,109,151,159,153,55,61,99,105,53,99,109,150,2x159,3x158,156,51,60,147,159,157,99,111,105,151,157,100,55,63,2x62,61,48,97,151,5x159,157,96,49,96,147,155,156,97,150,159,153,101,51,3x59,57,96,146,159,2x158,159,2x158,159,153,96,50,56,96,150,154,159,156,48,102,104,146,154,155,152"}

    Tagged:

  • Thanks for the input oosyrag.

  • Well said.

  • Thank you for the explanations Eleanor. đź‘Ť

    I don't know what this means. What kind of data needs to be sorted?

    As for the array sorting: I was referring to if you need to pick the highest or lowest value in the data series, or loop from the highest to the lowest/lowest to highest.

  • Ahh, I see, so you are using the alpha of a pixel at a coordinate as the Z value. Interesting.

    You mentioned animating, would this be based on multiple set JSON actions or altering the JSON of the sprite directly?

  • RTX 3080

    Changed out the text object for a sprite font, since it's being updated every tick.

    Probably more helpful to locate the point at which it drops in stability while moving but I got drawn in to the design it was forming, I might need to add a save and load / delete objects to properly test this.

    Technical question:

    The sprite is manipulated by setting it to JSON, with the z manipulation essentially forming a height map? How did you go about creating the JSON, was it automated based on the sprite?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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)

  • Hello all,

    I tend to find new ways to approach problems after discussing with others. I'm interested to know if anyone has unique approaches for performance, especially as the project grows; anything from tiny/specific situations to general coding principles.

    This serves as a good general guide: construct.net/en/make-games/manuals/construct-3/tips-and-guides/performance-tips, but perhaps you've encountered scenarios where you had to approach a performance issue in a less obvious way.

    Thanks for any response,

    1Step