Johncw87's Recent Forum Activity

  • Here is a comer case

    The normal vector and reflect vector might have trouble while the hit point is at (or nearby) the cross point of collision polygon's two edges. In the above image, the normal/reflect vector is correct for one edge, but the finally result is wrong.

    Any hint to correct this case?

    Something I've noticed in other game engines (like Source) is that the trace hit point is never actually on the plane (or line) it hit, but some small distance before it. My plugin is currently giving you the hit point right on the line. Perhaps they add a little space on purpose to avoid exactly this situation?

  • I've updated the plugin. Line traces now work with tilemaps, but there is currently an issue where flipped tiles will cause the normal to be on the wrong side.

    The example has also been updated with a second layout, which contains a tilemap.

  • Without seeing the assets, it would be hard to say what would be best. So let's look at some assets from a tile-based game.

    Do you see those boxes in the picture? They are composed of multiple parts (tiles).

    A 9-patch will allow you to create boxes like the ones from the screenshot using a single image.

    If you put the above image into a 9-patch, set all of the margins to 16, and set the edges to tile, you will have a single object that you can resize at will, and all of the 'parts' will automatically be rendered in the correct places.

    If your assets are not tile-based, then you will need a different approach. In the interests of keeping memory usage down, you may want to add each graphic as a separate sprite, and use containers and/or event logic to keep the parts together. You may also want an invisible object to handle the game logic of the platform (such as collision and movement), and just have the art assets move along with it.

    But, as stated at the beginning of this post, it's hard to say what you need without seeing the assets (or at least a better description on how they fit together). Everything in this post is speculation as to what you might need.

  • I think 9-patches are what you are looking for.

  • Great plugin!

    It is better then my light behavior, since my behavior could not get normal vector well.

    I'm glad you like it.

    Feature request:

    Since there has input vector and normal vector, how about adding another expression to get reflection vector?

    Added. Example has been updated too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure what your particular implementation of "delegates" means or does. However the main point of fast triggers is to avoid iterating every trigger of that type. Normally firing a trigger runs every associated trigger in the event sheet, but fast triggers pre-filter by the first parameter. So running a function does not have to check every "on function" event in the project only to pass on most of them because they have a different function name - it only iterates the "on function" events it knows have the right name to begin with. This prevents there being a performance overhead to the "call function" action proportional to the number of "on function" events in the project (which would make functions slower the more you used them).

    I recall reading some forum post or article from years ago that claimed that the official function plugin suffered from this exact performance issue you talked about. I'm glad to see that you came up with a solution for it, though I think you should have it documented somewhere, to clear up misinformation about it.

  • Traces (or raycasts, if you prefer) are line intersection tests which can be performed by every major game engine, and are very useful for getting information about an object's environment. However, detailed line traces are something that Construct 2 has been lacking. I've seen a few attempts at line traces done in events, however, they weren't very pleasant to use.

    So, to rectify this, I started on a trace plugin, based in part on the line-of-sight behavior. Just like the line-of-sight behavior, you can filter the trace to either solids or a custom list of object types, and you can tell it whether to use collision cells or not. It currently only does line traces, with hull traces planned later.

    The plugin has a couple of actions to manage the custom object type list, and 1 action for performing a line trace. The result data from the line trace is stored in the plugin object, and can be accessed via expressions. This currently includes hit position, the normal angle of the line it hit, and the UID of the object that line belongs to. The trace result persists until the next line trace is performed.

    Last updated: 2016-11-25 9:27 PM PST

    Download

    Preview (Drag the endpoints around, and observe the results.)

    .capx

    DISCLAIMER:

    The plugin provided here is just the first thing I made that worked well enough for my purposes. No real attempts at optimization have been made, other than copying some design patterns I saw in the construct 2 runtime. Using it in a large project is not recommended at this time.

    Now, I have a question for ASHLEY. Why is this not default functionality? Traces are too useful for a game engine to not have.

  • I'm getting this too with Release 185. I assume it has something to do with me installing Java 8 recently.

    EDIT:

    Uninstalled Java 8 and now it works fine.

  • I don't need a workaround. Picking by UID works just fine as a workaround. However, this bug is a very unintuitive behavior of object picking that trips up even the more experienced construct 2 users, as seen here. It's like one of those silly exceptions in English. "I before E, except after C..." followed by a bunch of exceptions few people care to remember.

  • Thank you so much ggibson1 !! That fixes it. For some reason picking does not work as I thought it should under the context, and although I'm not sure "why" picking is being weird, selecting by UID does fix it and makes everything work as normal! Thank you!

    This behavior feels like a bug, so I made a report.

  • Problem Description

    After creating an object, it will not be available for object picking in triggered events until the next tick (pick by UID still works)

    Attach a Capx

    https://dl.dropboxusercontent.com/u/207 ... cking.capx

    Description of Capx

    Clicking anywhere spawns a sprite on the left side of the screen. It travels to the right.

    It sets the width to 4. It should also set the height to 4, and turn it from red to blue.

    Steps to Reproduce Bug

    • Run project.
    • Click anywhere.
    • Observe size and color of the box.
    • Click again while the box is still on the screen.
    • Observe size and color of both boxes.

    Observed Result

    The created box is still red and 16 pixels high.

    Expected Result

    The created box should be blue and 4x4.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 7 Home SP1 (x64)

    Construct 2 Version ID

    Release 180 (64 bit)

    Release 183 (64 bit)

    Additional Notes

    There may be more cases where this problem manifests, ones that don't involve triggered events at all.

  • The picking system may be a little complicated, but if you only have one instance of an object type, you don't have to worry about it at all.

    EDIT:

    Actually, I was just reminded of a certain behavior that might be tripping you up. If you create an object, and then in a different event on the same tick, try to use an action on it, it won't work unless you had picked it by UID. All other forms of picking don't work properly for objects that were created in the same tick.

Johncw87's avatar

Johncw87

Member since 21 Feb, 2014

Twitter
Johncw87 has 13 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Viral Game One of your games has over 100,000 players
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

18/44
How to earn trophies