99Instances2Go's Forum Posts

  • LOL that BSOD !

  • Yesh, that is how it works. Now you know almost everything there is to know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using a globals as requested.

    https://www.dropbox.com/s/07fus6w961l81 ... .capx?dl=0

    But, as you see, you need an event for each global. The event sheet will get way to long. And at one point you get lost in all those events. Why not use a dictionary ?

    https://www.dropbox.com/s/zfbkqdzuvoj5q ... .capx?dl=0

  • You do not have permission to view this post

  • To save yourself from endless looping, just use a lookup table.

    In c2, the most easy lookup table is a dictionary.

    But, lets do it with the second best candidate: a 1D array.

    Using a 1D array, we can use .....

    The condition > Array > Contains value (value)

    The expression > Array.IndexOf( value )

    ..... to get an the index of a found value in return

    Both scan the whole array, and that is not what we need, so i made a 1D lookup table (event 22) with only the values that they are allowed to scan (the 2nd value in ArrayForSequencing)

    From there it is easy, as you see :

    https://www.dropbox.com/s/qpclzk430wxf3 ... .capx?dl=0

  • The first pick makes 'the picklist' where the subs start picking from.

    Loop

    Pick Hotkey with ID = loopindex <-------- the picklist contains now that one Hotkey

    Hotkey Assigned is not -1 <----- picks from previous picked list (containing the hotkey with ID=loopindex), if it exists the new picklist contains a hotkey with ID = loopindex and Assigned =not -1, if it dont exist the new picklist is empty an no matter the action that follow ... they have have no Hotkey to work with

    Lets assume Assigned = not -1, now the picklist contains 1 hotkey with ID = loopindex and Assigned =not -1

    now you set current to the loopindex

    Pick Hotkey with ID = current <------ since current = loopindex, that hotkey is in the previous picked list, it is an unneeded pick, but yeah it works

    Pick Hotkey with ID = current - 1 <-------- the previous picked list is not ever containing that hotkey, it contains only the hotkey with ID = current, since it dont exist in the previous picklist, the new picklist will always be empty and the condition untrue

    So, concluding, the pick hotkey with ID = current is totally not needed, it is picked already.

    To make the pick Hotkey with ID = current - 1 work you first need to make a new picklist that contains that Hotkey.

    Or use a 'pick all' before that condition, or use a function (a function always starts picking from scratch)

  • Not a bug in the comparison.

    val = 0.40000000000000013, or bigger then 0.4, so the comparison is just true.

    It is a accuracy trade off that goes with software and computers.

    https://www.google.be/search?q=floating ... arithmetic

    It is for you to make 'software' that is using algorithms that goes along with this.

  • but I was not able to wrap my head around them...

    Lets compare 2 plugins. The official one and EasyStar.js pathfinding for tilemap, and wrap your mind around it.

    The 3th party is here: behavior-easystar-js-pathfinding-for-tilemap_t129056

    The official pathfinder is designed to find the shortest path and to move from node to node in a way that it is effective the shortest path. Therefor it needs to also control the movement. That the pathfinder also controls the movement is at the same time a blessing and a burden. The official pathfinder also takes in account the acceleration, the deceleration and the rotation speed. And that makes it a fairly complex thing, behind the scenes.

    All 3th party plugins that i know of dont also move the object. They just find paths and provide the nodes. Up to you to move it from node to node in a way that you find is best.

    Since you want to move in a 'grid' i choose for 'EasyStar.js pathfinding for tilemap'. That is the right one for this job. From now on i call it 'EasyStar' and the official one 'Official'.

    The Official is (as behavior) attached to the object that needs a path.

    The EasyStar is (as behavior) attached to a tilemap.

    This has consequences.

    The Official finds a path from layout coordinates to other layout coordinates.

    The EasyStar finds a path from one tile index to another tile index.

    So, lets compare them.

    In this capx, i use both to find a path, to show the nodes, and to move from node to node.

    To move the EasyStar (it does not move things, just finds paths) i used MoveTo from rexrainbow.

    behavior-moveto_t63156

    So here is the first capx.

    https://www.dropbox.com/s/2p4y99ondeq3f ... .capx?dl=0

    So that is the basic setup for both plugins. Notice how the Official moves its sprite over the shortest path. Moving over the grid is NOT the shortest path at all. That is very clear when you compare it to the the EasyStar. Hope this basic setup helps you to use the the EasyStar. But. That is not my target with this. I gonna try to steer you to use the Official.

    Now, if you look at the nodes from the Official (the green nodes), they lay perfect on the grid. So we have to force it to take a longer path, not the shortest. A path that moves on the grid.

    To do that, i use it to find a path, but i use MoveTo to move the sprite over the path.

    Done that in a capx.

    https://www.dropbox.com/s/vho1dil31phms ... .capx?dl=0

    As you see, now it moves perfect over the grid. I do the moving myself because i am not interested in the shortest path movement provided by the Official.

    For the purist. Yes, i can do that without a 3th party plugin. (correcting for dt is up to you then)

    https://www.dropbox.com/s/txt3to7z2svde ... .capx?dl=0

    Now you have 2 methods. And both work flawless.

    Just choose based on what path you want. Because the EasyStar and the Official do provide a slightly different path.

    Hope this helped you some.

    PS. I am aware that Dropbox killed a lot of download links. I have no idea how this is gonna be solved. And i dont know if i am allowed to distribute 3th party plugins.

  • WASD keys are not done for AZERTY keyboards. I (but i am stubborn) will not ever play a 'WASD only' game.

    And i dont think there is a web standard for kids with disabilities.

    Wich is rather nice, because up to you to invent it. The possibilitys are wide and wild.

    I would go for keys that can be chosen, starting from a configuration that you think is fine.

    Also, i dont know if that is enough for kids with disabilities. Those keys are really tinny, certainly on the latest cheap laptops, and we all know that kids with disabilities have a big chance to fall in the market target for those tinny laptops.

    I would use space to select/deselect. Its a big key. But i would also experiment with a rather totally different approach.

    Like.

    Touching any key on the right of the key board > move right.

    Touching any key on the left of the key board > move left.

    Same for up and down

    Maybe you should even reconsider if up and down are really needed. You could do the up/and down in a automated way. Move it right and it moves automatically (and smooth) up/down to the nearest target. Now you have a big space bar, and the whole left and right of the keyboard to do the stuff. Dont matter if they press several keys at once, because 1 key is for some really really difficult.

    Anyway, taught i give you my 2 cents.

  • Explain what 'the moving' is supposed to do ?

  • So D walk - DD run

    That is impossible. Unless it keeps walking when D is PRESSED once. In that case you need another key to stop it. If that is what you want, then it is easy. A second PRESS will run. Release the key and it keeps running/walking. Until another keys is pressed, eventually a 3th D PRESS.

    Why ?

    Well, when you want it to walk when HOLDING D, it will immediately run because you are HOLDING D. And there is no way around that.

  • The pause.

    https://www.dropbox.com/s/kkq9rsnx1o5af ... .capx?dl=0

    Adjust the timing to your liking.

    Adjust the lerp so the player is able to move more into view.

    Place the events that move monsters in the right group. Each group holds events for that room.

    Monsters in other rooms where the player is not, will go on non active / wait for the player to see them, i know that.

    Use a Boolean on the room to keep a group unlocked, once unlocked, if that is what you want.

    Regarding the above comments, that is done in a cheaper way. (well ages ago already)

  • tarek2

    No, you can not use a tilemap as a replacement for randomly spawning those sprites.

    I asked because a tilemap is also a pretty optimised object.

    I asked this other questions because C2 has the collisions well optimised.

    https://www.scirra.com/blog/ashley/6/co ... on-in-r155

    You lose that optimisation if the collision/overlap check is not the first condition in a root event.

    Still assuming that we speak about static objects. If you drop the collision cell optimisation, you better bring something in place that is almost as fast. And the only thing (that i am aware off) that is fast enough to beat that optimisation is the Line Of Sight.

    But lets compare. Only testing reveals something in C2.

    This is a bunch of STATIC objects and one moving sprite. Look in the debugger, and see the collision checks running out of control. Yet, the performance drop is minimal. Well, on my laptop. It is kinda fast, dont know on your device.

    https://www.dropbox.com/s/9y6q7s6c4wy73 ... .capx?dl=0

    Now, lets bring those collision checks under control. Using LOS.

    https://www.dropbox.com/s/zzz5ifttiom7b ... .capx?dl=0

    Neglectable collision checks now. You see ? Yet the performance is almost the same. What we won by getting those collision checks under control, we lose by bringing them under control. CPU wise.

    Conclusion: Static objects do not kill performance. That is because they have no 'personal ambitions'. If you have a performance drop, it is not because the amount of objects/instances. It depends on how many objects you apply how many 'personal actions' on in 1 tick.

    Well, that is my experience so far. I am still no expert though.

  • Is the collision check in a root event (not a sub), and is it the 1st condition in that event ?

    Do you use a tilemap for static things ?

  • There is no other choice then 'doing it like that'.

    It is not the amount of instances (of objects for that matter) that weight on performance in the first place, it is the amount of instances that you give a personal (each instance different) 'touch'. Like moving them in different directions based on conditions, test for collisions (also a personal thing) and overlaps, giving them all a personal pathfinder ..... etc.