Author Topic: Is it possible to make a 2 player agi game?  (Read 24396 times)

0 Members and 1 Guest are viewing this topic.

Kon-Tiki

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #15 on: October 23, 2002, 10:00:20 AM »
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-
« Last Edit: October 23, 2002, 10:04:17 AM by Kon-Tiki »

Kon-Tiki

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #16 on: October 23, 2002, 11:28:13 AM »
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:
Code: [Select]
if(controller(ego2_up)) {
     if(!isset(ego2_going_up)) {
        if(isset(ego2_going_down)) {
        reset(ego2_going_down);
        set(ego2_going_up);
        }
        else {
        set(ego2_going_up);
        }
     }
     else {
     reset(ego2_going_up);
     }
}

if(isset(ego2_going_up)) {
     get.posn(ego2,old_ego2_x,old_ego2_y);
     new_ego2_x = old_ego2_x;
     new_ego2_y = old_ego2_y;
     new_ego2_y -= 1;
     reposition.to.v(ego2,new_ego2_x,new_ego2_y);
}  
if(controller(ego2_down)) {
     if(!isset(ego2_going_down)) {
        if(isset(ego2_going_up)) {
        reset(ego2_going_up);
        set(ego2_going_down);
        }
        else {
        set(ego2_going_down);
        }
     }
     else {
     reset(ego2_going_down);
     }
}

if(isset(ego2_going_down)) {
     get.posn(ego2,old_ego2_x,old_ego2_y);
     new_ego2_x = old_ego2_x;
     new_ego2_y = old_ego2_y;
     new_ego2_y += 1;
     reposition.to.v(ego2,new_ego2_x,new_ego2_y);
}  

This code needs to be put in Logic 091:
Code: [Select]
 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.

-Kon-Tiki-

Joey

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #17 on: October 23, 2002, 01:52:28 PM »
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?

Offline Joel

Re:Is it possible to make a 2 player agi game?
« Reply #18 on: October 23, 2002, 02:01:22 PM »
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:

stopped
up
down
upright
downright
right
left
upleft
downleft

That method conserves resources.

Joey

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #19 on: October 23, 2002, 02:07:03 PM »
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.

Offline Jelle

Re:Is it possible to make a 2 player agi game?
« Reply #20 on: October 23, 2002, 02:30:22 PM »
Quote
backspace. 13, 0 i believe.
no, 13 is enter
8 is backspace

Quote
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
Politics is supposed to be the second-oldest profession. I have come to realize that it bears a very close resemblance to the first.

Kon-Tiki

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #21 on: October 23, 2002, 02:39:40 PM »


[attachment deleted by admin]

Joey

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #22 on: October 23, 2002, 02:56:10 PM »
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

Offline Joel

Re:Is it possible to make a 2 player agi game?
« Reply #23 on: October 23, 2002, 03:10:41 PM »
I just got the second player's rectangle to start moving toward the first player's  :o

Joey

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #24 on: October 23, 2002, 03:15:06 PM »
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

  • Guest
Re:Is it possible to make a 2 player agi game?
« Reply #25 on: October 23, 2002, 05:08:59 PM »
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?

Offline Andrew_Baker

Re:Is it possible to make a 2 player agi game?
« Reply #26 on: October 23, 2002, 07:52:23 PM »
Check the table in the help file for set.key().  F11-F12 do not seem to work in AGI.
I hope you realize that one day I will devour the Earth.

Offline Chris Cromer

Re:Is it possible to make a 2 player agi game?
« Reply #27 on: October 23, 2002, 10:01:20 PM »
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).
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Rich

Re:Is it possible to make a 2 player agi game?
« Reply #28 on: October 24, 2002, 12:08:14 AM »
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...

Offline Allen

Re:Is it possible to make a 2 player agi game?
« Reply #29 on: October 24, 2002, 07:58:08 AM »
Geez Rich...
Working on FQ really screwed (excuse the pun) up your head. Did you always have a dirty mind like that?

-Allyb-
http://www.mizpro.co.uk
The new home of Mizar Productions.

It is a sign!


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.067 seconds with 21 queries.