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.

Author
Message
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 9th Mar 2015 19:58
How big can I make arrays in AppGameKit v2?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Mar 2015 09:24
Strictly speaking as large as there is space on the device. It's better to change the size of the array as you need it. It's pretty rare you'll get too high for the device to handle. Normally space taken up by media is more of a problem.

Here's an example of a function for adding enemies to an array (basic):


Using AppGameKit V2 Tier 1
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 10th Mar 2015 11:51
Is it limited by the size of a 32 bit integer, 4,294,967,295?

I need REALLY big arrays

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Mar 2015 12:59
If you need arrays that are that big then you are doing something wrong...

Using AppGameKit V2 Tier 1
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Mar 2015 13:18
Quote: "If you need arrays that are that big then you are doing something wrong... "


+1 (or have I just blown the stack by adding one more?)


What are you trying to do?

Quidquid latine dictum sit, altum sonatur
Conjured Entertainment
AGK Developer
13
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 10th Mar 2015 14:09
Personally, I like to define the size of my Arrays, and I like to keep them as small as I can get away with.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 11th Mar 2015 15:52
I just need to store a huge amount of data But a couple of million items in the first array dimension should do the trick, maybe more Sorry for not being more clear on what I need it for :-P More details will come later when my app is ready And no, I am not making that big arrays on users smartphones, tablets and what not

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Mike Archer
4
Years of Service
User Offline
Joined: 19th Feb 2015
Location: Wales
Posted: 12th Mar 2015 02:54
Quote: "Is it limited by the size of a 32 bit integer, 4,294,967,295?"


Just a point to mention, not just to do with arrays, but limits in general, in AppGameKit an integer is a signed integer, so it is 31 bits + 1 bit to indicate if it is negative or positive, and as such the limit in AppGameKit is −2,147,483,648 to 2,147,483,647.
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Mar 2015 11:58
Quote: "Just a point to mention, not just to do with arrays, but limits in general, in AppGameKit an integer is a signed integer, so it is 31 bits + 1 bit to indicate if it is negative or positive, and as such the limit in AppGameKit is −2,147,483,648 to 2,147,483,647."


Thank you very much, good info It is still big enough for my project

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
JLMoondog
Moderator
10
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 12th Mar 2015 14:58
Hacking government computers?

Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 16th Mar 2015 10:00
Quote: "Hacking government computers?"


HEY HEY HEY, don't reveal my plans! It is a big secret! No, no hacking I wan't to keep track of a lot of user data

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 16th Mar 2015 10:21
I just made a quick test for big arrays. AppGameKit crashes around 2GB of data. I tried separating the array into multiple arrays but AppGameKit still crashes around 2GB. So what do I do now? Do I program my servers in C# instead? Is there any other way to this?

By the way, most of the error messages I recieve are blank. VC++ also crashes sometimes, and most of the time also with blank error windows.

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 16th Mar 2015 10:26
If I'm not mistaken, this has nothing to do with AppGameKit, and is totally dependent on the available ram the device has... 2GB of Ram is a horrendous amount to be using for a single application... I don't understand why you would need such large arrays ...

Using AppGameKit V2 Tier 1
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 16th Mar 2015 10:43
Quote: "dependent on the available ram the device has"


There is around 5GB available at the momemt (not used!). The machine running the application will have far more.

Quote: "2GB of Ram is a horrendous amount to be using for a single application"


That part of the application is server side. The client app is way little.

Quote: "I don't understand why you would need such large arrays"


I need to have certain information ready at all times for the user to access.

I never learned C# but I might have to now.

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Mar 2015 12:58
Quote: "There is around 5GB available at the momemt (not used!)"


AGK is 32-bit, so you can't address that amount of memory.


Quote: "Quote: "I don't understand why you would need such large arrays"

I need to have certain information ready at all times for the user to access."


This is what databases do, but they don't put it all in memory. In my day job I work with hundreds of gigabytes of data, there are all sorts of ways to accommodate the needs of the user. If you lift the lid a little on what you are trying to achieve we may be able to help.

What you are currently saying is that the user needs millisecond-response to gigabytes of data?

Quidquid latine dictum sit, altum sonatur
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 16th Mar 2015 17:27
Quote: " If you lift the lid a little on what you are trying to achieve we may be able to help."


It is a companien app for an already popular game. I don't expect too many users but on the other hand I do not like to be caught unprepared. One of the parts that need a very large database is login. Can you indulge me in the database thing? I would like to be able to call a database from an AppGameKit app Other parts of the program need quick response, what response time can I expect from a large database, with say, 10.000.000 items? I must admit I useually don't know every aspect of what I start to build, I learn along the way. Another project I have, I expected it to be a couple of months work to do most of the things. I had no idea what a huge task it would be to make nearly all editors and the game engine myself was, but now it is almost done

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Mar 2015 18:36
Quote: " I would like to be able to call a database from an AppGameKit app"


Unfortunately AppGameKit doesn't have any database functionality. You can still use an online database by working with the HTTP commands.

Login...Everyone expects to wait a couple of seconds to login. And you certainly never put all of the users into memory, it's a huge security flaw. If you are anticipating lots of users, then I assume it is online? You would send teh user name and (encrypted) password to the server via HTTP. This would call a program (e.g a PHP program). The PHP program does the database lookup and validates the password, sending back a true or false response to to your program. The end user never directly accesses the database.

Quote: "what response time can I expect from a large database, with say, 10.000.000 items?"

It all depends on how well you design the database
I could return a record quicker than you can look up from the keyboard to the screen...in the right circumstances. On the other hand if you are running a search for a complex set of criteria with multiple valid records, it may take a few seconds.

It certainly sounds like you should be doing this as an online database and returning only relevant information. You'll need to be keeping the data up to date, and you don't want to be distributing 2GB+ of data to numerous copies of the same repository, and keeping them synchronised. Users won't thank you for consuming gigabytes of their disk with potentially unused data. (Nobody could consume this amount of data in a lifetime unless you are performing aggregations etc on the full data).

It's all about smoke and mirrors. When you're watching an intro sequence to a game, it's not for the intro sequence. It's so the game can be loaded whilst distracting you. When you pick an option and the screen smoothly scrolls to one side, it's to fool you into thinking it's loading the next screen faster than it actually is. If it takes 2 seconds to load data, you need a 2.5 second animation to hide it, where the data appears in the last 0.5 seconds.

Take a look at some of the games you own again, you'll soon spot the smoke and mirrors.

Quidquid latine dictum sit, altum sonatur
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 17th Mar 2015 09:36
Quote: "and you don't want to be distributing 2GB+ of data to numerous copies of the same repository"


I do not send ANY data to the user during login, other than a login accepted true/false. Users send their email and password and the server checks them I do encrypt passwords on the server But I would rather use a database as you suggest

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 18th Mar 2015 10:19
So now I need to learn PHP and SQL?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Cybermind
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 13th Apr 2015 18:42 Edited at: 13th Apr 2015 18:45
Thanks for the great advice I am learning PHP, have set up a server with PHP, and now I have started researching the whole MySQL thing

EDIT: Where did I get the SQL thing from? I can not find it in this thread :-P

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...

Login to post a reply

Server time is: 2019-08-23 15:19:11
Your offset time is: 2019-08-23 15:19:11