Construct 3 suggestions & ideas

Suggest and vote on ideas for Construct 3! Please note this is only one aspect of planning. We do not guarantee any features here will be implemented, even if they are top-voted ideas. The aim is just to collect feedback. Remember to search for existing submissions before adding an idea, describe your ideas as comprehensively as possible, and vote for plausible ideas that are well thought out. Please see our full guidelines on suggesting features.

108 VOTE

[Construct 3] Function Advanced :: Call Function on event sheet

Hello Construct Team. I have a feature request that won't require much time to add and if you wanted to, you could even add it immediately on the next release. With that said, this feature would still be very beneficial with developers who have complex projects.
I have a sample Construct 2 plugin that might be a good basis on how it could be achieved and to show its practical use. Although I expect improvements from Construct team as it will be an official feature.

The feature is the action "Call Function on Event Sheet". This eliminates the need to include an entire event sheet just to call a function from another event sheet. This would be very useful for complicated projects that require branch events. Games with Multiplayer, Open-World, Map Generator, Procedural Generation or any large projects that requires complex and modular game management and in-game design.

Thank You.

-ChadoriRebornXD

  • Chad Joseph Nuñez
  • Jun 5 2018
  • Too vague
  • Jul 2, 2018

    Admin Response

    Event Sheet includes were designed specifically to make it easy to include the same set of events across multiple layouts. A well-designed project should have a "common" event sheet for logic re-used across layouts, and this is a good place to include a sheet of functions so they are available everywhere you need them. This should be easy and straightforward; if you need to rearrange your project to do this, you'll probably find it's better designed afterwards.

    Since nobody appears to be able to explain any downside to this approach (see comments), we can't see any reason to support this at this time. Additionally adding slight variations on basic features like calling functions is potentially confusing for new users who will need to figure out which alternative they ought to use, which involves explaining the subtleties of each to them, which slightly raises the difficulty level of using the software. Therefore we need very good reasons to "split" core features like this in to variants that do slightly different things.

  • Attach files
  • MissionGames Corp commented
    June 13, 2018 14:44

    Please make this happen! Event includes become messy overtime and the only way to do it around is to make more event sheets. +1

  • Zach Smith commented
    June 13, 2018 14:48

    This will make things easier.

  • Ian Malby commented
    June 13, 2018 15:04

    This will really be very useful to Construct 3 users. I do appreciate if Scirra will support this feature on the next few C3 releases. Looking at the given plugin being able to call functions from another event sheet would really help in avoiding include loops. And I actually have experienced this myself on my projects in Construct 2. If only I have found this sooner, then I wouldn't have those problems. 

    I tried converting this but it didn't work.

    Benefits I have found:
    1) This will avoid those complicated 'looping includes'.
    2) Less number of event sheets. To separate functions from local event sheets to avoid misfire.
    3) Use as a global initialization for each independent event sheets without including the entire event sheets for better management and prevent accidental misfires and better troubleshooting.

  • Chad Joseph Nuñez commented
    June 14, 2018 02:38

    Yeah. Those are some of the benefits with this feature. The reason it can't get ported to Construct 3, is that the SDK for the function features is unavailable. And some key features like the 'cf_fasttrigger' is not documented too and possibly never will be.

    I do have an additional feature request, if it's alright to have an easy indicater if it's able to call or receive from another event eventsheet.

    In the case on Construct 2, I replaced the icon color to 'red' to easily determine a local function and a function_advanced.

    But not that it filters out local function and function_advanced, it is just a guide which has an external reference, it is just a event making convention to easily identify which is which.

    Thanks.

  • Admin
    Ashley Gullen commented
    June 17, 2018 11:36

    It's not clear to me why this is so important. What's the problem with including an event sheet of functions? A well-designed game would probably have a "common" sheet with logic used across all gameplay layouts, and if you include your functions there, then aren't all your functions always included anyway?

    BTW please don't claim that something is quick or easy without knowing the engine internals - functions use a very specific and pretty complicated separate path through the event engine which also involves some special coding in the editor too. It is not necessarily easy to change, particularly while avoiding any performance regression to existing normal function calls (even a small extra check in the same path could noticably regress performance in some benchmarks). There are a lot of tradeoffs to be weighed up. While this blog post is not directly relevant, I think the sections on experienced vs. inexperienced engineers and social co-operation are relevant: https://www.construct.net/blogs/ashleys-blog-2/blame-in-technology-and-the-aardvark-case-948

  • Chad Joseph Nuñez commented
    June 18, 2018 06:26

    Is that so? Well. In the first place, no one knows the internal of Construct 3. I just assumed Construct 2 is near the same architecture, just Construct 3 is better and improved on the editor side and in the runtime too in the future.

    I understand what you imply. And I don't claim to actually understand something I can't read inside but please do understand that I did not mean it that way.

    As I would also suggest, that we, the users have used your event sheet system for years. So, when it comes to being organized in Event Sheet systems, I think we do know more a lot about those things. My case, is that in the long run, we do need this to be able to read long and modular events easily.

    Thank You, again. 
     
    Anyway, I actually ended up starting redesigning my project from ground up to make it happen, but it is not as organized as it was before. Which was a +1 for Construct 2.
    It's a long process but I don't expect to get a plugin port to Construct 3 soon.

    But for future convenience, please do think about this more and reconsider.

    Thank You.

  • Admin
    Ashley Gullen commented
    June 18, 2018 09:50

    You've still not explained why you're not using a common event sheet. What are you doing instead?

  • Chad Joseph Nuñez commented
    June 22, 2018 00:13

    Hey Ashley, sorry for the late reply.

    The thing is that you won't have problems if your game logic is linear. Modular game design is very confusing overtime when events reach 20,000+. Each with its unique features. If all functions are global, and not near their required module, it becomes very hard to read in the long run.

    It's not that it isn't possible to put them all global. Just hard to read and may take longer to analyze. Like in my case with a 2 year project, I had events that I made last year that is understandable to read now but still needs a recap to fully understand what I have previously written.
    So, if I do this with all functions global, I would require to make quite a long documentation for each module.
    But not only that. I would have spaghetti 'include' events. 1 Event Sheet per module would become 4 Event Sheets per module. With for example, 'Initialize', 'Server Connect', 'Local Features' and 'Functions' (If Functions are Separate Event Sheet per module).
    Imagine having at least 30 modules, it would be haywire. Especially with cross includes. That is very hard to manage.
     
    It's easier with Programming Languages with Objects. But since Construct 2 / Construct 3 don't have block scopes aside from groups and adding them might break previous projects. This might just be the solution we need.
     
    Most Construct users don't understand this yet since they are still either new or not engaged to larger projects.
    I can't blame them as also I am surprised that I even needed this in the first place, I just learned it the hard way. But eventually , this could become needed for better event organization if someone were to engage with larger projects.
    And Construct 3 editor and runtime is getting better and inviting people to take the challenge in creating larger projects.
     
    For your question on how I am doing it instead, I am doing it with the method I stated above.
     
    Thank you for your time.

    P.S. I can't blame you if you don't implement this, I also think the APK Expansion Files or the New Runtime should be prioritized.
  • Admin
    Ashley Gullen commented
    June 22, 2018 10:55

    I still don't really understand why event sheet includes don't already cover this. They were specifically designed to solve this in an easy way.

    If you have 30 includes on an event sheet per layout, then can't you simply move those to a "common" event sheet, and include the common sheet instead? Then you can probably reduce it to a "common" include and maybe 3 or 4 other layout-specific sheets.

    Or are you saying you have 30 includes per layout, and they are all different every time? If so, why? The vast majority of projects I've ever looked at never needed to do anything like that. What kind of game is it and how is it designed that you'd need to have so many different includes on every layout that are never repeated between layouts?

  • Emmanuel Rubio commented
    June 29, 2018 14:45

    Chad:
    Option1 Function event sheet:
    - New Event Sheet
    - Put all your Functions there,no other events, just functions.
    - Include it in all your other event sheets.
    - Done.

    Option2 Create your own functions:
    - Learn to use groups and sub grups and how to activate and deactivate them
    - Learn how to use arrays, and dictionaries, and the potencial use when spawning them ingame
    - Functions are basically repetitive events with the posibility to share results between algoritms. You can create a "function" events sharing results in arrays or dictionaries.
    - Be organiced and logic as fuck.
    - Done.

  • Admin
    Ashley Gullen commented
    July 2, 2018 09:55

    Nobody seems able to explain the shortcomings of the include approach, so marking this as "too vague".

    I'd add that it looks like this suggestion has been specifically targeted by an unusually large number of voters in a relatively short time. It is probably not useful to do this before the suggestion is clearly thought through and all the alternatives (such as using includes) weighed up. The best way to get quality new features implemented is to co-operating with us to ensure ideas are feasible and valuable, rather than seemingly trying to force the case with ballot stuffing.