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 / AGK code challenge

Author
Message
CJB
Valued Member
16
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 13th Feb 2017 15:53
It's been a while since we've seen a retro MegaDemo! Include anything you like, - star-fields, sinus scroller, particle effects, fake 3d floating blobs, ... or perhaps just one segment of a megademo each written as a standalone 21 second chunk which can all be stiched together at the end to produce a community mega demo and the winner is whoever makes the best segment? Could be fun!

...but the file loader dialogue is far more sensible.

BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Feb 2017 17:12
If we go with the File selector, another trick you need to know...set your folder like this...

SetFolder("")
SetRawWritePath(selectedFolder)


Without the first line, the SetRawWritePath won't work.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
16
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 13th Feb 2017 17:24
That should probably get reported as a bug.
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Feb 2017 21:54
Ummm, Feb 22 at midnight (ok so technically that hits the 23, whatever). That's next wednesday. I'll start grading submissions thursday.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Feb 2017 01:39 Edited at: 15th Feb 2017 01:52
Ok, so I'm a bit confused. How in the heck do I get a list of files in agk? Far as I can tell, I can only change the write path with no way of actually browsing said path other than using the built in file explorer that popsup with ChooseRawFile. I mean, how am I suppose to get a list of files from C:

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Feb 2017 03:08 Edited at: 15th Feb 2017 03:10
openfolder()
getfirstfolder()
getfirstfile()
getnextfolder()
getnextfile()
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Feb 2017 08:25
@Phaelax here's my first few lines of experimentation. It get's the Drive and the first level of folders. It should help speed up the research stage of the challenge...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 15th Feb 2017 18:42
I'd like to try this challenge but I don't quite understand what the challenge is. Are we supposed to write a function similar to the "ChooseRawFile()" command that also return the full path of the selected file?
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Feb 2017 19:17
@Ranietz yes that is exactly the challenge.
ChooseRawFile does not include the path.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 15th Feb 2017 19:30
Alrighty then. I'll see what I can come up with.
Scraggle
Moderator
17
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Feb 2017 10:06
I thought the challenge was to be able to navigate to any arbitrary path and load a file from there - which so far seems impossible!
AGK V2 user - Tier 1 (mostly)
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Feb 2017 11:38
Not impossible, just needs a little bit of lateral thinking and luck in the workarounds you try...

I'll keep posting as I find time to add to my solution. I'd rather people took my code to jump start their submission, and come up with a good, robust solution to this challenge
This version displays a pop-up and allows you to click on folders to navigate through the hierarchy.
Although you can move back up the structure, it is only by chance rather than design, and needs refining.

Next step - display files within the folders.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Scraggle
Moderator
17
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Feb 2017 15:43
That's nice!
I think I can see how to make this work

I still think that file/folder navigation in AppGameKit is horribly implemented in Windows. There really ought to be more native navigation commands like there are in DBP.
AGK V2 user - Tier 1 (mostly)
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Feb 2017 11:35 Edited at: 17th Feb 2017 11:36
I've been playing around a bit with these commands.

What I noticed, no matter in which folder you are a folder is always available - 'media'. I know it is the folder that exists in the app root directory. But for a Fileselector, this is not useful.
You could omit the last folder, but what if in the root directory more than just the media folder is present.

Does anyone have a solution for this?

It would also be very useful if you specify an invalid path at SetRawWritePath which would not be set. Now you can enter everything and he accepts it.
SetRawWritePath ("Q: BlaBlödsinn")
results in (GetWritePath ())
"Q: BlaBlödsinn /"
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Feb 2017 12:50
Quote: "What I noticed, no matter in which folder you are a folder is always available - 'media'."

I reported this a long time ago, but I can't remember what the response was.
I also considered removing any folder called "media" but you may need legitimately have one.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Scraggle
Moderator
17
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 17th Feb 2017 13:06
I've noticed that too but thought I was going mad because I couldn't figure out what I was doing wrong.
At least I know now that my sanity is intact
AGK V2 user - Tier 1 (mostly)
CJB
Valued Member
16
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 17th Feb 2017 13:49
If you DO legitimately have a media folder, does it show two!?
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 19th Feb 2017 02:26
Quote: "If you DO legitimately have a media folder, does it show two!? "


No, it does not.

GetFirstFolder() and GetNextFolder() returns every folder from the write path and the read path but when a folder exists in both paths it get returned only once.
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Feb 2017 08:54
Thanks BatVink, that helped out tons. I also didn't realize we could pass by reference now either.

