Is it possible to make a 2 player agi game?

Joey the question is (read the subject. ::)) is it possible to make a 2 player agi game? thats what i was thinking of if i made a new BETTER version of snowboarding. right now im concentrating on DQ2, but after that, im not sure what i should work on. im thinking GOSQ2 or snowboarding (a newer version of it.)

(I know what chris is going to say. Anything is possible. or hes gonna say something like that. ::) ;) jk. What i meant is has this been done before, or how hard would this be? what im thinking is all i have to do is set new keys for a second player. maybe not that easy huh?)
AGI1122 Well it hasn't been done before, but it is possible, just map certain keys to control the 2nd player and then both players could play.
Joey do you think its a good idea? i think it is and i may make it. the first 2 player agi game. please know one make a 2 player agi game until i do. it was my idea. ;)

if you wanna go ahead. i may fool around with it sometime.
AGI1122 Of course, you should know the second player isn't going to work exactly like the ego does. The ego is automatically mapped to the arrow keys and it moves him automatically.

You would have to program what the view does on different key presses because it wouldn't happen automatically.
Andrew_Baker There was a two-person puzzle/action/adventure for PSX called Cookies and Cream. Rather, it was a game where one or two people had to simoultaneously control two characters to get through each level.
jelleghys But,... ???
Let's say, ego 1 is controlled by the usual cursors and ego 2 is controlled by the numeric controlpad. If you press up-6, then would ego 1 move up (because you pressed up) and would ego 2 move right (because you pressed 6) or will nothing happen because you haven't said what the keycombination up-6 does.

