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 / Huge Math Error the AGK

Author
Message
XanthorXIII
AGK Gold Backer
12
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 9th Sep 2011 20:18
Ether I'm going crazy or something is really funny here with Globals and dividing.

This code below does not use Globals, this produces the expected result of 6.25 and 4.166667


The Code below uses globals and does not get the same results.


Please confirm what values you get. This is a huge error that needs to get fixed ASAP.
Jimmy
20
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 9th Sep 2011 20:26
I think this is because you're initializing your globals with a math operation instead of a constant value, which is a bug, yeah, but it can easily be worked around:



XanthorXIII
AGK Gold Backer
12
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 9th Sep 2011 21:57
I'm just about ready to throw in the towel on Tier 1 and just move over to Tier 2. The problem with Tier 1 is while it looks good on paper, there's a lot of fixes that need to be done.
Jimmy
20
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 9th Sep 2011 22:53
I agree. While I'm not going to throw in the towel, I am going to give it time to improve before I try to code anything major in it.

Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 10th Sep 2011 03:31 Edited at: 10th Sep 2011 03:38
Have you tried declaring it as Global on one line, then assign the value on a separate line?




DMXtra
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 10th Sep 2011 05:44 Edited at: 10th Sep 2011 05:45
Why not post the bug here so it can be fixed:

http://code.google.com/p/agk/issues/list

App Game Kit (A.G.K.) - Want to be creative on many platforms at once? This is the tool you need.
XanthorXIII
AGK Gold Backer
12
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 10th Sep 2011 05:50 Edited at: 10th Sep 2011 05:51
I can do that but that's not how it's suppose to work.
I'll do it anyway just so I can continue working.
And yes, I have posted it to the Bug List on the Google Code Community for the AGK.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 10th Sep 2011 17:45 Edited at: 10th Sep 2011 17:45
Quote: "I can do that but that's not how it's suppose to work."

I know, but what does work and what is supposed to work are two separate things.
I ran into problems with globals too, but when I declared it as global on a separate line from the value assignment, my problems went away.
It's not that big of a deal to declare it on a searate line anyway, so that is the initialization style I am using now.

Good Luck

LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 11th Sep 2011 00:35
The benefit to the literal values in the declaration line is that those values are pre-loaded into the data variable before the code begins, meaning you get started a few instructions quicker. If we all agree we don't need that performance boost, I can permanently modify the compiler to always treat the initialiser in real-time rather than at compile time. If anyone has an input on this subject, use this thread and I'll check back on it before making any changes to the compiler. If there are any issues you might be experiencing with T1, please use the issues board to let us know about then. We feel T1 has great potential, and we want to make sure this potential is realised as soon as possible.

I drink tea, and in my spare time I write software.

Login to post a reply

Server time is: 2024-02-23 14:05:05
Your offset time is: 2024-02-23 14:05:05