Soccer game

Hi
I´ve been searching for away to make a soccer game that you shoot penalties. But I´ve got problems. Big problems. I have no idea how to do. Could anyone be nice to help me with demo or tell how I will do this. I´ve searched alot but don´t find a good way of doing this.
1- How will I shoot and detect if it´s in the goal.
2-Make an ai for the goal keeper that gets better and better.
Have anyone tried to make a game like this or have a demo laying that could work or any video tutorials of what I´m searching for. Please answer me asap. Thank you :)
//Fajlajp

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Are you wanting to do an overhead view or a 3D view?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Sorry I had to stop reading when you referred to it as soccer ;)
  • FajlajpFajlajp Member Posts: 666
    edited March 2013
    @tatiang
    Something like this would be great. But if it doesn´t work, I could go with 3d.
    https://www.dropbox.com/s/n42n5adg4ih5ips/penaltygogo-game.jpg
  • iCreationZiCreationZ Member Posts: 158
    I believe the technical term for the sport is "Football" ;)

  • iCreationZiCreationZ Member Posts: 158
    We Brits invented it after all! (Well, the majority at least!)
  • FajlajpFajlajp Member Posts: 666
    @iCreationZ
    Actually the sport that I´ve try to recreate is called team handball. But most of the people haven´t herd about it. It´s just the European people that have herd about it. So i thinked of instead of saying handball I said soccer(it´s the same point) so more could under stand Take a look if you want
  • iCreationZiCreationZ Member Posts: 158
    edited March 2013
    Well that completely changes the situation! ;)

    It should be entirely possible, using collision rules to detect whether the ball crosses the line, and when the ball is thrown, have the goalie move towards the ball on its axis, and it is this speed that you want to increase in order to increase the difficulty. Also, add some random movement such as diving the wrong way every now an then, and you're away!
  • FajlajpFajlajp Member Posts: 666
    edited March 2013
    Yeah. But the there is a bit problem. I want to have 2d so I don´t really know when it crosses the line and how I would do so it seems that the ball is get further and further away.
    Also I don´t the goalkeeper to be totally random. I want it to be better and better when you chooses from easy-expert.
    Any idea @iCreationZ
    I´ve tried since I first got gamesalad about 3 months ago.
  • FajlajpFajlajp Member Posts: 666
    And what did you think of the sport;)
  • iCreationZiCreationZ Member Posts: 158
    Well lets tackle the first problem, of getting the ball to the goal, and registering the score.

    Going by the picture, it's a bit difficult to determine what you're after, will the player be able to select the power of the shot, or just the direction?

    If its just the direction, once the shot has been taken, use the change size behaviour (negatively) and a little trick with interpolate to make the ball look like its arcing away from you. Then add a timer, so after however many seconds you want the ball to travel for, which would depend upon the power of the shot, change score to +1 or true or whatever.
  • FajlajpFajlajp Member Posts: 666
    That sounds good.
    And the other problems...
  • iCreationZiCreationZ Member Posts: 158
    As for the sport, great idea! It's really unique, plus it's great fun in real life!
  • FajlajpFajlajp Member Posts: 666
    Yeah I know. Played one match today. It was really great fun :D
  • iCreationZiCreationZ Member Posts: 158
    Well, as for the AI of the goalie...

    I'd suggest determining how long it will take for the ball to reach the goal.

    Lets say, 2 seconds.
    Have an actor for the goalie which, after 1 second will move towards the balls position (y), this would mean that the goalie would not have instant reflexes, realistically, and to increase the difficulty, simply change the speed at which the goalie moves towards the ball.

  • FajlajpFajlajp Member Posts: 666
    Yeah. That´s also sounds good. You will need reflexes as a good goalkeeper. The movements i figure out how he will do.
    So it´s only left for the cross the line...
  • iCreationZiCreationZ Member Posts: 158
    Well all you'd need to do for that is say,
    After 2 seconds (as in my last example) the ball has crossed the line, so it's at this point that you add rules for changing the score or resetting for another go, etc.
  • FajlajpFajlajp Member Posts: 666
    Thanks @iCreationZ
  • TheGabfatherTheGabfather Member Posts: 633
    edited March 2013
    Assuming the rules of penalty shots are the same with football,
    adding to @iCreationZ 's suggestion, you can also try to create a "guessing" AI.

    Since it's a penalty shoot out and each shot would be over in a snap, you can try giving the goalie a set of directions to lunge to as its options. Dive left, reach left, stay in center, reach right, dive right -- depends on how wide you want to design your goal.

    For example's sake, if you decide on 5 directions you can create a simple table with, say 26 rows. Allot 5 rows for each direction, and initially 1 row for the actual or correct direction which the shot is really going towards. Once the shot is taken immediately fire a rule that randomly chooses 1 row and have the goalie block in that direction. As the game progresses, simply perform an Add Row (correct direction), which increases the likelihood of the goalie blocking a shot.

    P.S. I doubt it, but if the Rule takes too long to complete, simply adjust the time it takes for the shot to reach the goal :) cheap.
  • FajlajpFajlajp Member Posts: 666
    @TheGabfather
    That sounds great. Thank you so much. You just gave me an idea of how will do :D
  • FajlajpFajlajp Member Posts: 666
    It´s really great that the community helps people, like me, to understand more. Thank you. If you have any more ideas how this will be a great goalkeeper. Just post a comment:)
  • iCreationZiCreationZ Member Posts: 158
    @TheGabfather

    That's a much better tactic than my tacky, cheap 'n' cheerful AI!
  • FajlajpFajlajp Member Posts: 666
    @tatiang
    I´ve thinked and remembered that you spoke of 3d. And I will try to do that. Have you any idea how I will let the ball left go of is and, detect if it crosses the goalline and so on.
    Thank you for taking the time and helping me
    //fajlajp
  • FajlajpFajlajp Member Posts: 666
    Or anyone else that knows. All help I´m glad for
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2013
    I just wanted to know if you were planning on 3D or not. Other people have given you good suggestions about timing the ball to see when it crosses the goal line.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You might also be able to have a set of conditions using two actors (the goalie and a rectangular actor the width of the goal) to see if the ball is touching the "goal" area but not the goalie.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here's a demo I just made that detects whether the ball is in the goal or saved by the goalie. Open the Log Debugger Window and then click on each soccer ball to see the results.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    And this one's more playable and has on-screen scoring:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • FajlajpFajlajp Member Posts: 666
    @tatiang. Thank you so much.
Sign In or Register to comment.