Pfff, hard to explain myself. My question is: will you have to defiene what every possible key-combination does, or not? ???
Joey well this is interesting and would be quite a challenge i would be willing to take. but this leads me to something else. can you connect people online with agi? you make a multiplayer agi game that would connect through ip addresses. is this possible? i dont know how to find EVERY SINGLE command for AGI. is every command in the index and others in defines.txt? could you make you own commands? (you would have to edit agi studio huh. and sierra's interpreter wouldnt be able to understand that command so i would have to make my own interpreter.)
Jelle wrote:

But,... ???
Let's say, ego 1 is controlled by the usual cursors and ego 2 is controlled by the numeric controlpad. If you press up-6, then would ego 1 move up (because you pressed up) and would ego 2 move right (because you pressed 6) or will nothing happen because you haven't said what the keycombination up-6 does.

Pfff, hard to explain myself. My question is: will you have to defiene what every possible key-combination does, or not? ???

You can define what they do, but the interpreter would not automatically know. Just use the example in logic.091(I think it was that logic?) and it will show you how to assign keys. Then after you assign it, you have to build little if statements that tell what is pressed, and what to do if they are pressed. It won't be automatially I press 6 so it goes right, you will have to program and tell the interpreter what to do if they press 6.
Then after you assign it, you have to build little if statements that tell what is pressed, and what to do if they are pressed. It won't be automatially I press 6 so it goes right, you will have to program and tell the interpreter what to do if they press 6.

Yes I know, that's not my problem...

I was just wondering,...
Program the game so that ego 2 will go right when you press 6.
Than program the game so that ego 1 will go up when you press up.
But than if you press 6 and up together, will ego 1 move up and ego 2 go right or will the game do nothing because you press up-6 instead of up and 6...

I don't know how I can explain me better...

Or maybe:
Compare with ctrl-z in agi games... when you press those keys the game will end because you pressed ctrl and z together... The interpreter thinks as if it's one key... You had to set ctrl-z...
But how can you possibly set every possible key-combination...

I know there are games with more than one player, but I don't think they are written in AGI, so...
jelleghys Oh well, maybe it isn't a problem at all... Just forget everything I posted here... :-\
Joey heh heh. no i think that was a good point. that will be something to look out for. i understood what you meant. when i have some free time ill check this out. maybe I (the one who always has the questions) will do what has never been done before..... MAKE THE FIRST 2 PLAYER AGI GAME!!!!

i was thinking of one packet with multiple to player games. ex: laser tag, a downhill snowboarding race.... you know, simple little things. not all one game or quest. it would be mini games for 2 players.
gpm Check this idea: AGI Pong.
That'd be a great way to get the ball rolling on 2-player AGI games!

But don't count on an online version.. remember Al Lowe couldn't figure out how to make a multiplayer LSL game (which is why there was no LSL4) [glow=green,2,300]in SCI[/glow], let alone AGI.

Personally, I'd be pretty happy with a hotseat version.
Joel well, you'd have a great deal of difficulty doing an online AGI game for the simple reason that AGI doesn't have network support. it would at the least require a hacked interpreter...and I'm not really saying that such an idea would work for sure.
sonneveld if you were to create a network agi.. how would you implement it? peer to peer (send data to everybody) or a client/server setup (send and receive data from single source)?

A game world would have variables shared across all clients so you would need functions to read the variables/flags from the game world. either a function "get.gameworld.var" or flag, when set, would mean any variable access is through the gameworld. what about copying variables from the server to your own client variables?

What about the state of other ego's in the room? There would have to be a limit on the number of ego's in a room because of the limit of animated objects in agi.

You would have to increase the limit (We're adding new commands and network support anyway) and perhaps only show the nearest 10 people around you. The rest could be shown as a list of (or number of) people at the bottom of the screen.

communication. shouting something so everybody in the room can hear or a speak to individual person option? you would need to easily find the name of each person then.

quests. how would you program them? one big quest for everybody or an individual one that people can join in?

new rooms. only created by people who run the server or can anybody add a room? how?

- Nick
Sami_Tervo Hmm, how about this :player one uses keys and second players uses mouse.

And oh yes, AGI-community's Go-players...let's start workin on a Go-game!
Sami_Tervo wrote:

And oh yes, AGI-community's Go-players...let's start workin on a Go-game!

Making Go has two more difficult logic-bits than a 2-player logic. AGI should check the chains made by the two players and, in some cases, eat other player's stones. The placed stones're best stored in variables (one var for each place) Now, to check the chains, it should check the vars surrounding the one presenting the place where a stone's placed. With a well-thought var-namesystem, this's possible (probably define them using coordinates). On itself, this isn't difficult, but it should check if a stone of the opposite colour should be eaten or not. This's the mayor problem. Any ideas on this would be appreciated.
Btw: Go's perfectly done with the controls of one player.

Back to the multiplayer. I've got some time now, so I'll look into the multi-player logic and try to make Pong with it, so you guys can get along with multi-player games.

Kon-Tiki Ok, managed to get a second player to play. It's difficult to find keys for him, though. This code's from my Pong and only uses Up and Down. Up's backspace and Down's enter (don't enter in the intro screen, press space ;D )
The defines should be put in defines.txt. Just count from where they stop (so if the last flag in defines.txt is f15, define f16)

This's the code that needs to be put in Logic 000:

if(controller(ego2_up)) {
if(!isset(ego2_going_up)) {
if(isset(ego2_going_down)) {
else {
else {

if(isset(ego2_going_up)) {
new_ego2_x = old_ego2_x;
new_ego2_y = old_ego2_y;
new_ego2_y -= 1;,new_ego2_x,new_ego2_y);
if(controller(ego2_down)) {
if(!isset(ego2_going_down)) {
if(isset(ego2_going_up)) {
else {
else {

if(isset(ego2_going_down)) {
new_ego2_x = old_ego2_x;
new_ego2_y = old_ego2_y;
new_ego2_y += 1;,new_ego2_x,new_ego2_y);

This code needs to be put in Logic 091:

set.key(8,0, ego2_up); // Bckspace - Ego 2 goes up
set.key(13,0, ego2_down); // Enter - Ego 2 goes down

Make sure parsing's off, or you'll get weird results (using Enter as a cursor ;) )

If I forgot something, be sure to tell me, but I think this is all the code I used (besides loading views, but that's up to you, put them in logic 000 and put a draw(ego2); under each draw(ego);)

I'll go finish Pong now.

Joey NOOO!!!! :'( i really wanted to figure this out myself.....
i thought i was gonna be the first person to make a two player agi game. :'(

oh fine. ill make my own. kon tiki you source will be helpful. it will save me time. (now i cant have the fame of finding it. ;) jk) i still will make a 2 player thing though and release it. thanks kon tiki.

about the multiplayer agi. i guess it would be hard huh? it was just a thought. i didnt really plan on making it. now 2 player game is a different story. it would be a hot seat. i never thought about all that stuff anyway that nick mentioned.

btw: what is a go game?
Joel I wouldn't recommend using 4 flags for the second player's direction. Just do what the interpreter does by default...use a var. In fact, there are even useful constants already defined in the template game's defines.txt file:


That method conserves resources.
Joey oh oh oh, reviewing kon tikis source a little more revieled a question. how do you find out what nubers are the key you are choosing in agi studio. k that didnt sound like a good question huh. what i mean is here is the thing for backspace. 13, 0 i believe. how do you find that out and how do you find the numbers for the other letters.

also, is it possible to allow letters to be set as player 2's keys? that is if i wanted a 2 player non typing game.
backspace. 13, 0 i believe.

no, 13 is enter
8 is backspace

how do you find that out and how do you find the numbers for the other letters.

Do you know ASCII?
8 = backspace
9 = tab
13 = enter
27 = Esc
32 = spacebar
48 = 0
49 = 1
57 = 9
65 = A
90 = Z
97 = a
122 = z

0,59 = F1
0,70 = F12
Kon-Tiki [attachment deleted by admin]
Joey ah, i was just kidding with you kon tiki. good job making a 2 player game thuogh. CONGRADUALTIONS!!! hope i can fulfill such a task. ;D
Joel I just got the second player's rectangle to start moving toward the first player's :o
Joey after actually checking out pong, i did notice that BOTH players can move forward. and player 2 ends up near player one (i have no clue how.)

kon tiki, i would be happy to help you with pong sometime if you need it.
Joey i was looking at the source for pong. it seemed confusing but now it isnt as confusing. i started on a game called air hockey. it will be a 2 player game. the only thing is, i need player 2 to be able to move left and right. i was working on this for about 2 hours. i learned some stuff. great job kon tiki! anyway, i understand how to move ego 2 left and right.

v36 blah blah
v37 blah blah
v37 += 1;

you use the second varible (which is for a different axis i believe) and that will move it left and right. i set these following keys.

set.key 133, 0
set.key 134, 0

those should be f11 and f12 according to agi studio. but this doesnt work. it dosent move left and right. i also would have to reset more flags in one statement for these new things. i mean i need to reset 3 different flags in one statement. i need to put like 3 else statements in it, but it still doesnt work. they wont move left to right. could you give me what you think the code would be anyone?
Andrew_Baker Check the table in the help file for set.key(). F11-F12 do not seem to work in AGI.
AGI1122 F11 and F12 are not valid keys to use in AGI. I wrote the list of keys and what their values would be, even if they where not available(like F11 and F12... and there are a few others that arn't available as well).
Rich Hmm... two-player game... wouldn't it be great to make a two-player FQ game where one person controls the man and the other controls the woman. Great sex would be based on how well the two people interact... just like real life! Heh, heh, what an idea I've thought of.

Anyhow, I'm not sure how well AGI could implement a two-player game. Take a look at King's Quest 3 for a moment... the scene where the mirror reflects the ego.
The reflection was in fact a seperate animated object that was controlled not through the user's actual button pushing. The interepreter was told to find what button was pushed and mimic it to that seperate object. If you look closely, you will see that it is at least one interpreter cycle behind from the main ego movement. I believe that likewise, any second player control would also be an interpreter cycle behind the first player who has instant movement. This would give the first player a big advancement. Well, this is just something to think about...
rwfromxenon Geez Rich...
Working on FQ really screwed (excuse the pun) up your head. Did you always have a dirty mind like that?

Joey ha ha. good one allen.

well i tried f8 and f10. those didnt work either. ill try again. thanks.
Andrew_Baker f10 should work. That's what I use as my action button. And SQ2 uses it, too. Check to see if it hasn't already been assigned to something (?), and double-check your code!!!
Allyb wrote:

Geez Rich...
Working on FQ really screwed (excuse the pun) up your head. Did you always have a dirty mind like that?


The truth is, by the time we're 20, I believe we all have minds as dirty as that... even women. What sets me apart is that I feel free to express that mind. What's the difference, we're on the web... no one will know. Actually, my real life friends are all just as dirty and we all make such jokes. They all know that I make FQ and they love it!!! (guys and girls)
SGreenslade Here's another suggestion albeit less pratical and VERY time consuming. The interpreter dictates the number of egos. Just crack open that safe, rearrange the information, adding more if needed and then give it a try. This would have to be a job for a very talented and devoted programmer with quite a sum promgramming knowledge. Of course, I am neither of those. Any takers? It would make things more comfortable for the second player. The way you are going about assigning keys and delayed cycles, it would turn the whole experience in a game of finger twister.
Andrew_Baker While I admire your idea, part of the reason some of us use AGI is to use just AGI. We're friends with it, often having grown up playing Sierra games. Personally, I check my game against as many pure interpreters I can find. I prefer NAGI, but I'll check it against the classic interpreter, just to make sure that it would work for someone who might have an old 286. I mean, I have a Commodore 64, and I would love to score real games for it, instead of using a hacked C64 interpreter. The hacks are beautiful (AGI-Mouse, template switching, etc.), but I'll never use them, because they aren't really AGI anymore.
Joey hey thats an excellent point andrew. maybe using someone elses interpreter means..... were not really using/playing agi. hmmm. oh well, i use sierra's anyway.

about air hockey, dont mean to copy you kon tiki. its basically the same huh. well, id love to see pong finished soon. thats gonna be fun. i think ill get a demo of dq2 out first, then ill work on air hockey. i think i'll have enough time today to work on it. i have no clue when a demo will be released. maybe today, maybe tommorow, maybe next week, maybe next month. it all depends on how much time i have to work on it.
Joey wrote:

about air hockey, dont mean to copy you kon tiki. its basically the same huh. well, id love to see pong finished soon.

Don't worry, I retreated from Pong. it's public domain now. If someone wishes to finish it, feel free. If someone wants to copy it, no problem. I just won't work on it anymore, so if someone wants it finished, it'll be up to him/her.

SGreenslade I like agi too, but you shouldn't have to go to a chiropractor after every time you played a two-player agi game...if there's one thing I dislike about certain games any programmer makes are those that have soddy controls.
Andrew_Baker I think it would still be interesting to work on a cooperative game. Imagine that your main directional controls controlled the main character, and the supplementary controls could represent a less abled drone or something.
Joey hey you know i wanted t make pong too. maybe ill work on that since you have both players working. that would be cool. i may. thanks though kon tiki.
Eero R 1: First AGI game with two players was made by Sierra (Helicopter simulator), and over COM port, so it is possible to do 2-player game over internet too.
2: I tried to do 2-player game about a year ago, but I didn't finish it, because it is really hard to do so that characters can be in different rooms and both still visible (splitscreen is impossible, because when you do combinations of many rooms (you show two separated rooms in one screen), and one player goes into other room and second player does something, then the action is interrupted. When it is only one room in the game (like Helicopter simulator) then it is easy to do 2-player game.
3: Up arrow isn't 8 in the numpad, 8 only emulates it, you can switch the emulation off with Num Lock.
sonneveld for two rooms.. just have two versions of each room.. one at the top and one at the bottom (maybe a special program to shift it?) and use to add one on top of the other.

re helicopter sim.. I'm pretty sure that's NOT agi unfortunately. for one thing, agi doesn't support 3d graphics but they do share the same copy protection encryption method. (ie a .com file that decrypts an exe file and then runs it)

- Nick
Oliver It's possible and Eigen has got a template for two player AGI game ready and he's going to show it soon but he's got an internet problem and he can't come here (In some strange reason) :(
Eero R First, there are many Helicopter simulators, but that what I mean, is absolutely full AGI game, because it was in one of the AGI demo packs, it is openable with AGI Studio and it looks like AGI game. And also, that is not 3d game.
And for Oliver:
Kuule, sa oled ka Eestist, (seda poleks oodanud, mis?) meili mulle:
HwM Uh, just to make sure, we're talking about Sierra's 3D Helicopter Simulator... Indeed, the DEMO is in AGI... But so is Thexder... And both games weren't made in AGI, only the self-running demos in the demopacks... Like Nick says; the only thing they have in common is the copy-protection method...
Joey yes helicopter simulator is made by sierra, but is not an AGI game.
Andrew_Baker Good enough... Is the AGI DEMO two-player??? And does it use the COM port? I found out that my MS gamepad works as a joystick in AGI games, so would it be possible to A) use the joystick as a separate command interface for player #2 B) access or emulate the COM port over a network?
sonneveld The demo was non-interactive.. it was basically pictures of how it *might* look in the actual game.

joystick support is intimately linked to how the ego moves.. like the cursor keys.

- Nick
Joey yes the demo was like a movie. but would we be able to use a joystick for player 2?

(im not sure if thats what nick meant, that we cant.)
SGreenslade Yeah that's what he meant. Is it possible to make a mouse interface for the second player? That would keep both players' arms untangled.
sonneveld the joystick and the arrow keys will control the same one ego. I *think* the joystick buttons can be mapped to a different controller but I can't remember.

Now the mouse interface.. if you use the default interface in NAGI, it will just move the ego wherever you click. However, if you use Brian's mouse api.. then yes, you could control one with the mouse and the other with keys.

- Nick
SGreenslade Brian? ???
SGreenslade Nevermind...I know now who you're talking about.
sonneveld sorry.. for the benefit of the audience. there are three different ways that agi can access the mouse:

1) let the interpreter handle it for you.. this happens in most v2 games on other platforms and in NAGI. click and the ego moves where you clicked. Your game can't access the mouse though.

2) use Brian's hacked api that he added to the dos interpreter (NAGI supports this too if you tell it to). you run a certain command and then check certain variables to find out the state of the mouse

3) use Sierra's actual commands to use the mouse. The amiga agi interpreter actually supports proper mouse commands but only in the v3 interpreter. You can check the state of the mouse via a special eval command and even box the mouse in a certain area. Only supported on the amiga atm since the pc version never used a mouse (will add to NAGI one day)

- Nick
Joey hey, what if we could have 2 joysticks!? we coulb probably set that up right? i think now that a dq2 demo is out, for today, im going to try to get a demo of pong out. kon tiki gave up on it i think or something and said anyone can take over it. i will. ill try to fix the bugs and stuff.

but 2 joysticks will kick ass!
Zonkie Hey, two joysticks would be awesome :o. But would it actually be possible if they were on the USB port, because I don't think there are many people around with two gameports...

But again, then there would be a problem with typing commands, and it would be so different from the AGI games we know... :-\

Now that we're talking about two keyboard players, mouse and two joysticks, let's make a five-player game ::) ;D...

Anyways, I guess the only Idea that would work out for adventure games is to have one main player who is on the keyboard and one minor character with some other control, as was already suggested earlier.
Joey 5 player game. lol. hey the 2 joystick thing, that would be for non typing games, like pong. hopefully i can get pong done today. it shuoldnt be that hard i think.

kon tiki, if your reading this, what is your full name so i can put in the about menu

(kon tikis name here) made pong v0.1. He was just testing, so he gave up on it. Now i finished it. So i would like a lot of credit to go to him for giving me the 2nd player code and other stuff.

id put something like that.
kon tiki, if your reading this, what is your full name so i can put in the about menu

Kon-Tiki == Raf Vermeulen
(Dagnabbit, the mystery's unveiled ;D )

Joey ok thanks. i may finish pong or air hockey.
SGreenslade oh great next thing you know we'll have sierra's agi party aka la mario party...
Andrew_Baker Sweet! That would be pretty easy with hot-seat play. Just think! you could choose Larry, Patty, Roger, Graham, Sludge, that one kid from Black Cauldron. Cool!
SGreenslade uh don't forget sonny bonds, agi rosella, alexander, maybe sweet cheeks marie and some others...(see hoyles games for character suggestions)
Joey haha. that would be cool.

now for air hockey, you need to move up, down, left, right. i can only get up and down. i do this code for the left, right, but it doesnt work.

if (c35)) {
if(f18)) {
if(f19)) {
then below it i put
else {
if (f18)) {
if (f16)) {

it compiles but doesnt work. (note i also do the other flag.)
Kon-Tiki Have assigned a key to c35? If not, then look in the help-file how to do that.

Joey yah i assigned f10 to it i think.
Kon-Tiki That's a flag, not a key ;D Have you used this:

set.key(nCODE1, CODE2, c35);

Look the command set.key up in the help-file, 'cause I don't know what key you want to set it to.
Also, you can't assign the cursors.

Joey no kon tiki, i mean the key f10 ::)
Kon-Tiki Have you tried:

if (controller(c35)) {

instead of

if(c35) {

Don't know if that makes any differences, but it should work with the first one.

Joey sorry, i think thats what i do. i dont have the code in front of me, but i think i have if (controller(c35)) {

ill check soon though.
Joey well im not going to be working on a two player agi game for a while now. i have a lot to do. in a little, im going to start learning c++. thats going to occur a few days after christmas hopefully (i will get my book then i hope) i may not even be working on dq2.... for like, a long long time.
Eigen Try this. Check Readme for controls. [attachment deleted by admin]
Kon-Tiki Uhhhh, those keys don't work. I can only control the right character. The left one moves to the lower-left when I change the speed. Still, it looks really cool. The idea of using two egos's awsome.

Eigen I can move around with both players. ??? Just hold down the CTRL key and W for example and the left man moves up. To move right man use mouse.

Kon-Tiki Ooops, didn't see that CTRL in front of the keys ::) It works now. Looks like you're able to make Spy vs. Spy in AGI now ;D Just hope the keys won't be Azerty-sensitive :-\

Zonkie Whoa, this is really, really nice!! I really like the idea of the two egos as well, as Kon-Tiki said, that gives a whole range of new possibilities... :D. Somehow, I can't get the input-changing to work though. Otherwise that looks really promising...
Joey wait, eigen are you making a two player game? you should. maybe like a laser tag game or something.

im not making a 2 player game for a while probably. im going to be learning c++ soon.
Eigen I'm not going to. Just thought it might be useful. :D

Eigen To change input press INSERT. So you can select which player types. ;)

Zonkie I tried pressing the insert key, but it wouldn't do anything... Maybe that is because we have different keyboard layouts or so?
Kon-Tiki I use azerty and it works fine here. Only thing that's a bit tricky is moving the guy which uses the keyboard.

Eigen There isn't any other better key to assign. :P I tried arrow keys but they they didn't work. :o

Zonkie Azerty keyboard? What does that look like? I have a qwerty keyboard, so maybe there are some problems there...?
Kon-Tiki I doubt it that that gives problems, since qwerty's the most used keyboard around. Azerty looks like this:

Joey what kind of keyboard do i have? its in english, funtion keys are at the top, then come numbers, then tab q w e r t y etc.
Andrew_Baker qwerty :D that's how it got it's name, the first "handful" of letters are "qwerty".
SGreenslade there is a diskette label with the same name...
Joey oh thats awesome! i didnt even know i put the letters to spell qwerty in it! lol! ;D
Gordon What site should I use to make a two or more person game email me asap or at lease soon please.
Kon-Tiki I have sample code of it on my site (which is down until later this week ::) ) and Eigen's version of it is over at (check the Fanmade AGI games part)
Eero R Hehe, the first thread I posted in under my name, and after being away for half a year. I was quite an idiot back then too, thinking that Helicopter Simulator was an AGI game, even after playing it... And enjoyed shooting in Police Quest that much I wanted to make a game entirely using that. :P
Joey i thought helicopter simulator was agi. and i also loved shooting in police quest. i wanted to have that in agent quest but i didnt know how to make it yet in agi because i was just learning. therefore the game was short and came out like crap, just like my other games! the only agi thing made by me that i like is Solar System Tour.
AGI1122 Only the non-playable demo of helicopter simulator was AGI. The actual playable game/demo was not AGI.