Author Topic: Flixel with Starling FrameWork ?  (Read 11441 times)

3WG

  • Active Member
  • ***
  • Posts: 110
  • Karma: +0/-0
    • View Profile
    • Jeux.MU
Flixel with Starling FrameWork ?
« on: Mon, Oct 3, 2011 »
Hi flixelers,

I'm looking to see if someone (whose better than me) allready try to port flixel with the great http://www.starling-framework.org/  ?


I have no idea where to start , should it be a good idea ?

Thanks .
Flash games are FUN !
Jeux.MU

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel with Starling FrameWork ?
« Reply #1 on: Mon, Oct 3, 2011 »
Nah they really really won't play well together. It'd be like trying to shove the triangle through the square hole. You might get it in eventually with brute force, but it was never meant to be in there in the first place.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

3WG

  • Active Member
  • ***
  • Posts: 110
  • Karma: +0/-0
    • View Profile
    • Jeux.MU
Re: Flixel with Starling FrameWork ?
« Reply #2 on: Mon, Oct 3, 2011 »
Arf  **** :)

I whas so happy to imagine the power on a GPU flixel for making mobile games.. :(
Flash games are FUN !
Jeux.MU

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel with Starling FrameWork ?
« Reply #3 on: Mon, Oct 3, 2011 »
Yeah I know, but in reality it's not as simple as that :) Flixel is not a good match for Stage3D (*especially* on mobile), and would need a complete re-write to be honest. In fact, any "blitting" engine would.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

Arkeus

  • Contributor
  • ****
  • Posts: 321
  • Karma: +1/-0
    • View Profile
    • I, Arkeus
Re: Flixel with Starling FrameWork ?
« Reply #4 on: Mon, Oct 3, 2011 »
I think making a library similar to flixel, but rather than going the blitting route and having drawing being in software, use the starling display list as your base object, would be a better idea than porting.

Flixel's API would fit perfectly, and it would feel like you'd be using what you've been using for so long. But simply the backend drawing would change. Also taking advantage of things like "Starling supports many convenient new features, like bitmap fonts, sprite sheets or particle effects." would make it easier.

It doesn't seem like it would be all that hard to do (maybe I am missing something), and would definitely be a fun project. :) If I wasn't so intent on working on a new game, I'd probably pick this up and try it to see if it's possible.

John Hutchinson (Johntron247)

  • Commodore 256
  • Contributor
  • ****
  • Posts: 392
  • Karma: +1/-0
  • I can has lazerz?
    • View Profile
    • Level X Games
Re: Flixel with Starling FrameWork ?
« Reply #5 on: Mon, Oct 3, 2011 »
I think making a library similar to flixel, but rather than going the blitting route and having drawing being in software, use the starling display list as your base object, would be a better idea than porting.

Flixel's API would fit perfectly, and it would feel like you'd be using what you've been using for so long. But simply the backend drawing would change. Also taking advantage of things like "Starling supports many convenient new features, like bitmap fonts, sprite sheets or particle effects." would make it easier.

It doesn't seem like it would be all that hard to do (maybe I am missing something), and would definitely be a fun project. :) If I wasn't so intent on working on a new game, I'd probably pick this up and try it to see if it's possible.

Dude! You totally should!  This would have an excellent chance of getting something Flixel-like going that could likely run very fast even on mobile devices (GPU optimized).  It may even be enough to make targeting multiple platforms with AIR at lot more worthwhile!  A lot of people, myself included, would be most interested in that.

John Hutchinson (Johntron247)

  • Commodore 256
  • Contributor
  • ****
  • Posts: 392
  • Karma: +1/-0
  • I can has lazerz?
    • View Profile
    • Level X Games
Re: Flixel with Starling FrameWork ?
« Reply #6 on: Mon, Oct 3, 2011 »
If it's good enough I'd even pay to use it. Just throwing that out there. ...but I'd need proof, of course.  Something like a game or game prototype running the system would do well for that.

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel with Starling FrameWork ?
« Reply #7 on: Tue, Oct 4, 2011 »
Sorry I just don't think Starling is good enough to do this. Try playing around with it in anger and you'll see what I mean.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

John Hutchinson (Johntron247)

  • Commodore 256
  • Contributor
  • ****
  • Posts: 392
  • Karma: +1/-0
  • I can has lazerz?
    • View Profile
    • Level X Games
Re: Flixel with Starling FrameWork ?
« Reply #8 on: Tue, Oct 4, 2011 »
Well that sucks!  It's just not flexible enough or what?

Building the game libraries from scratch, using as much Starling as possible for all the backend stuff, and modeling the front end on Flixel, does seem like a viable solution.  However, we also know that you're very knowledgeable and capable, so it's extremely likely that there's something about this that we're not considering.  What would make this an unreasonable task?  Does Starling just seem to hard to use or is there a technological reason that would make it a fool's errand?  In my experience the frustration thing goes away with enough experience, as you learn about all the available tools and get more comfortable thinking about the problems from a different perspective.

I have ZERO experience with Starling so it's likely that I'm way off here. If so then there's definitely a piece of the puzzle we're missing and I'm curious what that would be.  Is there something specific you can tell us about Starling that would make building a cross platform retro game library with it (and AIR) inpractical?
« Last Edit: Tue, Oct 4, 2011 by JohnTron247 »

Fallsburg

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Flixel with Starling FrameWork ?
« Reply #9 on: Fri, Oct 7, 2011 »
Well, I'm actually about 95% of the way of porting flixel (my heavily, heavily modified outdated version of flixel) to use Starling as the rendering engine.

I don't quite get why Photonstorm is so down on it.  I get that using blitting + starling is a bad idea, but using flixel as the game front end and starling as the rendering component makes a lot of sense to me. 

When I finish up my current game (hopefully around January or so), I'll sit down and apply what I've learned from combining Starling and Flixel with the newest versions of each.  Or I can offer up my raggedy, heavily modified versions of both right now, and people who have the time/know-how/care more about it can take a crack at it.

Starling is really nothing except a rendering system and an event model.  The even model can't be ignored, but it is essentially the standard flash event model so it subs into flixel pretty easily. 

Generally, my combining of the rendering of Starling and Flixel can be described as this:
Flixel has no rendering code.  None whatsoever. 
FlxSprites (and other similar classes) have a starling.display.MovieClip. These objects update their movie clip with x,y, angle,alpha every frame.  They also do animation playing.
FlxTilemaps (and FlxTileBlock) have an image that is rendered to (essentially what Flixel does right now, but with blitting) 
FlxGroups now have a starling.display.Sprite that they add their children to.  This is more akin to the standard display list style in Flash, but in my opinion Flixel already uses the idea of the display list in form if not in function (i.e. You add things to a group, the group can be turned off/on, things can get shuffled around in the group to determine render order, etc.)

The pieces that I don't have working right now (due to life taking precedence, not inherent difficulty):
Mouse events -- The Starling keyboard events are directly analogous to the Flash keyboard events, so that was an easy change.  The mouse events in Starling are all interpreted as Touch events, so there's a bit of a difference there.  I expect to have this working by the end of the weekend.
Animation wonkiness -- frame numbers don't match up (i.e. what frame you are on in an animation in Starling != _caf).  This isn't an issue most of the time, but if you have code that relies on what frame of animation something is in, this is broken right now
FlxButton -- Just haven't gotten around to it, but honestly the Starling button is essentially all that is necessary

I'd definitely be interested in helping getting Flixel and Starling working together if someone is interested in spear-heading the effort.  The power of Starling can't be denied.  Already it has allowed me to add in tons of wonderful graphics that just weren't realistic with Flixel (i.e. hundred of alpha transparencied particles on the screen), and the scaling and rotation looks so much better than what regular Flash is capable of.  I really like Flixel as a framework for making games, but the rendering component is incidental to me.  I think the blitting method of Flixel was the best rendering method previously, but now that new, better methods are available, there is no reason to not use them. Whether Starling is that method is debatable, but it's worth the debate.

initials

  • Contributor
  • ****
  • Posts: 378
  • Karma: +0/-0
  • Initials
    • View Profile
    • Initials Blog. Code and other things.
Re: Flixel with Starling FrameWork ?
« Reply #10 on: Fri, Oct 7, 2011 »
Very interested to see this.
With GPU acceleration and Flash Player 11 out now, I am really excited about the future of indie games.
Initials: Super Lemonade Factory, Super Lemonade Factory Part Two, Above The Clouds, Revvolvver, Four Chambers of the Human Heart

Arkeus

  • Contributor
  • ****
  • Posts: 321
  • Karma: +1/-0
    • View Profile
    • I, Arkeus
Re: Flixel with Starling FrameWork ?
« Reply #11 on: Fri, Oct 7, 2011 »
I'm completely with Fallsburg. I think fitting a rendering system like Starling with the features of flixel is perfect, and it's exciting to hear that he hasn't had any issues with it. If I get bored of my current project, I'm pretty sure that will be my fallback project. I really enjoyed making a flixel-like library for javascript, but there just wasn't the motivation for me to finish it up and release it because there isn't really any good reason to make games using html5 at the moment. But maybe starling is the push I need to make a flash version of it. :) And maybe others will too.

