Monday, 28 March 2016

Intercept with Diagnostics

Just easier to see - the white circle indicates the calculated interception destination for the pressing player.

The interception point depends on the distance from the presser to the ball, and the direction and speed of the ball.

Sunday, 27 March 2016

Intercept

When defending, if a player transitioned to the "press" state, he would initialize his "seek" behavior which directed him to run to the ball.

The problem with this was, since the ball is continuously moving, the pressing player invariable ended up arriving a fraction too late to have any impact, and ended up chasing the ball from behind until he was relieved of his pressing duties.

The solution is to introduce a new A.I. behavior - "intercept" - which makes a guess at where the ball is going to be, and heads the player there instead.

Here you can see the defenders "connecting" with their intercept target nearly every time.

Friday, 25 March 2016

Close Control

Just a look under the hood.

When the ball flashes red, that means the player can change direction and successfully keep the ball. Two skills will determine the behavior - dribbling and close-control.

A player can do close control (change direction) when the ball is close enough to him. Better dribblers keep the ball closer, so can change direction easier. This dribbling aspect is shown in the vids, first an average dribbler, then an expert dribbler. You can see how timing comes into it to change direction at the right moment.

The close-control skill is not demonstrated, close control is 100% sure fire for now. That means, if the ball is in control range, the close control will always be successful. In future the success rate will depend on the close-control skill rating.

An average Dribbler:


A great Dribbler:

Wednesday, 23 March 2016

Retro Consoles

Megadrive/Mega CD/32X, Super Nintendo, Saturn, Dreamcast, Nintendo 64, Gamecube and Amiga in one. No emulators!


Monday, 21 March 2016

Gimp My Ride

Here's some amateur gimping of a section for a Mortal Kombat Bezel. Using only the smudge tool, you get a pretty nice result!



Monday, 14 March 2016

Mario (Super Nintendo) and SWOS (Amiga)!

LED's temporarily switched off until we can isolate the bezel from the screen to eliminate glare.
 

Of course, only when we own the originals... :D





Boot Sequence

Here's the new boot sequence for anyone who's interested. Much faster since the update to 64bit Mint 17.3! Next we'll remove the diagnostic output.

Saturday, 12 March 2016

Launcher

Here it is with more distinct backgrounds for each platform.

Friday, 11 March 2016

Multi Platform Launcher

So the arcade machine needed a little maintenance. Whilst doing that, I got the bug for making it a multi platform launcher.

This is pretty awesome, even if I do say so myself :)

Emulators for other platforms are integrated seamlessly with the launcher. Notice the change in background to signify platform. Backgrounds can be customized for each platform. For an example, here's a small game set with both mame and amiga games:





 And here's the grid layout:

Tuesday, 8 March 2016

Tackling, a Rethink

On reflection, one of the things that made sensi so simple and fluid was the tackling. Not the slide tackle, but tackling without sliding.

Basically, you ran into the attacker who had the ball and just changed direction when you thought you were close enough. Hopefully you'd come out with the ball. No real concept of a "tackle" mechanic.

As an insight to how the "clash" worked, you could see the cpu "cheat" if you dibbled straight and let him catch you from behind. He'd know the precise time to reverse his direction and come away with the ball.

But, in another twist of fate for sensi play-ability, the user controlled player could also take advantage of this "cheat." Due to the controller a.i. which took into account the direction you are pushing the joystick, you could clock the non-controlled player in your team who is going after the man with the ball, then hold the joystick in the opposite direction. This meant:

a) you wouldn't be switched to control the perusing player until:
b) he reached the appropriate point where he could steal the ball, and since you were already holding the joystick in the opposite direction (preferably away from your goal!), your player would come away with the ball.

We will do something similar, though not identical, in Senseless.

Since we have a hybrid dribbling system (Kick Off + Sensi), the rules for tackling are as follows:

1. When attacking player and tackler are running in a straight line, the core game mechanics will run uninhibited. So in this hypothetical, if the tackler is running faster, he will take over control of the ball by dribbling (knocking it forward) as normal. This could result, for example, in putting the attacker off his timing in changing direction at the right moment to keep control.

2. As long as the attacking player isn't doing some close control (changing direction with the ball under control), then the close control of the tackler (he times it right to change direction when the ball is close enough) will win out.

3. If the attacking player changes direction with the ball under control (close control) in anticipation of a tackle, and the tackler also times his change of direction correctly, then the winner of the clash will be determined by the match engine through comparing the two players dribbling and tackling attributes.

You can see it here. You have to look closely, because the defending players don't have any attacking a.i. programmed, so after the tackle, they are pretty lost. But you can see them pressing the ball and attempting the tackle, sometimes successfully, sometimes not.


Sunday, 6 March 2016

Fix, Kinda

Not perfect, but now it's the closest goal-side player who presses...

The Futile Chase

If you watch some old Sensible Soccer vids, you'll notice that a defending player who is not goal side will chase the attacking player around in vain, never catching up with him.

Now I know why...


Game Design - Tackling

So, in implementing the defending team tactics, we encounter the player tackle state. But what is a tackle?

I mean, we know abstractly what a tackle in football is, but the action must have a consequential mechanical reality in the game engine.

There are two kinds of tackle: the slide tackle and the standing tackle.

The mechanical reality of the slide tackle is pretty straight forward. The player launches towards the ball, and if his feet touch it, he knocks it forward in the same direction, thus dispossessing the attacking player. Players with a better rating for tackling will have a longer and more accurate "lunge."

But what about the standing tackle? What does it mean in the game to "tackle" in this way?

The existing game mechanics of dribbling/controlling have the defending player take over ownership of the ball when it is within his control range. So in practice, the defending player just has to run into the ball to do a "tackle." Simple.

The additional layer is the player attributes. For example, a player good at tackling vs a player bad at dribbling will result in the defending player winning the "struggle for control of the ball" almost every time.

One final quirk not seen in Sensi, is that we will implement deflections. So if an attacking player simply dribbles into the path of an opposition player, he can not run straight through him - it will result in the ball deflecting off the defending player. This also applies to the ball in open play - if it is traveling too fast to control it will deflect off players in its path.

The above considerations are designed to make your tactical instruction actually matter in the game engine.

So, the upshot of all that for the state machine system is -

The default defend state remains the same: Cover. In this state the player merely tries to get to the sector dictated by the tactic.

Depending on the team tactical instructions, the player may transition from the cover state to the press state. It is only within the press state that the player has the possibility to transition to a tackle state.

Saturday, 5 March 2016

Zen-like Thought For the Day

Kick Off was a game for gaming fans who quite like football. Sensible was a game for football fans who quite like gaming.

Defending : Cover

Pretty happy with this. The existing architecture was able to handle the new A.I. requirements quite nicely.

We only need to modify the "Cover" behavior to accept the positioning "attitude" as a parameter. Then, when calculating the target position, we simply use the grid tool to shift the sector up or down rows in proportion to the attitude value.

So here's an example of the defending teams "covering" positions with two different attitudes. One to sit back more and one to press higher up.

Here the defensive line drops off and sits deep, closer to their own goal.

Here the defensive line press higher up the pitch.

Tactics: Defending

[read this first]

Defending Tactics

A team is deemed to be "defending" simply when one of its players is not in possession of the ball, and until one of its players gains possession.

The configurable defending tactics are:

Transition

This refers to the moment the ball changes hands. I.E. the team was attacking, but has just lost the ball. The degrees are:

N0: Ultra defensive, whole team immediately turn the other way and get behind the ball.
N1: Defensive. Everybody except forwards tries to get behind the ball.
N2: Normal. This is a neutral attitude, just go to positions as normal.
N3: Risky. Linger in forward positions in anticipation of the next ball turnover.
N4: Kevin Keegan. Just stay up-field without regard for chasing back.

Pressing

As described in the example above, repeated here for completeness:

N0: Stand off the player in possession and focus on covering your own position on the pitch. Only attempt to retrieve the ball if you are your teams closest player to the ball, AND the ball is in your zone.
N1:  Stick to your zone, but always press the ball if you are the closest to the ball.
N2: Press the ball if it is in your half, and you are one of the three nearest players to the ball.
N3: Press all over the pitch, if you are one of the three nearest players.
N4: Always press if the ball is anywhere near to your zone.

Tackling

N0: Light. Stand off. Never dive in. Avoid tackling almost always.
N1: Almost never employ the slide tackle.
N2: Balance between normal tackling (stealing the ball) and slide tackling.
N3: Favor the slide tackle whenever available.
N4: Slide with no fear of yellow or red cards!

Positioning

N0: Paranoid. Stay a few sectors deeper than the standard positioning config.
N1: Deep. Stay one or 2 sectors deeper than usual.
N2: Normal. Stay in configured sectors.
N3: High. Push up one or 2 sectors
N4: Adventurous: Push up as high as possible.

Counter

This indicates the attitudes when the team regains possession.

N0: Just clear the ball.
N1: Clear the ball if under any pressure at all.
N2: Balance between safety and counter attack.
N3: Try to keep the ball whenever possible.
N4: Hold on to the ball at all costs, risking losing it in dangerous positions.

A.I. Design

General Overview

Degrees of precision in creating tactics will be limited to five discrete options on a sliding scale:

Low, Medium-Low, Medium, Medium-High, High.

Think of a slider bar widget the user can drag from low to high. Different descriptors will be used for different tactical aspects, but the meaning remains the same. For example:

Pressing

Low: Stand off the player in possession and focus on covering your own position on the pitch. Only attempt to retrieve the ball if you are your teams closest player to the ball, AND the ball is in your zone.

Medium-Low:  Stick to your zone, but always press the ball if you are the closest to the ball.

Medium: Press the ball if it is in your half, and you are one of the three nearest players to the ball.

Medium-High: Press all over the pitch, if you are one of the three nearest players.

