Mobile Performance And Optimisation


(no-jo) #1

Firstly i’d like to say welcome back FP i’m sure i’m not the only one who’s missed the site over the past few months and especially the forum. It’s good to see you familiar guru’s are back on board too.

Wasn’t quite sure as to whether this should be help or a discussion topic but then i thought “the more the merrier” and it’s not specific coding help i’m after and i think this could be helpful to most users in some way.

Anyway…

So, I’ve been working on a project for nearly a year now (yes you read that right,a year! although this has been a very very part time project) and the ultimate goal was always to port out to android and IOS with some in app purchases you know shop items such as remove ads, buy new characters, unlock worlds etc. and the game follows the typical menu feel of the mobile market.

You’ll be pleased to know that i’m nearly finished!

But now i’m at that stage where i’m looking for some definitive answers and direction for optimising my branch for mobile platforms. If indeed it is even possible.

I read on some forum a (long) while ago where @ChevyRay said that it was possible to alter the FP Engine to optimise it for mobile and that it was a 10 minute job (or something like that. Sorry @ChevyRay can’t find the link and it was a long time ago so this might not be entirely accurate but that was the jist). The person who started the thread said he would like to see an example and so did a few others but the thread went dead.

There were mentions on the old forum about numerous tests with varying frame rates but nothing concrete and nothing endorsed by FP.

There were suggestions of removing filters and rotation (which i did).

I have noticed this current topic [Stage3DPunk and mobile publishing with FlashPunk][1] and it does look like the sort of direction i could be tempted to go especially if this bit is true:

currently the deal is that it’s freely available for them to use on any other platforms (eg Google Play/iOS) as long as we’re publishing on at least the Nook/Kindle markets

But to be honest before i started going down a particular path i thought i’d get to the bottom of this once and for all and bounce this one around and get some opinions.

Will any future release of Flashpunk address mobile optimisation?

If not can we get a mobile optimised branch of the current version available for download please? In fact can we get one anyway or at least a “how to” or “Good Practices”?

Is there a tutorial for publishing flashpunk to IOS and Android that anyone can suggest for FlashDevelop. If not can we have one please?

Am i barking up the wrong tree with flashpunk as a serious engine contender in the mobile market? I mean i was hoping to code once and tweak a little depending on the platform (Android, IOS, web). I’m definitely not the only developer who wants this.

Any additions to this discussion will be greatly appreciated.

Also, if anyone else has found themselves in a similar situation please post here. Let it be known.

Many thanks and sorry for the long post.

no-jo


(Jacob Albano) #2

FlashPunk’s rendering system is fairly easy to strip out and replace. I also remember Chevy talking about a version of FlashPunk that used the Display List for rendering, and that it resulted in significant performance increases on mobile platforms. It might be a little more work than you want to do, but it’s not that bad.

I wanted to try out Stage3dPunk but the developers wouldn’t let me use it due to my games not being “addicting enough”, so I can’t offer any technical opinion on that.


(Zachary Lewis) #3

The way FlashPunk renders is very processor-heavy. The only way to fix this is to rewrite the rendering engine to use the GPU optimizations available from Stage3D. I believe it is possible to make this rendering replacement in FlashPunk core without breaking backwards compatibility for those running an unchanged version of FlashPunk.

That said, you’ll have a bad time trying to get superb frame rates on mobile running vanilla FlashPunk.


(no-jo) #4

Thanks for the speedy replies.

Zach, Would you say then that Stage3D is the only way forward to achieve a quality frame rate / performance in a mobile environment?

This is probably going to sound a bit cheeky and it’s not intended that way but have you got an arrangement with kickbackgames? I’m just surprised an open source Stage3D API/branch for flashpunk doesn’t already exist. I thought that getting our flashpunk projects into the mobile market was way up on the list. That’s not to say that i won’t submit my game to kickback especially if they can open doors on additional platforms to the two obvious ones. Plus reading through the pitch from @Ultima2876 it does sound attractive.

I guess my only hope is that it is “addicting enough” Jacob. Sorry to here that. Did you get your project released to the mobile market? Did you make these adjustments or did you abandon it?


(Zachary Lewis) #5

It’s the only way to do that using Flash. The majority of the mobile devices have kickass GPUs on them that handle the majority of the rendering, and Stage3D is the main way to offload graphics processing to the GPU in Flash.