Here's an early preview of mine.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Feb 2017 19:09
I can't seem to reliably get the list of files in a folder. I print out p$ to verify it's a legit path and it is. But it keeps returning a list of files that include files in the root path of the app. Also, I've noticed any folder I've read from now has a 16 byte window_position.dat file in it.


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 19th Feb 2017 20:52
window_position.dat get written to the write path whenever you move the window.
You have to set the write path back to the default one after you have read the files/folders you need or else that file will appear everywhere on your drive.
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Feb 2017 23:10
What is the purpose of the file? I'd guess it stores the position of the app, but for what reason?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 19th Feb 2017 23:23
Quote: "What is the purpose of the file? I'd guess it stores the position of the app, but for what reason?"

I don't know. I think it's a newish feature. I'm on version 2.0.22 and none of my older projects has this file.
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Feb 2017 10:35 Edited at: 22nd Feb 2017 10:36
I think I can not make it on time. I have too less time for it, and I just wanted too much.
For me, it's already turned into a small GUI project.

This is what mine looks like at the moment.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine

Attachments

Login to view attachments
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Feb 2017 15:08
Quote: "For me, it's already turned into a small GUI project."

I know how you feel, mine did too. I have come to the conclusion that AGK's file commands are complete garbage. How hard is it to wrap 'dir' into a function!?

How'd you end up getting the list of drive letters? I couldn't seem to get any higher than root, which was only the C drive.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Scraggle
Moderator
17
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 22nd Feb 2017 15:45
I've given up too!
It's just not practical with AGKs current file/folder commands.
Quote: "How'd you end up getting the list of drive letters?"

I'd be interested in knowing that too
AGK V2 user - Tier 1 (mostly)
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 22nd Feb 2017 17:12
The deadline is tonight, right?
I also managed to get the drives letters. You'll have to wait till I post the code to see how since that's all I have going for me at the moment.
Messy code and ugly GUI.

Attachments

Login to view attachments
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Feb 2017 17:52 Edited at: 22nd Feb 2017 17:53
Phaelax wrote: "How'd you end up getting the list of drive letters? I couldn't seem to get any higher than root, which was only the C drive."

Scraggle wrote: "I'd be interested in knowing that too "


This is my code for this solution. I have copied only the relevant to filehandling.



Is not particularly elegant and has a few problems. E.g. a drive would not be recognized if there is no folder available. And of course the problem with the media folder.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 22nd Feb 2017 21:53 Edited at: 22nd Feb 2017 21:54
Here's my entry.
As far as I know it works as it should exept for the media folder issue we all are struggling with.
The GUI could be prettier and code could be separated into more functions but I don't feel like working on it anymore.

damothegreat
3
Years of Service
User Offline
Joined: 18th Sep 2016
Location:
Posted: 22nd Feb 2017 21:59
Wow!! Very nice. I'm out this round but well worth a mention of the great code and results even from the dip stick of this forum


Well done.

Damo
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Feb 2017 22:05 Edited at: 22nd Feb 2017 23:18
I used this code to spit out all available drives. At first, I only checked the folder count. Every drive letter returned at least 1. Obviously I don't have 26 drives letters so I had it tell me what folder it was finding...... media!
So then I checked file count, again everything had at least 5 this time. So what files does every one of my non-existent drives contain?

steam_appid.txt
steam_api.dll
main.agc
file selector.exe
file selector.agk


So basically, no matter what I do, it always returns the contents of my app folder on top of whatever else is in the folder I select. So in the case of non-existent drives, these will always appear.





Ok, I've worked out a solution for getting drive letters, and it was a pain in the butt for how simple it looks. Even wrapped it up into a nice function!




The initial path for getting the ghost files just needs to be any non-existent path. I was using A: but figured some folks might still have a disk drive.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Feb 2017 00:36
In case I don't get around to actually finishing this before tonight, here's what I have so far. It's not complete as I can't actually select a file, but you can folder browser somewhat.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 25th Feb 2017 06:00
Quote: "Some great efforts from people with what they had to deal with"


but who won ?
fubar
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Feb 2017 10:13
I think the challenge ground to a halt because of the limitations we found (repeating media folder and default folder files).
Maybe we will all be winners, when Paul fixes them
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 26th Feb 2017 01:15
perhaps we can follow with CJB's mega demo idea
fubar
damothegreat
3
Years of Service
User Offline
Joined: 18th Sep 2016
Location:
Posted: 26th Feb 2017 21:31 Edited at: 26th Feb 2017 21:45
Think we are waiting on Phealax to decide the winner, as Phealax cannot appoint himself and others have provided, its only fair to proceed in the proceedings of choosing a winner from what I have seen

Between

Madbit
Ranietz
Batvink
possibly Scraggle - had input but didn't see code

In fact no, like BatVink said - we are all winners - we all know how to code.

