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 / Was wondering about speed

Author
Message
haliop
User Banned
Posted: 15th Jun 2013 23:47
Tier 1 against Tier 2
Mobile wise if ill build the same app , which will run faster is tier 2 called native as for Agk native or as device native ??

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jun 2013 00:20
My assumption would be that it would be the same since both would compile to bytecode then be interpreted from there anyway.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Jun 2013 00:48
Tier 2 does NOT compile to byte code. It compiles and links to direct executables appropriate to the platform.

I think Tier 2 is somewhat faster because it is compiled to (ultimately) machine language.

Tier 1 will always be an interpreter processing the byte code file created by an IDE and there is somewhat less flexibility. The interpreter is a compiled (machine language) as appropriate to platform. But it always uses the same byte code file, which is an AppGameKit formatted set of instructions.

And the existing Tier 2 compilers all have debugging capability. Which comes in handy.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jun 2013 00:57
Ooooo, see ya can't spell assumption without... well you get the point!

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 16th Jun 2013 01:04
The byte-code interpreter is fast, but native is always going to be faster.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
haliop
User Banned
Posted: 16th Jun 2013 09:47
cool thank you.
i actually started with tier 1 and built awesome with it
but i guess it will be kinda slow on mobiles
i am already good enough with C++ since i started here with DarkGDK
so i guess it will be a matter of few hours to convert my project from tier 1 to tier 2

however i do find something neat about tier 1 using interpeter..
hmm ... Hacking and Cracking our apps... in tier 2 the crackers will do the same as they always do.. but in tier 1 they will have a bit of problem with how to use the byte code file...

well until i'll test it i'll keep at it with tier 1
i honestly thought that tier 2 will use an interpeter also now that i know that its not ... i just realized AppGameKit is more powerful then it seams.

thank you for your response ..
if any of you know a bit about how to save our projects from being hacked please let me know

have an awesome day.

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 16th Jun 2013 10:47
It's impossible to prevent a determined hacker from disassembling a binary. They key things to make it harder are:

* Use full compiler optimisation
* Ensure that there are no debug symbols in the release
* Inline a lot of smaller functions so that there are fewer jumps
* Perhaps encrypt any strings
* Update your release as often as possible
* Compute and store CRC values for files, and force a crash exit if the file does not match a stored CRC - this prevents merely replacing your images and sounds with others.

On the whole, though, it's hardly worth the effort for something with a low sales value

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
haliop
User Banned
Posted: 16th Jun 2013 12:37
i see.. ok thank you.
about CRC well... cant the hacker hack into the binary and change the
if file crc = 1000000 ? like he can change the crc check also.. so lol

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 16th Jun 2013 13:15
Like I said - the only thing you can is to make it as boring as possible to do it.

As far as CRC goes, it's a lot harder to hack than the bytecode interpreter would be!

The new MemBlock system makes it much easier to protect images.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
haliop
User Banned
Posted: 16th Jun 2013 13:37
yeah..
hmm i'll eventually find how to .. and post it here.

MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 16th Jun 2013 14:56
Tier-1 Basic is not much slower than Tier-2, for 2 main reasons:
- AppGameKit commands are executed in "native code", because they are part of a library linked to the executable and written in C++.
- AppGameKit bytecode, if it is like Java bytecode, is more a machine language/assembly code, so it is very fast to interpret.
This makes bytecode-based languages, like AppGameKit Basic, Java, Perl, (and I suppose Javascript too) very fast to be executed and very adapt to be used for real-time applications...and in fact Java is very used in embedded applications.
So The statement that Tier-1 is incorrect, and many games in demo and showcase have been written in Tier-1. AppGameKit Basic is able to manage hundreds of sprites with physics, collision and whatever else.
There are a lot of other problems with Tier-1 Basic, that AppGameKit is trying to address and hopefully solve.
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 16th Jun 2013 16:30
Prove it! If you don't, I will!

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Jun 2013 19:16
haliop, one of the gotchas about converting to Tier 2 (I discovered) is that the Sync() call doesn't work exactly the same.

While it will update the display anywhere it is called, user and accelerometer input is only updated at the end of the app::Loop() method.

So, you can't put up a display and wait for the user to touch something before doing the next thing using a while loop.

It becomes necessary to basically create a bunch of states and do things based on that. One state can create the menu, and another can check for a press on something and then change the state to one that process the results.

I plan to work up a good example that does things with menus and http stuff to show how it works in Tier 2. I just don't know when I'll be able to finish it.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
haliop
User Banned
Posted: 17th Jun 2013 16:41
very nice AL , havent touched Tier 2 yet.. thanks

Login to post a reply

Server time is: 2024-04-27 16:19:06
Your offset time is: 2024-04-27 16:19:06