DuckfaceNinja's Recent Forum Activity

  • Ashley, I did look at real-time game example...Even in real-time game, there is only a single instance creation of a sprite called "Peer". But my question is even there are only 2 players or "n" number of players, I want to create multiple instances of sprites for each Peer...And I want to associate all instances of sprites created by a particular peer to that peerid....In such case, inside the peer group if I have an event like - on-created sprite event - set Paddle.peerid to multiplayer.peerid action sets the peerid only for the first instance of the sprite...The peerid for all other instances is blank using this approach...somehow sync object is not syncing for the remaining instances of peer sprites ...Hope I am clear..

    You either want to look at container or independent sprite like RTS?

    I haven't look at RTS yet but I think that'll be one hell of a job.

    Looking at your name I think you're an Indian, happy celebration then!

  • I have to spawn a new sprite on peer or host whenever the user double clicks on a screen...While I was able to get this working, I am not able to update the sprite.peerid with the peerID's of the user who creates them...I am using "Sprite - oncreated" event on peer and then assigning it to multiplayer.peerID...(as per the example multiplayer.peerID is supposed to contain the peerID whenever sync object creates a sprite on the host)...Strangely multiplayer.peerid gets set only for very first sprite that gets created on the peer / host...The sprites that get created from then on have blank values in their peerid instance variables..I am sending a message to host to create a sprite whenever peer double clicks on screen...

    I'm not sure if you're having the "not yet created" issue here, but I think this might be the case. I have issue before with similar like this but different. Ashley introduced wait for signal a few release back which solved this issue.

    I'll explain my case, I'm not entirely understand the technical work on the back of it but I hope this help:

    I think sync object is sync 1/30 second so there's a chance that the data arrive is not in desirable order when used in parallel with send message. However, reliably ordered message are guaranteed to arrive in order if it is a case of between broadcast and send. There's a chance the sync data arrived the tick before the send message arrive which theoretically confirms why wait for signal works.

    Tl;dr, experiment with wait for signal in the on created event. Actual snapshot of my simplest case:

  • I don't know what should I be saying here... What's left is you are the one who has to understand how to do it.

    Some pointers:

    1) Understand what sync object does: (creation and destroy is covered here not broadcast message)

    2) Sync Position (or with angle) if it is moving npc/enemy object.

    3) Sync None if it is a static object like loot. Use broadcast message to update position on created.

    4) Restrict client input just for continuous trigger, for triggering trigger use send message.

    I'm not sure how familiar you are with c2 event system, what can I say is the way you set up you capx imply that you still need some more study to get out of the normal event structure (it feels incomplete rather than wrong), in MP it is different but you can correlate such as to use every tick = use sync, to use trigger = use send message, trigger once= send message.

    I'm an artist, not a coder and official example and manual is all I need to understand this, there's no reason why you can't do it

  • New items\backpacks respawns\erases with time and in case of it new players connects you propose to send for everyone newcomer messages about every loot positions?

    Yes, doable in the form of array.asjson . However to set it up, it is not as direct as syncing the position, rather quite tedious but it'll save you bandwidth.

    If you don't mind about the bandwidth at all you can still go with syncing positions, but you have to live with the interpolation issue that you show, unless Ashley provide the "no interpolation" option for sync object.

    I think the other syncing way you can try is using instance variable. They have no-interpolation mode, so basically record you x and y in the host and have an event in common group to position to instance variable every tick, or every1/30 second depends on what you prefer but the drawback is, the object movement might look choppy, jerky or stuttery.

  • I have Firefox 11.0

    That is super old! I think webrtc is not yet ready when FF 11.0 is released though, that is how old it is.

    mostly use IE ... like 90% of Earth population

    Divide by 10.

    MAC Safari not work with Multiplayer object too?

    http://www.webrtc.org/

    I think you did not notice the time has lapsed. You should update your browsers though.

  • Function calling a function is kind of a nested loop, right? . Now i have to rework them argh.

    That sounds like recursive functions. You have to be careful not to create infinite loop of function call, you need a way to exit the loop, it can lead to browser freeze and crash. I did an infinity loop before and I would say it's a bad practice at least for me.

  • Can you clarify one thing for me please.

    Triggered functions take up cpu too as well ,right?

    For example. Enemy near player > call function("enemy slow")

    and on function("enemy slow") > enemy speed half and enemy fire rate half and etc etc .....

    Imagine that the function calls a lot of actions ,like 10 or so. This would make cpu usage high.

    My problem was that the cpu usage for functions in groups were barely showing 0.2%. That's why i put the group(GROUP and GROUP2) withing the triggered functions ,and then i got such high values and also the weird total group cpu usage.

    I'm not sure about this, but I do have a single function with 97 action in 54 lines, no performance impact at all, so amount of action doesn't affect anything significant. This will have to do with what condition/action you're doing, what I know is a heavily nested loop can give a bit of hiccup if there's too much looping on object creation/destroy, there are other extreme cases as well.

    Wow this is great! This means I need to speed up my game development!! Never thought this will be available earlier than expected, awesome!!

  • I am guessing you have some sort of variable that is set to subtract 1 on a certain action. You may need to not allow it to go past 0.

    I don't think this is related at all.

    Pandy this might be a bug on the debug engine, try to reproduce it in a minimal capx and post a report. Or you can opt showing some screenshot of the group, or just attaching the capx will do as well so that others with idea can point out why is it like that.

  • IE never supported webrtc AFAIK, firefox can be inconsistent sometimes but there's no problem so far from May until recent version.

    Have you tried out opera?

  • And how in this case other players will see backpack on connect(if backpack not sync)?

    If the host is the one who created the backpack, the backpack will also created on all peer, but set the position manually and pin them. This is how you sync backpack position by piggyriding the position value of the character.

    Ashley also mentioned this before.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Other players must see this backpack, without sync its bad. Make it via broadcast message with position is bad too, because on start all loot generates randomly, and it will destroy bandwith by sending for each player postions of created objects.

    That is why you need to pin the backpack to your referenced position which is the character. Broadcast message is used like function/trigger which you have to send it only one time, unpin the backpack and set the position according the message.

DuckfaceNinja's avatar

DuckfaceNinja

Member since 28 Nov, 2013

None one is following DuckfaceNinja yet!

Connect with DuckfaceNinja

Trophy Case

  • 11-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies