Community

Community Affairs => Forum Support and Suggestions => Topic started by: gumby on January 20, 2013, 03:05:52 PM

Title: Fan game source code
Post by: gumby on January 20, 2013, 03:05:52 PM
Here's a suggestion:  how about creating an area for hosting all the fan game source code?  Reason being so it could be fully searchable.  Right now, I've got all fan game source code on my laptop and every time I want to find an example of how something is done I end up grepping the whole directory structure until I find examples of the code I want, then I go and open the script.  Works fine for me, but an online feature like this might make things more accessible for others.

I'm imagining something similar to an online SVN repository browser.

Maybe SMF has a plug-in for something like this?
Title: Re: Fan game source code
Post by: Collector on January 20, 2013, 05:05:03 PM
Or on the Wiki. The nature of the Wiki is such that makes it easy to find stuff. Each could have any category assigned to to make it easily searchable. Say, if a game had a good example of using a VIEW resource and a unique timer usage, it could be assigned categories of source, timer and view, or any other categories that would apply.

And no reason to not have it on both here and the Wiki. I believe in duplication as a safe guard against a crash or attack.
The information would still be accessible.
Title: Re: Fan game source code
Post by: Cloudee1 on January 20, 2013, 05:17:47 PM
Except for a couple of games, most of them are really only a few rooms. I'm not sure I see storing all of the source code when 98% of it is actually duplicated template scripts. I'm open to ideas of how to organize it to make it useful. But at this second, I don't see "the vision" I guess.

What would work out for now though, and since the source code has been released I don't think many would see it as an issue, If you have found something useful in the source codes then just copy and paste it into a thread in the how to section.

ie. Examples of Blah Blah Blah.
Title: Re: Fan game source code
Post by: gumby on January 20, 2013, 06:11:02 PM
I see what you are getting at.  If the code that we have isn't all the useful to provide examples, the it really doesn't make sense to expose it for searchability.  I guess I was thinking that there was more value embedded in the available source code than you indicate, though I certainly haven't spent much a lot of time pouring over the source.

You are right, I hadn't considered that most of the code would be duplicated from the template game.  Perhaps it is better to raise a particular problem then provide source code to solve that problem, in a similar fashion to how we've been doing it with forum posts.  This does seem better than having 98% of the searchable source code essentially useless.

Unless we could treat it like different branches (like an SVN branch) beginning with the template.  Start with the template, then do a comparison against a particular game, and the differences would be what make the game unique.  Not sure if this could be presented in a coherent way though.

Oh well, even if it doesn't come to anything it's been worth the discussion.  I'm always interested in considering how we can improve knowledge transfer to developers.
Title: Re: Fan game source code
Post by: Cloudee1 on January 20, 2013, 07:33:41 PM
I did a search of the smf mods and I don't see where there is anything like a repository out there.

I'm not opposed to getting the code out there, I just haven't come up with a real good way yet to present it in a usable way.
Title: Re: Fan game source code
Post by: gumby on January 20, 2013, 08:39:23 PM
Yeah, I don't we'd just want to have every page of code up - like you said, you wouldn't want lots of identical matches from a boilerplate template script.  I'll think about it and see if I can come up with something.
Title: Re: Fan game source code
Post by: Collector on January 20, 2013, 08:58:18 PM
It would take some effort on someone's part, but any games that have some bit of code that could prove useful as a "How To" could have that code copied into a new game from the template to have a small working example that only does that one thing. Something that could serve as a try it like the W3Schools. Snippets of code alone are not always that useful for someone trying to learn a new language. Working examples can be far more instructive.
Title: Re: Fan game source code
Post by: gumby on January 20, 2013, 09:36:52 PM
Collector, yeah I agree it makes sense to isolate the code we are trying to document and put it in a template game.  That way we don't have other code cluttering the how-to and potentially obfuscating what it is we are trying to demonstrate.

This whole topic sort of falls into the idea about possibly creating how-to's out of (or in conjunction with) walkthroughs.  Cloudee, you still thinking about doing this?
Title: Re: Fan game source code
Post by: Collector on January 20, 2013, 10:01:55 PM
Does any stand alone SCI script compiler exist? If so, it would not take that much to do something like this http://www.w3schools.com/css/tryit.asp?filename=trycss_default A full version of VS could let you do something in ASP with jDOSBox to do something similar with SCI. C# could easily do it as a local app.
Title: Re: Fan game source code
Post by: Cloudee1 on January 20, 2013, 10:07:16 PM
Collector, I don't know if it is feasable or not.

Gumby, Yes and no. Before I was thinking that we tackle all of the games... and then I uploaded and played President's quest. That kind of killed my spirits, I even filled in a rating for it. But it got me to thinking, how many of these other games are going to discourage me in the same way by just plain sucking. I mean really I hate to put down anybody's work, I understand that we all come from different places with different strengths but still that game... Kind of like the zelda demo. From what I remember it was just the ego on white background.

Here is where my thoughts on this subject have led me. Not necesarily a final call, but a current idea. I create a special board in which each thread is a room of a game, including all of the existing template scripts. Other rooms either from submitted games source code, or just expansions of the how to scripts can be added. It would be nice if we use the how to's to explain the idea of something with just the necesary bits of code and point from there to the whole roomscript in this other board to view it in place and in action.

