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 / Question about cpu & ram usage

Author
Message
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 20th Jun 2013 11:32
Hi,

does agk client runtime has multi-thread cpu capability?

why does agk client runtime do not take more then 1.8gb of cpu ram before crashing with an uncaught-exception?
32bit or 64bit seem to be the same.

regards
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Jun 2013 14:29
We need to know a lot more:

AGK version
Tier 1 or 2
Platform (Windows, iOS, Mac, Android)

What program is causing huge memory allocation? If it's your own, post some example code. You may be creating things every frame.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 20th Jun 2013 14:59
the current stable version: 1.76 i believe

no, it's not the problem for using alot of memory.
i have creating lots of images , most are 64x4x64px

my question is, why do a 32bit program not use up to 3.6gb before crashing? but crash at just half that?

is there no way for AppGameKit to compile 64bits program?

my program is design for some-what high-end system.

also i just tested for multicore system and it is multi-thread.

tier1 & 2, not able to allocate more then 1.8GB of ram space before crashing.

not sure if current system affect production but, here it is:

developed on:
Amd X6 - BlackEdition
16Gb ram
HD7970-GHz edition
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 20th Jun 2013 19:26
32bit programs on Windows generally have a limit of about 2GB of memory unless the /LARGEADDRESSAWARE linker option is set when compiling it in Visual Studio, this will let you go up to about 4GB. You can find this option in the Linker->System section.
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 20th Jun 2013 20:39
ok...?

is there a way to set compression level for getimage?
like in Jpeg quality?

because i notice getimage will auto decrease quality when large size images is generated.
abit more control on this would be really useful.

also, when will a 64bit compiler be release for agk?
it would probably be for 64bit os only but, not every game developed need to be mobile capable.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Jun 2013 11:05 Edited at: 21st Jun 2013 11:10
maybe try SetResolutionMode( 1 )
GetImage give you the backbuffer image 1:1
the image size you get with GetImageWidth & GetImageHeight

alternative you can plot/paint in memblocks.

the backbuffer can be smaller because for optimization
and in front it will span over the whole screen.
some pc games use this technics,arma 2,Take On Helicopters,Euro Truck Simulator 2.

about 64 bit,
at first your game should run with 100% first cpu core in 32 bit.
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 21st Jun 2013 16:23
ok, thanks.

is there a sample for memblock painting?

also is there a tutorial for programing a save?
i could not save an array and having a few millions file is a bad approach to this.

any help appreciated!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Jun 2013 18:22
in the docu is a example how to set pixels and make a image from memblock,you can save the image with SaveImage
http://www.appgamekit.com/documentation/Reference/Memblock/CreateImageFromMemblock.htm
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 21st Jun 2013 20:47
Thanks,

i try using the same image for multiple blocks, but weird enough, AppGameKit does not load and render the same images for all blocks but create a new images, place it and render per sprite?

Never had this issue in other engine such as Microsoft XNA Game Studio.

so i try getimages to create a big images that is more compressed and less mem usage, but it end up crashing as well.

pulling my hair out trying to go multi-platform, instead of just 2.

if anyone could try it out and confirm my result, i would be highly appreciated.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jun 2013 21:37
Images created within a MemBlock don't actually display unless you use the CreateImageFromMemblock and then either create a sprite using that image or reset the image of a sprite.

A MemBlock is just a block of memory that you can do anything you want to. There also just happen to be commands for creating an image from it.

I have a class that I created for showing that something is happening.

I create a MemBlock and an initial image and then a sprite from that image.

Each time I update the object, the following gets done:
1. The MemBlock is updated to create a new image
2. A NEW image is created from the MemBlock using CreateImageFromMemblock
3. The image for the sprite is updated with the new image (SetSpriteImage)
4. The old image is deleted and the id for the new image is stored (to be deleted next cycle or when the class object is deleted)
5. Two Sync() calls are made to make sure that the display updates

I had tried using CreateImageFromMemblock to overwrite the old image, which would automagically update any sprites using it. But it caused problems and didn't work as expected. So, I went with the method above and it works fine.

I am not sure what you are trying to accomplish and why you are using the same image for multiple memory blocks.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jun 2013 21:45
There is a maximum size of what you can put in a memory block (100,000,000 bytes, which is 25,000,000 integers, subtract 3 for a header and you can have a square roughly 5000x5000 (but not quite, the square of 25M-3 is 4999.999699999991).

This is a largish image.

But the limitation on image size is not in AppGameKit so much as it is on the platforms (as I understand the various discussions). And it is resolution related (width by height), not memory size related.

Also, using MemBlocks is more memory intensive than the straight image loading. Images created using MemBlock use up the maximum memory needed. Images loaded from files maintain the compression of the image (again, as I understand from other discussions).

How big an image are you trying to use?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 21st Jun 2013 22:16
sprite i'm using are just 1 64x64px image

i have search on this forum for an answer and it seem the engine could not generate sprite fast enough.

all i need it to do is handle 100k sprite, and it could not even do that, lol.
no way i could have it create the intended 184Millions sprite.

also, is there a way to get memblocks to read from an images?
from what i have tried, it seem not possible, and why would i use an image with a single color?

i use render() to prevent a full sync() call instead.

try this code yourself, see how slow it generate sprite?
if the engine could not handle this, no way it can handle 3d, lol.

JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 21st Jun 2013 23:44
Surely a loaded compressed image is expanded to create a bitmap?

-- 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: 22nd Jun 2013 00:18
I think one of the AppGameKit guys talked about the loaded images staying compressed until needed to create the sprite. But I could be wrong about that.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 22nd Jun 2013 21:36
well, on a side note.

the application can use multiple core, but that does not mean it is multi-threaded.

one day maybe, agk can create extra main.agk file, such as subMain.agk and have it run a second thread if there are multiple thread available to process on.

capable for creating more then 2 threads is helpful for future growth of this game engine.

also, how long do it normally take before your post need to be approve first?

Login to post a reply

Server time is: 2024-11-24 15:40:03
Your offset time is: 2024-11-24 15:40:03