Savvy001's Forum Posts

  • X3M

    Just played Demo 3

    This i going to be so awesome!

  • I will take a look at it after work tonight.

  • Ah thats should be simple.

    Make a variable, call it "allsounds".

    Then add to each event where you play a sound other than loop.

    On play: set variable to 1.

    Else: set variable to 0.

    Put the play "loop" event all the way at the bottom of the event sheet.

    Let it check: If variable allsounds = 1

    Set volume to low.

    If variable allsounds = 0

    Set volume to high.

    Because the event sheet works from top to bottom you can do it this way.

    All sounds are checked playing and if they dont play.

    Then for each sound the "Else" event is triggered.

    So it will be set to either 1 or 0.

    Reaching the bottom of your event list then it checks if that variable is 0 or 1.

    I hope i explained it simple.

  • You want to know which audio files are playing.. correct?

    So when adding a "play audio" event you can set a tag for that specific audio file.

    Then you can find out if that audio tag is playing using the condition: audio "tag" is playing.

    Imagine using 1 tag for all audio files.

    Than you can access all these audio files using that specific tag.

    Set their volume.

    Make stop playing.

    Setting effects etc.

    Example.

    2 audio files playing use tag "gunshot".

    1 audio file playing uses tag "bomb".

    You can check audio: is "gunshot" playing-->set playback rate to 1.2

    Etc.

    Does this answer your question?

  • Taken from the manual: https://www.scirra.com/manual/109/audio

    Audio tags

    Some actions affect audio parameters such as the volume for sounds which are already playing. However there can often be many sounds playing at once in a game. In order to identify which sounds you want to affect, sounds are played with an associated tag. This is any string that identifies the sound. For example, the player's weapon sound effect could be played with the tag "PlayerWeapon" and an enemy's weapon with the tag "EnemyWeapon". Then, the tag can be used in the Set Volume action to specify which sound to set the volume for. Tags are case insensitive.

    Multiple sounds can also play at once using the same tag. In this case actions like Set Volume affect all the sounds playing with that tag.

    A tag which is an empty string ("") has a special meaning: it refers only to the last sound played with the Play action. This is convenient for playing a sound and immediately setting its volume and other parameters

    AUDIO CONDITION:

    Is tag playing

    True if any audio with a given tag is currently playing.

  • ThePhotons

    Can you explain what those obvious reasons are?

    Because the official multiplayer object from scirra does support UDP.

    (As taken from the manual) https://www.scirra.com/manual/174/multiplayer

    The Multiplayer object supports a number of features to enable low-latency gameplay over the Internet:

    UDP-based transmission for minimal latency avoiding head-of-line blocking, with optional reliable modes

    NAT traversal to connect through common router/network setups

    Compensation for poor quality connections with high latency, packet delay variation (PDV), and packet loss

    Maybe i do not understand correctly, but if the official C2 MP object can do it, then why not the Photon Multiplayer plugin.

    If we can get more speed with this UDP method, we would love to see it implemented.

    Photon is the way to go.

  • mudmask

    I dont know.

    Good question for ThePhotons

  • mudmask

    Lerp will do the trick just make it lerp fast enough but still smooth.

    Animations depends.

    If a player shoots you already have that event raised.

    So on receiving that event you can set the animation.

    For the players movement animations just add that info to the data you are sending when raising the event of player x & y

    Then you can set it that way uppon receiving.

  • mudmask

    With Photon there is no need to use setbit/getbit.

    That logic only applies to the C2 multiplayer object.

    Check the tutorial https://www.scirra.com/tutorials/5023/how-to-build-a-multiplayer-game-with-photon

    The part where they say: Send your Position to every player.

    They do the x/y in 2 events, but with tokenat it can be done in 1 event.

    Here is a screenshot from my wip, you can see how it handles the x/y position of players.

    If you want fluid motion, this is the way to go. (and lerp the position on receiving the event)

    Also (just to be sure) photon does not need as much host to peer management, because in a cloud there is actually no host.

    So syncing objects can be done by picking the photon.masteractornr and setting a variable in the game to host = true.

    But if you do not have to, then you can choose a other route.

    This had my mind occupied for a while.

  • Savvy001 Alright, here's what I have currently: http://i.imgur.com/WWjySN0.png

    The opposing player is now in fact destroyed, except it doesn't need to be hit by the bullet to do so. Right when I press Shift.

    It seems I need to find a way identify that the bullet hits only the enemy, because I'm sure what's happening currently is that it's looking for ANY instance of the player to get hit. An easy work around to this though could be to make two separate Player instances for both teams?

    PS: The fact that the player does not need to be hit by a bullet to be killed is because you inverted the event 8 and 9.

    Looking at your image event 8 and 9 say: Player.actornr DOES NOT = photon.eventdata

    It should be: Player.actornr = photon.eventdata

    Somehow you inverted those events "THE RED X".

  • TabloidA

    Also, make sure to use 2 different bullet types of each bullet.

    1 Dummy (spawning on your pc, not harming anyone, this one is purely for visual reference)

    2 Real Bullet (spawning on the other players pc's, harming them when they are being hit)

    Imagine NOT doing this what would happen.

    You fire a gun.

    Bullets get spawned on both pc's, both harming the other player, and both sending event data to the other one.

    This clutters up the data on the photon server, and it could trigger multiple hits when actually it was only 1.

    The right way would be:

    You fire a gun.

    You see a dummy bullet flying.

    All the other players see the "real" bullet flying.

    The player is being hit with the real bullet.

    His game checks if the bullet.actornr is the same as his Photon.myactornr

    If true, then life is substracted, the bullet is destroyed and a event is sent to all other players with the update players life.

  • Savvy001 Alright, here's what I have currently: http://i.imgur.com/WWjySN0.png

    The opposing player is now in fact destroyed, except it doesn't need to be hit by the bullet to do so. Right when I press Shift.

    It seems I need to find a way identify that the bullet hits only the enemy, because I'm sure what's happening currently is that it's looking for ANY instance of the player to get hit. An easy work around to this though could be to make two separate Player instances for both teams?

    TabloidA

    Just add a variable to the bullet.

    When you fire the bullet, set it to photon.myactornr

    Then on collision with the bullet add the condition:

    Player.actornr "does not equal" photon.myactornr

    Then you when you shoot, the bullet can't hit you.

    In my game the bullets all have actornr variables to figure out who hits who

    And keeping the bullets from hitting the player who fired them.

  • mudmask & TabloidA

    When i first started with the photon plugin.

    I used the multiplayer example from the first post.

    It had the same latency mudmask is showing.

    This example capx photon provides, has a event raised for movement, but it is not set at each tick.

    They have it set at like 0.2 seconds interval.

    As soon as i removed that the latency was as good as gone.

    So be sure to check that raising the motion of player characters.

    Do it at each tick, or remove that condition completely.

  • Try Construct 3

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

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

    Well assuming you run the C2 version side by side on 1 pc does not make it connect "cross country".

    Meaning the connection and data stays within your home network.

    The photon version does connect to the photon cloud and the data then travels all the way back to you.

    So the photon version gives a more accurate latency representation than the C2 version.

    A question i have to ask, is did you copy paste the movement events from a photon example?

    If so would you please be so kind to show a screenshot of the event that "raises" on motion of the character.