Saturday, June 13, 2015

Haxe Android FrameRate Drop

Doing some reasearch on this: http://www.openfl.org/archive/community/programming-haxe/android-fps-drops/ You might consider what rendering you are using. If you are still using copyPixels or draw, which perform well in Flash's software renderer, its about the slowest you can go on hardware. The display list is faster, or drawTiles/drawTriangles If you are using one of these fps drop is inevitable, because these are using cpu and expensive processes. - Masking - Bitmap drawing or creating bitmap - Gradient line drawing - Filters - Color transform You should also check that you aren't using debug mode also. This may lead fps drop also. I apologize for dropping into an older thread, but I wanted to mention I just created a logical error in our stage rendering code. It was rendering on "lastRender + framePeriod", which, if the application was allowed to sleep, could result in a drop of several frames per second if the "lastRender" was not exactly at the desired time, but later due to an idle wakeup. The system was not under stress, it just wouldn't try to do enough frames. This is the cause of the behavior where more stress on the device would result in better frame rates, much to the confusion of most people. This logic fix will go out in the next version of openfl-native. Have a great day!

Bunny Mark

SO... Either I have a really slow phone...
Or my "optimized" tilemap rendering code is not that optimized...

Going to download 
http://haxeflixel.com/demos/FlxBunnymark/
And run it to see how it works...

Tried using downloadSVN to download the demo from the Git Repo.
No luck. Instead used:

haxelib install flixel-demos
on the command line.


UPDATE#1: Looks like bunny benchmark is dependant on bitFive... Hmm...
        Better look into what bitFive is doing. As I know it had
        something to do with drawing optimizations.

On command line:
haxelib install openfl-bitfive



UPDATE#2: Running the demo from the flixel project failed.
          Did not recognized bitFive was installed.
          Actually, the entire libraries folder was EMPTY...
          Like the project XML wasn't valid or anything..

SO now:
On command line:
haxelib install flixel-tools

Trying to build a fresh bunnyMark example using flixel-tools.
If this doesn't work... I don't know.. I feel kind of stupid having
to try this hard just to get something running that I should be able
to easily download.


UPDATE#3:
Error: ///////////////////////
Error: Could not find haxelib "openfl-bitfive", does it need to be installed?
Build halted with errors (haxelib.exe)."
//////////////////////////////

Using the command line, it installed openfl-bitfive version 3.0.
My guess is I need to take out the version requirements somewhere in
a config file.

Because: When I do "haxelib install openfl-bitfive"
on command line, it tells me:
"You already have openfl-bitfive version 3.0.0 installed.

UPDATE#4:
Went to "C:\DEV\Programs\Haxe\haxe\lib\openfl-bitfive\3,0,0"
And stripped the version number out of haxelib.json in that folder.
I kept the version variable, but it is now set to an empty string.

Hmm... The
""
Within my Project.xml is still causing my "References" folder in my
FlashDevelop project to become blank. I know this happens whenever you
put a library path that cannot be found. When I comment out
 from my Project.xml, the "References" folder
directories show up again in the project explorer...

So I guess stripping the version number out did not work...
Maybe the library is identified differently? I am typing something wrong?


UPDATE#5: Read some read-me files:: Trying this in 
Project.xml (Which read me refers to application.xml)
 //Commented this out.
 //replaced with this.

I can now see my library references in the project explorer, but don't know
if anything will actually run.

UPDATE#6: No luck...
I really want to run this demo to see if I am doing something wrong with my optimized
rendering... Or if Flixel is using better rendering methods than me.... GRRR.
I am pretty sure my phone is just ancient and super slow... That is what I am hoping for
because my flash code runs super awesomely fast.

UPDATE#7: Not cool... I wonder if I can find bunnyMark on the app store and just download it?
          I don't want to use flixel. I just want a bench mark to see how it runs on my phone.


Fruitless search terms:
openfl-bitfive not found
openfl library not found in solution explorer
openfl-bitfive not compiling

Monday, June 8, 2015

Tile sheets. Render in Haxe

http://haxecoder.com/post.php?id=21 Oh my.. I better look into this before I continue my work. Just in case I am screwing up royally. UPDATE: http://seanodowd.me/getting-started-with-haxe-2014/

RoxLib is where it is at for gestures in Haxe

This person did a good job documenting the features in this post: http://fugocode.blogspot.com/2013/07/openfl-gestures-using-roxlib-gesture.html

Haxe Touch Events

nme.events.TouchEvent.TOUCH_BEGIN nme.events.TouchEvent.TOUCH_MOVE nme.events.TouchEvent.TOUCH_END Looks like what I need. Interesting that I coincidentally coded some events in my engine using: START, CONTINUE, and END Very similar to this format. Hopefully that means coding this up will be easy. http://www.openfl.org/archive/community/programming-haxe/nmeeventstouchevent-are-not-sensitive/ UDPATE: //here: http://stackoverflow.com/questions/9229419/as3-pinch-zoom-and-single-finger-drag-detection Has something called "TransformGestureEvents" UPDATE: //Mentions standards of some sort including MSPointers that might be good to research. Knowing how to think about this stuff is important. http://www.sitepoint.com/unifying-touch-and-mouse-with-pointer-events/

Signing into blogger signs me out of GMail.

I don't enjoy how google likes to sign me out of my gmail when I sign into blogger. When google decided to link Youtube, Blogspot, and who knows what else all together... It became a real pain for me. And my productivity has suffered. Usually my solution is just to... Don't check email that much. And don't update blog as much as I should. Here are some other solutions: http://equalsdrummond.name/2010/01/24/fixing-the-google-account-problem/ I think a better solution might just be... Only using google for gmail. And finding alternative services for blogs that don't kill my productivity. Been reading a book on systems theory called "The 5th Discipline" and context switching is a big deal. ----------------------------------- In games news: Working on some basic Haxe Engine code for a game I want to make for the phone. Writing engines is a dangerous thing to do for someone trying to make a game. I've been down that road before. But I know exactly what I want and I have the experience to pull this off. And it will save me some problems down the road because I wont have to hack-up flixel like I did with my AS3 code base. You try to respect encapsulation, but it only goes so far when you need to make big changes. -John Mark UPDATE: Speaking of the inefficiencies I was talking about with google accounts. This was the original reason I logged in: https://github.com/rockswang/roxlib I am doing research into multi-touch so I can program a pinch/pull gesture for zoom control.

Tuesday, June 2, 2015

APK Push and Stuff

Casting: Use Std.int( someFloat); NOT: cast( someFloat, int); Latter will work for Flash target only. Debug APK in relase mode? http://www.openfl.org/archive/community/programming-haxe/android-why-apk-marked-debug/ Installing .apk on phone: adb push c:\TEST2.apk /sdcard/test2.apk adb shell pm install /sdcard/test2.apk alternatively: adb install c:\TEST2.apk or maybe it was... adb install c:\TEST2.apk /sdcard/test2.apk Whatever. One of these works.