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 / Does variable allocation to three dimensional arrays interfere with the graphic backbuffer?

Author
Message
NiftyBytes
3
Years of Service
User Offline
Joined: 14th Jan 2021
Location:
Posted: 14th Jan 2021 14:04
platform : LINUX

array [x,y,z] is defined

when filling it, e.g. y

for y = 1 to img_height
for x = 1 to img_width
for z = 0 to 3
a[x,y,z] = ...
next z
next x
next y

the graphics of a sprite which has absolutely nothing in common with the array is destroyed (almost deleted)

it seems that three dimensional arrays overlap with memory used for sprites

Bored of the Rings
User Banned
Posted: 15th Jan 2021 06:02 Edited at: 15th Jan 2021 06:02
Really? That's a critical bug.... post on github if possible, cant see it being fixed for a while... but you never know pigs might fly ha .... have a doughnut and chill
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 22nd Jan 2021 13:15
Where in memory are the array's stored ?
I've had a few problems when introducing sprites(buttons) after building an array . I ended up setting the array just before the 'Do' command ad all seems better or it's just my imagination .

Lance
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 23rd Jan 2021 01:46
It would be good to see the actual code
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Jan 2021 18:44 Edited at: 26th Jan 2021 18:46
it should be
for z=? to ?
for y=? to ?
for z=? to ?

order of precedence is important

PS:so the smaller of values up top working there way up in value

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
NiftyBytes
3
Years of Service
User Offline
Joined: 14th Jan 2021
Location:
Posted: 27th Jan 2021 08:34
it's a matter of personal preference;
the bug remains either way
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Jan 2021 13:49 Edited at: 28th Jan 2021 18:38
Quote: "Items being placed at undeclared memory locations will cause memory leaks if the engine doesnt capture them"

below is an example shows an array that the order of the variables will cause problems
if linux isnt detecting an error as such its possible that it may alter background graphics
because your trying to place a value that the AGKengine did not free up and places it
who knows where. Its just something to try and check for logic errors. If thats not the problem
it still may be some other memory leak

PS Can you post an example that causes the problem or a snippet of code that does

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
NiftyBytes
3
Years of Service
User Offline
Joined: 14th Jan 2021
Location:
Posted: 27th Jan 2021 14:57
it errs because you forgot the "2" in the second loopchain => num2
and has absolutely nothing to do with the fact,
that large arrays interfere with the graphic backbuffer

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 27th Jan 2021 20:06
This is most likely happening because u are doing a very long read procedure on an image that is responsible for drawing to a sprite. If u are reading a piece of memory for a long time and agk is trying to read from the same memory to update ur sprite it may not be able to. Solution copy the image or put it in a memblock read from copy then delete. Should have nothing to do with array size at all but the fact is your holding a file open in memory that ur trying to read from in 2 separate locations. This is not an agk specific issue.

atomcraft
3
Years of Service
User Offline
Joined: 22nd Jan 2021
Location:
Posted: 28th Jan 2021 10:08
This seems to explain the problem, but a solid program should be able to check whether a memory address is already in use.

n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 29th Jan 2021 22:55
Let's see how many times people ask the guy to post his code and him just replying rudely instead.

*grabs popcorn*
-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 30th Jan 2021 01:00
Quote: "the fact,
that large arrays interfere with the graphic backbuffer"


The word fact seems to be massively misunderstood nowadays, because you believe it does not make it fact, please post some code that consistently reproduces the issue.

I make heavy use of 3 dimensional arrays and never had a graphical issue, well, ones not caused by my own ineptitude, I have my gripes with TGC but I give them enough credit to be sure that an Intel accredited company has got some memory management going on under the hood..... please God don't let me be wrong on that!! lol

Login to post a reply

Server time is: 2024-04-18 21:42:45
Your offset time is: 2024-04-18 21:42:45