Everade's Recent Forum Activity

  • You have added the tag "animation" to the variable sync, yet this tag is nowhere to be found from any client input.

    I recommend to remove that tag from the Sync event if you don't use it.

    Multiplayer scenarios can be very complex, so without any .capx file, it's basically impossible for us to tell on how you handle Host and Peers accordingly.

    Otherwise please provide more information on your current state of how you're handling everything.

    Please note that:

    Sending client input from any Peer will ONLY send them to the Host.

    You in most scenarios you send only physical Keyboard/Mouse input to the Host.

    Then let the Host handle what's going to happen.

    And to reflect all actions to all Peers, you then forward this information from Host to all Peers.

    If you don't do that, you're most likely only going to see what's truly happening on the HOST side only.

  • My answer might be a little bit late but let me try to explain it to you.

    It's used to sync certain object variables, since you can't send them directly.

    So we use *Set client input state* event with a certain tag added to it to combine it with a variable sync.

    The Host will always recieve your Client Input.

    However in most cases, you want to Sync this recieved input information back to all the other Peers as well, so now you can use this tag, to sync an object variable according to the input recieved.

    Here's an example according to the Advanced Example from Construct 2/3.

    The Peer sends an INPUT STATE (which includes variable data)

    to the HOST

    So we send X and Y so the host knows our current position.

    At the top, we defined the input value tag lookx and looky (these are the ones we're sending to the host)

    And the 2 Sync variable events, is the information we're syncing back to all the other Peers.

    So we're directly syncing a specific Object variable to all other players!

    The tag is now used, to basically BIND the input value tag, and the Sync Variable event together.

    So the information recieved from the client input value is written into the variable sync, and sent back to all the players.

    Hope it helps

  • You do not have permission to view this post

  • You do not have permission to view this post

  • rayolf

    I don't have that file anymore.

    If you're really interested into this specific topic, then checkout the solution which worked for me as described a few posts back.

    You will need to use a custom "solid" code to be able to dynamicaly make objects "solid" or "non-solid".

    The official solid system from Construct can't handle this at all.

    Which means this solution works for Online - Isometric game using multiple, overlapping floors.

  • I think the Origin of your objects plays a role here.

    And of course the cell size.

    Although something looks really wrong in your example... Maybe Ashley should take a look at it.

    I've adjusted some things and it seems to work now.

    Although it still feels as if the pathfinding system is extremly slow.

    http://92.51.171.10/construct/pathfinding.capx

  • gumshoe2029

    Is there any guide on how to do this?

    Or what exactly do you mean?

    Currently i've built anything within the same construct 2 project.

    Which means the first player connecting will become the host (authoritative) while anyone else becomes a peer.

    I was already playing with the idea to create 2 seperate Construct 2 projects.

    Basically a "dedicated" authoritative Server version (not playable, just handles all the authoritative logic.

    And the actual players running the game connect to this version.

    The problem on that idea is that it would require tons of these server versions to run on dedicated machines.

    And i don't have the resources to accomplish that. Unless i give the players access to this version so they can run it themselfs.

    I guess there are other ways using plugins and other 3rd party tools but i have really no idea what nor how that would work out.

    In the end i would love to have a server-list so players can join wherever they want, and also to connect directly with their friends (maybe with steam integration).

  • gumshoe2029

    What's that supposed to mean ? xD

    And yes it works!

    Here's an example:

    (link removed)

    You can access the 1st floor by walking over the green box and access the 0 floor by walking over the red box.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 99Instances2Go

    Yea i guess i understood how seeds work (at least the basics)

    But let's say Peer has some short connection issues while shooting, or simply something went wrong while sending the player input data to the Host.

    Now the Peer will display 10 shots.

    But the Host only triggered / recieved / noticed 9 shots.

    This means that the entire seed sequence will be off by 1 for the Peer for the rest of the game.

    Which means all the following shots will be displayed wrong.

    I think the chances that this happens is pretty big, considering a fast-paced shooter with multiple players shooting with "realistic" automatic weapons and whatnot. (thousands and thousands of projectiles)

    And this is all running through a Peer to Peer connection with normal PCs and normal Internet connections. (not a perfect world)

    That's why i'm saying:

    To prevent that, maybe it could be possible to re-sync the current state of the seed every 30 seconds~2 minutes or something like that.

    (If that's possible, since i've never worked with it?!)

    newt

    Collisions will be handled host-side only.

    Displaying projectiles can be just aesthetics, but i want them to be as accurate as possible.

    Why? Because as a player i want to see when i hit something.

    Anything else is garbage.

    As i've said before, it does not have to be 100% accurate, so it's fine when there are some discrepancies.

    But missing and still killing, or hitting and never killing is ******** if it happens a lot.

    And i want some visual feedback with the projectile flash-line.

    I do not plan to only have a muzzle flash and then wait until the server responses if i've hit something or not.

    And i do not plan to only have a muzzle flash and then show absolutely wrong information just for the sake of being responsive.

    Random number being percent to hit?! I don't get what you mean.

    OddConfection

    Never done that, i will take a look at it if i can find something.

    Including player position as well would require for some host-side position checks, which i guess could get pretty complicated to achieve.

    Thanks again guys!

  • oosyrag

    1. I'm fine with it if it's an illusion. But it shouldn't bee too far off.

    Since my game isn't going to be competitive (player vs players) it's not so important to be 100% accurate.

    But i still want to have some proper visual feedback so in case of weapons which have a really bad accuracy don't shoot into the complete opposite direction, showing a hit but they actualy did not.

    Especially if there are smaller fast moving enemies and you try to hit them.

    I personally think (as a player) if that happens too much, they blame it on *bad hitbox detection* or network issues or whatever.

    The more accurate it is and the more responsive it feels the better for the game and the joy for the players.

    And i also don't want to play a game where my visual feedback is always way off.

    2. Yea really sounds like a nightmare xD

    I'm not sure if this is the best approach. And to prevent too much issues i can imagine that i'm almost forced to send 1 seed per peer, because if they are all shared the possibility that the sequence gets mixed up (delay of shot being triggered due latency)

    So that means 1 seed per peer, and to prevent missmatches over a longer time-frame i guess i would have to re-sync the seeds every 30 seconds ~ 2 minutes.

    Maybe that way it works out, i will for sure take a closer look at this.

    3. I'm actually using realistic real world projectile speeds ~400m/s which is around 266px per tick if running on 60fps with my setting.

    Which means that's absolutely impossible for my case

    Another reason why the official bullet behaviour would never work for me.

    Visualy the players will only see a flash-line similiar to the one showed in the picture i've posted.

    OddConfection

    I see 1 big problem with that.

    Let's say the Peer shoots, and sends the angle to the Host.

    The host recieves the angle but assumes that the player was standing at a different position (due movement of the player while shooting)

    I don't know if that's going to be accurate enough or if that's going to mean that the shots could be registered at entirely wrong positions.

    From host to peer there's the prediction stuff and all that, but what happens if i send this data the other way around?

    Is there a way to *sync* the angle together with the actual mouse click sync so the host recieves both data at the same time?

    Does anyone have experience with this?

    And to your question:

    The host is a player.

    And i know what that means.

    But Construct isn't really made for anything else... is it?

  • OddConfection

    Calculating such important things on the host is pretty much the basics about online games.

    You don't want the peer (player) to tell the host how he shoots.

    If you do that, you can easily cheat by let's say triggering 10k bullets in 1 second into any direction and the host will be like *ok let me kill everyone*

    That's not how you want to build any multiplayer game unless you don't care about cheating.

    All the peer does is sending key strokes, and that's it, anything else is being handled by the host.

    So if you press the "shoot" trigger 10k times in 1 second, the host will still only trigger 1 shot if handled properly.

    In this particular case i could maybe let the peer handle at least the angle, although i guess that could be abused as well but it wouldn't be too bad.

    But handling the distance for instance as well would mean that players can get full control about how far their flamethrower reaches and so on.

    99Instances2Go

    First time hearing about this.

    So that means it's calculated randomly using the fix seed values and i shall sync the seed values between the peers?

    Sounds like in the end i would still have to sync all data so it wouldn't be responsive unless i use the idea mentioned by blackhornet

    blackhornet

    Very interesting idea, i may give it a try.

    Although i guess it could get a little bit complicated since i will have to sync data to each single player objects on his own.

    That means there will be a lot of data which needs to be synced.

    I may take a closer look at this.

    Thanks everyone for your first feedback!

  • If you read the entire topic then you would notice that i have a similiar system already.

    My projectile system is entirely custom and generates a line which stretches over time for proper collision detection with fast-speed projectiles.

    The projectiles are already generated entirely random, however only on the host part.

    The question is now how to handle it within an ONLINE multiplayer environment, to get the same results on HOST and PEER without syncing the data from the HOST to the PEERS since syncing the projectile data would mean that it won't feel responsive for the PEER.

    If i sync the data, that means that you will send your shooting input to the server, the server calculates the projectiles and then sends the information back to the PEERS.

    This takes quite a while especially with higher latency and means that once a PEER (player) presses the shoot button, it will take some time to actually display the shot. To prevent that my goal is to directly display the shot (only display, not doing anything further since the host will detect actual hits later on), but it shall display the actual correct angle and distance the same as the host will calculate it.

Everade's avatar

Everade

Member since 24 Jun, 2014

Twitter
Everade has 11 followers

Connect with Everade

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • x65
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x144
    Lightning Draw First person to up-vote a new Construct 3 release
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Magnificent Comment One of your comments gets 25 upvotes
  • Email Verified

Progress

25/44
How to earn trophies