grossd's Forum Posts

  • In such discussions I wish you could consider making C2 open source

    Enthusiasts could then add features -- offloading work from you guys. But, would it then be possible for you to define a viable business model for yourselves to ensure that all the hard work you put into this is not lost (in a commercial sense) ...

    Dan

  • Also, i guess, a HUD would then go into an "inheritance layer" rather than replicate it across layouts.

  • I think an include layer would be indeed very good.

    You mention inheritance -- do you actually mean inheritance in the Object Oriented sense?

    I used to work (a long time ago) with a visual language (Digitalk Parts for Smalltalk), and visual components were in essence object instances (not unlike object type instances in C2), and you could freely subclass them, to add or customize specific behavior.

    For example, consider having a named (layer/include event sheet pair), which you can include in another named (layer/include event sheet) to add additional objects types and events. Perhaps this makes sense too in C2.

    Dan

  • Thank you spongehammer.

    The problem with Spawning is that they obscure the actual visual layout by pushing the layout elements into code. A key strength of C2 in my mind is that its visual programming which makes it easier to understand, program, maintain and change. This means that if you want to do reuse you have to move away from this paradigm.

    BTW, the keyboard is mostly spawned from one letter, but there are still layout specific design elements included.

    Dan

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • HI Ashley,

    Thank you for your prompt response.

    I can of course replicate the keyboard and other design elements across quiz layouts.

    But, I am going to include the keyboard in, say, 15-20 screens, and duplicate other kinds of design elements across various screens, and as requirements change, and they will change, since we are doing participatory design -- I have to redo all screens, one at a time -- all layout elements that can not be reused. Its tedious and error prone.

    It would have been nice if there is one location where I make the change and the change propagates across all layouts. Perhaps such modularity is not a strong requirements in game design, and my quiz game is unusual that it reuses design components across screens.

    Dan

    p.s. Also, i want to avoid parameterizing screens, and events, to facilitate reuse, since it reduces the readability of the event code, and there are always exceptions you need to deal with, which make things even more complex.

    EDIT: Also, i think the simplicity of C2 event coding, which I appreicate a lot, is lost to a greater extend when I parameterize for reuse. I've tried it, and then i found myself spending time debugging reuse code rather than improve the games themselves.

  • Btw, I understand that I can include events, and I am indeed making extensive use of "includes", for example, to "automatically" internationalize all Quiz screens. But, sometimes I need to include both layout elements and associated events, and C2 currently does not support such kind of combined reusable "components" "out of the box".

  • Thank you Ashley,

    What i am trying to do is to break down my quiz game into game "components" with which to construct quiz screens. A component would be in part layout elements and in part associated events.

    For example, I designed a visual keyboard (going from "A" to "Z", working in English and Hebrew), and want to include the keyboard in various quiz screens -- those for which an entry is required.

    So, instead of replicating the keyboard layout elements and event sheet across all screens, I want to include a keyboard component only, as a whole, in a new quiz screen.

    Using iFrame and HTML5 Messaging as implemented by the postMessage plugin seems to enable doing that. But, the overhead this would create may in the end be a bottleneck.

    Dan

  • Hi BluePhaze,

    (I just posted a reply but it seems to have gotten lost), so here again:

    Indeed, my question was about performance of exported games. I am wondering if there is a difference in performance if "games inside games" are run within one exported C2 game or whether each run in an iFrame.

    Daniel

    p.s. I would need to check the non-focus item you mentioned. I would want the game inside the iFrame be responsive at all time, not only when it has focus.

  • Hi Ashley, all,

    If i were to run one or many C2 games within a Game using the iFrame plugin, would this cause significant performance degradation?

    Why yes: because C2 runtime, runs two or many times in parallel, creating both memory usage and processing overhead

    Why no: because in the end all C2 game instances run on the same processor, and hence processing is time shared overhead is similar to running all games within one C2 game.

    Which argument is correct?

    If there is significant overhead could in principle the code be optimized to recognize multiple instances of C2 being loaded in a browser?

    thank you,

    Dan

  • OK. thanks.

    re: iframe composites

    So, Iframe within IFrame is not supported -- only one level of iFrame per C2 project.

    re: optimization

    Indeed something I haven't thought about: a C2 app running inside an iFrame imports all of the C2 runtime code again. I wonder whether browser optimize such things, since it appears to me that iFrame is in the end of the day a browser DOM construct, not an independent browser running in a browser -- at least according to my intuitive understanding of how iFrames might work.

    Dan

  • What is the ID used to direct a message to the page that includes the iFrame?

  • Hi Pode,

    Thank you for your prompt response. Can can you further explain the problem?

    What if each Canvas included in an iFrame is self contained and the only sharing with the "outer" canvas are events and messages.

    For example, I created a "virtual" keyboard and Entry Field to enter text. I'd like to reuse this functionality across several games/quizzes. So, I envision the keyboard to "live" within an I frame, and the linkage to the outer application is only via messages sent -- i.e. the complete text entered.

    EDIT: i.e. the application within the IFrame is treated as one object type in the "outer" application.

    Dan

  • Hi,

    I have been agonizing some time already that C2 isn't supporting "precompiled" C2 Layout/Event components and modularity -- what i believe to be a prerequisite to developing clean, reusable and scalable source code.

    But, I believe that I found a way to achieve it using adaptations of currently existing plugins. I would like to find someone with plugin development experience with whom I could jointly develop this to be shared in the C2 community.

    Here is the overall approach that seems to work:

    1. C2 would could be complied and then embedded in a C2 Project layout using Pode iFrames.

    2. Communication between the C2 project and project included in the IFrame would occur using HTML5 messaging such as implemented in the Pode's PostMessage plugin, which can send and receive message in event sheets using iFrame IDs.

    The C2Embedding plugin would offer additional features:

    1. the C2 project that embeds another project would provide the project a unique ID, which is then used in subsequent messaging to direct messages to the correct embedded iFrame C2 project . This could be provided as a parameter in the URL that links to the IFrame of the embedded C2 project would.

    2. a Dictionary could be used to specify the data interface between the main project and the embedded project. The Variable Dictionary would include "global" variable names in the embedded project that could be set or changed, which would then be reflected in the embedded C2 project.

    3. An Event trigger Dictionary could be used to indicate the events triggerable in the embedded C2 project -- or, in case of a lighter approach: an event with tag could be used to trigger events within the C2 project.

    4. the embedded C2 project could trigger events in the main project. A tags could indicate the event kind triggered.

    this is it, in essence.

    Having such a capability, would allow compiling C2 projects into "components" and have those components embedded and integrted in other C2 projects.

    i feel this could be very useful in better managing projects.

    Dan

    p.s. more thinking needs to be done to support special platforms such as node web-kit, how these access, load and run pre-compiled components in iframes.

  • Hi Pode,

    Is there a way to send a message to the C2 app that contains the iFrames (the main app in your case), rather than only between peer iframe apps?

    What i'd like to achieve is the ability to continuously exchange messages between an app in a frame and the main app, from setup and initialization messages to messages in response to external and internal events.

    thanks,

    Dan

  • Hi,

    Currently, web-nodekit only supports downloading text files. To save a canvas snap shot I added a bit of javacript inject code. You can download it here: http://wiki.goalorientedsolutions.com/d ... pshot_file

    Please be aware that due to some current discrepancies between web-nodekit in the preview and when exported, the save feature only works projects exported to web-nodekit.

    Dan

    p.s. thanks to emoaeden for encouraging me to package this in a capx.