Now the problem comes up, views pics and the actual game itself. Where and how should we keep this tutorial game updated to match the scripts found in the threads of the board.
Title: Re: Fan game source code
Post by: Collector on January 20, 2013, 10:35:29 PM
Without ASP, it would have to be an Windows Form application that could be downloaded. If we had a compiler that could be called from the app, the script in question could be compiled into a script.* file in a template's base game that had any needed extra resources already packed into the game's archive. The script in the game's base would override the packed script. This would allow the user to modify that script and be able to see the results right away. I have already written similar code in C#, sans the compiler, to do this.
Title: Re: Fan game source code
Post by: gumby on January 20, 2013, 10:49:49 PM
Collector - yes, a standalone version of a script compiler does exist.  It's Brian's, but I cannot for the life of me figure out how to make it work properly.  I'm all for this idea, but I have no bandwidth right now to take it on.

Cloudee, yeah some games should probably not be rated.  The majority of mine probably shouldn't - most of them just show off some things you can do and really shouldn't be considered games at all but should be classified as 'instructional' - it may actually make sense to add another category for 'games' such as this (or rename the 'demo' category maybe?).  Maybe we should only do walkthroughs of complete games, based on a specific set of criteria, though I'm not sure what that criteria should be.

Sounds like your current idea is looping back around to the idea of creating a sort of tutorial game.  Or mini-tutorials, not necessarily interconnected.  I like the idea of extremely focused, very short working examples.

I've got a suggestion, what if we start with the template game (our newest, latest-greatest template game).  Then we provide tutorials illustrating a particular feature.  Then provide a 'diff' code download, then the developer has to apply it as a 'patch' into the template game, creating a complete working game.  Diff/Patch tools already exist for this purpose, though I haven't used a diff/patch in years.

Basically, it's no different than what I just did with testing your avoid script, except you would have created a diff file & attached it to your post.  I could download it, apply it to a copy of the template game & would have a complete working game in a couple of clicks, no copy-paste necessary.  You'd create the diff, then everyone else could download it and patch it into a clean copy of the template game.
Title: Re: Fan game source code
Post by: Collector on January 20, 2013, 11:11:07 PM
If we are talking about just one or two scripts, all we need is a "base game". This app could maintain a sort of catalog of different "TryIt"s. New ones could be added by copying a download a sub folder of the app. These download packages would only need have the relevant scripts and extra resources over the base game. One could be chosen from an auto populated combbox that would list all downloads. it could just copy the extra needed resources to the base game's folder. and when closed, the raw resources could be deleted from the game's folder. The archive/map would not have to be touched.

All of this would be fairly straight forward to do if we had a working compiler. Where is a copy of Brian's standalone compiler?
Title: Re: Fan game source code
Post by: gumby on January 20, 2013, 11:37:20 PM
Here's the script compiler :)

http://sci.sierrahelp.com/Files/SCIStudio3/SCI_Script_Compiler_133.zip
Title: Re: Fan game source code
Post by: Collector on January 21, 2013, 12:13:34 AM
I played around with it for a while, but it seems to want to compile the entire game, not just the single script. It also wants an sci.sh, which is missing from any template game. It will accept the game.sh renamed to sci.sh and continues.
Title: Re: Fan game source code
Post by: gumby on January 21, 2013, 12:29:52 AM
I think if you pass the script name that you want to compile as a parameter it will just compile the one.  From memory, I think I had a horrible time trying to figure out where it wanted all the dependent files.  Here's a link to a related thread: http://sciprogramming.com/community/index.php/topic,384.0.html

Hmm, could be my issue with this tool was the 'cross-dependency' compiling that I never got worked out.  Maybe this compiler works just fine after all.  I'll have to reinvestigate this.
Title: Re: Fan game source code
Post by: Cloudee1 on January 21, 2013, 12:44:33 AM
Actually Collector, the templates do come with an sci.sh file. If you check out the Repository sort of Board, you will see it listed there.

I know you guys are tossing around some ideas, in the meantime I have gone ahead and copied all of the current files in the template game into this new board. Then I went ahead and added a reply to the rm001 thread which included the code from a how to.

Lastly I went into the how-to and edited it to point directly to that reply. I know it isn't as cool as the diff/patch idea, but it is up and running now without anybody needing any extra software.

Anyway, your opinions of my implementation.
Title: Re: Fan game source code
Post by: Collector on January 21, 2013, 10:10:43 AM
For quick reference it is fine. I still think that there is merit in a TryIt. If you enclose the code in the code tags, you won't need to remember to disable the smilies. It would also help to preserve formatting.
Title: Re: Fan game source code
Post by: gumby on January 21, 2013, 10:49:31 AM
Good idea with the use of code tags.  EDIT:  Blast it, but if we use the code tags, we cannot highlight the changed code.  Not sure the best way to proceed here.

Contributions this way is a great way for us to fix/augment the template game.  Not sure how this will work when we have examples that span multiple scripts, but it's a great start.

Oh, a quick note with regard to the keys.sh and the sci.sh.  These are strictly used for compiling, not necessary for game distribution as it only contains constant values which the compiler uses for translations at compile time.  They live in the 'Include' directories of Studio/Companion.  Speaking of which, time for my first submission to the new repository.
Title: Re: Fan game source code
Post by: CamKrist on February 14, 2013, 07:58:47 AM
Similar subject was being discussed at yahoo answers last week. I can post the link if needed.