Is AGK S Fast Enough?

Started by Pfaber11, June 11, 2023, 18:31:23

Previous topic - Next topic

Pfaber11

I didn't think it was at one time but have changed my opinion. I now think it is. There are several things that can speed things up, using a lower resolution, not doing all the calculations in one frame instead do this over several frames , camera range and shadow range can also make a difference. What I am working on recently was down to 45 fps and I thought that AGK S just could not do what I wanted. After some work using the above methods I now get 135 fps which is a massive improvement. These are the lowest frame rates in my game on this computer. According to something I read it said AGK S was 2 to 3 times faster than Blitz3D which I think is a compiled language. 
I've tried a few languages one of them I thought was the holy grail of basic (Pure Basic) but looking at it all in hindsight I think AGK S with the odd addon is a very nice piece of software. I did have problems with Pure Basic but maybe that was just me. I wanted to try Pure Basic and if there were not so many workarounds and everything worked without issue then great, I think it all works fine until you use the Ogre 3d . I experienced tearing and the shadows were not that great, I also dislike the way it handles the sun. I was gonna try it with raylib for purebasic but I really don't want to be back to learning a load of new stuff. Overall AGK S is the best language for me .  
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Alienhead

AGK S = Vulkan graphics which is way out in front of Opengl or directX as far as speed and optimization goes..



markcwm

Hi,

yes I used to use PB and think it is a great Basic for app development but I never used the Ogre3D wrapper.

What is AGK S, was it released recently? Does anyone know if you can write your own shaders for AGK2? 

Naughty Alien

..PB is capable both app development as well as 3D games. There are some impressive 3d demos done by PB and only issue i have had is, to align media toolchain properly (exporters and stuff like that), and you should know thing or two about shaders..other than that, i think its fantastic and when/if eventually gets updated renderer, it should be even better..

Pfaber11

There you are it's probably my programming. If when it gets a new renderer I may use it again. Me and Ogre 1.8 just don't get on .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Steve Elliott

AGK is definitely fast enough for 2D games on modern powerful computers - even if it's an interpreted language.  If you have a heavy logic based game then it will take a hit against a compiled language, but generally it's fast enough.

For 3D it's not as sophisticated as the competitors out there, lacking in features, but would still be fast enough for the types of project that could be produced by a very small team or sole coder.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Pfaber11

#6
I've done some animation with AGK S and liked the way it worked. With ogre it's the skeleton method which I don't really like. I will try and put my PB demo onto itch.io so you can see it . I'll put it on the PB bit of the forum so you can see what I made with it and how it works.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Naughty Alien

Quote from: Pfaber11 on June 17, 2023, 11:52:09I've done some animation with AGK S and liked the way it worked. With ogre it's the skeleton method which I don't really like. I will try and put my PB demo onto itch.io so you can see it . I'll put it on the PB bit of the forum so you can see what I made with it and how it works.

..Skeleton animation is only one part regarding PB..basically, once you have rigged your skeleton, you have to do 'skin mesh' in order to see surfaces of your animated mesh moves correctly and without 'cracks' which are visible when you implement dynamic lights..thats why proper exporter (Ogre MESH exporter) should be used to export all of your media, especially animated objects..once this is done properly, lighting will work fine and as expected..so you make sure that whatever modelling program you using, does have MESH exporter, if you really want to use PB..

Pfaber11

#8
I have decided to shelve PB for a while and stick with AGK for the time being. It is just so nice to know what I'm doing and it works. I had a problem with tearing in PB however I removed a tree and it cured it. I'm now gonna  put my demo together and show you what I made with PB.  The link is on the PureBasic  section .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

@ Alienhead yes I do use vulkan and it is really good. But I want my games to run on OpenGL as well as half the computers out there can't run it. 
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

RemiD

Quote from: Pfaber11 on June 11, 2023, 18:31:23There are several things that can speed things up, using a lower resolution, not doing all the calculations in one frame instead do this over several frames , camera range and shadow range can also make a difference.
to this you can add others optimisations :

- premake meshes and textures as much as possible.

- precapture reflections cubemaps.

- prebake lightning shading when possible.

- only consider the entities which are around an entity before checking for collisions (or raypick).

- decrease the number of vertices / triangles / surfaces in meshes.

- decrease the size of textures.

- combine static surfaces, of a zone, into one surface (with one texture).

- limit the number of 3d entities, (use maths to calculate translations and positions).

- update one ai of one bot per frame (near enough and last updated).

Pfaber11

I find having my laptop plugged in gives a frame boost also. As of today i'm on a new machine seems ok and runs my games fine.  Only got 8gb of ram though so may upgrade.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

I've found a nice way to get a higher fps . If you alter the figure at the end it breaks the terrain up into pieces . 48 works well for me at the stage I'm at and  I get about 30 fps increase . 
CreateObjectFromHeightMap(1,"xgameheightmap1.png",2560,60,2560,2600,48)
4 , 8 , 16 , 32 , 48 , 64 , 96 , 128
I tried all the above to find the sweet spot and settled on 48. 
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz