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.

AppGameKit Classic Chat / Speed of agk

Author
Message
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 30th Jan 2018 17:51
I know tier two is faster than one but by how much on average?
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 30th Jan 2018 19:31 Edited at: 30th Jan 2018 19:45
I'd guess tier 2 C/C++ is probably dozens or possibly 100+ times faster on code (logic) execution assuming the exact same code pattern is implemented in both versions.
I wrote a couple small programs for code execution speed comparison a year ago. One in C#.Net and one in AGK2 tier 1 (actually did a Blitz Basic version as well) and the C#.Net version was much faster. As in many times faster.

And considering that is C#.Net is compiled into IL (basically we can see this as what AGK2 tier 1 is compiled to) and then the current fragment (which is great for loops and so forth) is JIT (Just In Time) compiled into native machine code and a compiled C/C++ program won't need to do that JIT compilation during run-time C/C++ would be faster than C#.Net. How much faster? I don't know. Maybe 50%. Maybe double.

However, this is only for the program code we write. When it comes to graphics both tier 1 and tier 2 should be using the same AppGameKit libraries which means that aspect should be performing at the same speed in both. And generally in games it is this piece which is the bottleneck. However, any time saved on code execution will provide additional time to render more graphics.

Hope that helps a bit anyway.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jan 2018 19:49 Edited at: 30th Jan 2018 21:34
writing an array of 1280 x 720 is in c++ 65x faster at my pc

at phone with tier1 basic copying 2 hd images together with memblocks commands take 4-5 seconds ...

basic


c++
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 30th Jan 2018 19:52
That's about what I'd expect. Say 50+ times faster on average for pure code execution. Good to have it tested instead of theory though. lol
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jan 2018 19:58
and i guess some c++ nerds can speed it up much more
Quote: "
//C++-Code
asm {
//Assembler-Code
}
//more C++-Code
"
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 30th Jan 2018 20:00 Edited at: 30th Jan 2018 20:03
Quote: "I know tier two is faster than one but by how much on average?"

88mph

And if your PSU can kick out 1.21GW then you're gonna see some serious shit!
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 30th Jan 2018 20:22
Thanks for the input was just trying to work out if it might be worth learning tier 2 and it appears it would. 50 times faster is a huge amount.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th Jan 2018 20:24
Great Scott!!

I genuinely lol'ed at that post by scraggle ^^^
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 30th Jan 2018 20:41 Edited at: 30th Jan 2018 20:46
> ...if it might be worth learning tier 2 and it appears it would. 50 times faster is a huge amount.

The more important question is - do you need the extra speed? It comes at the cost of speed of development and complexity of code, as C++ is a fickle beast to partner up with.

Plenty of apps these days are written in - of all things - JavaScript. A hacky awful language designed and released upon the world from the inner bowels of Mordor. This is interpreted at run-time as well, much like AGK. And much like AppGameKit, it is no speed-demon compared to say C/C++, Rust or Go - all compiled languages really. Yet due to Angular/React frameworks hooked up to Electron run-time JS allows rather pain-free cross-platform app development using known and widely used web-technology.

And it works. And devs don't turn mysteriously hairless and shivering in angst-induced horror in a dark corner uttering again and again "I just tried to compile for ARM, I just tried to compile for ARM, I just...".

For high performance apps/games - and certainly for heavy-traffic backend infrastructure, speed is key. But in all other cases, you should offer a friendly thought to all those hardware engineers who have so kindly made modern computers so fast that we can happily waste most of their resources on rather inefficient high level languages. In the name of keeping sane, happy and meeting deadlines
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 30th Jan 2018 21:08 Edited at: 31st Jan 2018 00:35
@Dybing makes some great points.

And keep in mind like I mentioned in my reply above. Tier 2 is not 50+ times faster than Tier 1 period.

It is 50+ times faster executing the code you write.

In itself that is irrelevant. If your game runs at full framerate in Tier 1 then writing the same game in Tier 2 will provide no benefit. It is already fast enough in T1.

If the major bottleneck is the amount of / quality of graphics being rendered you won't see a 50+ times increase in speed. Because the rendering should be basically the same in both T1 and T2.

I'd guess that increase in code speed may result in anywhere from 20% to 3 times speed increase or so in real terms for an actual game. Because again... the execution speed of your code is only one part and generally the graphics rendering is the biggest issue in all game engines. All of those graphics being drawn is usually where the real bottleneck is especially with added load of custom shaders and such.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
puzzler2018
User Banned
Posted: 30th Jan 2018 21:09 Edited at: 30th Jan 2018 21:10
FPS takes a lot of advantages and disadvantages

if FPS runs at 60 - that a nice speed

If you set FPS to start at say 600 - and let your world come into play - this may knock it down to 30FPS

so you have to compensate for FPS inreases and decreases when moving around you app.

Cause your players will move frantically if FPS runs at 100 but runs really jerky at nice at say 30FPS

