Author Topic: DAME - a new map editor made using flixel!  (Read 225021 times)

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #440 on: Sun, May 1, 2011 »
There aren't too many tutorials on how to write code to load multiple levels with DAME, but mainly because I've seen so many people use different methods for this.

The complex Claws sample does show one method of doing this. If you look at it, basically it sets up a large box shape with a custom property called "target" that contains the value "Area2". (You can see the property defined when you go into selection mode and click on the shape). In the code all the shapes are loaded and those who have a target property will load the group whose name contains the value in the properties when it detects an overlap between the player and the shape. The section of the map to the right does not exist on start up and will only load once you enter that shape. You can of course put whatever data you want in the properties and make it do whatever you want.

If you wish to fully switch levels then I've not looked into that myself. I imagine one way would be to switch to a new play state, passing in the desired room to the play state's constructor or storing in a global value somewhere.

choifish

  • Member
  • **
  • Posts: 19
  • Karma: +1/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #441 on: Sun, May 1, 2011 »
^ Yep, that's how I do it. When I load the playstate, I check for a flag in my Registry (see Photonstorm's Flash Game Dev Tips) that says that we should be switching levels. If not, then I go ahead and load the correct level from the save file and grab the player properties from the save as well. When the player enters a door, I store the player's current properties like health, but with the new x and y coordinates in the Registry, set the aforementioned "switch level" flag to true, and store the string of the new level. Then I reload the playstate. It sees that that we are making a level transition and loads the new level and player properties from the Registry.

Works perfectly.

thechaosengine

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #442 on: Sun, May 1, 2011 »
^ Yep, that's how I do it. When I load the playstate, I check for a flag in my Registry (see Photonstorm's Flash Game Dev Tips) that says that we should be switching levels. If not, then I go ahead and load the correct level from the save file and grab the player properties from the save as well. When the player enters a door, I store the player's current properties like health, but with the new x and y coordinates in the Registry, set the aforementioned "switch level" flag to true, and store the string of the new level. Then I reload the playstate. It sees that that we are making a level transition and loads the new level and player properties from the Registry.

Works perfectly.

That sounds like a great way to go about it! I've been looking at Photonstorm's dev tip on using a registry but my attempts to adapt the examples given to switching levels aren't going anywhere. Would you be willing to share what your Registry and PlayState look like to get a game to switch between 2 levels? I'd really appreciate it.

berrinsun

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #443 on: Tue, May 3, 2011 »
Quote
Would you be willing to share what your Registry and PlayState look like to get a game to switch between 2 levels? I'd really appreciate it.

I'd really appreciate it too, I've been having trouble with switching levels...

osro

  • Active Member
  • ***
  • Posts: 121
  • Karma: +1/-0
    • View Profile
    • Purppura
Re: DAME - a new map editor made using flixel!
« Reply #444 on: Wed, May 11, 2011 »
I'm not sure is this already mentioned here, but when running DAME on OSX the tiles panel won't show up whatever I do.

On Windows computer it pops out right when I click the Map layer.

Also on OSX DAME seems to eat almost all CPU resources and feels very laggy.
On Windows it takes around 50%.

OSX
http://imageshack.us/photo/my-images/685/screenshot20110511at614.png/

Windows
http://imageshack.us/photo/my-images/695/dameusage.jpg/ < that usage it's almost all from DAME's process.

And those are just after you have started DAME from scratch.
« Last Edit: Wed, May 11, 2011 by osro »

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #445 on: Sun, May 15, 2011 »
Hmmm... I've not heard of the tiles panel not showing in a long while. A bug was fixed with that on a much older version. Is it just the tiles panel, or do other windows not show at all? (tile matrix, brushes etc?)

When version 2 comes out (very soon, I promise!) Some of these windows will be handled with a new system, so it's possible it will be fixed. Of course it's also equally possible a million new bugs will be introduced!

I am aware of CPU issues, but none that occur as soon as you open DAME - only when dealing with huge projects - I take it that you get the lagginess even when starting DAME with an empty project? What is your RAM/CPU speed on Windows? Are you on the latest versions of Air?

osro

  • Active Member
  • ***
  • Posts: 121
  • Karma: +1/-0
    • View Profile
    • Purppura
Re: DAME - a new map editor made using flixel!
« Reply #446 on: Sun, May 15, 2011 »
Hmmm... I've not heard of the tiles panel not showing in a long while. A bug was fixed with that on a much older version. Is it just the tiles panel, or do other windows not show at all? (tile matrix, brushes etc?)

Just the tiles panel not showing up. And this happens only on OSX.

I am aware of CPU issues, but none that occur as soon as you open DAME - only when dealing with huge projects - I take it that you get the lagginess even when starting DAME with an empty project? What is your RAM/CPU speed on Windows? Are you on the latest versions of Air?

Air version is 2.6.0.19140 on both.

Mac is 2.4Ghz Core 2 Duo / 4GB RAM
Windows machine is i5 560 / 4GB RAM

Ye, straight from the start with empty project.

lnBetween

  • Member
  • **
  • Posts: 59
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #447 on: Fri, May 20, 2011 »
Is it just me or when we zoom out completely using the mouse scrolling wheel the image becomes a mess?

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #448 on: Sat, May 21, 2011 »
It's not just you - zoom out beyond 100% is unreliable because I have to render the scene 4 times due to it being very slow to draw huge scenes in Air. It will be worse the more complex your scene is (ie multiple layers of different types). So by rendering it 4 times, split over different frames, it will cope most of the time, but as more is visible it also has to process a lot more objects. Until Molehill goes public that will always be the case.

That's why the 'use at own risk' comment is next to the allow zoom out menu option and it's not turned on by default.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #449 on: Wed, Jun 1, 2011 »
DAME version 2 is finally out!

It's gone through beta testing but keep backups just in case.

New features are:

  • Certain windows (tile palette, sprites, layers and properties windows) are now dockable.
  • Isometric tilemap support - support for diamond, staggered diamond and skewed. Tile matrix and brushes all still work as expected with these layer types.
  • Tilemaps can have height.
  • Tiles can be stacked on top of each other.
  • Improved visuals for selected tiles.
  • Improvements to drawing on tilemaps.
  • Can draw lines on tilemaps.
  • Flood fill for tilemaps.
  • Can select, move and scale regions in tile drawing mode.
  • Can copy and paste in tile drawing mode.
  • Eraser when drawing on tilemap images is now a separate mode.
  • Right click when drawing brings up context menu.
  • New configurable 16 colour palette for drawing.
  • Tiles can be animated.
  • Can have per tile properties.
  • Can repeat tilemaps on individual axes.
  • Can use any system font for text boxes.
  • Can use bitmap fonts for text boxes.
  • Increased undo history.
  • New Sprite Trails - automatically populate a path with a series of sprites.
  • Sprites can be automatically sorted for depth.
  • Sprites can use a Z value for height placement.
  • All object layers can be aligned with an isometric tilemap layer to allow exported positions to be relative to the tilemap's 'real' coordinate system.
  • Aligned shapes on shape layers will rotate/skew to fit the tilemap shapes.
  • Can change the frame for any sprite to be different from the sprite entry.
  • Tile sprites are now spritesheets - can scale and translate the image within.
  • Can rip an image to create a tilemap layer and tileset.
  • Choice of themes for DAME.
  • Importing dam projects with sprites improved to find pre-existing matches in current project.
  • Can save sprite entry lists separate to a .dam project as a .dsf (DAME Sprite File), allowing you to have multiple sharing one list of sprites.
  • Can move an entire group in real-time.
  • More of the session is saved in a .dam file allowing you to resume editing where you left off much easier.
  • Tiles now preview in tilemap layer properties window.
  • Can gives shapes different colours.

As a safety measure after the update, version 1.3.1 is still available from this link:

http://dambots.com/games/dame/DAME_1_3_1.air

If you have any bugs then post them here or send me a message and I'll do my best to fix them...

Gilda

  • Active Member
  • ***
  • Posts: 123
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #450 on: Wed, Jun 1, 2011 »
Dame seems to delete my matrix when I save and close it, well I can see the matrix there in the .dam file with I open it with notepad, but it doesn't seems to read it. :/

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #451 on: Wed, Jun 1, 2011 »
Can you send me a private message with the .dam file?

Strip out what is unnecessary if you wish - and I shouldn't need any assets either.

Thanks.

choifish

  • Member
  • **
  • Posts: 19
  • Karma: +1/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #452 on: Wed, Jun 1, 2011 »
Just wanted to let you know that your work does not go unappreciated. When my game is finished and (hopefully) makes some sponsorship money, I'll be sure to donate. Thanks for all of your hard work!

Gilda

  • Active Member
  • ***
  • Posts: 123
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #453 on: Wed, Jun 1, 2011 »
Can you send me a private message with the .dam file?

Strip out what is unnecessary if you wish - and I shouldn't need any assets either.

Thanks.

Oh it seems to of worked this time, I think it might of been me moving a file from DAME to DAME2.

goshki

  • Active Member
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
    • Vigeo Games
Re: DAME - a new map editor made using flixel!
« Reply #454 on: Wed, Jun 1, 2011 »
I haven't used DAME earlier (or rather - I tried but failed though) but today I gave it another shot and... well, I must say, I am amazed! I did a quick test of stacked tilemap layers with tiles with heights and it went pretty straightforward. Great tool! :D

Vexhel

  • Member
  • **
  • Posts: 30
  • Karma: +0/-0
  • Huh?
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #455 on: Thu, Jun 2, 2011 »
Very nice!
I can't seem to be able to attach a sprite to a path anymore tho...

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #456 on: Thu, Jun 2, 2011 »
Very nice!
I can't seem to be able to attach a sprite to a path anymore tho...
Well spotted! I'll have a fix coming soon. I'll also try and add some documentation for the tile stacking too since there's nothing on that yet.

XanderXevious

  • Contributor
  • ****
  • Posts: 360
  • Karma: +0/-0
    • View Profile
    • Deadly Alien Microbots
Re: DAME - a new map editor made using flixel!
« Reply #457 on: Thu, Jun 2, 2011 »
Version 2.0.1 released.

  • Fixed bug where you couldn't attach sprites to paths.
  • Added help documentation for tilemap stacking.

choifish

  • Member
  • **
  • Posts: 19
  • Karma: +1/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #458 on: Fri, Jun 3, 2011 »
Spotted a bug, addTilemap() in BaseLevel switches around the collide index and draw index when calling loadMap().

xhunterko

  • Contributor
  • ****
  • Posts: 449
  • Karma: +0/-0
    • View Profile
Re: DAME - a new map editor made using flixel!
« Reply #459 on: Fri, Jun 3, 2011 »
Some feature requests since I seen you didn't have any last I checked:

Ability to create a line of tilemaps. (for walls and floors)

Ability to export as png.

Ability to have negative collide indexes. (for scenery and backgrounds for those of us who like to export txt files for tilemaps and for foreground scenery usage)
Now on twitter: http://twitter.com/xhunterko I made a game that's in alpha you can buy here: http://xhunterko.itch.io/wave-miner-alpha