Wednesday, March 21, 2012

Assignment 3 - AI

This is a rough state diagram for the AI controlling one of our game's minor enemies, a stationary shooting enemy:

For "fire:" this is supposed to represent the enemy firing a stream of force in the direction of the player, not killing them but knocking them back. Mechanically speaking, it is drawing a straight line and altering the speed of whatever the line collides with, and the line remains active for five seconds (this is an example time; we may alter the amount of time firing or the pause time in the final implementation).

The enemy does not move from its position, but it quickly aims at and locks onto the player by rotating in the appropriate direction. The rotation speed will likely be high and its aim precise. The enemy's only real weakness is that once it starts firing, it is immobile for the duration, so this is what the player will need to learn to take advantage of. It is worth noting that if the player is clever with their timing, they can actually use this enemy's blast to their advantage, launching them past obstacles and toward their goal.

To function, the class controlling the enemy needs the following data as input at least:
  • the player's current position (which can be used to calculate the desired angle of rotation)
  • elapsed time
Internally, it will have the following data at least:
  • desired angle (see above)
  • current angle
  • rotation speed
  • range
  • force (how much the player's speed is affected if hit by the enemy's blast)
  • a boolean value to indicate which of its two states the AI is currently in
Here is a pseudo-code example to show how the enemy AI might be implemented:

If (!firing) // firing is the boolean value mentioned above
     Aim();
else
     Fire();

function Aim()
{
     if (player is visible, not behind a wall)
     {
          desired angle = new angle calculated from player's current X/Y position;
          if (desired angle > current angle)
               current angle += rotation speed;
          else if (desired angle < current angle)
               current angle -= rotation speed;
          else if (desired angle == current angle AND calculated distance to player < range)
               firing = true;
     }
}
function Fire()
{
     animate sprite charging graphic (if applicable);
     if (pause time has elapsed)
     {
           animate firing effect at current angle;
           if (player collides with line at current angle)
                player speed -= force; //we may make this affect other objects as well, but likely will not
     }
     if (total firing time has elapsed)
          firing = false;
}

NPC Sprite Concept

This is just something I made a couple weeks ago during the sprite art lecture. I figured I should share it in case it becomes useful later.

Thursday, February 23, 2012

Assignment 2 - Dimension

For Team VectorForce's project, I will be talking about the Physical dimension of our game (which is still untitled).

The game is a sort of puzzle platformer, so the game world exists in 2 dimensions: vertical and horizontal. The player's avatar can walk horizontally. A gravitational force holds the avatar down against the floor, but the player can use the "velocity gun" to launch themselves upwards, to further propel themselves left and right, or move back downward more quickly.

The physical layout of the game world starts from the level select area. This area serves as the central hub from which the player explores other levels. Each door leads to another area. As the theme of the game revolves around the Internet being blocked and censored, initially only one level is accessible to the player, but as they succeed in clearing each level (decrypting and freeing information at the end), more areas of the Internet become accessible to them from the level select area. Generally, clearing one level will unlock the next level in sequence, and having all of the normal levels unlocked will unlock the final stage.

(This is a general layout of how the levels might be shaped and how they will connect with the level select area. The sketches are not to-scale, and the exact level layouts and number of levels may vary in the final version of the game)

The player proceeds through each 2-D level, starting at one end and making their way through obstacles to reach the other end, where they unlock the next level and are brought back to the level select area. Levels are mostly arranged vertically at first, making the player ascend towards their goal, but there will be sections where the player moves left-to-right (or vice-versa), or falls downward and must dodge various traps and obstacles on their way. Despite these changes, there will always be a clear linear direction: the player must move away from the starting point, avoid any traps or dead ends, and continue toward the goal.

The setting takes place inside the Internet, so there isn't a very clear sense of realistic scale. The player's avatar might be very small, or the virtual world of cyberspace might be very large. Either way, the player has to clear a relatively long distance to reach the end of a level. However, the player's movement speed, with the help of the velocity gun mechanic, is quite fast, so they will be traveling the distance fairly quickly once they grasp the physics of movement inside the game world.

Every level is laid out on a digital grid, with spaces on the grid being occupied by various tiles. These are a few example tiles:
Some tiles are simply solid; the player can stand on them and launch from them, but these tiles could also obstruct the player's path depending on their placement. Other tiles may hurt the player if they collide with them, and some tiles may move around or disappear and reappear as time passes, requiring the player to time their movements carefully in order to proceed past them.

