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 / AGK 2.0 Alpha 5 + Mac version

Author
Message
dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 5th Sep 2014 13:55
Hi. I have had AppGameKit from day 1, but hardly used it because I'm a Mac user! Thanks so much for finally providing a Mac version.

Firstly, it is awesome!

But I've seen a few interesting compiler glitches, which may already be known.
There seems to be a problem with variables that are not defined or assigned and then used.

If I do this:

x$ = "hello"
y$ = "world"
z$ = "let's say " + x + " " + y

I get:

Compilation failed.

Not something like:

x not defined before use, or compiling and just outputting undefined values, e.g.
let's say 0 0 or let's say null null

P.S. Are you resisting OO? It's really hard going back to basic without OO, I'm used to using a competing product Monkey / Monkey X

Anyway, thanks!!!

Thanks
Paul
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 6th Sep 2014 13:24 Edited at: 6th Sep 2014 13:25
Eh, try:



x$ and x is not the same type, and the compiler do say so: (at least on the PC)

Running C:\AGK2beta5\IDE\Compiler\AGKCompiler.exe (in directory: C:\AGK_Projects\test)

Compilation failed.
main.agc:8: error: Incompatible types "String" and "Integer"

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 7th Sep 2014 16:30
Quote: "x$ and x is not the same type, and the compiler do say so: (at least on the PC)"


It doesn't on OSX. Just Compilation failed.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 7th Sep 2014 17:45
@ Paul,

Any chance of SQLite support? Just a handful of commands?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Sep 2014 20:53
Quote: "No matter how many times you draw a dark semitransparent sprite (i.e., 1-25% opacity) to a render image, any lighter sprite that was previously drawn to the render image will remain visible albeit faded to an extent"


After some experimentation this looks like a precision issue in the OpenGL blending pipeline. You will probably have to use a shader where you can pass in a high precision float to adjust the color before output, then just keep reducing the float value every frame.

Quote: "the SimpleBox2D example had achieved this using EnableClearColor(0) "


Now that my understanding of mobile GPUs has improved, I have deprecated EnableClearColor(0). Mobile GPUs don't do immediate rendering like desktop GPUs do, they build a list of things to render and then draw everything at once every time the image is needed. One of the ways they detect if they can throw away items in the list is by looking for the clear command, so if you never send it the GPU will just keep adding items until the buffer overflows, at which point I assume it renders everything to a "background" image that it then loads for every subsequent render, but I don't know for sure. A better method if you want to save the contents is to have two render targets and keep swaping between them, rendering the previous into the new one each time. Essentially creating your own background image but without the GPU having to overload itself first.

Quote: "Are Render Images designed to only be the same dimensions as the user's resolution?"


Currently, yes. This was because their primary purpose was for full screen shaders, but I will do some more work on this for the 3D update.

Quote: "It doesn't on OSX. Just Compilation failed."


That's odd, I'll see if I can find out what's going on.

Quote: "Any chance of SQLite support? Just a handful of commands?"


Not in the foreseeable future.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 7th Sep 2014 21:47
Quote: "I have deprecated EnableClearColor(0)"

So this doesn't do anything now? I have always used this in my game to to get more FPS. I have a background image drawn over everything so I don't need to clear the backbuffer. Never had any issues reported on this.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Sep 2014 00:09
Quote: "So this doesn't do anything now?"


Correct

Quote: "I have always used this in my game to to get more FPS"


On most mobile GPUs turning it off wouldn't increase FPS since the way they render (tile based deferred rendering) doesn't cause a write to the frame buffer when clearing the screen. They keep a list of every polygon that needs to be drawn and then do the entire scene on chip tile by tile and only write the final pixel to the frame buffer, so the clear color comes for free. Turning clear color off in these cases might actually hurt performance since the GPU can't throw away the polygons from the previous frame, but maybe they have other algorithms for detecting the end of frame and working around it. Either way it is safer to keep it turned on for mobiles.
Tegra 2 is one exception to this since nVidia tried to do a traditional (immediate mode rendering) GPU in mobile form which is why it had terrible fill rate.
fog
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 8th Sep 2014 01:21
Quote: "I have deprecated EnableClearColor(0)"
Can this not be left in Paul, even if you rename it as a raw command so people are aware of it's limitations?

It's a pretty essential command for me, not for performance reasons, but for the screen effects I want to create.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Sep 2014 04:11
I'll turn it back on for Windows, as desktop GPUs like ATI and Nvidia can handle it safely. But I'll leave it disabled for mobile platforms as the performance implications are all negative.

However I recommend that you switch to using render images to achieve the same effect (which will also work on mobile), as even desktop GPUs are not guaranteed to keep the last frame in the buffer.
fog
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 8th Sep 2014 04:19
Many thanks Paul.

I'm just in the process of releasing one game and have another 2 nearly complete so I don't fancy changing the way I'm doing things at such a late stage in those, but I'll swap to render images in future.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Sep 2014 09:45 Edited at: 8th Sep 2014 09:47
Quote: "Tegra 2 is one exception to this since nVidia tried to do a traditional (immediate mode rendering) GPU in mobile form which is why it had terrible fill rate. "

This means that this command would give us extra speed on for example Ouya, which is Tegra 2 based. So I would love to be able to handle this myself. I already make separate builds depending on the platform.

When was this command deprecated? Shouldn't it give an error now?

Le Verdier
12
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 8th Sep 2014 20:39
I have a quick question:
Are 3D maths functions planned in the 3D goal???
usual things about Vectors, matrices..

All hail the new flesh
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Sep 2014 00:58
Quote: "This means that this command would give us extra speed on for example Ouya, which is Tegra 2 based."


In theory yes, although your likely to get more speed by using SetScreenResolution. If you want to do some benchmarks with 108 and let me know if EnableClearColor has any significant impact on Ouya I'll see if it's worth it. Ideally AppGameKit would be able to detect the type of GPU it is running on and ignore EnableClearColor on the correct devices.

Quote: "When was this command deprecated? Shouldn't it give an error now?"


It was deprecated early in version 2, around the time SetRenderToImage was added. The help was updated but no error is generated. Although now I'm going to say keep using it (for performance reasons only) and let AppGameKit decide whether to ignore it.

Quote: "Are 3D maths functions planned in the 3D goal???
usual things about Vectors, matrices.."


I'll consider adding those, I've not thought about them.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 9th Sep 2014 19:14
Paul... once you get to the 3d stuff... are you able to add some commands that set objects to use sphere mapping or cube mapping etc... like darkbasic does?

It would be nice if those were built into the default shader so people like me that know nothing about shaders can use those.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 10th Sep 2014 05:02
@Paul, please see your PM, rather important...

@ Everyone, how goes your projects today guys?

I have a new thread over in Geek Culture that might interest those of you with new projects due to be released or currently in development

@Paul, any update on 10 point multi-touch on Windows 8.1? I am unsure if it is already supported yet or not...

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 10th Sep 2014 09:34 Edited at: 10th Sep 2014 09:34
@Paul,

It would seem that when referencing a sprite, particle, etc that doesn't exist no longer throws an error.

Sean

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Sep 2014 15:49
Quote: "are you able to add some commands that set objects to use sphere mapping or cube mapping etc... like darkbasic does?"


Maybe, depends what OpenGL ES 2.0 supports

Quote: "Paul, any update on 10 point multi-touch on Windows 8.1?"


Multitouch should work on Windows 7 and 8 if it has a multitouch display. I don't know how many points it will support though.

Quote: "It would seem that when referencing a sprite, particle, etc that doesn't exist no longer throws an error."


Use SetErrorMode(2) to display errors, otherwise they are hidden and only revealed with GetLastError()
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Sep 2014 15:54
Thanks Paul!

dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 12th Sep 2014 10:40
If you refer to a undefined variable in a Command, even Print(), I get a "Compiler failed" error with no information.

Also, what is wrong with this:

width = 1024
Print("width = " + width)

I get "Compiler failed"
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Sep 2014 13:32
Quote: "Also, what is wrong with this:

width = 1024
Print("width = " + width)

I get "Compiler failed""


The message should be more meaningful, but you can't add an integer to a string, it needs to be:

Print("width = " + str(width))

DeftAvatar
10
Years of Service
User Offline
Joined: 13th Sep 2014
Location:
Posted: 13th Sep 2014 09:47
AGK2 is shaping up well. One question: How can I return a reference to an object from within a function? Here's some code from my program:



I'd like my GetBadgeByLabel function to return a reference to an existing TBadge object. The function compiles as is, but doesn't seem to return a reference. My faulty logic, silly mistake, or not possible?

Runnable example:

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Sep 2014 19:03
Quote: "If you refer to a undefined variable in a Command, even Print(), I get a "Compiler failed" error with no information."


Fixed in Alpha 6

Quote: "How can I return a reference to an object from within a function?"


You can't. In your example the "badge" variable is local to the GetBadgeByLabel function so it is destroyed at the end of the function. Its values are copied into a temporary variable so that it can be passed to UpdateBadge, but then that variable is destroyed at the end of the UpdateBadge function.

Probably the best way to achieve what you want is to make GetBadgeByLabel return an index and then pass the badge to UpdateBadge manually like so

DeftAvatar
10
Years of Service
User Offline
Joined: 13th Sep 2014
Location:
Posted: 14th Sep 2014 04:43
Okay, thanks Paul.
sdl
AGK Developer
12
Years of Service
User Offline
Joined: 5th May 2012
Location: Germany
Posted: 14th Sep 2014 10:07
This is very important for me and other developers

Hi Paul,

please can add Interstitial Ads For admob for the Nest release ?

The Alpha 5 is very great !!!!

Thanks Sascha
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 14th Sep 2014 13:45 Edited at: 14th Sep 2014 13:45
+1 for properly supported ads
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 15th Sep 2014 13:30
Quote: "In theory yes, although your likely to get more speed by using SetScreenResolution. If you want to do some benchmarks with 108 and let me know if EnableClearColor has any significant impact on Ouya I'll see if it's worth it. Ideally AppGameKit would be able to detect the type of GPU it is running on and ignore EnableClearColor on the correct devices."


Finally got around to test this. The closer I get to 60 FPS on 720p the more the gap widens. Up to a 5 FPS difference. So it's less than 10%. But that can definitely make a difference on how smooth some game types feels. Platform games like mine are very FPS sensitive.

Login to post a reply

Server time is: 2024-11-25 11:21:37
Your offset time is: 2024-11-25 11:21:37