Itenimum1's Forum Posts

  • Oh, right basically I'm just cutting down on resource usage from the built in for each loops and appending each item to a manual loop iterator (using globals combined with a param in each function (note: only one function))

    but simply put it goes like

    call function loops:

    1-20

    add 1 to a value sort 1_20 (a list of sorts)

    20-40

    add 1 to a value sort 20_40 (you will always want to reset the counter once over 40 to the base 20 and then add 1, never counting 20 of course)

    etc etc each are loops.

    Each loop ends with one group of SpriteObject Variables (well, UIDs) being tested per loop, and with those being chosen, pass their param via one CENTRAL function with CentralFunc(Param0: SpriteObject.UID) its a way ive been creating class built in functions because I cant actual create classes in construct 2 which can inherent scripts within them and choose themselves. Atleast thats what is capable within game maker.

    Now I despise game Maker studio, not only is it buggy but their EULA is restrictive and they themselves say they will enforce it any time of their choosing. (Anyone know of an engine much like game maker with scripts? )

    So, Ive got issues, right now if you do stuff like

    Every "dt * value" seconds--->

    For each object ---->

    pass object to a function(param0: object.UID) and then in the function test to see if it is equal to function.param(0) it works,

    my problem stems from, yes I can do it instead like:

    pick object with a param/variable ---->

    test another condition or even overlap of a sensor object ---->

    pass object to a function(param0: object.UID) and then in the function test to see if it is equal to function.param(0) it works,

    The bad thing baout this, right now I got about 1000+ instances and the CPU usage is manageable, HOWEVER, if I dont create like 3 or 4 of these individual functions that only scope a certain about of objects each time (I.E. a range of objects with a unique variable, or objects onto a list (not sure how this is done in construct 2 tbh)) then I get TERRRIBLE bottle neck issues where some AI dont even get picked for over 50 seconds or more.

    I was wondering like what are some ways to go about managing these bottlenecks with the manageable way besides calling separate scoping loops ruining each tick in tandem with one another?

    GlobalVar1_1to100: 0

    add to GlobalVar1_1to100: 1

    On Loop 1-100>>

    ID > 0 <= 100>>

    pick if ID == GlobalVar1_1to100>>

    call function func(param0: UID)

    then function with matching UID as normal, make 4or 5 of these with blocks of 101-200, 201-300, etc etcetc

    seems to be the fastest way when dealing with instances over 1000+

  • umm, wellp, someone said to append the items which are pinged (flag/bool/var) to need a search onto a list of items which need to be sorted to use this appended search list to pull the UIDs on the list, which works.

    What i ended up doing in one of my tests is chunkify my lists of objects with limited scope. Which isnt new to programming I forget what this is called. Usually threaded I'm sure. But I just discovered event sheets can have functions which are called from other sheets which can end up being useful. Not sure if functions can get passed UIDs and store them PER(tick) call. Anyone know?

  • The has the bad habit of choosing all of them when trying to combine it with distance and compare functions sadly. Kind of important to use with pathfinding. But you can get around it by using a complex system of like 10 or more booleans however thats horrifically messy. Only way I know of choosing a single instance each manaul loop is to store its ID or you cant get unique pathing to the object or for the object/from the object.

    Otherwise you're left dealing with boolean flag hell which is horrible. Imagine the same scenario:

    Pick by comparison ->

    Sprite.Signature = "Heroes"

    Sprite.BoolHasSearched != true

    Sprite.BoolHasTarget != true

    Sprite.BoolJustSearched != true

    Everything else has to keep these in check, but this is only BASIC path finding, if I had conditionals:

    Sprite.BoolDamaged != true

    Sprite.BoolJustDamaged != true

    Sprite.BoolHasTargetInSight != true

    Each of these booleans has to get its own unique group of events which can exceed 100+. Now I COULD do it that way, in fact I've done it before and it is painful to keep the events clean when you do it this way, especially just reading the code back to yourself in the event sheet.

    In most other programming languages (typed) I just pass the object to a function as a parameter and it'll loop through the objects unique behavior that way. But we dont get class files/scripts, so choosing is done on one event list editor. Not just allowing the object/sprite to inherate a class/script and use it to do logic. Even if you do this manaully and pass it a GlobalUID you're back to square one. basically, the Sprite object in construct 2 cannot store a class inside of it which causes problems when looping through tons of instances because the instances are simply Sprites that hold variables and behaviors but choosing them is either done through:

    1. A global or Local Variable for UID/other unique identifier each loop

    2. A painfully slow built in For Each Loop

    3. A matching variable to either 1 and 2 through another instance, just as bad

    4. Matching to an existing number inside of an array, not that fast.

    This is discussing instances over 400+ mind you.

  • Are there any faster ways for dealing with a large amount of instances with unique pathfinding AI behavior other than using global_UIDs matching each instance or a number of global for each loops manually built using a few different global_UIDxxxx for instances over 400+?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Anyone have a backup of this? I can already do similar things myself but would love to have examples so I can compare list editor techniques.

  • Amazing work, thank you for this. Construct Classic still cant be replaced due to the content it has to offer. Also that nice BSD license for the games exported with it and the fact it is free GNU licensed software makes it a smart choice... I find even now owning Construct 2 license that Construct Classic -- even with built in limitations and bugs and quirks -- is still quality. I recommend it.

  • Ah, anyway I just remember that your way of doing this is actually a global for each loop and one Ive already tested before, I was trying to give a bunch of objects a brain object and test each Unique (If UIDObject == UIDObjectBrain :: Do something) ID exists per brain do the search but I still need the for each loop to find the nearest object target to each one.

    It seems it is inescapable that to loop the objects you'll either do a global for each loop or a regular one. I'll just deal. Thanks again for making me realize this.

  • thanks ill give it a shot hope I understand this right.

    Do you know of LoS objects are more resource intensive than simple for each loops?

  • Multiple instances of same kinds, no for each loops? I'm trying to use built in looping but it seems impossible.

    note: I am using choosing by UID, but to even choose by UID you must loop through instances, hence the problem as it stops -short.

  • I figured it out everyone thank you. I didnt realize that asJSON is a state string with numbers and letters.

  • i was planing to load up a array by putting all the data in the array on one line as json But i read a post Ashley write state its no good to load a like this way it take up memory on make game take long to load

    on start of layout array load on paste in the code simple

    "{""c2array"":true,""size"":[200,111,1],""data"":[[[""NAME""],[""J""],[100]]]}"

    she say it best to load it from a file so search the for on how to use the ajax as a start for me i just forget about arrary

    Ouch, I didnt know we arent supposed to use a ton of arrays for object management, are arrays the only things that can save object data as JSON?

  • I am having a great difficulty figuring out how to load zones of objects (like large streaming engine games that allow travel over great distances). Sans switching game engines, I dont see many examples about doing something like this, especially because of localstorage constraints perhaps...

    How do I find the specific command for saving ONE OBJECT's data as a JSON file? Is it through arrays only? I can figure out how to build an object into an array I guess. Assigning strings and number values to be loaded from on the fly while in certain regions every amount of time I guess. Thats one way. Anyone know of other ways to approach this problem? I'm used to being able to literally disable objects in other engines and disable them or enter them dormant. In construct 2 this is just not possible. They must be destroyed completely and even then I hear theyre still in memory. So youre going to have to re-use objects or something....

  • Yep, still getting a number of errors with NWjs, amongst broken features. Hope they are resolved quickly..

    Just in case anyone else is having this problem, this may work for you. I rolled back to version v0.13.0 alpha 5 and beta 218 ran fine so far. (just reinstall on top of updated install, or delete old folder and uninstall and then reinstall.

  • I've been getting it on NW.js preview option, I cant place the cause. Happened after using the new beta 218 and the new nodewebkit install.

    "Cannot read property 'App'"

    line 165 (col 23) of preview.js, checked and looked fine..... Doesnt happen in non-NW.js...

  • wow thanks alot for the explination but, im kinda confused, what does lerp do?

    anyway, Iddint know the order was important for distance() and thanks for that. basically I want to check objects distances within radiuses, yes. But the other stuff sounds important too. I dont have a very good understanding of this so I'm trying to figure out all the distance functions since its important for me to know where stuff is.