Every level the player enters is fully enclosed by solid tiles, and these serve as the outermost boundaries of the game world. There is no illusion of an open world, and this fits with the theme of the game. The game world is representing the Internet, a virtual space with no real-world equivalent. The player likely won't have the impression that there should be more places to explore beyond the outer walls, especially since their goal in the game is enclosed in the same space as they are. Also, as the Internet has been censored in the story, the player expects that they cannot move entirely freely; they are confined to the areas they have been able to infiltrate and unlock so far.

So, that about covers it. As you can see, Team VectorForce's is creating a project with both direction and magnitude. The physical dimension of the game is not complex when compared to most modern games, but we are confident that a fun and challenging experience will emerge from this mechanically simple game world.

Thursday, February 2, 2012

Assignment 1 - A Cast of Characters

Here is a cast I created. This may serve as a starting point for a future project.

Genre: Action, “Dark” humor
Story Driven characters.

The Cast:
(I only have basic black-and-white doodles for character concept art, but they're meant to be more story-based anyway)

Kat:

The ambiguously-gendered protagonist, and newest member of the Order, a shadowy organization of assassins that acts to influence world politics. Kat is,
-mysterious
-sarcastic
-seeking purpose
-???
The player will be given moral choices to make for Kat, allowing them to define for themselves who Kat really is.

Venom:

A veteran member of the Order, and Kat's rival (or enemy, depending on player choice toward the end). Venom is,
-ruthless
-loyal
-cynical
-distrusting of strangers

Meister:

The aged leader of the Order. Meister is,
-scheming
-idealistic
-slightly absent-minded

Slick:

A young man who stands in the way of Kat's first mission. Slick is,
-enthusiastic
-dutiful
-protective
-also trying to prove his worth

Sample Dialogue:

(The opening scene where Meister explains the mission)

Meister: “If the revolution is allowed to spread, then civil war will soon ravage the entire country. To prevent this outbreak of war, and to protect the countless lives that would be lost, the leader of the revolution must be killed. With him dead, the spirit of his followers will break and the revolution will fail.” He holds up a map. “This will show you where to find him. The gates are well guarded against intruders, but not impenetrable. Simply find and kill him, then make your escape.”
Kat: “That sounds straight-forward enough. Does his death need to look like an accident?”
Meister: “No, discretion is not an issue, nor are other casualties. You may kill anyone that gets in your way.”
Kat: “Really? Wait, I thought this mission was to prevent a lot of people from dying.”
Meister: “It is. Don't you understand? If the revolution is allowed to continue, many more lives will be needlessly lost in the name of overthrowing the King.”
Kat: “So, you're saying we cannot allow innocent people to die in the name of revolution...”
Meister: “Correct.”
Kat: “...But we can kill whoever we want in the name of our ideals.”
Meister: He nods. “Now you're getting it.”
Kat: Pauses awkwardly.
Venom: “Meister, I am not convinced that this one should be trusted with such an important mission.” He turns to Kat. “Your skills are untested, and your words betray your lack of commitment.”
Kat: “And you're not in a hurry to make friends, I take it.”
Meister: “Untested or not, Kat is a member of the Order now, and I believe this mission to be within Kat's ability. Do you question my judgment, Venom?”
Venom: “I would never question your wisdom, Meister.”
Kat: Rolls eyes.
Venom: “However, I wish to request that I be allowed to shadow Kat-”
Kat: (thinking) Shadow cat?
Venom: “-to ensure the success of the mission.”
Meister: “As expected from you, Venom. I will allow this, but I also expect this mission to be a measure of Kat's skills, so do not get directly involved unless absolutely necessary.”
Venom: “Yes, Meister.”
Meister: “Now then Kat, I trust everything is clear to you. The horses are already saddled. You will reach the first gate on your map within the hour. You are both dismissed.”
Venom: “Yes, Meister.”

(At the start of the first level/area)

Venom: “This is it. I'll keep an eye on you from a distance, but don't expect my help. Meister charged you with this mission so you could prove that you are worthy of your membership in the Order. The time has come to see just what kind of man you really are.”
Kat: Turns and looks at him but says nothing.
Venom: “Er... or is it, what kind of woman you are? Now that I think of it, I have never seen you without your hood on. The name Kat is really quite ambiguous as well.”
Kat: “What difference does it make?”
Venom: “It makes a big difference. I still barely know anything about you. How can I or the rest of the Order trust you if we don't even know whether you're a man or woman? Besides, you should show some pride as a member of the Order. How can you not care how androgynous you look?”
Kat: “You're one to talk, with that hairstyle.”
Venom: Flustered, “Wha- What is wrong with my hair?!”
Kat: “Why? Do you worry a lot about how your hair looks?”
Venom: “Yes, I- I mean no, of course not... Enough of this. You have work to do. Get to it.”
Kat: “Yes, ma'am.”
Venom: “I'm not a ma'am!” He groans. “You think you're so funny? Cracking jokes on a mission is a good way to get yourself killed. You're an assassin; an elite representative of the Order, remember? Start acting like one.”
Kat: Sighs. “I know, you're right. I will take the mission seriously, I swear.”
Venom: “Good. Now get started.” He leaves.
Kat: Mutters under breath, “Yes, ma'am.”

(Toward the end)
A child blocks the path to the target. If the player attacks, Slick intervenes to stop them, giving the child and the target time to hide inside a building. He locks the door behind them.

Slick: “Hold there, villain! Only a wicked creature would endanger the life of a child!”
Kat: Pointing at the target, “Hey, he was the one hiding behind a little kid. If you want to question someone's morals, start with him.”
Slick: “Nevertheless, my people stand threatened, and I, a righteous knight's apprentice will defend the innocent from harm. Prepare yourself, vile creature, for I shall deliver a righteous arrow from above and pierce your stony heart in the name of justice!”
Kat: “Is this guy serious?”

If the player hesitates at the final area:
Venom: (offscreen) “Why do you hesitate?” (appearing) “Do you have some moral qualms about hurting a child? Get over it. What did you think you would be doing when you joined a shadowy cult of assassins? Holding a bake sale? You came here to do a job. Now finish it.”
  • If the player waits a little longer:
    Venom: “Stop stalling! If you won't kill a child, I'll do it myself.” If the player keeps waiting: “I knew you were weak.” He runs forward and attacks the child.
    • If the player lets him attack, Slick intervenes, helps the target and child hide, and does his normal introduction, only now Venom retorts at the end.
      Venom: (to Slick) “Foolish boy. If there's anything I hate more than disloyalty, it's unbridled youthful enthusiasm.” He quickly kills Slick, unlocks the door and turns to the Kat. “Now, get in there and do the job you came here to do. A commitment to the Order isn't something you can just walk away from.”
      • If the player attacks Venom at any time:
        Venom: “You dare to betray the Order by attacking me? So be it. I will take great pleasure in severing the weakest link from the chain.”
        • If the player flees while Venom is still alive, he shouts after them:
          Venom: “Are you running away? Coward! Mark my words, I will hunt you down!” If the player continues fleeing, they get the Deserter ending.
      • If the player follows the target inside without attacking Venom, then comes back out:
        Venom: “Having second thoughts? It's not too late. The target is within your reach. If you finish the job now, I promise not to mention this little misunderstanding to Meister. The mission of the Order is far more important, after all.”
    • If the player stops Venom first, Slick does not appear, and Venom says his usual line for being attacked.
  • If the player attacks the target after Venom appears, Slick appears and does his normal introduction, but Venom responds differently:
    Venom: “Ugh, what an obnoxious character.” To Kat: “But at least now I know you have the resolve to do what is necessary. I will let you take care of this fool.” He leaves the area.
    • If the player tries to leave the area, Venom returns:
      Venom: “Hold it. Don't tell me you're thinking of leaving. This job is not over yet. If you run away now, the Order will not welcome you back. Think about what you're doing.” If the player still leaves, he fails to stop them, and the player gets the Deserter ending.
Questionnaire:

1. The characters are mainly story-based.
2. The characters would ideally be drawn in a cartoon style.
3. Characters do have some visual stereotypes, such as Venom's scar, or Meister's bald head and facial hair.
4. The supporting cast have appearances that are fairly indicative of their character. Kat is left intentionally ambiguous in hopes that more players will identify strongly with him/her and let them know they can be an active part of the story.
5. N/A
6. Characters will convey their personalities through their dialogue as well as their actions in gameplay. Kat especially will be defined according to the player's actions in gameplay.
7. Overall, the cast tend to convey through their tone and speech patterns how seriously they take themselves and their situation, with Kat being the stark exception. Hopefully, these things lead to the player tending to roll their eyes at the NPCs, and thus Kat has even more in common with the player.
8. Kat's mysterious nature and unique assassin's tool (which is not revealed through dialogue here) will hopefully intrigue the player.
9. Kat's attitude of being the only sane person in a world of crazies will likely help the player identify with him/her, as well as the knowledge that they can impose their own choices on Kat's character to change the outcome.
10. As above, Kat is going to develop based on player preference. Whether he/she finds a conscience and deserts the Order, becomes a cold-blooded killing machine, or remains somewhere in the middle, the player will direct that growth.
11. Characters do seem to fit into archetypes here. Kat is a Hero, or at least an anti-hero, and possibly a Shape-shifter depending on the player. Slick is a Threshold Guardian to the letter. The others are less clear. Meister is something of a Herald, at least at first. Venom can become an Ally (reluctantly), but isn't guaranteed to.