Community

AGI Programming => Mega Tokyo AGI Archive => Topic started by: Nailhead on January 15, 2002, 12:51:42 PM

Title: an AGI/Web game
Post by: Nailhead on January 15, 2002, 12:51:42 PM
Chris, I'm interested in hearing more about this AGI/web game possibility. I too dreamed of it long ago. As you said, cookies would be the best way to save a game, rather than server-side. Will you be using PHP or CGI for the programming?

Just curious, this would be a really cool project.
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 15, 2002, 11:45:56 PM
So far all of it is based on html and javascript. I am trying to use cookies to make a saved game. It is rather hard considering I don't know much about cookies. I have however been able to make a saved game the problem is I don't know how to load it back up after it is saved, I will just have to experiment to figure out. When it saves it writes the pic number you last visited to the cookie. As for CGI and PHP I can't really use those or know how to because the AOL server does not support them for account use.

Also I have finished the restart function which automatically takes you back to the first screen.

I have encountered one bug so far but it is the Visual AGI code for some reason when I go to the page the sound is by default off but if it you have visited the site before then the sound will be on but it will say it is off. I need to figure out how to fix this.
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 15, 2002, 11:48:32 PM
On another note if anyone knows how to make animated gif's I could use them to make the game animated. Also I have been using the pics from V to make it but am not decided on whether or not I will make a V web/AGI game. It just depends on how well it comes out.
Title: Re: an AGI/Web game
Post by: Zero on January 16, 2002, 10:35:49 AM
Wow this is cool.   ;D
Title: Re: an AGI/Web game
Post by: briancorr on January 20, 2002, 04:31:44 AM
to make animated gifs you need a gif animator

a free shareware one can be found at www.coffeecup.com

Title: Re: an AGI/Web game
Post by: Chris Cromer on January 20, 2002, 05:45:19 AM
Thanks now I can make the game animated.
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 20, 2002, 08:42:51 AM
The only problem is I can only make 10 animated gif's then the program will not work unless I buy the full version. I need to find a free gif animator that allows me to make as many gif's as I want but does not add an ad to it.
Title: Re: an AGI/Web game
Post by: robingravel on January 20, 2002, 10:07:04 AM
Try Microsoft GifAnimator. It's a freeware.

http://download.microsoft.com/msdownload/gifanimator/gifsetup.exe

Robin Gravel
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 20, 2002, 10:39:19 AM
Ok I will try it thanks for the link.
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 20, 2002, 10:50:08 AM
That is perfect thanks Robin. I will use it to make the game animated and to add animation to my web site.
Title: Re: an AGI/Web game
Post by: robingravel on January 20, 2002, 12:08:13 PM
It's my turn to help you Chris.

Robin Gravel
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 20, 2002, 12:50:19 PM
Well thanks again.

So far it is going pretty well. I am trying to make it into a engine so that it can be used to make more AGI web games.

Lots of the functions are starting to come together. I still have not been able to load the cookie to use its information to restore the game I will have to play around with the restore function some more.

I have decided to make the functions into seperate .js files to make it easier to manage and to work with the engine.

The only functions that are not finished yet are the sound, restore, and inventory functions and probably a few others I will have to impliment but can't think of to make it like an AGI game.

After I finish getting the engine put together I will start making the first game to use the engine.

I am still trying to decide what game I should use with the engine. I am thinking either SQ2 or a fan game.
Title: Re: an AGI/Web game
Post by: Bjoern on January 20, 2002, 10:04:04 PM
Quote
I am still trying to decide what game I should use with the engine. I am thinking either SQ2 or a fan game.  

If you like, you could take V.
I still don't understand the idea exactly: Is the goal to make a game completely playable online with VisualAGI or is it to desgin an AGI-like surface for a website?

b.o.k.
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 20, 2002, 10:27:26 PM
I am making an online game not a web site. I will use the print screen command to take pics from the games then I will put them in the pic directory and have the engine load them when needed. I also have to open up the game and make animated gif's of all the views that the game will be using. I am making saving, restoring, restart, and inventory functions. If i can figure out how to make some sort of a parser I will use that instead of a point and click game. Does anyone know how I can go about making a some sort of parser in html or javascript.
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 21, 2002, 01:52:16 AM
Wow that gif animator works great here have a look at some of the gifs I made:

