User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 36

Thread: Level editor that uses MMF2's own frame editor

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Level editor that uses MMF2's own frame editor

    I created an example for a level editor that does not use its own level building interface, but instead makes use of MMF2's own frame editor. You can rearrange the background objects however you like in the first frame, then in the second frame it loads the level from an ini file. To compile the level first, simply run the application. This can save time since you don't have to build your own layout interface from scratch. It works by running a fast loop, picking objects at random and recording their type and position, then deletes that object. It keeps running the loop until there are no more objects to record.


    Extensions used are Ini++ v1.5 for storing level data and the Platform Movement Object (simply for testing purposes as a platformer game). I commented the events, so it should be fairly straightforward. Important notes; you can change the file name for the level in the global strings properties, and object type is stored in the active object's alterable values. This is important when adding your own objects, they use alt values for unique identifiers. I also have it set up to save the levels in the same directory as the mfa file, you can change that in my events if you want it elsewhere.

    Hopefully some of you will find this useful. Please notify me of any problems. I have it fully working and I didn't find any issues with it however.

    Edit: For learning purposes, I left the ini file open for you to look at how the data is stored. Ini++ allows you to easily save it as an encrypted file if you don't want people playing around with your level layout. I also just noticed that in the level loading, I had the center dirt tile pasted into the background with obstacle collision. This is unnecessary for that tile type since it won't be touched by the player (not sure if that really matters for performance reasons, but thought I'd point it out).
    Attached files Attached files

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,729
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    This is unique for me and thanks for sharing Shawn. I will be adding this to my website in the next 99 years. LOL

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nivram View Post
    This is unique for me and thanks for sharing Shawn. I will be adding this to my website in the next 99 years. LOL

    Marv
    Thanks Marv! It didn't take me too long to complete, did it this morning. The one thing I dislike about level editors is setting up the interface for placing objects so I developed this method instead. For large levels you'll need to increase the maximum amount of allowable objects from 500 in the frame properties since it uses actives for placement. The actual level loading itself though does not use a ton of actives. It creates and pastes objects into the background on call as it runs through the loop so there should be no performance issues.

    Also, I noticed some unnecessary lines in the ini code. I had used "Object"+" "+Str$(Object Count) for some reason instead of just "Object "+Str$(Object Count). I think that was a by product of some string parsing idea I had. Not a big deal, just could have been done a bit more correct. I attached the edited version to this post even though it's not really a big deal at all. Still works anyway. Just didn't want to confuse some people wondering what that's there for lol. I also fixed the center dirt tile to be pasted as a non obstacle. Unfortunately I can't edit the original post anymore to update it with the fixed version.
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I have uploaded an enhanced and streamlined version of this editor. In the previous build for level loading, I had it create active objects for the various tiles to be pasted. This update changes all of that to use one active object for loading. It now switches that active's animations to an animation representing which tile to paste, then pastes that image. This way you don't have a bunch of unnecessary active objects in the level loading portion of your game.
    Attached files Attached files

  5. #5
    Clickteam Clickteam
    Simon's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    2,642
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Nice work Shawn, I'm sure this will spark a lot of people's imaginations :-D

  6. #6
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks Simon! I'm experimenting with this in a project I'm working on. Copying and pasting the level loading into a game is simple, but the one thing you have to make sure of is that the global values match the order from the level editor. So you'll want to add those globals first before any others in a game, or you'll have to go through the events and change everything. And of course make sure the required objects are copied to your game before copying the events. I guess that's common sense, but rookie mistakes that will break the engine lol. The smartest thing to do would be just copy the entire frame before actually beginning work on your game. I had to retro fit this to work in my existing project which was a bit of a pain.

    I might add layer position to this at some point to handle multiple layers too, but I'm sure people can easily build on this example themselves. I also could have just as easily used the regular ini object, but used ini++ for the encryption.

    One problem with this level building method however is that you must keep all of your level layouts saved in different frames if you want to be able to edit them again later. Since you're using the frame editor for the layout, you can't just simply load a file to edit.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Tisnart's Avatar
    Join Date
    Feb 2008
    Location
    On, Canada
    Posts
    1,030
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hey this is pretty cool Shawn.
    I tried to make a scrolling level and noticed a couple of things.

    1. Because you use "Paste image into background" instead of "Add Backdrop" the pasted tiles are destroyed if (or when) outside of the frame.

    2. Also, I had to uncheck "Destroy object if too far from frame" from all the objects properties, otherwise any objects outside of the frame obviously don't get created upon loading

    Once I did those two things I was able to make a nice large scrolling level....Nice work and thanx
    I will keep playing around with it.
    Gerald

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,112
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    hah I can't believe I never thought of making a level editor this way, nice idea!

  9. #9
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hey gerald, thanks for pointing that out! I'll have to edit that and upload a new version

    Okay, I just fixed it so it should work now. Example has scrolling as well to test that. I also gave you credit in the notes for pointing the errors out. I don't know why I used paste image instead of add backdrop. I always used add backdrop in the past, my brain is slipping lol. I probably should have just went ahead and adjusted the maximum amount of allowable objects too so that way someone making a large level doesn't have their objects disappearing, but I guess that's easy enough to figure out. Another item I should add in the future is storing the virtual width and height and setting that upon loading the level. Currently, if you have levels of varying sizes, you'll have to adjust that yourself in the events. I could have it set up so the level editor handles all of that itself.
    Attached files Attached files

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Tisnart's Avatar
    Join Date
    Feb 2008
    Location
    On, Canada
    Posts
    1,030
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    No prob But you never have to give credit to me just happy to help with such a good idea.

    I had a couple more thoughts on this.(I haven't tried these myself yet, just thought I'd throw them out there)

    1. Different frame sizes, it would be nice to record the frame size and then load that also.
    Lets say I want to make many levels at various frame sizes Level 1 may be 2000 x 640, Level 2 at 2800 x 640, etc.

    2. Adding active objects and not just backdrop obstacles. Say you wanted to record and load moving platforms, coins, etc (You get the idea). You would then have to not only save their position and image but any Alterable Values, animations, etc. Not that this would be hard to incorporate on an individual basis I'm just thinking outloud


    The more I ponder this method the more I like it and see some of the benefits of it (at least for me personally)
    One problem with this level building method however is that you must keep all of your level layouts saved in different frames if you want to be able to edit them again later. Since you're using the frame editor for the layout, you can't just simply load a file to edit.
    This could be a very good thing as I tend to sketch out my levels anyway so also saving these in frames like this would be a good way to go back edit them,etc.

    I really like the idea of creating levels in the frame editor like this, it just seems like it will be so much easier......hmmmm
    The only thing I can see as a con would be what you mentioned
    And of course make sure the required objects are copied to your game before copying the events.
    and perhaps doing #2 as mentioned above....but are they actually a negative thing

    Anyways just some personal thoughts and I'm done blabbing (for now )

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. open both event editor and frame editor
    By Mook06 in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th January 2010, 09:26 AM
  2. Bugs in MMF2's Frame Editor
    By Jaffob in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th May 2009, 01:23 AM
  3. Open Frame Editor and Event Editor at same time
    By juanjo in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th April 2008, 05:53 PM
  4. Open Event Editor and Frame Editor for same frame?
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th March 2008, 06:03 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
  •