FunkPunk - Flashpunk that works on mobile!


#1

Hi!

I’ve been using Flashpunk for several years now and made dozens of games, and since I would like to port some of them on mobile, I am rewriting FP rendering pipeline to make use of Flash’s display lists which since 11.3, (IIRC) are hardware accelerated. This is kind of defeating the initial point of FP, but oh well,. times change!

Anyways, the point is, this is not another “flashpunk inspired engine” (and trust me I have that as well :P), but a plug’n’play replacement for FP, that you put in your source code instead of FP, compile with possibly as little changes as possible, and have the result be indistinguishable from the original.

Here is a tiny website with a demo: http://funkpunk.sos.gd/

And here it is on GitHub: https://github.com/TheSos/funkpunk

It’s pretty much super early right now, but 90% of stuff works already! I hope this will come in handy to more people than me!

Let me know if this is something you were looking for :slight_smile:

Cheers! Sos


(Zachary Lewis) #2

Is your solution to just eschew the blitting onto a bitmap and just add sprites as individual display objects on the stage? How does this work with scaling and drawing offscreen objects?

I’m not criticizing, I’m genuinely curious what you’re doing in hopes of finding the best way to evolve the library’s baseline.


#3

I mostly just replaced Image.render()'s copyPixels/draws with adding Sprites, plus added simple pooling to speed memory management up!

Look here: https://github.com/TheSos/funkpunk/blob/master/graphics/Image.as#L132 (By now I alrerady moved that to Graphic.as to have overrides and cater for Canvas.as too, tho)

As for offscreen objects, I want to have a simple test that can be overriden, in case anyone needs that!

Currently I’m combating AIR’s mobile GPU SNAFU (latest versions screw everything up, as usual) and want to do some tests on actual mobile.

And feel free to criticize :slight_smile: I’m always up for a healthy dose of feedback, be it positive or negative! The thing is, I’m creating all that to cater for my own games, but since it appears nothing like this is out there, I wanted to share and help out other guys! I bet there are many games that would be cool for mobile made in FP!

Soon, I will be nagging everyone to try it out and report bugs too!


(Zachary Lewis) #4

Are you redrawing every graphic each tick, or are you checking for graphics that need updating? With this setup, you could probably get away with just calling copyPixels() once, then moving the containing Sprite to compensate for the camera offset. This could really speed stuff up for items like a large Tilemap or Backdrop.


#5

Nah, I’ll start thinking about optimisations when things get slow :stuck_out_tongue: For now I want to focus on getting it as compatible as possible

Oh, and I just got it to work with mobile, but ti seems to have hiccups as too much stuff gets created, I need to rework my pooling!


(Martí Angelats i Ribera) #6

I didn’t thought about this method. It’s pretty interesting.

Edit:Writting being sleepy is not a good thing O.o


(Jacob Albano) #7

I saw this a few days ago and I’m looking forward to having a chance to play around with it! Having a real job has gotten in the way of gamedev and participating on this forum. :confused:


(Zachary Lewis) #8

How dare you let your job get in the way of important stuff like this!? :anger::angry:


(Mike Evmm) #9

There’d already been some talk here about FunkPunk. I’m currently not using FlashPunk that much, since I’m trying out Haxe, but this kind of stuff is always great. Hope it goes well.


(FNX) #10

Damn, if you did this a couple of years ago I didn’t have to move to another engine :wink: Just made a quick test and it works, at first look it doesn’t seem to support smoothing when scaling… Am I wrong?


(Martí Angelats i Ribera) #11

Remember that stage3Dpunk is out (it have been there for quite a bit, now) and it supports the phones.


(FNX) #12

Yes, I worked a bit with Dave/Ultima trying to port my game with that engine but it was in its early stage and I had to move on… Anyway, back on FunkPunk, I managed to have letterbox fullscreen scaling working, smoothing working (I just realized that this is not a stage3d engine but a proper gpu engine so no direct in rendermode :stuck_out_tongue: ). One issue is that there’s an outline set on the text by default (which I don’t remember if was there in basic flashpunk) but set it to 0 solved text rendering problem. Performace are stable around 55/60 fps even if in a puzzle game there’s not much action :smile:

Good job Sos!


(mikale) #13

Awesome. It’s working for me! You have my full support with this.

Can we just integrate this method (whatever you did) to the official version already? :smile:


#14

Oh, wow! Glad to hear it works not only for me! Thanks! That’s super encouraging! :slight_smile:

I have broken my clavicle and can’t do coding at a decent pace for few weeks! Drop me a note if you want to use it and need any help or find any bgugs, it’ll all go on my todolist :slight_smile:


(Jacob Albano) #15

Yikes! Hang in there man!


(FNX) #16

Hello everyone, I made a quick game just for testing purposes with funkpunk on mobile and it just works :smile:

If you want to have a go you can download it here

I coded originally with normal flashpunk but the bouncing was a bit odd, with funkpunk it’s quite fluid! When I’ll have some more spare time I’ll try with something more complicated.


#17

Oh, hey! That’s cool :slight_smile: Glad to see people using it!


(Savvas Antoniou) #18

Any tutorials? How to set up FunkPunk?