High: Always press if the ball is anywhere near to your zone.

Passing

Low: Do not release the ball until a suitable short pass candidate is found. Do not clear the ball, even when under pressure.

Medium-Low:  Release the ball only as a last result if no short pass candidate appears. Clear the ball if under pressure.

Medium: Release the ball to the best candidate, short or long. Clear the ball if under pressure.

Medium-High: Look for long pass whenever possible. Pass short only as a last resort.

High: Get rid!! (just hoof it up the pitch at first opportunity)

For the sake of brevity, these five notches will be referred to as N0 - N4.

Tactical aspects are only configurable at the team level. For individual player instructions, the concept of a "role" will be used. At most, the team instructions may be configurable separately for defenders, midfielders and attackers. For example:

Sweeper: This tactical role will cause the player to remain very deep, always the last defender for his team. He will never press the ball unless an attacker is bearing down on him and he is the last man. When he gets the ball, his actions will depend on the team instructions.

Poacher: Will never stray far from his zone. will stay as close to the opponents 6 yard box as possible. Will shoot at every opportunity. Will not chase back to defend.

Friday, 4 March 2016

Landmark

So the match engine runs continuously without having to manually reset the ball position. All breaks in play are handled and match starts again without interference.

Going forward, and taking my cue from an awesome presentation given at the GDC, I've decided to give Dino Dini's approach a go and concentrate on getting the game working *without* the user controls.

So the A.I.  should be able to play a good game of football on its own, then we add the user to the mix.


Credit Where It's Due

If you already know what a kernel is, move right along, nothing to see here :)

GNU's NOT LINUX!!!

If you call yourself a "Linux user," what do you mean when you say that you "use Linux?"

What is Linux anyway?

You probably already know that it has nothing to do with the apps you are running to get things done. Like Firefox, Chrome, Gimp or whatever. They are available on other "operating systems" too, right? Right.

So what about the more basic stuff like your desktop, the menu you use to start apps, the task bar and all those windows you bring up to configure your settings, network, display and such? Nope, still nothing to do with Linux.

Maybe you are a l33t h4x0r and do stuff in the terminal (you know simple stuff like changing directory and listing the files), but you are still not actually "using Linux" directly. These are all programs (read "apps") written by Richard Stallman and his friends at the GNU project. They are part of GNU, not Linux.

Yup, when you type "ls" to simply list the files, this is not some magical functionality of Linux. It is a genuine "app" written by the folks at GNU and just given the name "ls."  No different from your fancy "app" to browse the net or read e-mail. Really, it even has a main() and everything... :p

All of these apps, PLUS the Linux app, make up the "GNU" operating system that you are using.

So what is Linux, what does it actually do, and when are you actually using it? As simply as I know how to describe it, Linux is the "app" that lets other apps do stuff. Basically, it cares about the hardware so other apps don't have to. For example, what is a "file" and how do you open one? You might have your stuff stored on a CD (optical technology) for example, which is completely different from a hard disk (magnetic technology). Yet you can still open "files" on each of them. This is what Linux does.

From a programmers point of view, Linux provides a function to "open" a file and deliver it to us in a specific format. It is Linux which does all the hard work of getting the data off the actual hardware; we don't care if it is an optical device or a magnetic device, or if the data is stored sequentially or whatever. Linux handles all that for us.

It even handles interactions with your processor, deciding which apps will get access to the next "cycle" of instructions and allocating them intelligently to give you the illusion of running several programs simultaneously.

Anyway, Linux (written by Linus Torvalds) is just one component (granted, a very important one) out of thousands that make up the system you are running on your computer when you claim to be a "Linux user." For most of the others we have to thank Richard Stallman and GNU.

As an example to illustrate the point, the Apple Mac runs the Mac OS operating system, which uses the XNU kernel. This is directly analogous with saying that you run the GNU operating system which uses the Linux kernel.

But nobody says they are running XNU, or they are an "XNU user."

This is why I think we should endeavor to respect Stallman's wishes and try to remember to refer to it as "GNU/Linux". And if you have never heard of Stallman or GNU, please take a look, and learn about who they are, where they came from and what they are doing:

www.gnu.org

Wednesday, 2 March 2016

Camera Tweak

And here is is softened up a bit.

 

Camera Tricks

Instead of just centering on the ball, the camera favors the attacking team so that the goal comes into view quicker. Needs to be softened out but not bad for a first try.

Tuesday, 1 March 2016

Physics

Just some physical interactions with the new goal graphic. Code-wise, the physics system is such a basic approximation, I only had to change one number to make it look OK with the new graphic; the depth of the goal.

Goal Graphic Perspective

With a bit of trial and error over lunch time, I managed to hack up a passable graphic of the nets in the proper perspective for the south goal. Programmer art ftw!

The graphic actually matters here, because with the first (wrong) image, if the ball crosses the goal line whilst in the air, it would look like no goal due to the sprite position when adjusted for height and perspective.

Compare: