Author Topic: v1.3 is up on github  (Read 8120 times)

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #20 on: Fri, Dec 11, 2009 »
My Flan map fails to show up in-game now (w/ v1.37).  No errors in Flex.  :-\

Does this have something to do with the new FlxTilemap?  Can anyone repro this?

I looked at how the tilemap was added in Mode, but wasn't sure what exactly I was seeing yet.
« Last Edit: Fri, Dec 11, 2009 by BullitSpeed »

Socapex

  • Active Member
  • ***
  • Posts: 156
  • Karma: +0/-0
    • View Profile
Re: v1.3 is up on github
« Reply #21 on: Fri, Dec 11, 2009 »
Might want to file a bug?
Free cake every day at #flixel on irc.freenode.net.
Use your favorite IRC client or  http://webchat.freenode.net/

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #22 on: Fri, Dec 11, 2009 »
I'm not sure if this is a bug or if I just don't yet understand how the new version handles Flan maps (if it still does the way Flan currently preps them).  I was hoping maybe we can be quickly enlightened on the change?

I upgraded from v1.34 to v1.37 today and that's when the Flan map broke.

Code: [Select]
_map = new Sandbox;
this.add(_map.layerBackground);

Otherwise, if this seems to be a bug, then we can post it on github.  ?

PaulGene

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
    • PaulGenehompson
Re: v1.3 is up on github
« Reply #23 on: Fri, Dec 11, 2009 »
its not a problem with flan, its the new FlxTilemap.

If you look in FlxTilemap:

FlxTilemap(MapData:String, TileGraphic:Class, TileSize:uint, CollisionIndex:uint=1, DrawIndex:uint=1)

You now have to pass the tilesize, i just got mine working fine now.

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #24 on: Fri, Dec 11, 2009 »
its not a problem with flan, its the new FlxTilemap.

If you look in FlxTilemap:

FlxTilemap(MapData:String, TileGraphic:Class, TileSize:uint, CollisionIndex:uint=1, DrawIndex:uint=1)

You now have to pass the tilesize, i just got mine working fine now.

Crap.  So this means we can't have multiple tilesets with multiple tile sizes (in layers)?  I wasn't sure if this could be done with Flan, but I'm hoping...

PaulGene

  • Member
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
    • PaulGenehompson
Re: v1.3 is up on github
« Reply #25 on: Fri, Dec 11, 2009 »
As far as i know you never could have multiple tile size per tilemap, you can still have multiple tilemaps with multiple tile size ... on multiple layers ... though ... man thats a mouthfull

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #26 on: Fri, Dec 11, 2009 »
I'm not sure this is a step forward if it excludes the Flan way of bringing in a level...

Now defining things about your map is essentially done in the PlayState via creating a new FlxTilemap.  You've got to specify the level filename, tilesize, tileset, collision index, and layer order in your playstate, when it seemed to be nicer contained all within the actual level class file, separate from the PlayState, as exported by Flan.

Is there any way to continue doing it the Flan way with v1.37?  Or is there a different approach with FlxTilemap that achieves a more partitioned way to go about it?

Mode, for example, is just one level space with a single tileset for the entire game, so it's not as bad incorporating all of that into the PlayState.  However, a larger game with multiple levels and multiple tilesets and multiple layers would have to load everything into the PlayState all at once and would seem to better utilize a more separated approach.
« Last Edit: Fri, Dec 11, 2009 by BullitSpeed »

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: v1.3 is up on github
« Reply #27 on: Fri, Dec 11, 2009 »
YOu should be able to write a wrapper for FlxTilemap that can store a bunch of that stuff for you and pass it to the super() itself?

ClimbHigh

  • Guest