Retro-Rob

  • Active Member
  • ***
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Flixel with Starling FrameWork ?
« Reply #12 on: Fri, Oct 7, 2011 »
I'd really love to see this happen. 

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel with Starling FrameWork ?
« Reply #13 on: Sat, Oct 8, 2011 »
My reasoning for not using Starling with flixel is pretty simple: it's just not optimised for it. Flixel and Stage3D, fine, that could be a lovely combination, and it's one I've been working on all week. But I just don't think it fits all that well with Starling itself, mostly because it tries so hard to emulate the display list, and secondly because I can easily batch draw calls to the shader myself, saving a lot of overhead, but I didn't see anything really like that in the Starling API. I also believe there are better ways to handle tilemaps now, and have been seeing if it's possible to draw it direct from a shader rather than re-uploading texture data each frame.

I've nothing against Starling, it serves its purpose, it's just the thought of an API on-top of an API on-top of Stage3D doesn't sit well with me. So I've been learning how to do it directly instead and realising that actually it's the only way to avoid potentially thousands of uploads and draws each frame.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

Arkeus

  • Contributor
  • ****
  • Posts: 321
  • Karma: +1/-0
    • View Profile
    • I, Arkeus
Re: Flixel with Starling FrameWork ?
« Reply #14 on: Sat, Oct 8, 2011 »
My reasoning for not using Starling with flixel is pretty simple: it's just not optimised for it. Flixel and Stage3D, fine, that could be a lovely combination, and it's one I've been working on all week. But I just don't think it fits all that well with Starling itself, mostly because it tries so hard to emulate the display list, and secondly because I can easily batch draw calls to the shader myself, saving a lot of overhead, but I didn't see anything really like that in the Starling API. I also believe there are better ways to handle tilemaps now, and have been seeing if it's possible to draw it direct from a shader rather than re-uploading texture data each frame.

