Rhindon's Recent Forum Activity

  • - Thank you for your reply.

    I think I'm still a bit confused...

    By including another event sheet into the primary one (the one doing the including), does that mean that C3 runs through both event sheets as if all the events were part of a larger single sheet? I know I asked that originally but I want to be sure which of my questions were being answered.

  • I'm trying (hopefully) to optimize my event sheets to the following

    - Set up / game start (establishing details when a new play through begins)

    - Main (most everything happens here)

    - Extras (Functions, less-used events/triggers, etc)

    The main game happens all on one layout so one primary event sheet seems logical.

    But I plan on having a lot going on so managing event lines seems all the more critical.

    What I am wanting to understand better is how referencing (including) other event sheets actually works.

    I picture it something like taping another event sheet to the primary one that's doing the "including". In that sense, if correct, does that mean that the system is still running through event lines like both sheets were actually just one larger one?

    OR... Is there some special programming in the C3 architecture that knows how to reference the "included" event sheet only when needed but ignores it the rest of the time?

    For simple organization of event lines, there's still benefits either way and other pluses (like not having to copy event lines across multiple sheets... Sorta like Functions). But is the use of "included event sheets" at all beneficial to how fast C3 can run through events before starting a new tick?

    Thank you for your help and insight.

  • FYI "pick by unique ID" should be a lot faster. "Pick by evaluate" checks every single instance; "pick by unique ID" directly picks the right instance.

    In general it's best to use the most-specific condition that does what you want, since it may be specialised for the purpose.

    Understood. :) I don't think I have many conditions that would necessitate Pick By UID, but I will try to find ways to make it the way I do things. Thank you, Ashley and Dop. I'm always grateful for you both.

  • I don't know WHY this made a difference, but instead of doing this within the Function...

    - Virus object spawn Square object

    - Set Square object in a position relative to the Virus object according to data in the contained Array

    ...instead I did this...

    - System create Square object at a position relative to the Virus object according to the data in the contain Array

    I tested that for ONLY the first 36 squares (1 out of the four quadrants surrounding the Virus) and it worked.

    This makes little sense, but it works.

  • Yeah...it's strange because nothing has really changed other than that I'm using Functions and one less For Loop. And that calling a spawn object action + setting their positions all in the same even line. (Previously, I used conditions to test where inside the now-non-existent extra For Loop it was and then told it to position the newly spawned squares at that time.)

    I haven't changed the values in the Array - the only thing I do is reference them. They'll always remain the same.

    So, if I'm placing the very first Square, it'll call on Array.At(0,0,0) and Array.At(0,0,1) Both values are 15, respectively. So I would tell it to place the Square 15 pixels to the right and above the Virus object.

    .At(1,0,0) and .At(1,0,1) would be X=45 and Y=15...... Place Square to Virus.X + 45 and Virus.Y - 15.

    And so on. Whatever the value in the specific Array cell, that gets added to the Virus coordinate values to determine where to place the Squares.

    Since the Array is 6x6x2, the two For Loops each being 0-5 should cover the X/Y index values of the Array. The Array is contained with the Virus object, too, so picking the Virus object ought to pick the Array. ... I'll try to implement your suggestions further, but I'm not sure how I'm going to do that - rather, I'm not sure what I'm looking for by doing that.

    It's not under System object. It's Virus -> Pick by unique ID

    Ooooh, okay. Gotcha. I need to remember that. LOL

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • (Also, I don't see a "Pick by UID". I see "Pick Nth Instance", "Pick by Evaluate", "Pick by Random", et al. But no "Pick by UID". Anyway, apparently that's not the issue at hand after all.)

  • Okay, so, Pick By Evaluate I think is what you meant anyway... I thought you were suggesting a different System Event line. Anyway...

    I tested to ensure that the Virus.UID is getting passed to the Function by having some temporary text be set to the Function Instance Variable which holds the UID info. I know now that the UID is getting passed correctly so I know the Virus instance is getting picked correctly everytime the Function is called.

    The problem, then, is that the Black squares are not being positioned around the Virus object correctly.

    Using the For Loop to declare which cell of the Array I want to pull a value from, and then adding or subtracting that value from the X/Y value of the Virus, I tell it where to position the Black Squares. (It amounts to 144 squares in tight box/grid formation. The Array, itself is made up 36 X/Y values (36 on Z=0 for the X position of the Squares and 36 on Z=1 for the Y position of the Squares).

    As stated earlier, this worked in my pre-Function instructions. But now I can't get the Squares to position correctly. They ALL appear, but only in the original X/Y position of the Virus, itself, upon the Function call.

  • dop2000 - I figured out how to do that after re-reading the documentation and used Pick By Evaluate...

    ...but that didn't work.

    I'll amend it to try it as you suggested and let you know if that works as I'm hoping it to.

  • Hello, everyone.

    For the life of me, Functions - especially the newer implementation of Functions in C3 - has proven to be a challenge for me. I get the concept, but actually using them, and doing so effectively, still is something I struggle to wrap my head around.

    What I'm trying to do here is...

    When the Virus object with a "Green" designation is set, it generates a "field" of small black squares surrounding the Virus. Using an Array ("Green_SqrsData"), I pre-set values for where to position each black square. I know this works because a previous iteration in the code was working perfectly. Now I'm trying to stuff event lines away into a single Function to shave time off of tick cycles because this game is planning to have a LOT of objects working all at the same time. So faster tick cycles means faster gameplay.

    This brings me to my problem...

    PROBLEM: When a specific Green Virus is ready to generate a distortion field of squares, it calls on the Function. But IN THE FUNCTION, itself, it needs to know WHICH Virus object called on it. I need a way to PASS the Virus.UID to the Function so that the Function knows what Virus to spawn squares around. Now, the interesting thing is that when I run it like it is here, the squares (all 144) do spawn...oddly. They simply do not get positioned correctly per the data in the Array.

    WHAT AM I missing or how do I pass the Virus.UID to the Function?

  • Thank you for taking the time and bearing with me, Ashley. I'm very grateful. That should help me keep things manageable.

  • A while back, like, when Ashley first introduced the new Pathfinding behavior (I get chills remembering how awesome this introduction was at the time), I seem to recall the explanation that using too many Pathfinding objects all at once (even worse if the cells used for finding paths along were of different sizes) could eat up a lot of CPU.

    So, what I'm wanting to seek clarification on is how exactly C3 processes each object (rather, each instance of an object). I'm going to try to explain what I THINK I currently understand and then if someone could help me correct my (mis)understanding and/or add some info that could help me better grasp what's going on "under the hood" of this game's engine.

    As I understand it, each object with Pathfinding generates a grid by which the objects move, via nodes at specific cells. How this is done, I couldn't begin to guess...lots of math. Yes, certainly lots of math.

    I'm going to assume that instances of that object use the same exact grid as a means saving overhead on the CPU. There's no sense in generating a new grid to calculate movement on, I would think. (Unless, for some reason, it's necessary that each instance of each object with Pathfinding needs its own grid?)

    Either way, I think it's safe to say that the more objects with multiple active instances of Pathfinding is going to eat up a lot of CPU simply because of all the demands for calculating the path...especially when the cells are tiny (because that's a lot more precise of movement going on there around objects...it's more cells to account for). And the larger the layout, the larger the grid, the more cells...maaaaaaaaath.

    NOW, I know I'm probably going to need to be corrected on my assumptions above, but this leads me to my questions further on how to try to save on CPU demands when using any amount of Pathfinding.

    1. Does simply having Pathfinding assigned as a behavior to an object (enabled, but not actively being used) cause any considerable demand on CPU? Regardless of the number of instances of an object in the layout?

    2. Would destroying an instance of an object make a difference as soon as it's not needed?

    3. Is a grid generated per object using Pathfinding? Per instance of an object? Or does this grid exist so long as Pathfinding is at all assigned to an object even if it's not used in the project layout?

    I will try to set up my own tests to see what I can figure out, too, but those of you with a greater understanding of how C3 works in the engine, itself, your insight and understanding would be of great value to me. Thanks for your time.

  • That makes sense. Thank you, sir. I'll try to keep that all in mind. Hopefully I'll figure out something creative to manage the higher number of instances.

Rhindon's avatar

Rhindon

Early Adopter

Member since 8 Jan, 2013

Twitter
Rhindon has 2 followers

Connect with Rhindon

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies