Refeuh's Forum Posts

  • Hi -

    hard to say without more details, but here's a few generic performance tips :

    • check the version of your browser and graphics card driver, to make sure you're running hardware acceleration, and not a software renderer
    • use the debug pane to inspect how many entities your scene has, or which are the most expensive. A simple mistake in the logic or scene management could lead to a situation you're not expecting (lots of expensive entities outside of the viewport, etc.)
    • check your entities are running only the logic they need ; it's possible you have physics or collisions, or similar service enabled on objects that don't need it
    • try to isolate the problem by disabling bits of logic or gameplay. Collision, AI, effects, etc.
    • resource management ; it's possible to create simple "naive" situations that are complete perf killers, i.e. geometry that cannot be batched. E.g. "bad" effects with "unique" particles, or unique effects on sprites, etc.

    So... no easy answer, but the general approach is 1. narrow it down. 2. identify perf bottleneck 3. fix perf killer 4. repeat

    'hope that helps a bit.

  • outline.47 — Now for sale in the Scirra Store!

    https://www.scirra.com/store/royalty-free-sprite-fonts/outline47-413

    <h3>Small but legible</h3><div class="deshr"></div>

    • Incredibly compact yet readable and stylish sprite font !
    • Average character size is 4x7px (up to 4x9px for large symbols)
    • Suitable for low-resolution and pixel-art games

    <h3>Customisable template</h3><div class="deshr"></div>

    • Mix & match layers : 4 exteriors, 2 interiors, 1 effect
    • Easy to recolorise mono-hue resources
    • Supports C2 font scaling ; adjust character spacing as necessary

    <p>Supported characters : abcdefghijklmnopqrstuvwxyz0123456789_ .,:;?!'"^+-*/=%@#()[]{}<>$��</p><p>Note : A..Z and a..z use the same sprites</p><p>Instructions : this font uses variable width and negative character spacing ; use supplied .capx and event sheets for proper settings</p><p>Screenshot background artwork by Michele "Buch" Bucelli (http://opengameart.org/users/buch) ; used under CC0 license (public domain) only to demonstrate the font in context</p>

    Use this topic to leave comments, ask questions and talk about outline.47

  • [quote:1bnn3bqv]could we agree that a single update could be at least 3.5kb and if it is by default sent 30times a second... then can we agree we are going to have a upload bottleneck on a 1mb/s line?

    Absolutely, I will agree that 3-4kbytes updates, 30 times a second, will saturate a home-user 1mbit line !

    Though 3-4kbytes is quite a lot to describe the actions, status and updates of one single peer. That's ~2000 int16 or float16, and since the peer won't be running any critical gameplay logic for security reasons, there's usually not much more to send than just player input and actions, and a few miscellaneous useful bits of data.

    There are already lots of perfectly viable multiplayer games working with this limitation, including massively multiplayer ones.

    What I don't understand is why you consider the number of peers a relevant factor when analysing the upload bandwidth on the peer side ; it's very possible I got your point wrong, in all the confusion about room, sizes, sessions, etc.

  • Though we still don't know what the "1, 4, 10" room thing is all about

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:3upa4pqv]peers can only handle 15 other peers connected because host collects info from peers and broadcasts to peers and peers broadcast to peers via host...

    I believe this is inaccurate ; we've run the numbers already - but while bandwidth requirement is exponential on the host/server, quadratic O(n^2), it's only linear on the peers O(n).

    Since peers don't connect to other peers directly and only send/receive data to/via the host, peers only send data about themselves and only receive 1 update about other peers.

    Session with N peers - n bytes of data per peer to store their status. Size of the data to describe the entire "world" = N*n bytes

    Peer : sends n bytes to the host ; receives N*n bytes of world update

    Host : sends N*N*n bytes (broadcast the world update to all the peers) ; receives N*n bytes (peer updates)

    If peer download bandwidth is the limiting factor, I think there are bigger issues to sort at the architecture level than room sizes !

  • [quote:3rxtlxru]The number of player in each room depends on the host connection

    Sorry, I must be missing something - I am probably just confused but I thought from previous discussions you didn't want a player to be the host ("I don't want to use a player as the host"). So why would it depend on anything else than the infrastructure and bandwidth you provide

  • Btw, if I may ask, are you working on your creations full-time ("pro" activity), or in your spare time ("amateur"-style, which doesn't exclude a game-creation-related full-time job / freelance) ?

  • [quote:cumh8n6x]Team 7Soul - designer and artist

    Enough said, I'm sold ! (my apologies to the programmer, I don't know him -yet-, but that's definitely a familiar name ! )

    I discovered your work a while ago when looking for pixel art resources on DeviantArt and OpenGameArt - I am a huge fan and I was delighted to be able to buy your asset packs when they were made available for commercial use.

    Copy Girl looks amazing ! I *love* Megaman- or Metroidvania games, I can't wait to play yours

  • +1 ; most of my groups are for organisation purposes only as well

  • [quote:2823bbuw]Do you think i can make the server outside of the actual game? A different project

    The C2 project is where you define the objects to synchronise, what to synchronise, and the format of the data. Then C2 handles it all under the hood for you.

    If you don't do that, it means you'll end up fighting the system more than using it.

    It doesn't mean it's not doable (I'm sure DuckfaceNinja has some clever tricks to share ), it means it'll be counter-productive. You still have the option of web sockets. But when talking "easy" C2 multiplayer, think "Risk of Rain", not "Realm of the Mad God", for example.

    As for a standalone "server", if you have the knowledge to analyse the C2 marshalling to write a separate system that will interact with a C2 peer or multiplayer-enabled object, you have the knowledge to write your entire system altogether, which would be easier in the first place as you wouldn't need to fight the existing structure. Though we're talking significant amount of work for a veteran networking programmer.

    C2 is designed to fast productivity for simple games. If it's not saving you time, you're not using the right tool.

  • "can we make a standalone node-webkit (or browser) build and use it only for sending and receiving infos?"

    It can be the same C2 project, with significantly different event sheets, depending on being the host or a peer ; then you can ensure your instance is the host, by having it join the session/room first using the Scirra signalling service.

    Your "host" events would :

    • interface with the database, to read/write centralised data
    • receive inputs from peers
    • run critical gameplay logic
    • broadcast updates to all peers

    The peers "just" send user inputs, display the world based on the host updates, and run non-critical logic (visual effects, animations, etc.)

    Bandwidth issues remain though, and you still need your host on a box with a big pipe if you need to handle lots of peers and data.

  • If you know the details of your project, it's "easy" to calculate how much bandwidth you need (or at least get a good estimate). Just be aware it grows very quickly.

    With the C2 built-in host/peer model, you can ensure "your" instance is running as the host ; the console is irrelevant and does not reduce or increase the complexity of the networking problem.

  • There are several questions that can be discussed separately, as there is little overlap.

    1. Console. It's a nicety, and shines in automated/scripted environments to be able to pass/process complex commands, but in the end it's only an interface to the underlying systems. If you need an actual console for low-level management of objects/sessions, C2 might not be the best choice. C2 gives maximum productivity when working at high-level, on entities, behaviours and events.

    2. Data management. There are some good tutorials to get C2 to interact with a remote SQL database. Beyond that, it all depends on your projects. Your specifications need to be analysed to deduce a relevant set of data structures, tables, interfaces, queries, etc.

    3. Bandwidth. As the previous posts mention, the user connection if the limiting factor. C2 provides a built-in host/peers architecture, not a server/client ; subtle difference.

    "the server hosted by someone should be able to handle more than 100+ players"

    If a user is hosting the session, we can break it down and analyse what it means in terms of bandwith. A typical ADSL2+ connection gives you a 800kbits/s upstream bandwidth. 100kbytes/s, that's the maximum hard-limit to play with. What follows is a bit simplified, but gives an idea of the order of magnitude of the problem.

    Also, bandwidth requirement is exponential (more players = more data to send to more peers, see mutliplayer tutorials 1 Concepts page 9)

    Say you have 100 peers controlling a sprite that moves around smoothly on a shared map. You need at least a position (x,y) that we'll encode into 4 bytes (2 16b floats or int). The state of the game requires 400 bytes (position of all of the players). At an update rate of 15fps to be conservative, that's already : 400 bytes data x 100 peers * 15fps updates = 600kbytes. Way above what a home-user connection can handle.

    Even if we're clever (less updates, better packing, partial prediction, etc.) and save a factor 10x, that's still more than 50% of the bandwidth and the players are not doing much yet.

    It's very different if you have 100 players in a turn-based grid layout. Or if you have a dedicate host and a much larger connection.

    But bandwidth is the limiting factor. There's no software technology or plugin around it, it's a technical hard limit. Basically, it's very hard to give specific advice without more infos about the specifications of the project, but "large scale multiple" and "user hosted" don't work well together.

  • [quote:2hjk33ff]There are things that you can let the peer to process

    Definitely ! Usually, when cutting it down to the core critical gameplay logic, there isn't that much in terms of processing that needs to be happening on a dev-controlled server/host.

    Though if the idea is to go with the suggested scenario (i.e. 1 host handling multiple game sessions in parallel, every player is a peer), I'll want to have realistic estimates for min/max bandwidth bounds (i.e. knowing the load I can put on the host connection, how much game sessions can it handle at the same time), to assess the practicality of the whole solution. A working technical implementation that is not viable in terms of scalability wouldn't get me very far, therefore this is still a major risk.

    Coming from a background of much lower-level programming (consoles, etc.), it is always tempting to try to push the boundaries, but beyond a certain point it simply becomes counter-productive (time invested vs. technical advantage)

    Btw, thanks for all the input It's always great to be able to bounce ideas and make sure we're not missing the obvious !

  • Ah ah, well, at least this thread confirms I haven't missed anything obvious that would make it all very easy