Predictable "Random" Generator

0 favourites
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • 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?!)


    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 bullshit 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.


    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!

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

    A player either has a shot or does not have a shot, line of site would handle that. The number generated tells you if the shot hit, based on accuracy aka chance to hit, and possibly the damage given.

  • Why don't you use an authoritative server? You could use websockets to transfer the relevant info back and forth?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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).

  • Like use a server side program (Python, PHP, Java, etc.) to run the logic for your game. Then communicate with that program via WebSockets. Then your clients would make a request like: "shoot at position x,y" and the server would take that request, apply the randomization at the time of request receipt, and determine if there is another object at r(x),r(y) at the time that the request is received and turn around and push the same results to all clients.

    You should be able to do the same thing with an authoritative client, but it seems easier to work in another more robust language than JavaScript.

    I can give you a guide on how to setup your own servers and point you to programming resources. I have been hesitant to post a guide on how to setup and run authoritative servers because I don't want to step on Scirra's store. Feel free to PM me though, and I will send you information.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)