(http://www.members.aol.com/agisci/t.gif)
(http://www.members.aol.com/agisci/tt.gif)
(http://www.members.aol.com/agisci/ttt.gif)
Title: Re: an AGI/Web game
Post by: Chris Cromer on January 30, 2002, 11:36:19 PM
I need to make a decision on which way to go for user interface. Everybody please give me your opinions on this.

Should I use a parser, point and click, or a mixture of both?
Title: Re: an AGI/Web game
Post by: Nick Sonneveld on February 01, 2002, 08:52:05 PM
I think if you're going to go to the trouble of recreating an AGI game, you should try and stick with the look and feel.  But I think you should do whatever you feel is easier and appropriate.

- Nick
Title: Re: an AGI/Web game
Post by: Chris Cromer on February 02, 2002, 03:12:35 AM
Point and click would be the easiest one to do because links are already built into web browsers. The paser would take me having to write a function to use a text box and have some sort of way to parse it. I think I would like parser to stick with the original AGI games but then only reason I asked is because I wanted to know what everyone else thinks about it.
Title: Re: an AGI/Web game
Post by: RaDIaT1oN on February 02, 2002, 04:40:58 AM
A text parser would be the better option.
IMHO "point and click" is for people who can't or are too lazy to type.

The implementation would be more complicated.  I really don't remember javascript at all, but I don't know how you would even load the dictionary without using a linked list of some form.  Writing the parser for AGIL had me scratching my head for days.  Another trick to it is when words have spaces in them, so you can't simply use spaces as word delimiters.
Title: Re: an AGI/Web game
Post by: Joel on February 06, 2002, 11:53:25 AM
technically, you're talking about writing a lexical analyzer that matches the longest possible string, not a parser.

as for loading the dictionary, I don't think it would be that difficult. A linked list probably would not be a good approach, because the dictionary probably would not be changing very much at run-time. An static array of sorted arrays would probably be a reasonable approach. I would definitely say put the declaration in a separate js file. You could also put a function declaration in that file that performed something like a binary search through each of the word groups. There might be a better way to do it than that, but it would probably be pretty complicated.
Title: Re: an AGI/Web game
Post by: Chris Cromer on February 06, 2002, 12:45:37 PM
I am thinking about making a mix between a sort of text paser and point and click. The point and click will be used for moving the character from room to room while the text parser will be used to do things in each of the rooms. What do yall think of this?
Title: Re: an AGI/Web game
Post by: K.J. on February 06, 2002, 10:02:11 PM
Go for it and let us know your progress :).

BTW, I think that you will need to use CGI as it is far more powerful than JavaScript, and CGI programs can be written in C/C++, BASIC, PASCAL, etc...

Though I guess that you might be able to use Java.

K.J.
Title: Re: an AGI/Web game
Post by: Chris Cromer on February 06, 2002, 10:12:12 PM
There is a few problems with using CGI.

1. My server does not have a cgi bin.
2. I don't know anything about CGI.
3. Server side is also not my specialty.

So for now I am stuck with JavaScript and HTML.

As for a progress report:

I have made a function to make the cursor stay the hand at all times even when you are not over a link.

I have also made a function to disable right clicking so that you cannot look at my code/or cheat while playing the game.
Title: Re: an AGI/Web game
Post by: K.J. on February 06, 2002, 10:24:59 PM
I have made a function to make the cursor stay the hand at all times even when you are not over a link.

I have also made a function to disable right clicking so that you cannot look at my code/or cheat while playing the game.


Could you please send those my way?

K.J.
Title: Re: an AGI/Web game
Post by: Chris Cromer on February 06, 2002, 10:31:48 PM
This is the code for disableing the right click:

Code: [Select]
function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}


and this one is for making the mouse icon stay the hand:

Code: [Select]
function changecursor()
{
     document.write( '<body style="cursor:hand">' );
}
Title: Re: an AGI/Web game
Post by: Joel on February 07, 2002, 07:38:36 PM
Although I don't really want to encourage it because I think this kind of activity is major abuse of JavaScripting, but does that JavaScript code block someone from using the Windows Context Menu key (or Shift-F10)? Have you disabled the menu bar for the game (making View->Source inaccessible for IE users)? If not, there's not much point in doing it, because anybody who really wants to cheat is going to find a way to do it anyway. Of course, even if it did block the context menu key, I'm sure it would be no problem to find a utility that downloads HTML files and displays the source rather than interpreting it.
Title: Re: an AGI/Web game
Post by: K.J. on February 07, 2002, 08:50:17 PM
I was just messing around with AGISCI's Javascript code and found out what Joel said. I think that what needs to happen is that the game needs to be started from a link that opens a browser window with no menu, address bar, or nav bar(like those anoying popup ads).

K.J.
Title: Re: an AGI/Web game
Post by: Chris Cromer on February 07, 2002, 10:25:17 PM
Quote
I think that what needs to happen is that the game needs to be started from a link that opens a browser window with no menu, address bar, or nav bar(like those anoying popup ads).


My game already does that.

Quote
Have you disabled the menu bar for the game (making View->Source inaccessible for IE users)? If not, there's not much point in doing it, because anybody who really wants to cheat is going to find a way to do it anyway. Of course, even if it did block the context menu key, I'm sure it would be no problem to find a utility that downloads HTML files and displays the source rather than interpreting it.


There is many possible ways to read the code and cheat. This just makes it harder for the user to do so. For instance your windows store web pages in a temporary directory. Now if I were to load the page then go to that directory I could open the file in a text editor and view the code. There is always some way to read its source.

Quote
Although I don't really want to encourage it because I think this kind of activity is major abuse of JavaScripting, but does that JavaScript code block someone from using the Windows Context Menu key (or Shift-F10)?


I am not sure if it does or not. I have not thoroughly tested it yet. The only thing I really tested was to see if I could disable right clicking.
Title: Re: an AGI/Web game
Post by: K.J. on March 18, 2002, 07:28:13 PM
So how is the game going?

K.J.
Title: Re: an AGI/Web game
Post by: Chris Cromer on March 19, 2002, 01:06:09 AM
I have been focusing mostly on V, but it is still coming along quite nicely. I am still having a few problems with saving to a cookie though. I don't know anything about cookies and how they work which is making it a little harder to impliment saving.
Title: Re: an AGI/Web game
Post by: K.J. on March 20, 2002, 08:56:31 PM
Cookies? Javascript for Dummies has a great section on it.

K.J.
Title: Re: an AGI/Web game
Post by: Chris Cromer on March 23, 2002, 06:30:04 AM
Sorry it took so long, I didn't notice this topic had a reply.

I guess I will need to take a look at that then. Hopefully I can figure this out. The save works perfectly, it has all the info that is needed in the cookie but now I got to learn how to load that info then make it go to that specific part of the game by using the cookie.
Title: Re:an AGI/Web game
Post by: Kon-Tiki on August 09, 2002, 02:45:13 PM
This seems like a good tutorial for cookies in Javascript:
http://www.trans4mind.com/personal_development/JavaScript/cookie1.htm

Another site which can probably be of much help is:
http://javascript.about.com/cs/cookies/
Title: Re:an AGI/Web game
Post by: Chris Cromer on August 09, 2002, 06:11:31 PM
I don't need that info anymore, but thanks anyway.

I started over, and have been making it in php now. I am using a mixture of cookies and sessions to make it.
Title: Re:an AGI/Web game
Post by: Joey on August 09, 2002, 06:57:46 PM
Wow. This really does sound interesting. But im not really sure what you people mean. You are going to make an AGI game that can be played on internet explorer? (or the internet i mean) I think it would be cool if we could have a virtual AGI chat room. Everyone would be an AGI charachter, and we could talk to each other. Mabey even go on quests together. (like the person who made it would make mini quests, then people could do them together.) This is just a thought. I think it would be really cool though.

Back to this.... I wish I could help you chris, but I have no idea about html or JAVA. If you need anything, just ask.

(Hey, mabey ill look into JAVA or something and see if I could make a virtual AGI chat room. I doubt it, im not that good at programming. I would need help.) Tell me what you people think about the virtual agi chat room though.
Title: Re:an AGI/Web game
Post by: Brian Provinciano on August 09, 2002, 07:09:09 PM
Java and Javascript are totally different. If I were you, I'd do it in Java. Java, though not as powerful and C++, is quite powerful, and would be an excellent choice.

There already was work on a Java interpreter that plays real AGI games. If you learn Java, you could modify to be able to play actual AGI games with expanded web functionality.

On the flip side, if it's not going to actually be "AGI", then check out Indiana Java. It is a great engine.
Title: Re:an AGI/Web game
Post by: robingravel on August 09, 2002, 07:19:49 PM

if I could make a virtual AGI chat room. I doubt it, im not that good at programming. I would need help.) Tell me what you people think about the virtual agi chat room though.


