Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411495 Posts in 69373 Topics- by 58428 Members - Latest Member: shelton786

April 25, 2024, 06:32:03 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The HaxeFlixel Helping Hands
Pages: [1] 2
Print
Author Topic: The HaxeFlixel Helping Hands  (Read 3049 times)
Pizzamakesgames
Level 2
**



View Profile WWW
« on: October 25, 2015, 10:30:40 AM »



HaxeFlixel

Hey there, I'm a HaxeFlixel dev, and I've been having as much fun as I've been having problems with it in the short time of a year that I've been using it now. Lately I've been looking to make a big retail game with HaxeFlixel, at which point I felt like I had to get rid of all the problems I've just left kinda lingering for the time being. This is where the idea for this thread came from. A place for HaxeFlixel devs to exchange cool stuff and terrible problems, to encourage, get together and help eachother out.

If you're not familiar with the framework, you can check out these links: HaxeFlixel, Forum, Tutorial
« Last Edit: October 25, 2015, 10:37:13 AM by Pizzamakesgames » Logged

Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #1 on: October 25, 2015, 10:30:52 AM »

I'll do a little intro post to showcase what I imagine a quality post in this thread might look like, as well as get something to talk about.

Personally, I've made a couple free games with HaxeFlixel over the past year, like:



Currently, I'm working on a bigger project that's been giving me some trouble lately. Specifically, this error.
It's only happening on the start of the game, only on the cpp target, after it's already been compiled, and it's happening inconsistently. The appropriate scripts the error is pointing to are openfl's sound.hx and flixel's FlxSound. Though, I'm suspecting the fault to be somewhere within my setup or the code of my game. If anybody would have any pointers, feel free to suggest any ideas.
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #2 on: October 25, 2015, 11:09:51 AM »

So I do remember about running into sound issues with certain targets. I remember that the cause was some targets require wav files and some ogg files.

Try converting it to a wav file to see if that fixes it. Unfortunately I can't remember which platform has issues with which filetype.
Logged

Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #3 on: October 25, 2015, 11:23:21 AM »

You are not referring to Flash needing .mp3 and neko/cpp needing .wav or .ogg but a different issue that shouldn't be happening where say cpp would have issues with .ogg and neko would have issues with .wav for example?
Logged

larsiusprime
Level 2
**



View Profile WWW
« Reply #4 on: October 25, 2015, 12:58:51 PM »

Hey there! I'm currently developing the Defender's Quest series using HaxeFlixel.

Specifically, the sound issue is related to the thorny world of MP3 licensing.

You see, in many legal jurisdictions there's still patents or whatever nonsense that require you to pay money to the MP3 licensing body if you use an MP3 decoder in a commercial game. This restriction does not apply to Flash, because if you use Flash you're under a blanket license that Adobe grants to you under their EULA (IIRC, that is).

