matpow2's Forum Posts

  • Tokinsom

    Thanks! Happy our hard work is paying off :)

    Glad we could use KiwiStory as well for our showcase, I'm sure that's one of the sample games that people will recognize.

  • Porting showcase

    Today, I'd like to showcase a few examples of how Chowdren can be used to port Construct 2/3 games. If it wasn't clear, Chowdren now supports the following setups:

    • Construct 2
    • Construct 3 using the Construct 2 runtime
    • Construct 3 using the Construct 3 runtime

    Also, all major platforms are supported:

    • Windows, Mac, Linux
    • Nintendo Switch, PS4 and Xbox One
    • Android and (soon) iOS

    Today, we will showcase a few Construct sample applications on a handheld console platform as well as PC.

    All the samples shown have excellent support with Chowdren, both on desktop and consoles.

    Note that the following are NOT announcements of ports of any kind.

    KiwiStory

    This is one of the bundled Construct 3 samples, and uses the Construct 3 runtime. It uses a number of effects, some of which are stacked, e.g. ReplaceColor and Brightness. It is a fairly simple game, but exercises a number of plugins, e.g. Function, Platform, Sin, Bullet, Tiled Background, Sprite Font, Dictionary, Ninepatch, and several native events.

    Handheld console display

    PC video

    WebM

    Subscribe to Construct videos now

    Mighty Goose

    Thanks to Richard Lems, I was able to test a prototype engine of the game "Mighty Goose" on Chowdren. The game is made using the Construct 3 runtime. Make sure to follow Richard on Twitter as well as Patreon.

    The game makes use of layer-based effects with Outline, and uses Tween, Platform, Bullet, Ninepatch, and other plugins.

    Handheld console display

    PC video

    WebM

    Subscribe to Construct videos now

    Bunnymark

    This Construct 2 sample application is fairly simple, but exercises the Construct renderer/event system to a large degree.

    Handheld console display

    PC video

    WebM

    Subscribe to Construct videos now

    Conclusion

    Chowdren has good support for Construct 2/3, and has support for all major desktop and console platforms. I hope I've demonstrated that fact today :)

    If you'd like to see more of Chowdren on consoles, please get in touch. For licensed developers, I will be able to get into technical details and more elaborate demonstrations.

    Today, we only showcased small demonstrations, but we have much larger projects running on Chowdren. Behind the scenes, we are working on ports of several Construct games which haven't been announced yet. In any case, I hope this whet your appetite a bit for things to come, and I look forward to working with more Construct developers soon!

  • macube

    The multiplayer plugin hasn't been ported yet, since none of the Construct games being worked on uses it. Multiplayer is also not straightforward if you're porting to consoles, since consoles have compliance requirements that you need to adhere to, so multiplayer games will need to be considered individually.

    Macbee

    (Long post ahead! This will apply to all users in general)

    Benchmarks and performance

    Chowdren is significantly faster than Construct, but in terms of specific numbers, that depends on your game and events.

    For Clickteam Fusion, the community did several Chowdren benchmarks that tested some specific feature (e.g. time taken for 100k loops, 100k 'set position of object', etc), and even though that gave very impressive results for Chowdren compared to Fusion, such benchmarks are synthetic and do not test larger systems. Even though I could do something similar for Construct, I'd like to be fair to the work Ashley & team are doing.

    In general, here are some pointers:

    • If you are creating a game where event performance is a bottleneck on some systems, it most likely won't be an issue on Chowdren.
    • If you are creating a game where you are otherwise CPU-bound on some systems, it might be better on Chowdren.
    • If you are creating a game where effect performance (especially stacked effects) is a bottleneck on some systems, it might be better on Chowdren.
    • If you are creating a game with few events and a lot of drawcalls, Construct and Chowdren are likely equivalent.

    Specialization

    Even though having good performance out-of-the-box is great, a big advantage of Chowdren is also the possibility of specializing the engine according to your game. For example, we are currently working on finishing the ports of Baba Is You, and we were generating some code like this:

    FrameObject * fixed_test; fixed_test = get_object_from_fixed(LuaObject::get_int(1));
    if (fixed_test == NULL) goto event_end;
    family_1.clear_selection();
    for (ObjectIterator it(family_1); !it.end(); ++it) {
     if (!((*it) == fixed_test)) it.deselect();
    }
    if (!family_1.has_selection()) goto event_end;
    

    If we can make no assumptions about the value of LuaObject::get_int(1), the family loop is necessary. This will slow down the game significantly if family_1 has a large number of objects. However, for Baba Is You, we always pass valid objects to functions, so we can specialize this to

    FrameObject * fixed_test; fixed_test = get_object_from_fixed(LuaObject::get_int(1));
    

    In Chowdren, we allow specialization like this using configuration scripts. Obviously, this requires quite a bit of knowledge in terms of the game and engine, but when you're porting to consoles and the like, having that sort of control is amazing.

    Hope this post didn't contain too much rambling, but explaining performance has been on my mind for a while :)

  • My bad! Here's an updated link.

  • /Cryptwalker

    Thanks!

    BUGStudio

    Will continue the discussion with you in the email thread, thanks for getting in touch.

  • Thanks!

    I should also note that about 300 new ACES/etc. have been added since the last update.

    The new list can be found here: bpaste.net/show/e51bc5858af4

  • Good news! Chowdren now supports games created with the Construct 3 runtime.

    Some plugins do not work yet, but they should only require a small adjustment to correct for the differences between C2 and C3.

    Here's one of the C3 projects, running in Chowdren (please ignore the missing Spritefont objects):

    Video: https://streamable.com/q1rub

    We're still working exclusively with C2 games, but at least the door for C3 games is open now :)

  • mikehive: Sorry for the delay! We're working on a number of different Construct 2 projects, so it's been a busy week. Replied by mail :)

    For everyone else listening, it might be a good idea to include the following in mails you send to me:

    - Breakdown of the game/your studio (link to a website is fine)

    - Potentially a demo (or even better, a .capx) I can take a look at

    - Is there a publisher involved, or is there a budget for ports?

    - Release schedule/plans

    - Potential target platforms

    I hope that wouldn't be too much work to put together! I'm aware that porting is just one of the things you might be looking into, but it will help me understand if I will have time to put your game on my schedule. Some people send me brilliant examples of the above, which makes it easy to start a discussion without too much back and forth :)

  • BBaller1337

    The timeline for ports depends on our current schedule and other things. Looking through my mails, I don't think I see yours? You can send me another mail and hopefully I'll see it this time. If you didn't already, please be sure to include an introduction of yourself/your game/your current plans, just so I have some key points I can use.

  • Macbee

    I see! I'm always fascinated by people doing their games in Construct Classic. You're a very rare breed by now, haha.

    InvaderXYZ

    I think you misunderstood! I was pointing out how you could estimate a budget if you were to do ports from scratch. Maybe your estimate would be accurate if you were doing just that, but of course, the point of Chowdren is to reduce both time & cost needed for Construct ports.

  • Try Construct 3

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

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

    The speedup when using Chowdren with Clickteam Fusion is about 7.7x (where the standard runtimes are also written in C++). Admittedly, I don't actually have any data for this, but I would expect the speedup when using Chowdren with Construct Classic to be similar. Do you happen to have a game made for Construct Classic? :)

    InvaderXYZ

    Hey! Sorry, it looks like your mail got lost in the noise. I remember you had a very small budget for ports, and I'd like to point out that porting is a serious endeavour, requiring many work-hours and time on my part.

    I think I need to spend some time to explain, just to set reasonable expectations for smaller developers.

    If you were to do the port yourself, you can estimate a ballpark cost. In the most ideal situation, a port would take about one or two months to do. You would likely need to hire a senior engineer that has some knowledge of cross-platform development. If you look at the average salary of a senior engineer in your area, you could start approximating the budget for a port.

    I get at lot of emails a day about Chowdren, both regarding Fusion and Construct. Ideally, I would be able to respond to everyone, but usually, I need to prioritize publishers or developers that have at least considered the above.

    For developers who do not have a budget for ports, there is still the possibility of revenue share or recoup, of course. In that case, you need to have a strong case for your game, and why revenue would be able to cover the cost of porting instead.

    I do not want to discourage anyone from contacting me, since if your game is excellent, I will definitely be in touch! However, I will have infinitely more time to spend on someone who have researched what porting entails, who have already had their game approved for release on consoles, and so on.

  • I was referring to the community Discord server, which skymen linked to above :)

    Cryptwalker

    I'm busy with gamescom at the moment (we're showing off Baba Is You on Switch!), but I will see if I have some more time once I get back.

  • Another update: on some platforms, we can get rid of temporary framebuffers entirely for effects that do not use cross-sampling. Most effects do not use cross-sampling, so this significantly improves the performance of effects, especially popular ones like Overlay and Screen.

    This is achieved by using memory barriers on platforms that support it (such as console platforms, and Direct3D 11/OpenGL with glTextureBarrier). This allows us to read a texture while writing to it at the same time, so a temporary framebuffer isn't necessary. WebGL does not support memory barriers, which may be a reason why the regular Construct runtimes do not perform this optimization.

    As described in the effect compositor writeup from Ashley, objects sometime require predrawing in the standard runtimes, such as when objects are rotated. By using the right texture coordinates for the background texture, we can also skip this step, removing another case where temporary framebuffers are used.

    In Chowdren, there are now only a few situations where a temporary framebuffer is required:

    • When a layer has 'force own texture', is not fully opaque, or uses an effect, a temporary framebuffer is needed to render the intermediate result.
    • When an object uses a cross-sampling effect (such as WarpMask, WaterBg), a partial copy of the background is made.

    Headbang Games

    Please check your inbox :)

  • I have some news: Chowdren can now automatically merge effects together. This means that most of the time, Chowdren does not need an intermediate framebuffer to render objects with effects, which the standard runtime will have to do in many cases. If you use a lot of effects, you can expect this to yield some large performance gains.

    With the effects merging feature, there is also support for most Construct effects now.

    Technical details

    Consider two GLSL fragment shaders as follows:

    // shader 1, constant multiply
    void main() {
     gl_FragColor = texture2D(texture, texture_coordinate);
     gl_FragColor.rgb *= 2.0;
    }
    
    // shader 2, monochrome
    void main() {
     vec4 col = texture2D(texture, texture_coordinate);
     col *= vec4(0.299, 0.587, 0.114, 1.0);
     col.rgb = vec3(col.r+col.g+col.b);
     gl_FragColor = col;
    }
    

    Now, consider the result of applying shader 1, followed by applying shader 2. When shader 2 calls texture2D on texture, this is actually the result produced by shader 1. Therefore, if we wanted to merge these shaders together, we could do it as follows:

    vec4 temp_color_1;
    vec2 temp_coord_1;
    
    void main_1() {
     temp_color_1 = texture2D(texture, temp_coord_1);
     temp_color_1 *= 2.0;
    }
    
    vec4 sample_1(vec2 tc)
    { temp_coord_1 = tc; main_1(); return temp_color_1; }
    
    void main_2() {
     vec4 col = sample_1(texture_coordinate);
     col *= vec4(0.299, 0.587, 0.114, 1.0);
     col.rgb = vec3(col.r+col.g+col.b);
     gl_FragColor = col;
    }
    
    void main() { main_2(); }
    

    When running this through glsl-optimizer, we get the following result:

    void main ()
    {
     vec4 col_1;
     col_1 = vec4(0.598, 1.174, 0.228, 2.0) *
     texture2D(texture, texture_coordinate);
     col_1.xyz = vec3(col_1.x + col_1.y + col_1.z);
     gl_FragColor = col_1;
    }
    

    As you can see, the merged result is quite optimized, and we would expect this to be much faster than using temporary framebuffers.

    There are still some cases where we will need temporary framebuffers. For example, for large effect chains using complicated shaders, most shader compilers will choke on the merged result. For the games I've looked at, this has only been a problem with the following effect chain:

    noisemask, lottes, blurhorizontal, separatechannel, separatechannel, hsladjust

    The culprit here is Lotte's CRT shader, which is a large shader.

    To be fair to the standard C2/C3 runtimes, even though this optimization would be nice to have in them, I can see why it wouldn't be feasible to implement. For example, some users may depend on some very specific behavior from the renderer, and this could be a non-backwards compatible change. Also, dealing with large effect chains (like the one above) may not be straightforward.

    InvaderXYZ

    Please check your inbox, you should have received a reply!

    Cryptwalker

    Thanks a lot! I will take a look when time allows :)

    NetOne

    Nice! I feel Iconoclasts definitely deserves all the praise it has received.

  • In related news, our port of Iconoclasts (made in Construct 1) is releasing on Nintendo Switch on August 2!

    I hope we can announce some of the Construct 2 games we are working on soon as well.

    elliot

    For now, I won't make benchmarks available here. You can contact me by mail or on the Discord server if you'd like more info.

    In general, Chowdren is significantly faster than the standard runtimes. However, making specific numbers available would undermine the fact that the standard runtimes are viable for the majority of users. Ashley & team are doing a great job of identifying performance hotspots, as can be seen in their work on the expression compiler.

    Cryptwalker

    You can send me your project on e.g. the Discord server. Hopefully, I'll have time to take a look soon!