Tecmo Cup Soccer / Captain Tsubasa – Football RPG

Old Weird Games digs up forgotten weird games from the past and takes a peek at the interesting and unique game design in them.

Platform: NES
Genre: RPG / Sports
Tecmo Cup Soccer was the westernized version of the Japanese game Captain Tsubasa, I’m using it because it was translated to English for the NES. They’re basically the same game though.

Tsubasa is really taking the RPG genre and stretching the definition to its limits. How do you take a set of RPG rules that add value to a different and unrelated genre like sports without alienating people who play sports games? It’s quite refreshing to see a RPG that is not themed with wizards and dragons or robots. The graphic style is impressive for the NES, obviously taking cues like camera angles and visual effects from classic anime style. Kind of reminds me of 8-bit Phoenix Wright.

Nintendo World CupWhen me and my brother bought this game in the early 90’s, we were expecting it to be like Nintendo World Cup – a simple side scrolling “arcade” football game. We didn’t totally grasp all the mechanics at first but after the initial disappointment of finding out it wasn’t what we expected, it ended up being maybe even a more memorable experience than the multiplayer Nintendo World Cup matches. I don’t think I understood that the players stats were going up after each game until coming back to the game years later. Obviously not being a native English speaker and being a kid meant that we rarely understood anything but the basic game mechanics and then explored from there.

It is a unique concept and offers hours of gameplay that is still a lot of fun these days. And sports games haven’t tried out new things like this in forever. Or maybe in Japan they have? As a mostly turn based game it shows how to create tension and dramatic situations for the player without real time action.

Tecmo Cup soccer title screen snap0001
Title screen and a shot from the intro animation.
Continue reading “Tecmo Cup Soccer / Captain Tsubasa – Football RPG”

What is an Interface in OOP? Example in ActionScript 3

This is written for ActionScript 3 but also works for most similar languages. If you can read the code examples, it will probably apply to you.
In Object-Oriented Programming languages – including AS3, there are special “classes” called Interfaces (it is also a keyword in many languages). You might have noticed some of them in the basic library included with the language. They’re easy to identify because the name always starts with an uppercase I; like IEventDispatcher.

To understand what an Interface class is, you must first know understand what is meant when we talk about an interface of a object.

Coffee machineLet’s say you walk out of your office into the breakroom and find the simplest coffee maker in the world. It only has one button labeled [COFFEE]. You press it and it dispenses a cup of hot and tasty coffee for you. To you as a user the interface of the coffee maker is that button. You only want a cup of coffee, you don’t want to think about what goes on inside every time you use it.

Another simple interface would be a e-reader with just one book in it. It only has two actions you can use on it, go one page left or go one page right. It still has to form the pages on the LCD screen and store and decode the content of the book, but you only see two points of interaction with it. Left and right. If the users could also access the algorithm to render the text to the screen or change the voltage from the battery, they would be very confused and probably break it soon enough.

You sit back to your desk and decide to write your own coffee maker in ActionScript. The pseudo-code for the first revision of your coffee maker class looks like this.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.designoidgames.interfacetut
{
    public class CoffeeMaker
    {
        public function CoffeeMaker()
        {
                       // Constructor in ActionScript
        }
 
        public function makeCoffee():void
        {
            grindBeans();
            heatWater();
            runWaterThroughBeans();
            coffeeComplete();
        }
 
    }
}
package com.designoidgames.interfacetut
{
	public class CoffeeMaker
	{
		public function CoffeeMaker()
		{
                       // Constructor in ActionScript
		}

		public function makeCoffee():void
		{
			grindBeans();
			heatWater();
			runWaterThroughBeans();
			coffeeComplete();
		}

	}
}

Continue reading “What is an Interface in OOP? Example in ActionScript 3”

Unity objects in right z-order but still overlapping – Render Queue Index

Recently I had a problem where I had set up some background gameobjects and sorted them on the z-axis thinking this would automatically render them in the right order always. When the camera moves they start flickering/overlapping each other. At least for the most basic shaders this is not always the case and you should instead set the renderQueue value for the objects that have a strict z-order you want to render them in.