I’d love to get a version of FlashPunk working with Stage3D. Perhaps that’ll be my next goal. I agree with you wholeheartedly: There should be an open, easy way to get FlashPunk games optimized for mobile. The fact of the matter is, Kickback (apparently) currently has one, and since they haven’t opened it up, you’ve gotta go through them. It’s capitalism at its finest, and I applaud them for it. It just sucks for people that don’t want to deal with them.


(no-jo) #6

It’s not that i don’t want to deal with them. At this stage i’m reviewing the options. It just so happens that it turns out there is only one though. or is there?

What about starlingpunk? isn’t this more geared towards mobile and already accelerated by Stage3D (not that i want the hassle of porting really).

Thinking about it. Maybe i’ll bow to capitalism (which is not too bad if the developer gets to keep the IOS and Android Markets plus @Ultima2876 mentions a 50/50 split on additional platform such as kindle which i hadn’t thought was possible with flash. (Think I read somewhere that air was not supported or something) So if the deal is as sweet as advertised then you’re only making more money, not losing any. Then if rejected look at starlingpunk or haxepunk (Is haxepunk good for the job?). But if you could get an open source version out that would be great.

All in all getting our games mobile is a bit of a nightmare. That’s why when i saw flashpunk was back and then when i saw the post from kickback i must admit there was a sigh of relief. Didn’t even think my game might be rejected. (pretty naive really).


(Ultima2876) #7

Just wanted to chime in and say that the only real reason we’ve been ‘rejecting’ games up until this point is because our engine is still in beta. We’re aiming for a proper release at the end of the month, at which point we will have an alternative arrangement for games that we aren’t interested in publishing that will still allow you to use the engine.

Regarding capitalism (:D), basically I was working on the engine anyway and then I had to stop thanks to real life kicking me in the balls. Adam Schroeder at FGL got in touch and has invested quite a bit of money to keep me working on it and off the streets. The money we make from publishing games goes to him to pay him back (then we’ll later get a cut once it’s all paid back).

Generally speaking although we might sound like it with our big words and corporate goals, we’re actually a couple of bedroom developers living at home, making flash games in our free time and this whole publishing thing is just something that chanced upon us thanks to a very business-savvy guy at FGL.

One other thing is that when @jacobalbano initially got in contact with us, we had no means of providing a demo of the engine. We do now and will through release, so we have been working with developers on a ‘no-obligation’ basis to try the engine before considering a publishing deal with us. The demo is limited to 6 minutes rendering time (yes, we still have a lot of investment to pay back!) but otherwise runs exactly the same as the full version will.

@jacobalbano if you are still interested in trying the engine then shoot us another email. The exact response we gave to you was as follows;

“Hello there, Thanks for getting in touch and sorry for the delayed response - had a busy weekend! Unfortunately these games aren’t really in the scope of what we’re looking for at the moment. Do you have anything else or anything that’s in development that we might be interested in? I’d love to check out anything you have to offer :slight_smile: Thanks!”

It wasn’t that we didn’t find your games “addicting enough” (hehe quotes), it was just that at that point in time (May 4th) we were looking for games that met certain criteria for features we wanted to test, such as Tilemaps. I’m sorry if I gave a bad impression, as I said at the time I had a really full-on weekend and a bunch of emails to reply to!

Finally (phew, this is getting to be a rather long post) the thing that is potentially going to make Stage3DPunk and the whole KickBack Games publishing deal work is the FlashPunk developers and community. If you guys have any suggestions as to how we can improve our deal, I can run it past the higher ups at FGL and we can see what we can do. I use ‘currently’ and ‘at the moment’ a lot because ultimately this whole publishing thing is new to us and we want to meet the needs of the developers as we are in fact developers ourselves; we’re constantly re-evaluating things to try and keep things sweet for you guys.


(Zachary Lewis) #8

Why do you prefer FlashPunk over Starling? If you want to create mobile-ready content, Starling is already prepped and ready for all that business. Is it the ease of use? Knowing what makes people love FlashPunk is a great way for FlashPunk to get better!


(fedyfausto) #9

Flashpunk is better :slight_smile: whereaver i created a Square Engine Plus it’s an engine make from FP logic and Starling render enngine, but for this moment this don’t support the spritesheets (only atlas and movie clip of starling), you can try my little game created with this: Droppy the Drop

PC or MAC: https://mega.co.nz/#!YYYWGRpJ!YeFykFt8Ggm8G4dUo6syhUaCZ8pZGv-d61Dli9KyYPQ

Android: https://mega.co.nz/#!oIwRVTwL!OZS2alsAyWmKylaMZcm1HjMuxbsA9mWwq-m-EgEOELE

IOS: https://mega.co.nz/#!4J5h2bDS!LHzzpiHYcsRlp9xBAPIcDxGXVZsoFKz4QDoqKRDZyRQ

the game is so simply, for now you can make simple games with this engine, but i prefer FP for make games :slight_smile:


(fedyfausto) #10

whereaver with another my game created with FP , i use some optimizations and this work really great in Iphone 5(60 fps), iphone4s (40/50 fps), with particles system (Entities) and other some stuff…


(no-jo) #11

@zachwlewis Out of choice i would stay with Flashpunk 100%. The web performance of the engine is spot on.

The community / support both before and, as i’m finding out now is excellent and after a year of using it I’m starting to get to know my way round it not to mention I’ve never even followed a basic tutorial for Starling. Porting my existing project would feel like starting from scratch again. And that would be a massive step back for me.

Personally, @Ultima2876 i’m pleased that someone has done the stage3D integration. It needs doing and in my opinion for flashpunk to remain at the forefront it has to embrace mobile platforms. If you can make a little cash while FP catches up with other engines then good for you plus with additional platforms on top of android and IOS this starts to become an interesting proposal.

I’m trying to put myself in a position where i can earn a full time income from games design (I’m not expecting to be the next Rovio although it doesn’t stop me dreaming, you all know what i mean) and for me mobile is the direction to travel (in fact it has been for some time) . So I just wanted to lay the cards on the table regarding FP and mobile performance dig up some dirt and find out if i’m banging my head against a brick wall or not.

I’m finding all of your posts extremely positive to the FP cause.

@Ultima2876 I have a couple of projects i’m working on that need to take priority but when i get a minute in the next couple of weeks and after a few tweaks i’ll drop an email to support@kickbackgames.com with a link to my game. It’s nearly finished-only awards, shop integration and three comic strip intros to do (intros not necessarily essential although they do help paint the overall picture). Possible merchandising but i might be getting ahead of myself there. However, there are three complete worlds with 15 levels per world plus 2 more worlds in development also a sequel and prequel planned and ready to be developed once I have a mobile ready engine).