I've nothing against Starling, it serves its purpose, it's just the thought of an API on-top of an API on-top of Stage3D doesn't sit well with me. So I've been learning how to do it directly instead and realising that actually it's the only way to avoid potentially thousands of uploads and draws each frame.

I completely agree that performance-wise going directly with Stage3D is a far better alternative. However, from what I've seen, Starling will be more than good enough for most things, and it comes with some major benefits (depending on the audience). For example, if users of Flixel had to dive down deep into shaders within Stage3D to edit things about the library they need changed, I don't think that's a great experience for the typical user. It might be more powerful for those who want to take the time to do it, but for people using a game framework in flash, I don't expect that will be very many people.

Though for those who want to use the library as is, and not touch anything beneath it, they will get the benefit of not having starling as a middle layer.

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Flixel with Starling FrameWork ?
« Reply #15 on: Sat, Oct 8, 2011 »
Fair enough, like I said I have no objections to the API as such, I just feel it walks quite the opposite direction (because it has to) to support things flixel doesn't need.

That said, if I was going to use any API I'd use ND2D - that thing is elegant as hell, and seems to have better game-specific features imho. Really lovely API.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

eid0rb

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Flixel with Starling FrameWork ?
« Reply #16 on: Sat, Dec 29, 2012 »
Fallsburg, I know this is an old thread, but I was wondering if you ever happened to finish your swap of the flixel rendering engine for Starling? If so, I would absolutely love to see the code in any form, and hear about the performance gain you have seen.

I currently have an AIR / Flixel project that has some performance issues on iOS and Android, and am considering options for how to rework the rendering portion of flixel to improve performance.

Thanks.