Dropped because of the amount of things you put in
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jan 2018 21:53 Edited at: 30th Jan 2018 22:02
i had only speed problems in image processing with basic, but mind agk is for games.
the other one was recursion for ai at a board game - unfortunately too slow, but i still can tranfer this project into c++

developers with c++/c#/java/swift/database/web/... knowledge are highly coveted. its not wrong to learn.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
puzzler2018
User Banned
Posted: 30th Jan 2018 22:45
board games can be looped on sync loops with a

Thinking...

type of variable when true then goes into thinking mode but every other part of the app can still be accessed like pressing buttons instead of a terrible nested loop hang feel

Its about good structured programming to stop them hanging feels
puzzler2018
User Banned
Posted: 30th Jan 2018 22:59
Always keep in mind of nested loops and try to keep every frame going when one is going.

eg

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jan 2018 23:31
Quote: "Its about good structured programming to stop them hanging feels"

its not a hanging feel its about playing against a cpu opponent ai and nobody will wait 30 minutes for a move ... (and btw a too deep recursion will make agk crash)
me thought i can do a Nine Men's Morris (Mühle) AI in Tier 1 Basic but it was not possible because speed ...
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
puzzler2018
User Banned
Posted: 30th Jan 2018 23:53 Edited at: 30th Jan 2018 23:56
Next challenge awaits - Nine Mens Morris

https://en.wikipedia.org/wiki/Nine_Men%27s_Morris
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Jan 2018 00:04
Quote: "Next challenge awaits - Nine Mens Morris"

i made this game as parlor game to play with friends, but today people have no friends and prefer cpu human versus human is much more fun.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 31st Jan 2018 00:15
I prefer human vs human too

(....So much more fun as I can cheat )
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 1st Feb 2018 15:25 Edited at: 1st Feb 2018 15:30
@Markus,

but you wouldn't use an Array [x, y] for Image processing. You rather would use image-functions or memblock operations.

@puzzler2018, after the minecraft-clone, some AI Zombies with "Mühle"-AI
https://software-talk.org/blog/de/2012/10/muhle-das-brettspiel-inklusive-ki-mit-alpha-beta-algorithmus/

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Feb 2018 19:40 Edited at: 1st Feb 2018 19:43
@Xaby
Quote: "but you wouldn't use an Array [x, y] for Image processing. You rather would use image-functions or memblock operations."

i would make a feature request to get image data into array for tier2 or using something in c++ that can load images into memory.
currently i tryed make video from light painting and after that i try to process pic by pic but can not step one pic foreward.
i used playvideotoimage , but if you process one pic which take a lonk time, the video skip frames and use real time.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 7th Feb 2018 08:03
@Markus

I miss also a lot of the functionality, I am used to have in PureBasic. I also tried a bit with "Playvideo", but maybe we have to use external plugins or so, to decode Frame by Frame.

It would be also nice, to be able to have more than one Image-Render-Target. Logicaly. Combining and Composing new things, are a lot easier with PureBasic functions.

Maybe we have to make a tutorial about image processing and a "Photoshop"-like clone or Paint-like-clone.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Feb 2018 09:59
I'm confused......why can't you image process in an array? I have my 2d space game using memblocks to alter large images really fast - where the player takes dance it alpha blends scratches, dents.....even holes with burn marks. That's processing 2 or 3 different images through a memblock before making an image and copying back to the sprite. On a small sprite (say 100x100) you can do this 30 times a second.

You can also have multiple render images can you not? I did a dynamic downsampling routine using a render image, while using another to do interface effects.

Is it AppGameKit now quite equipped in that regard?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Feb 2018 11:30 Edited at: 7th Feb 2018 11:35
Quote: " memblocks to alter large images really fast "

not at phone, it takes 5 seconds to add 2 images in hd together.
the interpreter core is not that fast as you may think. you can do this in c++ in an array 100+ x faster

Quote: " On a small sprite (say 100x100) "

100 x 100 =10.000 pixel
1280 x 720 = 921.600
~ 100x more
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Westa
12
Years of Service
User Offline
Joined: 28th Oct 2011
Location:
Posted: 14th Feb 2018 09:05
The thing to understand, is that images in memory have to always be transferred to OpenGL as a texture for display - which is basically what the memblock functions do - they are not just moving images in memory.

Westa
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 14th Feb 2018 09:30
Markus, what phone is that on? I've had much faster results than that .
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Feb 2018 12:15
Quote: "Markus, what phone is that on? I've had much faster results than that ."

Motorola Moto G 1. Gen. 2014
Prozessor: Qualcomm MSM8x26 Quad-Core A7 1,2 GHz (Adreno 305 450MHz GPU)
however with this cpu it can do the job in realtime, but not with agk.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)

Login to post a reply

Server time is: 2024-04-20 12:07:08
Your offset time is: 2024-04-20 12:07:08