#T-1...
Ha - actually published my game on time! Well looking back I can say that it is good for me to be under some kind of pressure to finish a game on time. Overall I can say that I am happy with the result. Overlap2d really helps visualize your game. While Box2d does away with a lot of complications you would otherwise have to take care of yourself.
That said - there are still a lot of situations for which box2d is not the best solution. Have a look at this article : http://www.learn-cocos2d.com/2013/08/physics-engin.... Possibly we could do with a physics engine for games...
That being said, for this game Box2d did help me a lot.
For the overall game I did have to cut features of course, and I am sorry to say that there are no tentacles present in this release.I did have some issues with Overlap2d which caused me to loose quite some time. Here are some of the obstacles I ran into. Hopefully this will help some of you to avoid some of the same mistakes I made:
- Spriter animations are using the world units for scaling, so when setting anything else then 1 the sprites are blown up out of proportion. For box2d the 'recommandation' is to use world units My solution for now was to ignore this recommandation. It seems to work ok with WU set to 1. (My resolution being 1920x1080).
- Rotating anything other then a composite gets stuck in the editor. I needed to rotate the 'wind' elements in my game. Rotating anything in the Overlap2d editor other then a composite caused the element to become unselectable. This actually caused me a lot of delay. I eventually moved all the wind elements in composites that I could rotate without problems.
- Particles within composites are not placed incorrectly on the screen. I wanted bubbles coming out of the air supply tanks floating in space. When you add a particle in a composite in Overlap2D this is not displayed correctly. My quick fix was to remove the particles from the editor and create them on the fly when setting up the entities.
- Rotating box2d elements in Overlap2D does not work. The rotation is undone as the physics body actually takes presedence over the rotation in the transform component. My work arround for this was to store the rotation before the first initialisation of the box2d world. Then initialise the word and then in code set the rotation for the box2d elements.
- I was not able to figure out how to fadeout the entire scene. This used to be easy when there still was a scene2d screen behind. Now I still see the actions in the git directory but don't know how we could apply these. We really need more good examples of games made with Overlap2D!
But the most important issue I still have is with the performance. Performance on my pc is great. Performance on my phone (a S5 Neo) not so. I need to spend some more time to analyse what is causing the delay. My suspision was the combination of the rotations and the many composite objects used in the game.
I did a little tuning exercise to find out:
Pc 60FPS Times in milisec. messured over 5 sec
Timer class com.uwsoft.editor.renderer.systems.SpriteAnimationSystem 0
Timer class com.uwsoft.editor.renderer.systems.ParticleSystem 2
Timer class com.uwsoft.editor.renderer.systems.LightSystem 0
Timer class com.uwsoft.editor.renderer.systems.LayerSystem 193
Timer class com.uwsoft.editor.renderer.systems.PhysicsSystem 54
Timer class com.uwsoft.editor.renderer.systems.CompositeSystem 185
Timer class com.uwsoft.editor.renderer.systems.LabelSystem 0
Timer class com.uwsoft.editor.renderer.systems.ScriptSystem 47
Timer class com.uwsoft.editor.renderer.systems.action.ActionSystem 0
Timer class com.uwsoft.editor.renderer.systems.render.Overlap2dRenderer 595
Timer class com.uwsoft.editor.renderer.systems.ButtonSystem 0
Timer class com.mvm.lost.systems.MovementSystem 0
Timer class com.mvm.lost.systems.CameraSystem 0
Timer class com.mvm.lost.systems.WinningSystem 0
Timer class com.mvm.lost.systems.WindForceSystem 2
Timer class com.mvm.lost.systems.AirSupplySystem 1
Timer class com.mvm.lost.systems.RewardPickupSystem 0
Android S5Neo 16FPS
01-17 00:40:28.559: I/System.out(10306):
Timer class com.uwsoft.editor.renderer.systems.SpriteAnimationSystem 1
Timer class com.uwsoft.editor.renderer.systems.ParticleSystem 99
Timer class com.uwsoft.editor.renderer.systems.LightSystem 0
Timer class com.uwsoft.editor.renderer.systems.LayerSystem 1785
Timer class com.uwsoft.editor.renderer.systems.PhysicsSystem 363
Timer class com.uwsoft.editor.renderer.systems.CompositeSystem 933
Timer class com.uwsoft.editor.renderer.systems.LabelSystem 0
Timer class com.uwsoft.editor.renderer.systems.ScriptSystem 795
Timer class com.uwsoft.editor.renderer.systems.action.ActionSystem 0
Timer class com.uwsoft.editor.renderer.systems.render.Overlap2dRenderer 6035
Timer class com.uwsoft.editor.renderer.systems.ButtonSystem 0
Timer class com.mvm.lost.systems.MovementSystem 12
Timer class com.mvm.lost.systems.CameraSystem 1
Timer class com.mvm.lost.systems.WinningSystem 2
Timer class com.mvm.lost.systems.WindForceSystem 41
Timer class com.mvm.lost.systems.AirSupplySystem 3
Timer class com.mvm.lost.systems.RewardPickupSystem 1
So on android in 5 sec. my game spends 6 sec. rendering. That does not look good:) The composite system also takes a lot of time. I tried hiding layers in Overlap2D to see if this would improve performance. Strangly enough it did not. So I will need some more time to study on this.
As I started this post saying I am happy with the result! I think I should end this post it with some shameless self promotion :) So - have a look at the final result! http://merijn.itch.io/lost