Man this is epic posting!

Keep opinions coming. v impressed with all your responses.


(no-jo) #12

I suppose ultimately i would like to see something like this if possible:

public class Main extends Engine
	{
		
		public function Main()
		{
			super (480, 320);
	        FP.screen.color = 0x000000;
            FP.engine.renderMode(IOS, GPU); //or renderMode(ANDROID,GPU) etc..
			//FP.console.enable();
		}

But i’m guessing much laughter at my suggestion.


(Ultima2876) #13

Honestly, that’s not far off what we have with Stage3DPunk. There are some unsupported features and some stuff that has more of a performance impact than it does usually, but the majority of games we’ve tested work very well, usually with one or two minor issues that either need fixing or working around. All in all, we’re talking 30 minutes of work rather than 10-15 hours.

Essentially once you drop in Stage3DPunk (a net/flashpunk folder and an swc), you’ve got an extra flag in the super() call called stage3d - set this to true and you’re in stage3d mode. And yes, it’s backwards compatible and offers a fallback - if it fails to initialise stage3d, there is an option to automatically re-init in regular FlashPunk mode. Very useful for web distribution - you want some extra particles on Stage3D-supported computers? No problem. Just shove if(FP.stage3D) around those sections, then if someone plays your game and can’t run stage3d it’ll fall back to regular FlashPunk mode which - and our entire goal is this - should render 1:1 exactly the same.

We’re actually developing a couple of games on this engine too (for web sponsorship and mobile release), so we’re as much invested in making it work well for the developer as anyone.

Among the other things we take care of within the engine are resolution issues - the engine will automatically pan and scan to any resolution to keep your game looking the way it should look - and we’re planning on integrating a touch-screen gamepad overlay. Hopefully that will be before release, but is basically essential for the majority of the awesome FlashPunk platformers out there to see success on mobile. We also have the FGL mobile API integrated tightly in the engine so you don’t have to mess about too much with handling the boring stuff like muting your audio when the player minimises your game, making sure it quits gracefully etc.


(no-jo) #14

Very interesting indeed. Thanks for the detailed info and responses from all members


(Zachary Lewis) #15

This topic was automatically closed after 30 days. New replies are no longer allowed.