User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: An update from me...

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    An update from me...

    Part 1 : Edif

    First of all, I'd like to announce my new SDK for MMF2 extension development. It's called Edif - "Extension Development Is Fun".

    Extension development has always been very much centred around tedious population of the info tables, resources, menus and jump tables, with a low proportion of the time actually spent on writing the code.

    In 2007, Villy and I made an attempt to rectify this with a new, macro-based SDK for MMF2 based on some earlier work by Turboferret, called rSDK. Although rSDK sped up extension development a lot (nearly all of my extensions have been rSDK extensions, and that's around thirty now) it introduced a new set of problems of its own.

    rSDK extensions didn't work with Visual Studio's intellisense due to heavily use (abuse, maybe) of macros. They were also impossible to translate since the strings weren't part of the resources (all official CT extensions are translated to French, so I haven't been able to use rSDK for, say, the Mochi extensions), and many bugs have been dug up over the years, such as crashes in nested expressions. rSDK also didn't solve the problem of the LPRDATA (rdPtr) structure not being allocated properly, so you still had to store everything as pointers, create them in CreateRunObject, and delete them in DestroyRunObject.

    Another problem common to the normal SDK and rSDK is that code reuse is impossible, without writing your extension in a class and having the actions/conditions/expressions as simple wrappers (more tedious wrapping work). Actions/conditions/expressions can't call other actions/conditions/expressions, because the parameters aren't real C++ parameters - they're provided via special functions (CNC_GetParameter*, wrapper with Param() and ExParam() in rSDK).

    Edif is my attempt to solve this situation. With Edif:

    * Your extension is a simple C++ class. Actions, conditions and expressions are member functions, with real parameters and real return types. They can call each other (obviously) and you link them to be used as the actions/conditions/expressions by calling, for example, LinkExpression(0, MyExpression) in the constructor of your extension class, to link the member function MyExpression to expression ID 0.

    If MyExpression took a float parameter and an integer parameter and returned a float of the two added together, it'd look like this:

    Code:
    float Extension::MyExpression(float MyFirstParameter, int MySecondParameter)
    {
        return MyFirstParameter + MySecondParameter;
    }
    All the GetParameter stuff, setting the flags, and giving the return value back to MMF, is handled by Edif. It uses assembler code to dynamically push the action arguments so that they arrive as real function arguments, and call the action function in the Extension class.

    * Since your extension is a real C++ class, you simply add what you want to store at runtime (which would normally go in rdPtr) as class members. The constructors/destructors will be called properly, and you can access them without putting rdPtr-> everywhere in your actions, conditions and expressions.

    * The Extension class (and the edittime stuff, which is the same in Edif as the normal SDK or rSDK) is the only thing inside the MFX file. Edif extensions also have an external JSON file (well, it's actually a slightly modified JSON syntax that doesn't require commas) which contains the object name, description, etc, and a description of each individual action/condition/expression and its parameters. It also contains the menu in a JSON-ified form.

    All the strings in the JSON file can easily be specified in multiple languages using a special syntax, and Edif will automatically detect if the current version of MMF is English or French, and choose the appropriate string. UTF-8 support for the Unicode version of MMF is planned.

    This leads on to...


    Part 2 : AS Dynamics

    If you're a user of Flash runtime, you've probably been following/waiting for my AS Dynamics object, the "custom ActionScript" object.

    You'll probably be disappointed to hear that you're never going to see it. Here's why you shouldn't be.

    Flash Player can not interpret AS 3.0 at runtime. This means that an object along the lines of the Lua objects but for ActionScript is completely impossible. Any AS 3.0 code must be written at edittime and compiled into the SWF.

    To get around this and allow people to write custom AS code, I got Yves/Francois to add a special feature to build 250. The way the SWF exporter works is that it extracts the entire runtime source to a temporary directory, adds in all the extensions, and then invokes the Flex compiler to build it into a SWF. The new feature means that it's now possible for an extension to hook into this build process and modify the contents of that temp folder before the Flex compiler gets invoked.

    The AS Dynamics object let you write an ActionScript file, and then call functions from it in a manner similar to the Lua objects (push argument, call function, etc) at runtime. It did this by modifying the AS Dynamics extension ActionScript at build time, to tell it to import this ActionScript file and how it was allowed to call it.

    When this was nearly finished, I got assigned the task of writing the Newgrounds API object. After five or ten minutes with the standard SDK, I began to wonder whether it'd take much longer to write a new, quick to use SDK and implement the object in that. That's where Edif came from.

    Edif deprecated AS Dynamics, before it was even released. Because all the information about the extension is external to the MFX file, if you don't mind your extension doing nothing in the C++ version, you can just copy-paste a precompiled Edif MFX, write new JSON to describe the extension and its actions/conditions/expressions, and then implement them in ActionScript only. You can make an extension for the Flash runtime without even having a C++ compiler installed, let alone touching a line of C++. Extension development is now open to anyone who can code ActionScript - at least, when some tutorials have been written, anyway.

    Edif topic is over here

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Posts
    1,630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    So, technically it is now possible to port Box2D over to MMF2 with Edif?

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    It was possible before, if you had the Flash SDK. But yeah, you can do it without the Flash SDK with Edif.

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: An update from me...

    However, you at least need a list of actions/conditions/expressions with their respective ID. I'm sure Werbad wouldn't mind giving it out, though.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    I get excited about C++ extension development, then disappointment about AS3 for a small amount of time until i realized that was just runtime (i think), then excited about AS3 development and a new SDK all over again... Epic! It's like drama in a post.

    This is really great, i took a quick look at the new SDK and seems to have a great format/layout so i will have to test this as soon as i can. Looking forward to any tutorials and info also, this seems like it will be really cool.

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    This post will change my life.

    EDIT: Thank you, its a good change! I feel like I'll learn a lot more C++ with the new Edif!

  7. #7
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Apr 2008
    Location
    California
    Posts
    357
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    I'm not sure what this means, but I'm assuming that if it's built around classes, I can finally use classes without them falling miserably apart. Never the less I'm just glad theres a new SDK. Lets see those extensions lists expand.

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,840
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    Along with MMF2 loadup times

  9. #9
    Clicker Fusion 2.5 Developer

    Join Date
    May 2007
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    That was a really great idea and it opens a lot of doors to MMF2 development.

    Thank you for all your hard work, Jamie.

  10. #10
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: An update from me...

    awesome i gotta check this out, wish i saw it earlier

Page 1 of 2 1 2 LastLast

Similar Threads

  1. About update
    By Xenon3000 in forum Fusion 2.5
    Replies: 1
    Last Post: 14th October 2013, 02:04 PM
  2. the next update...
    By Sevennemesis in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 14th May 2012, 08:57 PM
  3. I cant update my MMF 2 Dev
    By MGEnt in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th October 2010, 04:48 PM
  4. possible update.
    By SEELE in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 1st February 2008, 03:35 AM
  5. [UPDATE] Onu V1.03
    By TwiTerror in forum Extension Development
    Replies: 2
    Last Post: 5th January 2008, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •