Liquid Fun - Box2D became even better - SUCCEED !!!

  ... the case you feel the need for a new feature or want to submit one.

Liquid Fun - Box2D became even better - SUCCEED !!!

Postby valka » Mon Apr 07, 2014 9:51 pm

Hi,
This is like p0rn for Game-Devs!

https://developers.google.com/live/shows/6366108529459200

Update (17/4/2014): GForce did a great job here! he shared his work with us and made this easily possibe :)
i've managed to draw the particles (very ugly, sorry, but i was so eager to see these particles!),
it works very smooth on BlueStacks..
pretty sh!tty on my phone (LG Optimus 3D), sh!tty coz fps dropped from 45fps+ to 37fps+- with 1000 particles,
but very playable :) :) and its going to be awesome !!!



let the GLSL learning begin :) :) :) :)

BTW, im too lazy with GitHub, don't have time to learn how it works.
but for those that want to play with GForce's port on GLES2-AnchorCenter I uploaded the Lib:
http://www.valkaproductions.com/AndEngi ... LES2AC.rar

with the correct shader, that might be the outcome:
Image
Last edited by valka on Mon Apr 28, 2014 12:20 am, edited 11 times in total.
User avatar
valka
 
Posts: 97
Joined: Tue Aug 13, 2013 3:17 pm

Re: Liquid Fun - Box2D became even better

Postby Therdiday » Fri Apr 11, 2014 8:44 am

Absolutely invaluable addition! I will work on this eventually if no one else shows interest.
Therdiday
 
Posts: 343
Joined: Thu Oct 20, 2011 11:12 pm

Re: Liquid Fun - Box2D became even better

Postby valka » Fri Apr 11, 2014 2:14 pm

I'm going to allot most of my sleepless nights on adding these new features to AndEngine..
cant wait till i finnish my project to start this one!

I emailed to Daniel Wolff, one of the devs in google, and he said:
(libGDX port is same thing for andengine)
Glad to hear you're excited! It's a fun technology.
Check out JBox2D for a Java version of the app.
http://jbox2d.org/
Otherwise, it should be interesting. I'd love to see a libGDX port, especially one that uses a nice shader for the particles.
Keep us updated as you go along, and feel free to ask questions to the Google group:
https://groups.google.com/forum/#!forum/liquidfun
User avatar
valka
 
Posts: 97
Joined: Tue Aug 13, 2013 3:17 pm

Re: Liquid Fun - Box2D became even better

Postby smartus » Sat Apr 12, 2014 8:34 am

valka wrote:I'm going to allot most of my sleepless nights on adding these new features to AndEngine..
cant wait till i finnish my project to start this one!

I emailed to Daniel Wolff, one of the devs in google, and he said:
(libGDX port is same thing for andengine)
Glad to hear you're excited! It's a fun technology.
Check out JBox2D for a Java version of the app.
http://jbox2d.org/
Otherwise, it should be interesting. I'd love to see a libGDX port, especially one that uses a nice shader for the particles.
Keep us updated as you go along, and feel free to ask questions to the Google group:
https://groups.google.com/forum/#!forum/liquidfun


Good luck! Would love to see this, even the optimizations are great on their own. BTW you should get twitter, just by posting updates on this you could get hundreds of followers...

https://twitter.com/KulisAndroid/status ... 6099602432
User avatar
smartus
 
Posts: 510
Joined: Fri May 10, 2013 4:17 pm

Re: Liquid Fun - Box2D became even better

Postby valka » Sat Apr 12, 2014 10:35 am

smartus wrote:
valka wrote:I'm going to allot most of my sleepless nights on adding these new features to AndEngine..
cant wait till i finnish my project to start this one!

I emailed to Daniel Wolff, one of the devs in google, and he said:
(libGDX port is same thing for andengine)
Glad to hear you're excited! It's a fun technology.
Check out JBox2D for a Java version of the app.
http://jbox2d.org/
Otherwise, it should be interesting. I'd love to see a libGDX port, especially one that uses a nice shader for the particles.
Keep us updated as you go along, and feel free to ask questions to the Google group:
https://groups.google.com/forum/#!forum/liquidfun


Good luck! Would love to see this, even the optimizations are great on their own. BTW you should get twitter, just by posting updates on this you could get hundreds of followers...

https://twitter.com/KulisAndroid/status ... 6099602432


Geat idea :)
seems like we are all falling down to the social networking :lol:
User avatar
valka
 
Posts: 97
Joined: Tue Aug 13, 2013 3:17 pm

Re: Liquid Fun - Box2D became even better

Postby smartus » Sat Apr 12, 2014 11:59 am

valka wrote:
Geat idea :)
seems like we are all falling down to the social networking :lol:


It's necessary to survive :?
User avatar
smartus
 
Posts: 510
Joined: Fri May 10, 2013 4:17 pm

Re: Liquid Fun - Box2D became even better

Postby valka » Mon Apr 14, 2014 3:30 am

Update till now
(its 4:18am here.. and tomorrow are holidays here :? so enough hair pulling for today :) )

Digged into LiquidFun code, and its structure is the same as Box2D, only added some Particles cpp&h files.
rest of the code really seems to be optimized (all files sizes are dramatically changed)

I tried to override only the relevant files for the beginning and then just to compile an optimized version of Box2D,
like once was done when libGDX were updating their libs.

Had many errors about some unknown #include <algorithm>, but iv'e managed to fix that (a line was missing in libgdx mk file)

after that no success.. the compiler is throwing tons of errors..

seems to be something with the JNIEXPORT headers (the one's generetad by libGDX people, in the root of jni\Box2D, what is it ? the interface between C++ & Java ?)
these are the errors:
Syntax: [ Download ] [ Hide ]
Using cpp Syntax Highlighting
  1. [armeabi] Compile++ arm  : AndEngineLiquidFunExtension <= Body.cpp
  2. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp: In function 'void Java_com_badlogic_gdx_physics_box2d_Body_j
  3. niSetTransform__JFFFZ(JNIEnv*, jobject, jlong, jfloat, jfloat, jfloat, jboolean)':
  4. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:70:73: error: no matching function for call to 'b2Body::SetTr
  5. ansform(b2Vec2, jfloat&, jboolean&)'
  6. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:70:73: note: candidate is:
  7. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:162:7: note: void b2Body::SetTransform(const b2Vec2&
  8. , float32)
  9. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:162:7: note:   candidate expects 2 arguments, 3 prov
  10. ided
  11. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp: In function 'void Java_com_badlogic_gdx_physics_box2d_Body_j
  12. niApplyForce(JNIEnv*, jobject, jlong, jfloat, jfloat, jfloat, jfloat)':
  13. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:202:66: error: no matching function for call to 'b2Body::Appl
  14. yForce(b2Vec2, b2Vec2)'
  15. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:202:66: note: candidate is:
  16. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:742:13: note: void b2Body::ApplyForce(const b2Vec2&,
  17. const b2Vec2&, bool)
  18. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:742:13: note:   candidate expects 3 arguments, 2 pro
  19. vided
  20. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp: In function 'void Java_com_badlogic_gdx_physics_box2d_Body_j
  21. niApplyForceToCenter(JNIEnv*, jobject, jlong, jfloat, jfloat)':
  22. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:213:50: error: no matching function for call to 'b2Body::Appl
  23. yForceToCenter(b2Vec2)'
  24. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:213:50: note: candidate is:
  25. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:762:13: note: void b2Body::ApplyForceToCenter(const
  26. b2Vec2&, bool)
  27. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:762:13: note:   candidate expects 2 arguments, 1 pro
  28. vided
  29. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp: In function 'void Java_com_badlogic_gdx_physics_box2d_Body_j
  30. niApplyTorque(JNIEnv*, jobject, jlong, jfloat)':
  31. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:224:27: error: no matching function for call to 'b2Body::Appl
  32. yTorque(jfloat&)'
  33. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:224:27: note: candidate is:
  34. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:781:13: note: void b2Body::ApplyTorque(float32, bool
  35. )
  36. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:781:13: note:   candidate expects 2 arguments, 1 pro
  37. vided
  38. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp: In function 'void Java_com_badlogic_gdx_physics_box2d_Body_j
  39. niApplyLinearImpulse(JNIEnv*, jobject, jlong, jfloat, jfloat, jfloat, jfloat)':
  40. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:235:84: error: no matching function for call to 'b2Body::Appl
  41. yLinearImpulse(b2Vec2, b2Vec2)'
  42. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:235:84: note: candidate is:
  43. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:800:13: note: void b2Body::ApplyLinearImpulse(const
  44. b2Vec2&, const b2Vec2&, bool)
  45. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:800:13: note:   candidate expects 3 arguments, 2 pro
  46. vided
  47. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp: In function 'void Java_com_badlogic_gdx_physics_box2d_Body_j
  48. niApplyAngularImpulse(JNIEnv*, jobject, jlong, jfloat)':
  49. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:246:36: error: no matching function for call to 'b2Body::Appl
  50. yAngularImpulse(jfloat&)'
  51. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Body.cpp:246:36: note: candidate is:
  52. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:820:13: note: void b2Body::ApplyAngularImpulse(float
  53. 32, bool)
  54. C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//jni/Box2D/Dynamics/b2Body.h:820:13: note:   candidate expects 2 arguments, 1 pro
  55. vided
  56. make.exe: *** [C:/Users/Ruslan/Documents/Android/AndEngineACGames/AndEngineLiquidFunExtension//obj/local/armeabi/objs/AndEngineLiquidFunExtension/Box2D/Body.o]
  57. Error 1
  58.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4


BTW.. its my first try with ndk.. so if someone have any direction, i would love to hear any suggestion.
User avatar
valka
 
Posts: 97
Joined: Tue Aug 13, 2013 3:17 pm

Re: Liquid Fun - Box2D became even better

Postby GForce » Mon Apr 14, 2014 6:27 pm

Hey guys,
I'm from libgdx and I ported LiquidFun to libgdx some months ago. Since the box2d extension of AndEngine is basically the same as the Box2D version of libgdx I was able to port it to AndEngine very quick.

Check this out: https://github.com/finnstr/AndEnginePhy ... DExtension

I also edited the PhysicsTest in the andengine-examples to see if it works.
Just add this to onCreateScene()
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. ParticleSystem particleSystem = new ParticleSystem(mPhysicsWorld, new ParticleSystemDef());
  2.                
  3. ParticleGroupDef groupDef = new ParticleGroupDef();
  4. groupDef.flags.add(ParticleType.b2_waterParticle);
  5. groupDef.position.set(
  6.                 CAMERA_WIDTH * (30f / 100f) * (1 / PIXEL_TO_METER_RATIO_DEFAULT),
  7.                 CAMERA_HEIGHT * (80f / 100f) * (1 / PIXEL_TO_METER_RATIO_DEFAULT)
  8.                 );
  9.                
  10. PolygonShape parShape = new PolygonShape();
  11. parShape.setAsBox(CAMERA_WIDTH * (20f / 100f) * (1 / PIXEL_TO_METER_RATIO_DEFAULT) / 2f,
  12.                 CAMERA_WIDTH * (20f / 100f) * (1 / PIXEL_TO_METER_RATIO_DEFAULT) / 2f);
  13. groupDef.shape = parShape;
  14.  
  15. particleSystem.createParticleGroup(groupDef);
Parsed in 0.013 seconds, using GeSHi 1.0.8.4

I hope everything else still works because the original extension used a very old version of the box2d port and I updated it to the current one. I also havn't written a renderer for the liquid, because I havn't worked with AndEngine for a very long time. Maybe anyone else could do this. So at the moment you can't see the water but you can see the bodies swimming in it.

Have fun :)

EDIT:
If you want to learn more about how this project works, check out my libgdx-repository and especially the test class (or just ask me ;) ):
https://github.com/finnstr/libgdx
https://github.com/finnstr/libgdx/blob/ ... nTest.java
GForce
 
Posts: 10
Joined: Mon Mar 19, 2012 2:39 pm

Re: Liquid Fun - Box2D became even better

Postby Therdiday » Tue Apr 15, 2014 4:10 am

GForce, You da Man! :)

I'm updating your build with the realFrictionFactory updates, AnchorCenter changes and will throw it up on Github. I'll edit this post once that's complete... unless someone beats me to it.

EDIT:
Had it up and running, but then I started getting
Unable to execute dex: Multiple dex files define Lcom/badlogic/gdx/math/MathUtils$Atan2;
errors. Let the headaches begin!
Therdiday
 
Posts: 343
Joined: Thu Oct 20, 2011 11:12 pm

Re: Liquid Fun - Box2D became even better

Postby GForce » Tue Apr 15, 2014 12:21 pm

I never had this error yet, so it's hard to help you without seeing code... Maybe you can upload your changes to github?
GForce
 
Posts: 10
Joined: Mon Mar 19, 2012 2:39 pm

Next

Return to Features

Who is online

Users browsing this forum: No registered users and 9 guests