(Incidentally, this is why audio tools like Audacity don't come out of the box with an mp3 decoder, and give you a wink and a nod telling you to go download LAME.dll)

So HaxeFlixel is based on OpenFL. There's no *technical* reason the OpenFL team (of which I am a part) couldn't include an mp3 decoder, but then we'd be silently giving anyone who uses a non-flash target this licensing burden.

So we made a decision way back: no mp3 decoding by default on non-flash targets.


This is a bit annoying as it requires you to ship different sets of audio files, but it's kinda the best we can do in the situation.

TL;DR:

Flash: WAV or MP3
Everything else: WAV or OGG

I'm also a regular contributor to HaxeFlixel too, so if you have any questions about anything in the stack -- Haxe, Lime, OpenFL, or HaxeFlixel -- let me know.

PS:
mp3 is kind of a terrible audio format. It's got fundamental problems that make it very difficult to loop because of how it stores metadata, as anyone who has tried to get a seamless looping song playing in flash can attest to.
« Last Edit: October 25, 2015, 01:07:25 PM by larsiusprime » Logged

Nostrils!
Carpetwurm
Level 0
***


Nobody


View Profile WWW
« Reply #5 on: October 25, 2015, 01:48:04 PM »

Oh cool. I'll probably use this thread soon.
Thanks, Pizza.
Logged

>Forum signatures
>[current year]
Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #6 on: October 25, 2015, 02:46:21 PM »

Ah, thank you very much for clarifying that issue, larsius. You being a part of the OpenFL team, I actually would have a couple questions right away. Would you know if there were any reported problems with the loading of .ogg or .wav files on the cpp target in the past? As I've been asking around regarding this error I'm trying to solve, people kept referring to OpenFL, suggesting to try compiling using -Dnext. In general, might there be any point in the libs that might lead to an inconsistent capability of loading any audio on launch of the game?

Oh, also, gratulations on the great success of Defender's Quest!
« Last Edit: October 25, 2015, 02:54:56 PM by Pizzamakesgames » Logged

larsiusprime
Level 2
**



View Profile WWW
« Reply #7 on: October 25, 2015, 02:55:49 PM »

Sure I can look into it, but I need to know a little bit more about your specific case. I see you're getting error messages related to ogg files -- to be clear, do you *have* ogg files in your assets folder? Also, can you show me what exact code lines you're using to do the actual sound loading?

Once we have that I can look into the specifics.

As for -Dnext, that merits its own entire post on the underlying structure and interaction between HaxeFlixel and OpenFL. In the future this shouldn't be an issue but OpenFL and HaxeFlixel have been in their biggest transitions *ever* over the last year, so there are some common points of confusion that could use some ironing out. I'll try to get to that tomorrow.
Logged

Nostrils!
Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #8 on: October 25, 2015, 03:13:26 PM »

I'd be happy to show you, thank you in advance. The ogg files are definitely in the folder, as this error only happens occasionally. About every 5th to 10th start of the game. I've been encountering this error using two different means of loading sound, though nothing seemed to have any effect on the error occuring.

Quote
Up until now, I was handling sounds like this:

Code:
var step1sfx = new FlxSound();

override public function create():Void
{
step1sfx.loadEmbedded("assets/sounds/stepsfx1.ogg", false);
}

Now, I'm handling them like this:

Code:
var introsfx1_1:FlxSound;

override public function create():Void
{
introsfx1_1 = FlxG.sound.load("1_introsfx1");
}

With this in the Project.xml:

Code:
<assets path="assets/sounds" unless="flash">
<sound path="1_introsfx1.ogg" id="1_introsfx1" />
</assets>

A thing to note might also be that trying to use -Dnext gave me an error of a procedure entry point "neko_buffer_length" not being found in neko.dll, giving out an Uncaught exception -  load.c(237) : Failed to load library : ./std.dll.

Oh, I almost forgot. By now I'm using a third method of loading the sound, which involves having the same code in the Project.xml, but omitting the FlxG.sound.load as well as the variable declaration, and just using the sound by id via FlxG.sound.play or FlxG.sound.playMusic whenever needed.
Logged

Mixer
Level 1
*


I've never really known what to put here.


View Profile WWW
« Reply #9 on: October 26, 2015, 01:26:39 AM »

What a cool idea for a forum thread.  Toast Left

I have been working on some tutorials (http://tinyurl.com/qjzh7ku) on Haxeflixel, where I try and help beginners get started.

For three-ish months I have been working on a cool game called Phlight, and I have some amazing (secret) news about that. You can have a peak at my old devlog over at http://phlightgame.tumblr.com/ . I'm thinking of moving to a better standalone website blog thing for it, or even just putting the devlog on tigsource, but it is fine there for now.

Here's an image from the blog, to give you an idea of it.
https://i.gyazo.com/00bdfdb5fe9a30982bccfcde6a5f45eb.png
Holy moly. I couldn't throw that image in the post as it is just too big. No spoilers on tig either, by the looks.

Anyhow, I love haxeflixel, and this forum post.  Gentleman
Logged

My twitter is @5Mixer.
I'm currently making a dungeon game, check it out :D
https://forums.tigsource.com/index.php?topic=59139.0
Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #10 on: October 26, 2015, 03:43:47 AM »

Happy to have you! Your game looks pretty neat. Got any plans for release yet? Is it gonna be free/paid, browser/standalone?

Regarding my errors, I've filed two issue reports at the HaxeFlixel GitHub repo to better keep track of them:
No sound on load: [Sound.hx:118: Error]
Sound cutting out after playing 255 times on cpp target

Until someone knowledgeable comes to the rescue, I'll be using this incredibly smart workaround that I came up with:
« Last Edit: October 26, 2015, 05:49:06 AM by Pizzamakesgames » Logged

Carpetwurm
Level 0
***


Nobody


View Profile WWW
« Reply #11 on: October 30, 2015, 04:10:15 PM »

[I copied this from the HaxeFlixel Forums]

Okay, so I need to know how to load a .swf file and use it as a cutscene in my game. Preferably, I'd like to use a cutscene state. Only problem is that I have no idea how to do this. I've seen posts before about this, but I'm not sure if any of them work well. If anyone has a good way of doing this, it'd be a great help ^)^
Logged

>Forum signatures
>[current year]
Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #12 on: November 09, 2015, 05:17:17 AM »

Wonder if there is a way to ignore regular expressions when using strings in haxe. Trying to display some ascii art but getting Invalid escape sequence errors.
Logged

Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #13 on: November 10, 2015, 02:53:54 AM »

The answer to the regular expression problem was just using "//", what a brain-teaser!  Roll Eyes

Got a little class that consistently throws an invalid operation error on neko, but not on windows cpp regarding FlxSound.

Here's the error: http://pastebin.com/sDPvJxv5
Here's the class: http://pastebin.com/guPVFZUm

The error happens on ProgressMusic01() every time.
Logged

Carpetwurm
Level 0
***


Nobody


View Profile WWW
« Reply #14 on: November 10, 2015, 05:51:44 PM »

Hey Pizza, since you're the only one who still uses this thread (other than me) do you know it HaxeFlixel supports Animated Tiles made in Tiled? I'm thinking of switching from Ogmo editor. Not sure if you've made any tile based games, actually.
Logged

>Forum signatures
>[current year]
Pizzamakesgames
Level 2
**



View Profile WWW
« Reply #15 on: November 11, 2015, 03:00:30 AM »

Yeah, I'm afraid I havn't :c
Logged

Carpetwurm
Level 0
***


Nobody


View Profile WWW
« Reply #16 on: November 11, 2015, 12:14:42 PM »

Yeah, I'm afraid I havn't :c
I thought so, too bad other people don't really pay attention to this thread
Logged

>Forum signatures
>[current year]
Mixer
Level 1
*


I've never really known what to put here.


View Profile WWW
« Reply #17 on: November 13, 2015, 12:17:59 AM »

I'm here :D

Saw this issue: https://github.com/HaxeFlixel/flixel/issues/93

Which leads to FlxTiledMapExt. Dunno if that helps.
Logged

My twitter is @5Mixer.
I'm currently making a dungeon game, check it out :D
https://forums.tigsource.com/index.php?topic=59139.0
Mixer
Level 1
*


I've never really known what to put here.


View Profile WWW
« Reply #18 on: November 13, 2015, 12:20:57 AM »

Oh yeah, about the lack of replies, it's likely due to the fact we are on TIG. Post on the Haxeflixel forum and you'll get far more replies.  Hand Thumbs Up Right This post gets buried here, and is buried out by more popular frameworks (GameMaker, Unity etc).
Logged

My twitter is @5Mixer.
I'm currently making a dungeon game, check it out :D
https://forums.tigsource.com/index.php?topic=59139.0
Carpetwurm
Level 0
***


Nobody


View Profile WWW
« Reply #19 on: November 13, 2015, 12:11:46 PM »

Oh yeah, about the lack of replies, it's likely due to the fact we are on TIG. Post on the Haxeflixel forum and you'll get far more replies.  Hand Thumbs Up Right This post gets buried here, and is buried out by more popular frameworks (GameMaker, Unity etc).

I think this post was just made to see if anyone here used HaxeFlixel
Logged

>Forum signatures
>[current year]
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic