oosyrag's Forum Posts

  • "You can't try and destroy the cards before the peer disconnects, if you want to do that when they disconnect. As you can't preemptively decide they will disconnect and destroy them ahead of time."

    I meant to try these two things to see if they cause a freeze or not.

    Freezes in construct are generally due to endless loops.

    If you try to minimize the project it will help you to identify the cause of the freeze.

  • Looks like I had the wrong approach.

    Attempt 1:

    Anchor canvas to viewport

    Clear canvas

    System scroll to Player 2

    Paste everything to canvas

    System scroll to Player 1 (or scrollto behavior)

    Didn't work.

    Attempt 2:

    Clear canvas

    Move canvas object to player 2

    Paste objects to canvas

    Move canvas to viewport

    Scrollto Player 1 behavior

    Didn't work

    Attempt 3:

    Clear Canvas

    Scrollto Player 1

    Anchor canvas to viewport

    Offset every object by the difference between player 1 and player 2

    Paste to canvas

    Return objects to original position

    Works!

    I can see issues with the timing for my first try as I don't know how the behaviors order in terms of the event sheet stack. I would have hoped the second method would work... If i manually paste on trigger, I can move the canvas object around with the "stamped" image, so I would assume it works similarly within a tick.

    Also opacity changes don't seem to be recorded either.

    + (no conditions)

    -> DrawingCanvas: Clear canvas rgba(0, 0, 0, 0)

    -> Sprite: Set opacity to 100

    -> Sprite: Set position to (-200, 0)

    -> DrawingCanvas: Paste object Sprite without effects

    -> Sprite: Set opacity to 20

    -> Sprite: Set position to (0, 0)

    The canvas "copy" is saved at 20 opacity.

    Should I put it in a bug report? Or working as intended? Ref: dropbox.com/s/gg5kdjvbe4ovsck/splitscreenc3pminimal.c3p

    Edit: Formatting. Line breaks not working?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • + LocalStorage: On item "easy" exists

    -> LocalStorage: Set item "easy" to best_Easy

  • You won't be able to get expressions from a string such as you have saved in JSON.Get("MyKey"). However, if you have a text already set as "This" & newline & "That", then write the entire string from text.text to your key, it will load properly. You can also save newlines as carriage returns in word processors like word pad, and can be properly get parsed by construct as well (notepad might not work). Basically it depends on how you create or write JSON.Get("MyKey").

  • Here's a quick try with helper sprites using the built in sin behavior to get the poly points for drawing canvas - dropbox.com/s/52gq4zmvnoxq9lb/canvas-perspective.c3p

    AFAIK texture transformations will not be possible though. Best bet is to squish the width down to 0 as mentioned above, or actually have the entire flipping animation with a 3d effect done from another program.

  • Oh! Sorry for the confusion. I was going by the manual entry where it said "If an object is destroyed the same tick that you paste it, it will not be drawn, since drawing happens at the end of the tick."

    I couldn't get it to work the way I imagined in a quick experiment. I'll give it another shot, must have done something wrong.

  • I had an idea to swap multiple canvas objects for each view from an off screen playing area to the viewport every other tick. So you would be seeing what happened one frame in the past.

    Seemed super clunky though, haven't tried it yet.

    The other way that has always worked is to basically render a copy of every object for every player, offset and on their own layer with blending modes to split the screen.

  • Is running typewriter text

    Every X Seconds

    -> Play sound

    Adjust every X seconds as needed.

  • Quick answer would be no.

    Have you tried destroying the cards before the peer disconnects? Have the peer disconnect without destroying the cards? Does either result in a freeze?

    What exactly happens when you say freeze? You mentioned the debugger is still running. Maybe something in your events stop working when there is no peer connected?

    Multiplayer issues are notoriously hard to troubleshoot, and exponentially more so without an example project to work with. Can you replicate the issue with a minimal project?

  • A parabola can describe quite a few final shapes. You mentioned constant speed, so rather than a fixed duration you would have a proportional duration based on distance traveled. Do you care if it swings out to the left or right? How wide do you want your curve? Will the width vary depending the distance traveled as well, or fixed?

    After giving this a shot, the problem is harder than it seems... especially considering the distance traveled is also affected (non linearly) by the shape of the curve, making it difficult to get a fixed speed across all situations as far as lerp and qarp are concerned. Tween also has difficulties when non linear factors come into play. Maybe I can try again with custom movement.

  • Are you using the 'Load image from URL' action for your random sprites? There is a 'On image URL loaded' trigger you can keep track of to determine how many times it fires/how many times total you expect it to fire.

  • Besides organizationally, which is completely up to you and your own workflow, layouts are best used for memory management. If you're going to be using the same set of graphical assets and sprites in all your battles, then there is no performance advantage for using a different layout per battle.

    Actually I'm not completely sure if this applies anymore with the new C3 runtime. The first instance of sprite objects are no longer required to be placed on a layout manually, but I don't know if that has anything to do with the loading of sprites into memory per layout. Someone more familiar with the new runtime please correct me if I'm wrong.

    Global Variables and Global Objects will be useful for any information you need to transfer between layouts. Additionally, the Persist behavior will be useful for when you return to your map layout.

    Families are useful to let you pick many different sprite objects at once. You can use them to simplify your events a lot, but they aren't usually critical.

  • Regarding question 1,

    You're going to have to decide on one or the other. Here is the situation: in any multiplayer game where there is latency, given a moving object, where any person currently is, is not where any other person sees he is.

    So you have to pick. If PlayerA is shooting PlayerB, does PlayerA aim where he sees PlayerB on his own screen (commonly used), or where PlayerB actually is by leading the visible player and shooting at the empty space ahead of what they see depending on their ping. You can't have both at the same time!

    There is a third case that is highly not recommended, where you try to show PlayerA where PlayerB will be X ms in the future based on ping by guessing where PlayerB is going. But if PlayerB actually changed direction, PlayerA wouldn't know until later and PlayerB would teleport on PlayerA's screen. Also you'll still have the problem with PlayerA shooting and expecting to hit where PlayerB wasn't actually was, and then you'll have to decide again to register the hit or not.

    Resources for reading:

    X-Wing: gamasutra.com/view/feature/131781/the_internet_sucks_or_what_i_.php

    Half life: developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization

    Quake: reddit.com/r/QuakeChampions/comments/7iuhlc/tech_talk_rockets_and_lag_compensation_and_some

    Reflex: reddit.com/r/truegaming/comments/2ruqba/advances_in_fps_netcode

    General: gabrielgambetta.com/client-server-game-architecture.html

    This isn't an FPS, but an MMO bullet hell which made some interesting choices regarding lag that are not "standard"

    ROTMG: t-machine.org/index.php/2012/03/28/realm-of-the-mad-god-a-great-game-interesting-monetization

    A Video from GDC a while back

    Halo: gdcvault.com/play/1014345/I-Shot-You-First-Networking

    Last but not least

    construct.net/en/tutorials/multiplayer-tutorial-concepts-579

    Honestly, the Construct manual page is one of the best ones out there. You'll notice all the different developers talk about the same concepts over and over again, and the manual gives a very good summary. Regardless, there is no "simple" way to describe it all, so I recommend just reading over and over again until it makes sense and you can understand it and you won't be a n00b anymore. While the concepts are all the same, each person would present it differently so as you go through the links maybe you'll find one that clicks with you the most.

  • You can also see how max speed was done in this example from a while ago - construct.net/en/forum/construct-3/how-do-i-8/spaceship-movement-130957 (also by r0j0).

    It doesn't use any behaviors, but you can see how it works very clearly,. It would apply very similarly to custom movement's dx and dy.