Re: v1.3 is up on github
« Reply #28 on: Sat, Dec 12, 2009 »
It's still gonna be another week or so I think until I get the documentation into github, but it's been re-skinned and has search and some other nice stuff.  Just waiting for ivans to clean it up a bit and then we should be all set :)
Hey fantastic news !
I'm just going to look at the source for now, but I'm anticipating this !

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #29 on: Sun, Dec 13, 2009 »
Not really :(  best to just compose the loops so that is is as least-noticeable as possible.  Here's a good page about that stuff that I dug up a while ago:

http://www.compuphase.com/mp3/mp3loops.htm

Pain in the ass!!  Hopefully the musagi stuff loops seamlessly when we get it integrated

What about using WAV files?  I used it when working in the Flash IDE on a few game test projects and it would compile them as MP3's (I think, according to the Flash Publish settings).  The gap would somehow not appear.

For Flixel, it seems there's a set type of MP3 (44.1 128kbps or something like that) that we can only use.  Is there a way to modify that?  If we used WAVs from Flex Builder, would it compress them upon compile?
« Last Edit: Sun, Dec 13, 2009 by BullitSpeed »

fefranca

  • Guest
Re: v1.3 is up on github
« Reply #30 on: Mon, Dec 14, 2009 »
Not really :(  best to just compose the loops so that is is as least-noticeable as possible.  Here's a good page about that stuff that I dug up a while ago:

http://www.compuphase.com/mp3/mp3loops.htm

Pain in the ass!!  Hopefully the musagi stuff loops seamlessly when we get it integrated

What about using WAV files?  I used it when working in the Flash IDE on a few game test projects and it would compile them as MP3's (I think, according to the Flash Publish settings).  The gap would somehow not appear.

For Flixel, it seems there's a set type of MP3 (44.1 128kbps or something like that) that we can only use.  Is there a way to modify that?  If we used WAVs from Flex Builder, would it compress them upon compile?

My best workaround for that is to import the loop as WAV in the Flash IDE, export it (as MP3 inside the SWF) and Embed the symbol into the Flixel game. I would love to have a simple alternative that doesn't require the IDE though! (Oh, but having the music ready and pre-compiled is a good idea since it saves processing time!)

Topic-jacking ftw ;)

Socapex

  • Active Member
  • ***
  • Posts: 156
  • Karma: +0/-0
    • View Profile
Re: v1.3 is up on github
« Reply #31 on: Mon, Dec 14, 2009 »
Sorry for my ignorance, but why would you use wavs instead of mp3? Probably I'm missing something here but you can easily encode mp3 using audacity (AFAIK) or other free encoders.
Free cake every day at #flixel on irc.freenode.net.
Use your favorite IRC client or  http://webchat.freenode.net/

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #32 on: Mon, Dec 14, 2009 »
An MP3 adds about a second or so of dead space in the soundwave upon compression.  Somehow, when compressing WAVs to MP3's when publishing in the Flash IDE circumvents this.  So unless you compress there, and compress your WAV into an MP3 anywhere else with anything else, your soundwave is going to get a gap of silence inserted.  When looping your MP3, it creates what seems like a pause in the loop, breaking the seamless effect.

Socapex

  • Active Member
  • ***
  • Posts: 156
  • Karma: +0/-0
    • View Profile
Re: v1.3 is up on github
« Reply #33 on: Mon, Dec 14, 2009 »
Ok, yeah I've read about this elsewhere, let me lookup something... So what I get from my little research is that decoder (player) can skip the silence in the beginning of the mp3. Most encoders will enter the quantity of silence (in sample) added to the beginning and end (aprox 528 both) in the mp3 metadata... I wonder why the flash IDE works for this. Speculating: Maybe it doesn't have to do with encoding but the decoding metadata is somehow embedded in the swf? Wonder if there is a way to implement this in flixel (reading mp3 metadata)?

This is good stuff, hopefully a decent solution will arise someday...

More stuff:
Quote
Simple Seamless Looping the play of a loaded or embedded .mp3 file (IDE or Flex)
You can easily loop the play of an MP3 by calling play() and passing in an offset and a number of loops. The offset is critically important here, because if you were able to encode your MP3 file with an encoder that doesn't put and "follower" space at the end of the file, you will be able to simply play with the offset number of milliseconds until the file loops seamlessly. For the example above, I changed the play() to look like this:
sndChannel = snd.play(956, 5);
That tells the SoundChannel to play the loop 5 times and always start 956 milliseconds into the file on every loop.

from: http://www.8bitrocket.com/newsdisplay.aspx?newspage=20783

So if you find an encoder that only adds silence in the beginning... please share :D

The author also explains a way to strip the silence at the end, but as stated, will add some overhead to the app. I don't think you could easily implement this stuff unless digging in flixel sound code. I might give it a try when I get to audio though. Currently I'm not there yet, have so much more stuff to do...
Free cake every day at #flixel on irc.freenode.net.
Use your favorite IRC client or  http://webchat.freenode.net/

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: v1.3 is up on github
« Reply #34 on: Mon, Dec 14, 2009 »
wish we knew why MP3 adds silence in the first place... completely annoying and unnecessary(?).

nice find. :)

Socapex

  • Active Member
  • ***
  • Posts: 156
  • Karma: +0/-0
    • View Profile
Re: v1.3 is up on github
« Reply #35 on: Mon, Dec 14, 2009 »
http://lame.sourceforge.net/tech-FAQ.txt to answer your question... Basically, I really can't understand lol ;D
Free cake every day at #flixel on irc.freenode.net.
Use your favorite IRC client or  http://webchat.freenode.net/

fefranca

  • Guest
Re: v1.3 is up on github
« Reply #36 on: Mon, Dec 14, 2009 »
This can become really annoying, using 8bit's hack isn't really a solution to the problem. I just tried something.. using a decompiler in my swf to extract the mp3 back to a separate file, the result is a total fail with a click in the loop.

Like Socapex said, maybe Adobe does some voodoo with the files in order to make the Flash player understand the MP3 leading and trailing spaces (of course it could be the decompiler's fault as well, just downloaded a shareware here).