There's an agi chat:
http://www.agigames.com/chat/

But it seen like nerby no one is used this chat anymore.
I stopped to go to this chat for that reason.

Really I think agi community does not need a chat.  I prefert using messageboard unstead.

If you have problems with agi programming, go to the board. In the board, the thread can stay forever. In the chat room, the thread stays only about 97 hours and disaspears later.

Robin Gravel
Title: Re:an AGI/Web game
Post by: Joey on August 09, 2002, 07:45:14 PM
Well Robin, I didnt mean a chat like that. I meant a chat room that would have graphics. anyway, i need to get off the pc, my dad needs it. I will explain tommorow.
Title: Re:an AGI/Web game
Post by: StrangeQuark on August 10, 2002, 03:40:38 AM
Chris: could you give some more information on what te game will be like? Is it just a normal adventure game you can play online or do you want to make it multiplayer?
Title: Re:an AGI/Web game
Post by: Chris Cromer on August 10, 2002, 11:39:32 AM
Well I am not making a game, I am making an engine for others to make games with... of course I would use java to make it but I don't know java(or have any java programming stuff). Right now I am using php to do stuff... the only thing it has is an AGI feel... it isn't real AGI. But maybe if I can find out about this java stuff I could make it a real interpreter.
Title: Re:an AGI/Web game
Post by: Joey on August 10, 2002, 11:40:48 AM
robin. this topic should be for chris's thing. i started a new one about my idea.
Title: Re:an AGI/Web game
Post by: StrangeQuark on August 10, 2002, 12:03:58 PM

Well I am not making a game, I am making an engine for others to make games with...

I was just asking because Sierra tried to make an online multiplayer adventure game once (it would've been Larry4, read about it: http://www.allowe.com/L-land.htm (http://www.allowe.com/L-land.htm)), but they had to give up, because they didn't know how that should work exactly. And frankly, I wouldn't know either  ???
Title: Re:an AGI/Web game
Post by: Chris Cromer on August 10, 2002, 03:06:19 PM
I am not making a multiplayer online game! Nor had I ever planned to. :P