Hillstrom's Forum Posts

  • Exacly the kind of topic i was looking for. I asked a similar question. You nailed some very good practice and confirmed my approachs as good ones.

    I also believe this topic, maybe as a tutorial, should be sticked somewhere.

    I found myself coding in similar fashion as Yann :)

    I see many "big names" here. Hopely some absent respected members could throw their two cents.

  • Yes, it helped me but since there's an already division between click and double click i supposed that this built-in event would take into account internally what yann did. Like a buffer or timer of inputs.

    In the end i changed completely my two events so this will not be an issue to me. But i would had liked a better control between clicks and double clicks for actions.

    For now long road seems the only road to use.

    Thanks all anyway

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I whould appreciate some directions here. I have the impression that i overcomplicate a simple mechanic.

    If a click on an object do an action, and a double click on the same object do another action, How do i prevent the first click to override the double click action?

    I need some kind of delay, so if a second click happends quickly it doesn't count as a one click action.

    The double click on object doesn't do this automatically :S

    Maybe I have to make an individual post for this

  • Sorry to resurrect an old topic from someone else. But I think is better than overpopulate the forum with the same questions.

    In regard to actions performed on quicks double taps of a button.

    This works too for double clicks/touchs?

    I need an object to perform two different actions, one when you click on it and another when you double click it.

    The problem is that the double click is overriden by the first click action. So i get the two actions performed at once.

    I believe that double click on an object takes into account a timer similar to your "sensibility" variable internally. So to differentiate from single clicks.

    Your implementation should help in my case with mouse clicks as it helps with keyboard buttons.

    But i'm missing something with the default "on <button< double clicked" from C2 engine? It should not prevent intrusions of events for single clicks? I'm puzzled with this :(

    Thanks and sorry for my smuggling.

  • Yes, sorry for the misspelling, it was low-end graphics card. Here in my country we say "gama/gamma" to how good a device is. High gamma low gamma, etc. Anyway you understood me.

    I'm going to test your method for clicking with "near" formula now. I believe it should be faster too.

    About the fill rate and the size of sprites, i have that very in count that's why i fear so much using sprites or big backgrounds. I don't have many smartphones to make test so i have to rely on other's experiences.

    Thanks for your help Arima, lets see how this all work.

  • Hello Arima,

    My platform to export "should" be ios/android and as a third option PC.

    The background image kills performance on low gamma graphic cards only. As far as i could test. In my pc with very high specs everything runs at 60 fps. But i see a noticeable slowdown on average pcs (like those on my office).

    I still didn't make much experimentation around this problem, that's why i ask out of topic. Maybe there's a known way to win some fps when big background images are used (specially on smartphones).

    Now for the real topic:

    Your approach seems good to avoid using another sprite. I will check it since i'm using exactly your method for other unrelated feature.

    (Somehow i miss your idea for this)

    Since you used this method, would it hit performance more or less than using the second mask sprite to register inputs?

    If you believe it won't impact performance then i will use it for sure.

    Thanks you very much! :)

  • This topic is a little wide but i will try to keep it simple.

    When a project becomes to big, events and objects composition starts to grow dangerously beyond control. To debug and probably for performance reasons when talking about objects.

    In C2 we can group events in groups and this helps a lot to order the project in general and the sheet in particular. But i found myself still with doubts about how to properly manage and order everything, especially how to manage objects internally.

    Back in the days of Game Maker, the staff always recomended the use of a "master controller object" or similar. This abstract object would have all the events general to the whole game or that are very wide in scope. And this is my approach now with C2.

    This helps me to take out certain amount of events from objects like the player character, enemies and whatever object you don't want to see it grow too much in complexity, for debug and performance reasons as i said before.

    But then i have a big "controller object" full of events that i still don't know if it will hit performance or if it's going to give me more headaches than concentrating all events into their corresponding objects.

    I will appreciate any thoughts about how to "best" manage a project or any view on this subject. (Of course with the use of C2)

    Regards people!

  • Hello all!

    I have a problem with fast moving objects. When i click one, usually i miss the object or the object seems to miss the input.

    The common solution (as i saw it implemented) is to give those objects a bigger mask to register inputs.

    My object right now use one sprite for the character and one sprite (mask), pinned to it, with the programming and collision checks.

    If there's a better solution so i can avoid using another mask it will make my day. 3 sprites for one object rings bad tunes to me.

    And, totally out of subject, if someone found a way to use background images without killing performance (cannot strip it as tilsets) also will make my day.

    Thanks in advance for any help!

  • Im becoming old or old and stupid... It was just a matter of deactivating the "enemy_mask" object's Physics Collisions and let's the player's enabled. This crossing of enemies is only intended for big ones and thoose are limited to one, maybe two, at the same time. And that's more manageable than deactivating four fast moving charcaters collisions.

    But, i'm still looking for any real or fake workaround to solve this "instance collision deactivation" issue.

  • But for the time it takes to pass through the enemy it could be more troublesome to destroy a physics enabled object and recreate it once it crossed than just disable collisions and cross fingers. I'm reserving your idea for possible events that require longer periods of collisions or overlaps.

    For how my characters moves (fast), they can cross a big enemy in 1 second or less. They move like bullets from point A to point B in stright line so i only need a second of collision inactivity without compromise other instances of the same type.

    I have still no experience with "objects swapping", your method is fast an reliable enough?

  • Hello all!

    Since C2 uses Box2D for Physics and Box2D cannot disable collisions for single instances of an object type. I'm fff, well... not happy.

    So far my only workaround to this is disable collisions and enable them as quick as the event ends. This makes my other instances loose their collisions but it's a matter of a second. But a second always can be seen...

    Anybony discovered a method to, at least, fake a "not in collision" for a single instance with physics behavior enabled?

    I will describe below my escene to make the picture:

    * 4 instances of "player" with physic behavior (tiny masks)

    * 1 instance of "enemy" with physics behavior (big mask)

    Those are the mask of the actual characters and enemies but never mind.

    The intention:

    Move an instance of "player" across "enemy" mask sprite, through the other side.

    While not affecting the other "players" instances on the same layout.

    The normal behavior is to collide with the enemy at contact. And that fine, i need that too.

    But I also need a way to cross an enemy (rising player z order) if some combination of imput is pressed (whatever input)

    That is impossible with physics behavior active on both objects. They will bounce or all instances of the object type will be disabled while just one cross the enemy mask.

    Big brains needed for this. (Just the crossing)

    Thanks in advance!

  • I updated my events this way:

    Event:

    CharMask => Is Overlapping <CharMask> ==> Sistem => Wait 1 sec

    |__CharMask => Is Overlapping <CharMask> ==> CharMask => Apply Physics Force 40 at angle random(360)

       Is Sleeping

    What i do was to check if the overlapping last more than 1 second. If it do Sleeping objects moves at a random angle.

    So far is good. It do what i want. But maybe there's a better way. I'm interested in whatever optimization i can implement to this.

    I will let this topic rest for a while and see if someone shows with an elegant solution.

    Thanks vee41 for your help!

  • My best shot so far is:

    Objects:

    CharMask = object with physic behavior

    Event:

    CharMask => Is Overlapping <CharMask>

    |_CharMask => Is Sleeping    =>> CharMask => Apply Physics Force 40 at angle random(360)

    It work fine for any instance of CharMask (previously ordered it's Z with a for each)

    I will try to do the same for CharMask with velocity < something low. Just in case "sleeping" becomes unstable.

    If someone found a better way please tell me.

  • The problem with your example vee41 is that i need my sprites to not collide with each other only at low speed. Also they are pinned to another sprite with physics properties (behavior).

    If i use collision checks they will bounce. And i need only stationary or slowly moving intance to be affected by the "no overlap" function/event.

    Imagine a pool table, if i shoot a ball, it should "not" bounce against other balls. But, as this ball lose speed after some time, it should not overlap any other ball if it just stop to close and overlap one.

    I guess i will need to add "speed" and "iddle" as instance variable of this objects. And filter by speed and iddle states.

    But i'm failing in all my previos attemps.

  • Hello all,

    I have a problem that beats the hell out of me.

    This is the escene:

    4 character sprites (same object type) without physics are pinned each to 4 circular sprites with physics behavior.

    I need to move those 4 pinned characters but without them bumping into each other. So, i turned off physics collisions for the circular sprites. Now those character sprites don't collide with each other.

    But, i need them to not overlap to each other when i move them at low speeds or at bounces or unpredictable collisions with obstacles.

    Two overlapped characters should separete to a minimum distance if they overlap at 0 speed or a low speed. But if a character moves fast it should still be able to "pass through" any character without any rearrangement.

    It just the slow "after bounce" objects who should not stop one over the other.

    Long explanation aside, How can i separate two overlapped characters (with physics) automatically? I tryed many things but i end with nothing good.

    If someone need clarification or a capx i will post it.

    But maybe it's a simple thing with a simple explanation.

    Regards people!