oosyrag's Forum Posts

  • I've tried to tackle this before. Try this out - construct.net/en/forum/construct-3/how-do-i-8/csv-similiar-array-json-vice-129070

    No guarantees it will work though, as different programs export csv in different ways and I definitely didn't account for all of them. If I remember correctly it should transpose the x/y for you too. Let me know if it works, if not send me a sample exported .csv and I can make it work.

  • In the paid version of C3, you have access to the array editor, which allows you to paste a spreadsheet directly into C3.

  • X usually comes before y which comes before z. x is horizontal and y is vertical. Easier to visualize based on a coordinate system maybe? Also consistent with the other ways xyz is handled in construct. Perhaps it makes more sense to someone who has not had programming experience before.

  • dropbox.com/s/m6x32uzqcjlf8sk/VisualLOS.c3p

    The bullet behavior with bounce off solids treats corners as rounded. Any way around this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is an option in the join room action that lets you lock when full. Disable that.

    Also there is no reason to disconnect from the signalling server. You can leave a room and join another room without disconnecting from the signalling server.

  • construct.net/en/blogs/construct-official-blog-1/remember-not-waste-memory-796

    Best practice:

    a. Use a combination of tiled/repeating backgrounds in addition to unique, smaller sprite instances placed in a variety of ways (color, size, orientation).

    b. Use tilemaps

    In addition, you can use smaller images and scale them to fit larger areas for cases where resolution doesn't make a big difference.

  • Update 2: Applied for visual line of sight dropbox.com/s/m6x32uzqcjlf8sk/VisualLOS.c3p

    Canvas' poly outline looks good but the fill doesn't work half the time. Am I doing it wrong?

    Edit: Fixed, it had to do with the order of adding poly points and the resulting intersection of poly points.

  • Update: Debugger shows 0 collision and poly checks/sec?

  • Project file: dropbox.com/s/iwy8ckiozyp604z/Raycast.c3p

    Method 1: By Angle

    Store angle and position of each corner of each solid object in an array.

    Create a blue line from sprite, angled towards stored angle, width (length) of LOS.Range.

    Cast ray towards each angle by x=origin+LOS.Range*cos(angle), y=origin+LOS.Range*sin(angle)

    Subevent if ray intersected, set line width to LOS.HitDistance, change color to green (truncate the line if it hits a solid).

    Result/Issues:

    A and D - Rounding errors, line can either collide or not at corners. Expected behavior.

    B - Works as expected

    C - No collision/ray intersection detected (until trying to exit out the other edge). Can confirm when moving around the origin sprite, if the max range for that particular line terminates within the solid, the line stays blue. So the first corner does not trigger the ray intersected event at all (sometimes). Possible bug?

    Method 2: By coordinates

    Same as above, except casting the ray at each corner's stored coordinates. Normally I wouldn't do it this way, except by default there is no way to cast a ray by angle/range and I am experimenting anyways.

    Result/Issues:

    Some lines don't show up at all, some lines work, and some lines shoot all the way through the solid.

    For the lines that don't show up, debug shows that the line is spawned, but with width 0 and set to green. So the intersection event fires, but LOS.HitDistance returns 0. No idea what is going on here.

    For the lines that shoot through the solid, simply no collision was detected (I draw the lines at full length first, then resize if a collision occurs). Can be reasonable due to rounding errors. Either the ray doesn't completely reach the nearest corner to collided, or same as problem C above.

    Further testing reveals that when putting the solids out of LOS range (300), the cast ray action still works. The farthest corner will trigger the intersection event and extend the line as expected, but the nearer 3 corners either don't trigger the intersection event, or they trigger it and LOS.HitDistance is 0.

    There were a few issues and I wasn't sure if I was doing anything wrong/behaving as intended, so I figure I'd make a post and ask for input before making a bug report.

    Also feature request: cast ray by angle, to LOS range? Not a huge deal and I'm out of suggestion votes. Workaround is simple enough, but "x=origin+LOS.Range*cos(angle), y=origin+LOS.Range*sin(angle)" might not be immediately obvious to some people. Also I don't know if there might be a performance benefit to not using sin and cos to calculate out the coordinates when casting a significant amount of rays.

    PS: Thanks for developing this, it was a nice surprise! With canvas, all the tools are finally available to do visualizations for line of sight! redblobgames.com/articles/visibility (Edit: Also really fancy lights and shadows!)

  • Two ways

    A: Use the sync action - Create the object on the host, and the object will be created and updated for all peers. Peers do not create or otherwise manipulate these objects. Peers should instead tell the host what they want to do, and the host will do it for them (either via messages or send input state action).

    B: Don't use the sync action - Use messages to tell the host (and have the host relay to all other peers) what has been done. Each peer creates/makes changes the objects on their own locally, based on direct input and received messages.

  • Sync object

    Automatically sync an object. The host sends information about synced objects to peers. This is one-way transmission; peers sync with what is happening on the host.

    If you are using sync with an authoritative host, peers will only send their inputs to the host. Have your peers tell the host what they are doing or want to do by sending a message. The host will move all synced objects based on these messages/inputs, and thus update the object for itself and all the peers.

    Local input prediction, lag compensation, and interpolation will be not applicable to your game, since it is turn based.

    Alternatively, if you don't need an authoritative host, simply have each peer and host relay their actions to each other via messages, and update the game state on each peer/host individually. Make sure messages are set to reliable ordered, and make sure host and peers utilize the same set of events to update the game state to keep everyone synced. Do not use the built in sync object feature in this case.

  • Basically there is no built in functionality to get the current window size. The intention is use best practice scaling modes to support different aspect ratios, since you have no control over the window size of the end user. There shouldn't be any case where resizing your visible viewport to whatever the window size is is superior (this would basically be like using a huge viewport, and no scale mode.

    This article may help, in case you haven't seen it yet. construct.net/en/tutorials/supporting-multiple-screen-17

  • I can't open your capx with plugins.

    Probably just a timing issue, you can adjust the lerp parameters.

  • Will need to see your project to troubleshoot. I'm guessing you have some event running every tick that shouldn't be.

  • Try looking up the GitHub API.

    You might be able to do something with iframes as well.