Kivy Particle 2.0 and a Simple Example Application

691 views
Skip to first unread message

Kovak

unread,
Apr 17, 2013, 8:34:53 PM4/17/13
to kivy-...@googlegroups.com
Hi Everyone,

I recently did a refactoring and initial cythonization of kivy particle. The end result is that your particle effects should see a performance increase of around 10-50%.

You can find it here: https://github.com/chaosbuffalolabs/kivy-particle

Bug Fixes and new Features:
Code is now cythonized and has a recipe for python-for-android
Support for setting and resetting blend functions
emitter_x and emitter_y values have been removed in favor of using widget's pos
render code has been changed to use scale instead of calculating new points for the quad

A new version of Particle Panda that makes use of the new blend features and contains some bug fixes will be updated on the play store today/tomorrow.

You can find the source for Particle Panda here as well: https://github.com/chaosbuffalolabs/ParticlePanda

I have included a simple demo to give an example of how particle effects could be introduced to your application and how they can be dynamically controlled. However, to make it work you will now have to build your kivy particle library.

The simplest way is to checkout kivy-particle, run python setup.py build_ext --inplace and then copy and paste the library into the root folder of the demo.

If you want to build for android you will now have to build a distribution of kivy with the kivyparticle recipe. Just place the kivyparticle recipe in your recipes folder and then ./distribute.sh -m "kivyparticle kivy_stable"

Just as a note: you will need to modify the recipe if you want to use the most current version of kivy rather than kivy_stable

Change the line
DEPS_kivyparticle=(kivy_stable python)
to
DEPS_kivyparticle=(kivy python)

and then ./distribute.sh -m "kivyparticle kivy"

Thanks Everyone and please let us know if there's anyway we could improve kivy particle or if you encounter any issues!

At the moment everything has only been tested on an Asus Transformer TF101, a Motorola Droid 4, and Ubuntu 12.04

-Jacob Kovac
Chaos Buffalo Labs





kivyparticle-demo.zip
kivyparticle_recipe.zip

Kovak

unread,
Apr 19, 2013, 1:47:25 PM4/19/13
to kivy-...@googlegroups.com
Hi Everyone,

Particle Panda 1.1.0 is now live on the play store! You can find it here: https://play.google.com/store/apps/details?id=org.cbl.particlepanda&hl=en

If you have any particle effects you've created make sure to back up your user_effects file as they will not survive the upgrade.
If anyone has figured out a way around this please share, it'd be nice to be able to preserve user files.

Change log:
bugfix: lifespan and lifespan variance now increments by .1 instead of 1
new feature: color panel now has a blend function selection popup
bugfix: files now load upon  selecting their picture as well as name
bugfix: fps counter now automatically starts

We also decided to make the app free to help showcase kivy's abilities and hopefully to provide a quality tool for kivy's growing game dev community.

Thanks,
-Jacob

J.H

unread,
Apr 22, 2013, 12:09:11 PM4/22/13
to kivy-...@googlegroups.com
Hello,

Thank you for your work. 

I updated Panda Particle on wiko peak smartphone, it's good, running better, better performance.

I test the demo after setup.py build_ext --inplace and copy the .so file into demo folder, it's ok.

I want now test your work and update my android apps. So I set DEPS_kivyparticle=(kivy python)
and ./distribute.sh -m "kivyparticle kivy". But I've error like :

Call prebuild_kivyparticle
Run build
Call build_sdl
Entering in ARM enviromnent
Compiler found at /media/DATA/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin//arm-linux-androideabi-gcc
rm -f /media/DATA/android/python-for-android/src/jni/../libs/armeabi/lib*.so /media/DATA/android/python-for-android/src/jni/../libs/armeabi-v7a/lib*.so /media/DATA/android/python-for-android/src/jni/../libs/mips/lib*.so /media/DATA/android/python-for-android/src/jni/../libs/x86/lib*.so
rm -f /media/DATA/android/python-for-android/src/jni/../libs/armeabi/gdbserver /media/DATA/android/python-for-android/src/jni/../libs/armeabi-v7a/gdbserver /media/DATA/android/python-for-android/src/jni/../libs/mips/gdbserver /media/DATA/android/python-for-android/src/jni/../libs/x86/gdbserver
rm -f /media/DATA/android/python-for-android/src/jni/../libs/armeabi/gdb.setup /media/DATA/android/python-for-android/src/jni/../libs/armeabi-v7a/gdb.setup /media/DATA/android/python-for-android/src/jni/../libs/mips/gdb.setup /media/DATA/android/python-for-android/src/jni/../libs/x86/gdb.setup
Compile thumb  : application <= start.c
ccache /media/DATA/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -MMD -MP -MF /media/DATA/android/python-for-android/src/obj/local/armeabi/objs/application/src//start.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/media/DATA/android/python-for-android/src/jni/../jni/application -DANDROID -I/media/DATA/android/python-for-android/src/jni/../jni/application/src/ -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl/include -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl_mixer -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl_image -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl_ttf -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl_net -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl_blitpool -I/media/DATA/android/python-for-android/src/jni/../jni/application/../sdl_gfx -I/media/DATA/android/python-for-android/src/jni/../jni/application/../png -I/media/DATA/android/python-for-android/src/jni/../jni/application/../jpeg -I/media/DATA/android/python-for-android/src/jni/../jni/application/../intl -I/media/DATA/android/python-for-android/src/jni/../jni/application/.. -I/media/DATA/android/python-for-android/src/jni/../jni/application/../../../build/python-install/include/python2.7 -finline-functions -O2 -Wa,--noexecstack -O2 -DNDEBUG -g -I/media/DATA/android/android-ndk-r8c/platforms/android-14/arch-arm/usr/include -c  /media/DATA/android/python-for-android/src/jni/../jni/application/src//start.c -o /media/DATA/android/python-for-android/src/obj/local/armeabi/objs/application/src//start.o 
/media/DATA/android/python-for-android/src/jni/../jni/application/src//start.c:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
make: *** [/media/DATA/android/python-for-android/src/obj/local/armeabi/objs/application/src//start.o] Error 1

I run Kivy 1.6.0
Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Linux version 3.2.0-39-generic (buildd@lamiak) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #62-Ubuntu SMP Thu Feb 28 00:28:53 UTC 2013
Ubuntu 12.04.2 LTS

And python-dev is installed. I can build "pil kivy" but can't "kivyparticle kivy". I'm not familiar with C/C++...

Another question is did you change the xml structure between old and new version ? Only emitter change or instanciate process too ?

Thank your for your advice and answers.

J.H



Kovak

unread,
Apr 22, 2013, 4:17:54 PM4/22/13
to kivy-...@googlegroups.com
Hi J.H.,

Particle Panda is built with kivy 1.5.1. Frankly, I just tried a few different solutions to build with kivy 1.6.0 and it just won't compile all the way. Using kivy 1.5.1 if you run into the error you posted you can try changing the DEPS_kivyparticle=(kivy_stable python) to DEPS_kivyparticle=(kivy_stable) that worked for compiling the kivy particle demo for android for me. Although Particle Panda is compiled with the original recipe. I'm not entirely certain on some parts of the build chain. The error you got is related to the python library not building correctly. Even getting past it I ran into another error in cython compilation of the kivy library on 1.6.0. I almost never use the latest branch of kivy because of compiling issues. I'd suggest just working with kivy_stable unless there's some feature out of 1.6.0 you absolutely need.

The XML file structure did not change for kivy particle with the update. Mostly things were just cleaned up a little and code was cythonized.

J.H

unread,
Apr 22, 2013, 5:06:33 PM4/22/13
to kivy-...@googlegroups.com
Thank you for information.

I'll use 1.5.1 for my next particle apps. My current apps with 1.6 version will use old particle lib for the moment.

J.H

Kovak

unread,
Apr 22, 2013, 9:25:13 PM4/22/13
to kivy-...@googlegroups.com
Hi J.H.,

I just tried again and kivyparticle compiles for kivy 1.6.0 without a problem, I've got the demo app running on my droid 4 at the moment. I've attached the recipe for kivyparticle I used. You will also want to use the branch of kivy found here: http://kivy.org/#download the current one that auto-downloads using the python-for-android kivy recipe is a 1.6.1 dev branch that has an error in compiling the context files. You may want to perform a git clean -dfx to make sure you're starting with fresh everything. Remember to back up anything that isn't default.

However, the canvas scale function has changed and I'll need to make those changes in kivy particle, I'll release a kivyparticle for 1.6.0 tonight
recipe.sh

Kovak

unread,
Apr 22, 2013, 10:40:15 PM4/22/13
to kivy-...@googlegroups.com
Ok everyone,

Here is a version of kivy-particle that's compatible with the scale change in 1.6.0:
https://github.com/chaosbuffalolabs/kivy-particle/tree/kivyparticle-for-1.6.0kivy

pre-1.6.0 you can find here still:
https://github.com/chaosbuffalolabs/kivy-particle/tree/kivyparticle

I wouldn't recommend using the master branch of kivy-particle. It's a more experimental branch that implements some features that have to do with particle effects on scrollable maps.
Reply all
Reply to author
Forward
0 new messages