Zizaco's Forum Posts

  • I'd like to know if the construct 3 multiplayer system is good enough to create a multiplayer game like minecraft, terraria or something online, you know what Im talking about?

    If you knows could help me I'd be greatul! - Dani10

    Short answer: Yes. It is. (coming from someone with work experience in networking/distributed applications)

    I did some experimenting, and I can say its multiplayer plugin robust enough for these sorts of games (and even for an MMORPG if you know what you're doing).

    (For instance, I have a working demo where even if the server drops, another client becomes the server and the gameplay continues smoothly for all connected peers)

    Multiplayer is always challenging and demands prior knowledge, a solid understanding of networking, multiplayer architecture, and extensive planning.

    You can read more about Multiplayer in Construct here: construct.net/en/make-games/manuals/construct-3/plugin-reference/multiplayer

    It has a robust set of features: UDP, Automatic data compression, Binary transmission, and specific datatypes.

    And you can also opt not to use the built-in "Multiplayer plugin" and go full-on scripting to leverage the Web APIs (such as WebTransport) directly via JavaScript/TypeScript. Meaning, there's literally no limitation compared to any other modern web/browser-based approach.

    --------

    Some insights:

    I recall watching a YouTube video where a developer failed to create his MMORPG using Construct due to performance issues. After seeing it, I concluded, "The problem wasn't Construct itself, but the multiplayer architecture he went with. Attempting to develop a real-time multiplayer game with hundreds of objects and players wouldn't fly, no matter the engine!" There's a reason most MMOs have tab-targeting combat.

    For example, in a Terraria or Minecraft game, relying on the built-in Sync object for every map tile would be excessive and could lead to various issues. It's better to develop your own set of Messages that indicate when a tile is created, destroyed, or changed. You should also create custom functions to handle the synchronization of these actions across all clients. Additionally, you might need to implement another message type for transmitting larger map sections (Binary transfer) and, finally, allow each client to handle collisions and platforming locally for smoother gameplay.

    Construct is very easy to use, but when it comes to Multiplayer, throwing things around without proper planning and using Sync object for everything without much thinking will cause you to hit a wall. You'll hear people saying that "Construct's multiplayer isn't robust enough". However, this is mainly due to the contrast between how easy Construct is to use and how challenging multiplayer can be. In more complex game engines, players tend to complain less about multiplayer capabilities because users of those engines are already accustomed to everything being difficult.

    --------

    edit: My last two cents. In general, if you fail to create your multiplayer game in Construct, you will likely fail to do so in any other game engine.

  • Two videos that popped up in just 2 days about C3 users switching engines. Especially the one by Foozle gives some good insight to the GDevelop workflow. Looks like a promising start and really nicely integrated i gotta admit.

    Ashley Tom

    Probably worth for you to watch.

    - joelmayer

    It seems like a trend. We might see more videos like this in the future. One thing that FoozleCC mentions at the end is quite interesting: "if you think you might use 3D"

    It's not only people who are currently working on 3D projects who choose it. Those who might consider 3D in the future see it as a way to futureproof their skills and projects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • skymen these major updates sound excellent.

    It's completely understandable that you'll take your time...

    There's indeed a lot that can be done with it as it is now

  • Thank you for the update and the fixes! It's worth putting the opencollective link forward (in app, and in the `README.md`).

    I just made a donation.

  • Having more examples would probably help!

    Is there a way we could donate to this project? I'd love to support it!

  • This is fantastic. I just used it to develop a more efficient version of a stack of effects I had been using.

    Thank you for your work!

    edit: I found a bug: github.com/skymen/construct-shader-graph/issues/74

  • I found the Three.js library in the root directory of the latest versions of c3.

    Does the presence of Three.js in the codebase mean that in the future we may see native or deeper integration of 3D primitives or WebGL 2.0/WebGPU functions within the game engine itself?

    -

    Nice catch! This is not present in the LTS version, even though it includes almost all the 3D features from the latest versions.

    I took a look, and this ThreeJS subset includes THREE.Material, THREE.SkinnedMesh, THREE.Skeleton, THREE.GLTFLoader, THREE.Object3D and more. 🙂

  • In order, starting with most important, here is what I feel is most needed:

    1. Full rotation of a 3D shape.
    2. Upgraded Layout view for 3D objects.
    3. Loading in gltf model files.
    4. 3D Bounding box collision.
    5. Basic 3D lighting (New Object: 3D Light).
    6. Basic 3D animation (from gltf files).

    - Jase00

    I agree with these 6 points. I think this is everybody's expectation when it comes to 3D in Construct.

    I want to emphasize that these features alone would already create a significant divide between 2D and 3D (exceeding the difference we see with HTML layers). For instance, implementing 3D bounding box collision with rotation would break compatibility with all the 2D principles that Construct is based on (an example is collision cells, which must be 3D and support various rotation angles, as detailed at construct.net/en/blogs/ashleys-blog-2/collision-cell-optimisation-914).

    Additionally, Scirra would need to manage features that only function within a 3D layer/context, such as lighting, glTF support, bone animations, 3D bounding boxes, and rotation.

    My ignorance is probably going to be shown with what Three.JS offers, but, I feel confident that Scirra can tackle their own 3D implementation [...] Maybe it's bad for me to say this as it makes third-party addon devs, or those familiar with Three.JS, have less use for their skillset or become restricted in some ways, but I stand by my point as of now.

    I, too, feel confident they can tackle their own 3D implementation with everything you asked... but it will take 10 years.

    Implementing these 3D features is orders of magnitude more costly (in time, effort, maintenance, and bug-proneness) than 2D. I'm concerned that attempting to reinvent the wheel will result in two years passing with only a few new 3D shapes added to Construct, rather than the six features you mentioned.

    Realistically, tackling 3D will inevitably involve dependencies. For example, I doubt Ashley is thinking about creating (and maintaining) a fully fledged gltf loader from scratch.

    BTW: I'm not an addon developer and I don't have a skillset in ThreeJS. I actually dislike it. The proof of concept I posted before was made with a different 3D library (BabylonJS). Since ThreeJS is a more stable, tested, and widely used library, I believe Ashley will see it as a more prudent option.

    MasterPose is right. Of course, a fully featured 3D engine developed by Scirra would be the best, but let's be realistic!

    My take is that Scirra should focus on creating a clean API/UI/wrapper around a mature 3D library/engine... I'm sure it will involve significant effort, challenges, and a lot of "pain", but at least this approach would address the increasing feature gap in a feasible way.

  • I'm not sure that would work well in practice. Suppose someone wants to drop a 9-patch object or Text object on to a 3D layer powered by a third-party library like ThreeJS.

    🙂

    (or maybe this can be handled in a way that resembles how HTML Elements are handled when outside of an HTML Layer [AKA: logically in one layer, but rendered in a "virtual[for the lack of a better term]" layer)

    That probably involves two sets of rendering code, depending on what they are rendering in, which is a pain for maintenance.

    Indeed, inevitably. Therefore, the way to opt-in to make an object available in the special 3D layer could be to implement some "glue code interface" to instantiate, update, and maintain an instance in that library. I think 99% of the addon builders would be more than Ok with that.

    It could be that object types that support such a special layer have to implement an onCreateRich3D(runtime, threejsScene), onUpdateRich3D(runtime, threejsScene), onDestroyRich3D(runtime, threejsScene) interface. Where `threejsScene` is provided by Construct. (oversimplification to clarify the idea.)

    For the native plugins, having just Sprites, Tiled Backgrounds, and 3D Shapes supporting the special 3d layer would be sufficient.

    I want to highlight that, in theory, the code for Sprites and Tiled Backgrounds is the "straightforward" (POC/non-production-grade) code I wrote [Construct Arcade Link]. Also, the author of MakeIt3D successfully wrote the code necessary for native Sprite animations to function. While clearly not production-ready code, these two examples demonstrates that such code may not be as much of a liability as it appears. (it will be some pain for maintenance, like everything... but perhaps less painful than the increasing 3d feature gap)

    but now you have zones with different feature sets that aren't compatible, and you can't do something like decide to make an existing 2D layer in to a 3D one.

    To some extent, this is the case with current 3D/2D layers: Once a project includes any 3D camera rotation, changing a layer from 3D to 2D will likely break the project and require some refactoring.

    Still, it wouldn't be completely incompatible. Typically, the 3D layers consist of Sprites, 3D Objects, and Tiled Backgrounds. As long as these objects implement the onCreateRich3D(), etc interface, these layers could be transformed into a "special 3D layer" while maintaining their original functionality, enabling customers to switch seamlessly between standard 3D and "special 3D" layer types.

    Ideally, an error message should prevent such a switch if the layer includes objects that aren't compatible with the "special 3d layer".

    In my experience users do not understand such things. Instead - not unreasonably - they expect things in a commercial product that they paid for to just work.

    I think this type of approach would be better explored via third-party addons, so it's not in the core product and can more easily be treated as an "beta" type technology that we don't support. So perhaps that's another direction we could explore, via exposing APIs in the addon/scripting system.

    You're right. Users expect things to "just work," but I struggle to see how this is much different than the 3D/2D/HTML layer distinction users already deal with.

    Sorry for the stubbornness... This is just some brainstorming on creating a foundation for addon developers to converge when choosing to leverage a third-party library. I truly believe this would help the Construct community quickly gain impressive 3D capabilities.

    I wonder what all the talented addon developers would accomplish if they could just converge around a common `THREE.Scene` instance (AKA: the special layer), knowing that all they have to do is call `add()/getObjectById()` and manage their objects. (again, oversimplification)

  • Integrating an existing 3D engine like ThreeJS is not a straightforward choice and has some tricky trade-offs.

    Absolutely. I completely agree with you on this. I understand it's not simple or straightforward. My proof of concept was "straightforward" as a testing ground, but of course, a hypothetical official support involves much more and is far, far, far from simple.

    [...] it's probably a major project to switch to another engine wholesale. Making a high-performance 2D engine also has specific requirements that 3D engines don't usually need or care about, so it may be that it cannot be done without a major performance degradation. [...] In the long term that means the limitations of ThreeJS become the limitations of Construct.

    That's why I've been thinking of this as a special/dedicated layer (like the HTML one) with restrictions that don't clash with the existing high-performance 2D/basic3D engine. The limitations of ThreeJS would become at most the limitations on an opt-in layer type.

    Such a layer could support Sprites, 3D shapes, and addon/SDK2-based objects (which could interface with ThreeJS's context). This would limit the surface of potential bugs by being somewhat "isolated" from Construct's current capabilities.

    Users using this "beta" layer would understand that they are in a "third-party" territory (as with HTML layers).

    Taking on board a third-party dependency for such an important component is also fairly risky in the long-term. The intentions of the ThreeJS maintainers may not align with our needs. [...]

    Indeed. I agree with you again. Dependencies can cause significant issues, and many people underestimate how problematic it is to have excessive dependencies beyond their control.

    It's important to "pick our battles", and so far, you have done a good job of picking stable dependencies that are "invisible" to us users. For instance, the way you handle minification, the Monaco editor, TypeScript, etc. So I absolutely respect your decision.

    Since you said you're open to tackling 3D "a bit more", then perhaps there's a good compromise to be had with an "isolated layer" and a well-chosen external dependency.

    I suspect a hybrid approach like that might be the way to go. As the 3D engine example illustrates there are also already ways you can include third-party 3D engines wholesale, so that's something you can explore as well, and perhaps there are also ways we can tweak the engine to better support that.

    This is precisely what I'm proposing. Some QoL around the concept demonstrated by the 3D engine, leading the way to what an "ideal surface area" would be, can go a long way.

    A special layer that instantiates a ThreeJS context and has supports a subset of plugins (Sprites, 3D shapes, and the SDK2-based scripting interface to access the ThreeJS context) seems to be the most balanced and less risky approach I can think of.

    PS: Please think about this with an open mind, like how you did with the TypeScript request back in the day. =)

    edit: I'm happy to submit a feature request for this on github, but it likely won't get many +1 votes since it's more about laying the technical groundwork rather than a feature itself.

    This decision should go beyond just the vote count. It needs a thorough analysis by you and your team. So, yeah... I trust your judgment even if you doubt this approach.

  • [...] That's a fairly significant amount of work to implement, but it's doable.

    [...] Construct is a pretty mature product now. Perhaps risk the rest of the product suffering or getting left behind is not that significant a concern any more. So perhaps we could more seriously consider doing more work on 3D features.

    [...] Let us know what you think! - Ashley

    This is an exciting response. I'm happy with the Scirra team being open to exploring 3D further.

    I’d like to ask Ashley about the feasibility of adding ThreeJS, BabylonJS, or PlayCanvas as alternative renderers. It may seem like an absurd suggestion, but hear me out... Although it would require considerable effort, it could be less than developing and maintaining each new feature from scratch, as you are currently doing. In short, it could provide a strong (WebGPU-ready) foundation to build upon.

    Since most of Construct's built-in plugins render either quads or simple meshes (such as 9-patch), now might be the right time to consider making such a change.

    This could be introduced smoothly for those who opt in, as you did with WebGPU OR as a special layer type limited to objects of certain plugins.

    for example:

    I experimented by extending Construct's official 3D Engine example using TypeScript and subclassing to recreate, synchronize objects, and utilize textures from Construct's spritesheets in a 3D Library (similar to ThreeJS)... including Construct's 3D Camera. It turned out to be relatively straightforward. I am happy to share the complete working example along with the source code. (It worked so well that it might become my default workflow for basic 3D games)

    Play on Construct Arcade

    Reason GDevelop has this all of a sudden is because they basically just implemented Three.js. - joelmayer

    This!

    Why is it important to leverage an existing 3D library (like ThreeJS)? Otherwise, Scirra and the community would need to reinvent the wheel for each feature, such as bone animation, WebGPU, particles, mesh distortion, Spine, lights, shadows, and so on, whether natively or via community addons.

    From my experiment, it seems easier to enable Construct-built-in plugins to work in a ThreeJS environment than to develop all the upcoming features from scratch in Construct's internal 3D context.

    To begin with:

    • Load 3D models (glb, gltf);
    • Normal 3D view in the editor;
    • Object rotation on all axes;
    • Changing textures in runtime;
    • 3D animation support;
    • Enable/disable nodes;
    • 3D Physics;

    That alone would be wonderful.

    - artheads

    This reinforces my suggestion of integrating a 3D Library. For example, the MakeIt3D plugin was developed in a few months using the approach I described and includes the features you mentioned (plus Spine, real-time lights, shadows).

    MakeIt3D achieved this by utilizing ThreeJS and synchronizing Construct's internal state with the 3D library's state [video]. This serves as the strongest proof-of-concept we could have. I think it would be great if Scirra could adopt a similar approach, especially if they can ensure smooth integration with the editor.

  • Visual prototype with 3D-engine rendering

  • I haven't developed an Addon yet, so I might be mistaken.

    From what I understand, C3 has two IObjectType:

    1. IObjectType Script Interface
    2. IObjectType SDK Interface

    From your screenshot, it seems like you're viewing the non-SDK API. My understanding is that from within your Addon you should be able to access the SDK API.

    What do you think?

  • [...] you can’t share the same texture between contexts. What you’d end up needing to do is copy the texture to memory from one context and load that into the other context. Memory wise you’ll be loading the texture twice

    Indeed. I can live with using double the RAM of the spritesheets containing shared Sprite Object. This shouldn't be a big deal for most projects.

    speed wise transferring images to and from vram is rather slow. So you likely will want to do that selectively.

    I agree with transferring images selectively. Speed wouldn't be an issue since the Texture would have to be copied only once per spritesheet, and then only the TextRect (coordinates) would have to be synced across contexts.

  • According to the SDKv2 docs, IObjectType.GetImage() returns an IAnimationFrame, which has GetCachedWebGLTexture() and GetTexRect()

    It won't be easy, cause you'd have to juggle the TextRect of the sprite being rendered... but it would be a fantastic feature to have, and it would unlock a whole new realm of possibilities.

    I think there's a shader to render part of a texture here github.com/knowercoder/threejs-sprite-utils (animated sprite)