If Phealax doesn't choose within next few days then assume we all winners and just choose another one - I believe Phealax does really long hours so may not have time

few things interest me are paranormal and real life docs - so maybe create something like an atom blowing up to look and feel of a nuclear explosion
Damo
Blendman
6
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 27th Feb 2017 14:45
Hi

Some great examples here

The skeleton challenge was a good idea. I have started some tests, because I would like to add it in my tool age2d :


But I think the skeleton lib should be improved with some features, like :
SetSpriteToSkeleton2DBone(sprite, skeleton,bone)
AddBoneToSkeleton(skeleton, bone, bonename$)
And other things like add frame to animation...

I think we could do that, but the skeleton system is ready in agk, it could be great to improve it a few ^^.
AGK2 tier1 - http://www.dracaena-studio.com
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Feb 2017 16:13
I'll get to testing the submissions tonight after work. I got sidetracked this weekend with the sunny 75 degree weather we had in February and built a shed instead of staying indoors on the computer.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
CJB
Valued Member
16
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 27th Feb 2017 16:18
That's okay, as long as it's a man-cave shed to house your computer!
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 27th Feb 2017 19:12
All good!!!!
Quote: "If its a man cave for computers we may need pictures"
fubar
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Feb 2017 13:55 Edited at: 28th Feb 2017 13:58
It's not really big enough to sit in comfortably. I just rent the house so I wasn't going to spend a lot on a fancy shed. I used pallets for the siding cause I'm cheap like that. Now when I finally buy a place, oh I'll have a fancy man cave shed with underground bunker. (turns out image attachment preview doesn't work with uppercase JPG)

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 2nd Mar 2017 10:55
You are quite the handy man Phaelax

I would've spent more time in ER after injuring myself with the hammer lol
fubar
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Mar 2017 23:59
I got a bit sidetracked. Yesterday was a crappy day at work. Ink pen ruined my pants and that was only the beginning. Then last night we had some crazy winds after the big thunderstorm hit. Here's a pic of what's left of my "garage". So I had to clean that mess up today and recover it. And for those not in Ohio, the temperature did a 180 on us again. 62 yesterday, it's snowing today. Last week we went from 75 friday to snow saturday morning.

But I've got AppGameKit open now and frankly it's all I plan on doing tonight!

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 6th Mar 2017 12:09
Hey Phaelax. Are you still going to pick a winner or should we just move on to a new challenge?
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Mar 2017 14:13
Ummm, MadBit wins. Next challenge.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 6th Mar 2017 22:48
Congratulations Madbit !!!
Up to you to set the next challenge.

I still like CJB idea of retro demo
fubar
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 7th Mar 2017 09:04
Thank you. This is somewhat surprising. I had not posted a full working code. But OK.

CJB wrote: "It's been a while since we've seen a retro MegaDemo! Include anything you like, - star-fields, sinus scroller, particle effects, fake 3d floating blobs, ... or perhaps just one segment of a megademo each written as a standalone 21 second chunk which can all be stiched together at the end to produce a community mega demo and the winner is whoever makes the best segment? Could be fun!"


CJB's suggestion sounds really great. But! Without media the demos will not be so impressive. If we now allow media. Would the evaluation more difficult. You would automatically rate the quality of the media and no longer the creativity of the code. It would then be no code challange anymore.
Or what do you mean?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
fubarpk
Retired Moderator
15
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 7th Mar 2017 09:26 Edited at: 12th Apr 2018 22:39
Allot of the early demos were just text scrollers (but did have catchy tunes in the background) and were very hard
to read often lol
but star fields, particle effects, floating 3d blobs all can be created without pretty media
Media can also be created easy enough with the draw commands or if you really have something small that is
hard to create with the draw commands you could draw it with a different program then turn that into a predefined
array of colours that you can then use in this demo so still no media is required
.
for example something ive been playing with


I am not all that good at Math so I found AppGameKit snippets https://forum.thegamecreators.com/thread/203769 a great help

There is help on drawing a smiley for example or my example of a smiley using an array on a previous page https://forum.thegamecreators.com/thread/218129?page=5

Quote: "So I don't think media is that big a requirement with the commands we have built into AGK"


And a Demo I made that I turned into a game without loading any media can be found here https://forum.thegamecreators.com/thread/218886
fubar
Phaelax
DBPro Master
17
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Mar 2017 19:45
I'd like to stick with the no media rule, it has always been one of the biggest aspects of the challenges in the past and has caused people to come up with some rather unique solutions.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ranietz
AGK Gold Backer
15
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 8th Mar 2017 12:23
Can we use shaders for this challenge?

Login to post a reply

Server time is: 2020-08-12 19:45:54
Your offset time is: 2020-08-12 19:45:54