Smaller renderQueue index means it’s closer to the camera and should be drawn on top of anything with a bigger index number.

1
2
3
4
public int renderQueueIndex = 3000;
    void Start () {
        gameObject.renderer.material.renderQueue = renderQueueIndex;
    }
public int renderQueueIndex = 3000;
	void Start () {
        gameObject.renderer.material.renderQueue = renderQueueIndex;
	}

Simple one-way platform in Unity

This is a simple trick to create a Mario-style platform where it’s open when you jump from below but you will collide with it when you’re above the platform. The good thing about this solution is that it’s very simple and clear what it’s doing, and takes like 10 seconds to set up. It is not perfect and if your game relies a lot on this type of platforms I would suggest a more advanced solution. Something where you take into account what direction is the character moving towards etc.

  1. Create the platform.
  2. Duplicate the platform and child this one to the platform. Call the child AboveTrigger.
  3. On AboveTrigger, make sure that under the Collider “Is Trigger” is set to false.
  4. Move the AboveTrigger up about the height of the platform and a little extra room so they’re not touching (or down if you want a top-open block). When the player is touching this trigger, the platform will turn its collider on – otherwise it’s always off.
  5. Attach the component at the bottom of the post to AboveTrigger.
  6. (Optional) Scale the AboveTrigger down by 5% or so to improve the character entering from the edges of the block – this depends on the game and should always be tested and tweaked to fit your character and controls.
Simple one-way platform
Setting the platform up in editor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using UnityEngine;
using System.Collections;
 
public class OneWayPlatform : MonoBehaviour {
 
    void OnTriggerEnter(Collider player)
    {
        transform.parent.collider.isTrigger = false;
    }
 
    void OnTriggerExit(Collider player)
    {
        transform.parent.collider.isTrigger = true;
    }
 
    // Use this for initialization
    void Start () {
        transform.parent.collider.isTrigger = true;
    }
 
}
using UnityEngine;
using System.Collections;

public class OneWayPlatform : MonoBehaviour {

    void OnTriggerEnter(Collider player)
    {
        transform.parent.collider.isTrigger = false;
    }

    void OnTriggerExit(Collider player)
    {
        transform.parent.collider.isTrigger = true;
    }

	// Use this for initialization
	void Start () {
        transform.parent.collider.isTrigger = true;
	}

}

Masters of Doom audiobook

The first 45 minutes of the story of id Software, John Carmack and John Romero. Read by Wil Wheaton.

Hearing the stories behind some of the most impressive game experiences of my childhood (Commander Keen, Wolfenstein, Doom, Quake) and the technological breakthroughs of the two Johns is very cool.

Understanding Recursion

This quote is from the great book about mathematics, logic and art: Gödel, Escher, Bach: An Eternal Golden Braid.

It’s a very elegant and easy to understand explanation of recursion which is one of the basic building blocks of programming. This explains more how a recursive function will traverse and branch out to different function calls, usually in a recursive function after hanging up on one person, you would return the data you learned from that call to the previous level which is missing in the example.

One of the most common ways in which recursion appears in daily life is when you postpone completing a task in favor of a simpler task, often of the same type. Here is a good example:

An executive has a fancy telephone and receives many calls on it. He is talking to A when B calls. To A he says, “Would you mind holding for a moment?” Of course he doesn’t really care if A minds; he just pushes a button and switches to B. Now C calls. The same deferment happens to B. This could go on indefinitely, but let us not get too bogged down in our enthusiasm. So let’s say the call with C terminates. Then our executive “pops” back up to B, and continues. Meanwhile A is sitting at the other end of the line, drumming his fingernails against some table, and listening to some horrible Muzak piped through the phone lines to placate him … Now the easiest case is if the call with B simply terminates, and the executive returns to A finally. But it could happen that after the conversation with B is resumed, a new caller – D – calls. B is once again pushed onto the stack of waiting callers, and D is taken care of. After D is done, back to B, then back to A.

Hofstadter, Douglas R. Gödel, Escher, Bach: An Eternal Golden Braid. New York: Basic Books, 1979.