ome6a1717's Recent Forum Activity

  • GenkiGenga - Wow, I didn't think it would be so easy... it actually seems to work pretty well. Now, getting into numbers...the inboundBandwidth / outboundBandwidth is constantly ~1500-3000. Is this okay? Or is that WAY too high? This would save so much hassle and potential failure...

    There will be up to 50-60 enemies in a layout at one time - mostly one 5-6 different enemy types, but just wondering if that's WAY too many objects. I'm only syncing position, though. (this is how many enemies I have in the test layout causing 1500-3000 bandwidth)

  • - to be honest, I haven't even tried syncing the enemies. I was just afraid that if I did so, and some layouts had a ton of enemies, that it would not react very well. I might give it a shot. Is there a syncing tutorial for enemies anywhere?

    Also, noticed a small issue with the concept of checking distance and outside their screen - it doesn't actuallly pick a zombie, so whoever the first zombie was picked is what will do that check. Unfortunately you DO need for each at the beginning of the loop, if I'm not mistaken.

  • - good point! Not sure how I missed that

    GenkiGenga - yes, that's exactly what I'm doing right now. It works fine as is, and even with TONS of simulated latency, it "works" (albeit a bit strange).

    For the most part, what I'm doing will likely be fine, but I was curious since I've never seen a tutorial or suggestion to do anything else (and since you can't really sync THAT many objects, what else would you do?)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm really curious to see what some other people think that have used the Multiplayer plugin, or knows a bit about coding MP games.

    So I have player inputs working well, and I'm getting to the portion of the code where the enemies are coded. I'm curious on your guys' take or ideas on the best way to achieve this. I'll have plenty of different enemy types, but for now lets just stick with the traditional "run towards you constantly" variety. So far, I have this:

    1. I basically set all the code for the enemies to behave the way they will (animations, triggers, etc.). However, ONLY the host determines when an enemy is active, and who the enemy is chasing, and then relays that message.

    ie

    if Host
    
    [ul]
    	[li]Pick Nearest Player[/li]
    [/ul]       - If Zombie distance < 25, set Zombie.chaseTarget to Player.peerID
           - Send MP Message (Zombie.instance, Player.peerID)
    
    [ul]
    	[li]On MP Message, pick Zombie instance, set chaseTarget to peerID[/li]
    [/ul]
    [ul]
    	[li]For Each Zombie[/li]
    [/ul]      - Chase Player by peerID
    [/code:wlf1lmmo]
    
    It works.  However, you will get slight differences depending on the latency of where that enemy is.  But technically, it's all aesthetic.  So if you're lagging like crazy; yes, it might look like you're friend is hitting air and killing an enemy on the other side of the screen every once in a while.
    
    Truthfully, I don't know how else do this without tons of bandwidth.  
    
    Any other ideas?
  • My recommendation to you is to do what I do. Compulsively save like crazy. Save UP like crazy. We have a title releasing on steam in 9 days and I have 114 capx files. Assume you're going to lose everything - it's the only way to NOT lose anything.

    I know that doesn't help you when it crashes when saving, but it will help minimize any major losses.

    I'm banking on that desktop build at some point anyway..

  • I'm curious about this, too. I have a beefy project that has quite a few objects and effects that will just run better outside of an HTML5 framework.

    It will actually be a great comparison on how a game in HTML5 vs Native performs.

    PS. I wasn't crazy about C3 before, but it has a lot of awesome features. C3 is still my prime editor for any 2d low res games. Nothing beats the event system, unfortunately. Obviously there are tons of limitations when it comes to backend (porting to consoles, gamepad feedback, resolution handling, etc), but I still love it.

  • That's kind of what I thought, but I'm just trying to figure out a way around it. I'm not a huge fan of selling a game that has multiplayer but doesn't work for anyone unless thy know how to go into their router and change the NAT and dmz settings. We never had this problem with unity multiplayer as far as I know.

  • I can connect 2 players to a room if they're on the same network, but if I transfer the game or use remote preview, it seems to not "join" the room. Is this common? I'm joining the signalling server, once thats done, it logs in with an alias (both of which work), then it lists the games and # of players (which works on both machines), and then when I click join, it seems like it joins (it says "connected to <gamename>"), but then it seems the players are kicked immediately.

    Not sure where to go...

  • Nevermind...I was unaware you had to keep the "remote preview link" box up...my bad!

  • I'm not sure how many users are having trouble with this, but I can't get remote preview to work. Everytime I do it, whether I open it in my browser or send it to someone elses, it just says "login failed".

    I'm trying to figure out how to test the multiplayer portion of my game...is that possible with browser c3?

  • RAM is dependent on the size of the window, aka if you're native resolution is 3000 x 2000, it's going to use more RAM if the screen is maximized than if your resolution was 1920 x 1080 maximized.

  • Here are some things I've learned:

    1. For events that you only use a small % of the time, (i.e. Menus), disable the groups when they're not needed. It can save a lot of CPU depending on how intensive it is.

    2. The dreaded for each loops. I had a lot of trouble for a long time fully understanding them, but here's a good way to utilize them for the best performance.

    If you have a Boolean "isAttacking", you can do

    if Enemy.isAttacking;     For each Enemy;    <insert actions>[/code:3b5vrw7i]
    
    As opposed to having the for each before the check (for some reason that takes a HUGE amount of CPU even if they're not doing anything)
    
    That might seem obvious, but whag really kills performance is using for each before an overlap check (which I always used to do)
    
    3.  Try to avoid every tick events as much as you can. If a health bar is being set, set it to update on a trigger (or when you are hit; use functions). If you have to do something every tick, ask yourself "can this afford to be checked every 0.1 seconds?"  This goes for checking variables, overlaps, collisions. It might not seem like a lot, but it adds up quickly. 
    
    4.   Avoid large images (a single 1920 x 1080 background is fine for a steam release, but add a few more and people will start complaining about fps issues). I can't comment too much about phone performance. 
    
    5.  Careful with overapplying the fillrate. This means having layers on top of layers on top of layers (if you have a background image, then I tilesheet for walls, then a mother tile sheet, for the floors, then another tilesheet for x y and z, it'll start to slow the game down when things are moving). 
    
    6. For tilemap a specifically, they're only useful if you're actually tiling (so if you have 3 tiles that you want to use as your floor and you want them built at random, a tilemap is the wrong choice - each tile that is not connected. basically has to redraw the Sprite (might save on objects but not on drawcalls)
    
    7.  I've yet to figure out an efficient way to do this, but for larger layouts with thousands of objects, you can destroy objects outside of the players view and recreate them every second or so. Use with caution, however, because depending on how many objects there are, it might pause the game a frame or two to create them. 
    
    8.  Use families as much as you can, but also use with caution. If you have 20 bullets in a family and 300 enemies in another family and you check an overlap with 1 bullet on the screen and 2 enemies in the layout, for some reason it'll check through every non existing enemy and bullet in both families.  There are ways around this, however (either using a Boolean on created and checking that before you do the overlap and for each - I think...)
    
    That's all I can think of off the top of my head. Hope it's helpful to someone!!
ome6a1717's avatar

ome6a1717

Member since 12 Feb, 2013

Twitter
ome6a1717 has 3 followers

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies