Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Arcade

Pages: [1]
1
SFML projects / American Football
« on: February 02, 2019, 08:24:49 pm »
A while back I posted in the Screenshot thread with a brief gif of an American football game I had started to work on. I've managed to continue working on it off and on since then so I decided to go ahead and make this thread where I can post some more detail for anyone interested. The game is far from done, but it feels like good timing since the real life football Superbowl Championship is this weekend.

The biggest challenge so far has been implementing the AI. The interesting thing about making a video game based on a real game is that there are pre-established rules that the AI needs to follow and they need to behave somewhat realistically. I don't want to fill up this thread with explanations of how American football works for those unfamiliar, but I'll try to give some brief descriptions of what my following gifs are showing.



A lot of these gifs are showing different game situations. The first one shows the offensive team on the left in white shirts throwing a quick pass to one of their receivers. The red lines show the routes that each receiver is going to run. The job of the thrower (quarterback) is to find an open receiver and throw them the ball.

Some of the players on the defense side in purple shirts have big yellow circles. These defenders are in a "zone" defense. The yellow circles represent the zone that they will try to prevent receivers from catching the ball in. The other defenders are either trying to tackle the quarterback while he still has the ball or are defending the receivers 1-on-1 in a "man" defense. In this case the receiver is able to catch the ball and gain 6 or 7 yards down the field before being tackled.

The small numbers above the players head and the small colored circles under their feet are just debugging information I have being displayed. They mostly represent the ID of the player and what behavior the AI is running.

(click to show/hide)

Part of my motivation for working on this game is that I've always wondered how sports games handle AI. I thought it would be a fun challenge to try and replicate it. The throwing aspect is one part that took me a while to get right. It's hard to calculate the direction angle, height angle, and speed the QB needs to throw the ball in order for the receiver to catch it on the run. The previous gif shows the QB just able to get the ball between 2 defenders so that the receiver can make a big catch. Sometimes the defense is able to crowd the receiver a little better resulting in an unsuccessful catch.

(click to show/hide)

There are also several kicking situations in American football, which I've been implementing. This next gif is a Field Goal kick where the team with the ball (in purple) tries to kick the ball between the goal posts for 3 points.

(click to show/hide)

In order to design these plays that I want each team to run, I've built an editor into the game. The next gif shows me designing the starting position and route I want a receiver to run. I then simulate the play which shows the receiver following the route, making a catch, and then juking the defenders for a big gain.
(click to show/hide)

The last thing I'll show off are some of the menu systems outside of the main game. These still need a lot more work aesthetically, but one of the important things you can do from here is set your "depth chart". This basically means setting which of your players you want playing at each position. Each player has different stats and abilities.

(click to show/hide)

The post is getting long, so I'll stop it here. The game still needs a lot of work, including a lot of planned AI improvements, but I hope to stick with it as I have time. The libraries I've been using to put this all together are just SFML (window, graphics, etc) and SQLite for the database backend to store information about each player.

2
SFML projects / Native Blocks - Finished!
« on: January 13, 2015, 08:24:46 am »
Hello everyone

I recently started working on my first game, and I think I've gotten it to a point where I can demo my progress so far! I'm not very creative with coming up with a good name, so I'm just calling it Native Blocks. It was inspired by the Puyo Puyo series of games, specifically the Sega Genesis game called "Dr. Robotnik's Mean Bean Machine". For those who aren't familiar with those games, the premise is that you have a playing area where blocks fall, similar to the style of Tetris, but only 2 blocks at a time. You try to make 4 blocks of the same color touch each other to make them disappear. This is a 2 player competitive game, so when you make blocks disappear, there is a good chance of a garbage grey block falling on the other player's side. The only way to get rid of the grey blocks on your side is by making a match that touches it. If you make a chain of more than 4 blocks then a larger number of grey blocks will fall on your opponent. If you make a combo, such that one chain disappearing causes the blocks to fall and make another chain disappear, it multiplies how many grey blocks get sent to your opponent.

Hopefully all of that made sense. Here is a video demoing it. Note that my screen capturing software makes the frame rate look worse than it really is:
http://www.youtube.com/watch?v=Xk2z2yu0WaM

I currently have 3 AIs implemented (easy, medium, and hard). You can either play against one of the AIs or you can simply watch the AIs play against each other, which is shown in the video. There are a lot more things I want to implement eventually, assuming I don't lose my motivation and move on to another project  :P.

Anyways hope you guys like it. Let me know what you think!

Pages: [1]