Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Full Project Uploaded To GitHub - Can Someone Look At The Code - Want Better Performance!

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 22nd Oct 2019 01:10
Hi,

This is one of our best...but HTML5 version is a little slow...
Android version runs 30 FPS(full speed) on a 5 year old $40 Android tablet.
Can someone look over the source code and let us know if we are doing terrible things?

I am lead programming for this game project, but I am not an expert.
I've done a lot to optimize, but the game is not as fast as it should be...

Click below URL link to see the full source code on GitHub:
https://github.com/FallenAngelSoftware/AppGameKit2-SpaceSwap
(above is the 100% full project with source code and resources which builds & runs on both AppGameKit Classic & Studio)

Thanks!

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 22nd Oct 2019 01:21 Edited at: 22nd Oct 2019 01:51
In [Options] screen, enter Secret Code: "2777" for Frames Per Second display...

EDIT #1:
- PNG images optimized using: www.TinyPNG.com
- OGG music optimized using: www.skyshape.com/oggresizer-vorbis-compressor.html

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 22nd Oct 2019 08:18 Edited at: 22nd Oct 2019 08:56
Well there are many things that can improve your games speed jezlee, I am not going to look though 5k lines of code in a crazy web of function hunting though to optimize it. If you want some serious help i would recommend putting all the functions that do not run in the active Game play loop into a separate include file off to the side. and re-upload it. Upon a quick examination there are a few functions that are repeated that do not need to be repeated and you have far to much tied into the sync system that i think is slowing it down from its potential. That said u can change 1 line sync() to render() swap() and ull get more performance but not much my phone goes from 56 to 60. might go higher but i feel ur sync system is limiting it. There are different ways to control the sync(). I prefer to never actually use sync because it rarely is optimized. Running everything within the sync loop is also a bad idea because the entire game loop is limited to the refresh rate. syncrate(30) do print"hi"sync()loop will print hi 30 times a second. when in actuality it can print hi about 4k times a second at its full potential but you only need to show it 30 times a second.

I use something like this to control multiple loop speeds things that need to run fast and things that dont and manually syncing things that need a visual update im sure this can be improved upon.



that said your game looks great and well designed code runs smooth and identical on multiple devices. very clear to read and variables have nice names, organization could be a little better for your dev purposes.
this is what i mean by organizing. this is a main source file. the entire game will run from this screen. first function is ran. it goes into its own loop that it stays in until it exits then the second function is ran back into its own loop again. and since a large function like login has its own source file names after it so there never any guessing where the function is. each source has its own global that are used inside of it as for easy programming. But to each their own. Give 100 programmers the same short task and you will get 100 different results. so what it comes down to is did you make a good product that works and are you happy with it lol.

Attachments

Login to view attachments
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 23rd Oct 2019 21:21
Hi,

Very interesting suggestions!
I'll try some things.
Many thanks!

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 24th Oct 2019 00:30
Hi,

Found the bottleneck...
Game runs 100% faster now, with 20 FPS on RPi 3b+
(originally was 10 FPS)

Thanks!

Jesse

JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com

Attachments

Login to view attachments
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 25th Oct 2019 19:51
hell yeah. awesome man what was ur bottleneck?

Login to post a reply

Server time is: 2024-11-23 08:26:05
Your offset time is: 2024-11-23 08:26:05