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 / Kickstarter Stretch Goal Save/Load Arrary

Author
Message
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 6th Apr 2015 22:38
Any word on when/if this will be added to AGK2?

I've got a couple of projects on hold, waiting for these commands.
unlikely
12
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 6th Apr 2015 23:13
Hi Rich. Can you not write your own using existing file commands?

Using AppGameKit v2 T1 + T2
Systems: Primary: Mac OS X 10.10
Secondary: Windows 7
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 6th Apr 2015 23:44
Quote: "Hi Rich. Can you not write your own using existing file commands?"


Yes, of course I can. I've been doing that.

Three points though,

1. I helped reach that stretch goal by backing at the Gold level, and Save/Load Array was one of the reasons why I kicked in.

2. A native command could be a LOT quicker than loading each element in manually. (DBPro had a plugin that was very fast.)

3. Save/Load Array for UDT arrays would really be a timesaver on many of my projects.
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 7th Apr 2015 01:14
@Rich Sorry to say, but at the speed AppGameKit progresses, I'm afraid it could be a very long wait.

unlikely
12
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 7th Apr 2015 05:45 Edited at: 7th Apr 2015 05:47
Quote: "Yes, of course I can. I've been doing that..."


Fair enough. I was just wondering if you could make do with your own version while you wait--so your projects won't have to be on hold!

(A 'native' version is probably not going to see massive speed improvements, as you will still be limited by hard drive read/write, either way. Would certainly be convenient, however. )

Using AppGameKit v2 T1 + T2
Systems: Primary: Mac OS X 10.10
Secondary: Windows 7
RickV
TGC Development Director
24
Years of Service
User Offline
Joined: 27th Apr 2000
Location: United Kingdom
Posted: 7th Apr 2015 10:24
Hi,

Thanks for the kick! I'll talk to Paul about this.

Rick

Development Director
TGC Team
bigc90210
9
Years of Service
User Offline
Joined: 12th Jan 2015
Location:
Posted: 16th Apr 2015 12:40
this is exactly what i am needing too, so +1 to this. Rich, out of curiosity how are you doing this yourself at the minute? I woudnt mind attempting a try at a manual way for now so i can continue with my project
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Apr 2015 16:52 Edited at: 16th Apr 2015 16:53
It wouldn't be difficult.
1. Open a file to write to.
2. Loop through the array.
3. Write the contents to the file.
4. Close the file.

Then just reverse the process to load it back in again.

AGK V2 user - Tier 1 & 2
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 16th Apr 2015 17:29
Or use a memblock, which should be faster.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Apr 2015 20:24
i think we need a WriteUDT/ReadUDT before,
this can used by load/save array too.

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 17th Apr 2015 00:03
As long as the UDT has a fixed size that will work anyway. Across all languages if you have dynamically-length elements such as strings or embedded images it cannot unless you can serialise the data.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 17th Apr 2015 05:36
There are lots of ways to work around not having save/load array commands.

I'm simply asking if the feature has been dropped, or if not, if it might be added anytime soon.

Rick stated he would talk to Paul about it, so the ball is in Paul's court.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Apr 2015 10:36
As a backer I think that unless a feature has become impossible or unreasonably workable then it is fine to drop it otherwise it should be completed at some point. That's not an unreasonable request.

There are a lot of ways around most problems but a built in command is always better for a common problem.

Using AppGameKit V2 Tier 1
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Apr 2015 15:52 Edited at: 17th Apr 2015 15:56
strings not belongs the udt struct length, its just a pointer to the next block of memory. ReadWriteString we already have, can used by load/save udt or load/save array.
about images, we used only id's yet in a integer type.
so load/save array would load/save integers only.
its not wrong and also not good but ok at the moment.
same with sounds id's.

other solution to get the udt struct items as enumeration name,data type
would also be handy if load/save array will drop.

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 17th Apr 2015 16:37
If a string has a fixed length it's an array of byte, effectively. So in many cases this is fine, because you copy data in or out. What's important is that the UDT has a fixed size.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Apr 2015 19:26
@JimHawkins
i mean the udt definiton is always the same size and strings are always
a reference only inside this struct.

integer 4 bytes value
float 4 bytes value
string 8 bytes reference
integer 4 bytes image id
integer 4 bytes sound id

so saving this udt is
writeinteger
writefloat
writestring
writeinteger
writeinteger

think this can generate the compiler for a udt,
dim a as udt
a.save(fileid)
a.load(fileid)

the lenght about u spoke is the data that contains a udt variable,
thats is often non fixed size, i agree.

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Yodaman Jer
User Banned
Posted: 17th Apr 2015 19:32
Quote: "It wouldn't be difficult.
1. Open a file to write to.
2. Loop through the array.
3. Write the contents to the file.
4. Close the file.

Then just reverse the process to load it back in again."


This is always how I've saved contents of an array, actually. DBP's old save/load array commands worked but I never liked using them unless I didn't want anybody to be able to modify the contents of the file. Plus I liked being able to open the file created and modifying lines to get different results without having to program a million different combinations! I basically used it as a cheater's method.

Of course it didn't work with UDTs, but I dealt with that too.

The formatting keeps messing itself up thanks to the Apollo Forums poltergeist!

Login to post a reply

Server time is: 2024-11-25 20:48:52
Your offset time is: 2024-11-25 20:48:52