Instance picking demo and a suggestion

This forum is currently in read-only mode.
From the Asset Store
Demo Game Multiplayer Online with member registration system
  • I have been playing with object picking for some time now. A long time ago I made a suggestion that the picking system needs to be improved; there is not much control over the picking, when instances of same object have to interract with each other. I suggested that in event editor, when choosing an object user could define additionally an "group" which would "represent" the specific instance or instances. (Ah. This is hard to explain ) So, that there would be conditions like:

    Sprite1.A.Value('Strenght') > Sprite1.B.Value('Strength')
    +Sprite1.A Collides with Sprite1.B
    
    

    Sprite1.B Destroy

    Add 1 to Sprite1.A.Value('Strength')

    [/code:2ywbf38n]

    Where A and B would represent different instances, and Construct would determine automatically based on conditions, which "group" would represent which instance. This would allow much more complicated interaction between different instances of the same object, and would provide much more power to the game developer. Imagine a situation, where there is action or expression which takes two object parameters, for example, an angle between objects. Currently Construct doesn't know what to do when asking to calculate the angle between "CoolSprite" and "CoolSprite". It cannot propely distinguish the different instances in events.

    HOWEVER, I found a workaround. I was happy with that and shut my mouth... and started making a .cap that would use the interractions between instances. Construct can distinguish between instances using Families. It works quite well, and I think and there is no special need for my suggestion... (It would be still nice to have, though! Imagine that syntax: Sprite.A.Something, pretty clear, huh ?) This .cap has been lying on my HDD for some time, but now I found time to finish and upload it. Go ahead and see, it's a cap about making object chains.

    By the way, I think that there is some bugs in picking code, or then I have just misunderstood how it should work I have pointed them out in comments in events:

    NOTE: Strangely, the Green picks all Cells in the Blue's group, although there is the "is overlapping"-condition which should rule the other Cells out. (I tested the normal and advanced overlapping, none of them worked the right way) The order of the conditions also makes dramatic changes to behaviour, although they should pick the objects same way. Seems that the first condition "defines" the Selected object list of Greens, and strangely later conditions don't affect it. (Try to move the Red.Tail==Blue.Tail -condition first! It picks ALL the Red!) I think THIS IS A BUG, but it doesn't matter in this algorithm. (I still hope it'll be fixed)...

    NOTE: For some reason, normal overlapping seems to ignore selected objects list totally, and picks every overlap, not just THE Red and Blue instances which are introduced in the main event.

    Oh, I blabbered a bit too much again. Sorry about the text flood. Some comments? And are these things I pointed out bugs? And devs, what do you say about my instance picking suggestion?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • David posted an example of family picking a few days ago in Help

    But good job on coming up with it on your own. And your example is pretty sweet, too

    Edit:

    Ooh, I can make it crash... if I mix them all up in a big pile then start clicking and dragging things out, eventually it will pop up with an error that says "A while condition has reached one million iterations blah blah blah" so apparently it's stuck in an infinite loop. Never seen that one before.

  • David posted an example of family picking a few days ago in Help

    But good job on coming up with it on your own. And your example is pretty sweet, too

    Oh thanks, seems that I missed that topic before.

    Edit:

    Ooh, I can make it crash... if I mix them all up in a big pile then start clicking and dragging things out, eventually it will pop up with an error that says "A while condition has reached one million iterations blah blah blah" so apparently it's stuck in an infinite loop. Never seen that one before.

    Yeah, the crash is because somehow the cells form a group where the first cell's Target value isn't zero but the UID of the last cell, kind of a ring. Then it tries to resolve the first cell in the chain, but ends up just looping infinitely...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)