Hi guys!!
I'll try to keep this as short and organized as possible.
My name's Bruno and I'm new to the forum, but I've been working with B4A for a while now.
This place has been a great resource for me, so first of all, many thanks to all of you for the tutorials and answers. You really helped me a lot. Also many thanks to Erel for creating such an amazing tool.
UPDATE:
===============================================
I DID IT!!!!!
I successfully ported the app from GameView to libGDX.
Please be so kind to test it and give me some feedback on performance results.
It works great on my Asus tablet and Xperia phone.
===============================================
About The Project:
I'm currently creating a fighting game / beat'em'up engine called "Bulldozer Engine".
My goal is to build games like Streets Of Rage, Final Fight or Street Fighter with great responsiveness and speed. I'm using Street Fighter 3 sprites and a hi-res 16-bit-era style background in order to stress test the app.
This is the main module:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
As you can see, I have the Animation Cycle separated from all the other modules, because I want the Animation to run at 24 FPS and the game engine to run at 60 Hz. These numbers are defined in Process_Globals:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
At the end of the Main Cycle, I have a module called Auto-Adjust FPS which compensates the animation speed, in case the frame rate drops momentarily. This option can be set on or off with ease.
Now, my little big problem:
So far I'm even surprised with how much I've accomplished in only 4 weeks but yesterday I've encountered a big problem.
My (quite unfinished) game engine runs great on my ASUS tablet (ME173X) but runs very slow on all other devices that I've tested. I've uploaded reference videos for every device where I tested this app.
Even with all the modules disabled, leaving only the Animation, the engine still runs slow.
I guess the problem is that I'm using the lib GameView and for what I've been reading in other posts, I should be using libGDX because it operates directly with OpenGL.
If this is the case, I really need your guys help in order to "port" my app from GameView to libGDX.
DEBUG Videos:
ASUS ME173X: Perfect Animation and Speed
Sony Xperia P: Slow
HTC One M7: Slow
Samsung Galaxy S3: Slow
PC Emulator Andy: Unplayable
Here's a link to the GameView version, so that you can test it yourselves.
Thanks in advance for the help!
PS: Note that the HTC One is far superior to my ASUS tablet and still it runs slow.
			
			I'll try to keep this as short and organized as possible.
My name's Bruno and I'm new to the forum, but I've been working with B4A for a while now.
This place has been a great resource for me, so first of all, many thanks to all of you for the tutorials and answers. You really helped me a lot. Also many thanks to Erel for creating such an amazing tool.
UPDATE:
===============================================
I DID IT!!!!!
I successfully ported the app from GameView to libGDX.
Please be so kind to test it and give me some feedback on performance results.
It works great on my Asus tablet and Xperia phone.
===============================================
About The Project:
I'm currently creating a fighting game / beat'em'up engine called "Bulldozer Engine".
My goal is to build games like Streets Of Rage, Final Fight or Street Fighter with great responsiveness and speed. I'm using Street Fighter 3 sprites and a hi-res 16-bit-era style background in order to stress test the app.
This is the main module:
			
				B4X:
			
		
		
		Sub Main_Engine_Cycle_Tick
    cycle_number = cycle_number + 1
    '================================================================
    If First_Cycle = True OR counter >= Ceil(cycle_fps/sprite_fps) AND cycle_fps <> 0 AND real_fps <> 0 Then
            
                    counter = 0            
            
                    start_calc_fps = DateTime.Now
            
                    Do Until active_actor = number_of_actors
            
                            Animation                
                                                
                            active_actor = active_actor + 1
                                                
                    Loop
            
                    If active_actor >= (number_of_actors - 1) Then
                        active_actor = 0
                    End If            
            
    End If
    '================================================================
    Scroll_Update
    Do Until active_actor = number_of_actors
        
                BG_Scroll_Test
        
                Actor_Orientation
        
                Body_Part_Location
        
                AI_Set_Destination
                        
                Player_Move
        
                AI_Move
        
                Check_Boxes
        
                Player_Colision_Detector
        
                AI_Colision_Detector
                                      
                AI_Interaction
        
                AtkStr_Control
        
                Display_LifeBars    
                active_actor = active_actor + 1
        
    Loop
    If active_actor > (number_of_actors - 1) Then active_actor = 0
    '================================================================
    If active_actor = 0 Then Bubble_Sort
    counter = counter + 1
    actors.Invalidate
    '================================================================
    If (cycle_number Mod 2 ) = 0 Then
        If cycle_number = 2 Then cycle_number = 0
        cycle_start = DateTime.Now
    Else
        cycle_end = DateTime.Now
    End If
    end_calc_fps = DateTime.Now
    '================================================================
    'Calculate Animation FPS
        timestamp = end_calc_fps - start_calc_fps
    'Calculate Engine FPS
        cycle_time = (cycle_end - cycle_start)
        cycle_fps = Abs(Round2((1/cycle_time*1000), 2))
    'Calculate Discrepancies
        fps_dif = (real_fps - target_fps)
        cycle_dif = (cycle_fps - game_speed)
    Auto_Adjust_FPS
    First_Cycle = False
End SubAs you can see, I have the Animation Cycle separated from all the other modules, because I want the Animation to run at 24 FPS and the game engine to run at 60 Hz. These numbers are defined in Process_Globals:
			
				B4X:
			
		
		
		Sub Process_Globals
    
        'Engine Settings
            'ENGINE MODE OPTIONS
     
                Dim game_speed = 60 As Int              ' - Default: 60Hz
                Dim cycle_fps = game_speed As Float
                Dim target_fps = 24 As Int              ' - Desired FPS for optimal animation
                Dim sprite_fps = target_fps As Float    ' - Starting animation FPS
            (...)At the end of the Main Cycle, I have a module called Auto-Adjust FPS which compensates the animation speed, in case the frame rate drops momentarily. This option can be set on or off with ease.
Now, my little big problem:
So far I'm even surprised with how much I've accomplished in only 4 weeks but yesterday I've encountered a big problem.
My (quite unfinished) game engine runs great on my ASUS tablet (ME173X) but runs very slow on all other devices that I've tested. I've uploaded reference videos for every device where I tested this app.
Even with all the modules disabled, leaving only the Animation, the engine still runs slow.
I guess the problem is that I'm using the lib GameView and for what I've been reading in other posts, I should be using libGDX because it operates directly with OpenGL.
If this is the case, I really need your guys help in order to "port" my app from GameView to libGDX.
DEBUG Videos:
ASUS ME173X: Perfect Animation and Speed
Sony Xperia P: Slow
HTC One M7: Slow
Samsung Galaxy S3: Slow
PC Emulator Andy: Unplayable
Here's a link to the GameView version, so that you can test it yourselves.
- Dumb AI: http://www23.zippyshare.com/v/5998905/file.html (Easy)
- Smart AI: http://www4.zippyshare.com/v/71125668/file.html (Hard)
Thanks in advance for the help!
PS: Note that the HTC One is far superior to my ASUS tablet and still it runs slow.
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
	
								
							
							 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		