Showing posts with label game feel. Show all posts
Showing posts with label game feel. Show all posts

Monday, July 15, 2024

Designing Platformer Player Controls

Taxonomy of Virtual Spaces Part II

One of the first steps in this project is to code a player avatar controller for 2-D platformer style gameplay, to allow the user to comfortably navigate the virtual environment. This also gives me a chance to use Unity's new Input System for the first time, as I've always used the Input Manager in previous projects.

Now, where to begin? Although I've created a few platformers in my time (like the experimental Super Mario Love (Rowe, 2019)), I've never created one professionally or for broader release. I've studied the game genre extensively and know enough to give my students advice on developing camera systems or how to adjust gravity to not feel "floaty," but this will be a new endeavor for me.


Building a Better Jump

Math for Game Programmers: Building a Better Jump (J. Kyle Pittman, 2016, GDC)

Building a Better Jump by J. Kyle Pittman is a lecture on using physics formulas to plan and design a platformer game controller, part of the "Math for Game Programmers" series of tutorials at the Game Developers Conference.

A common way to create a platformer game is to open the Unity editor, create a player character game object with a rigidbody, and write a script that applies a force on the object in an upward vector when the player presses the space bar. Then, through trial and error, the developer tunes the force value until the object can "jump" to the desired height. This tends to feel floaty, require a lot of iteration, and using Unity's default physics values tends to make it feel like every other Unity game out there.


How high?

Formulas for initial velocity and gravity

Pittman's approach is to remember your college physics formulas! By using the projectile motion vs. gravity formula f(t) = 1/2 gt^2 + v0t + p0 (Blogger is not great for writing formulas!), he shows that the initial velocity (v0)and gravity (g) values can be calculated based on how high you want the character to jump at the apex (h) and how much time you want the character to reach that apex (t). For example, if I want a character to jump 5 meters straight up and take 0.5 seconds to get there, then I should use a jump velocity of 20 m/s and a gravity value of 40 m/s^2 (or about 4 times our Earth's gravity).


How far?

Pittman uses more formulas to determine what lateral velocity (running speed) is needed to clear a certain jump distance. Remember calculating for how far a cannonball can fly before it impacts with the ground? No need to worry about launch angles here. Pittman shows how to calculate what x velocity is needed using time, height, and lateral distance requirements.


Break the Rules

Increase gravity at apex of jump to give the character a sense of weight

The formulas so far create a jump that is a perfect parabola, which unfortunately feels "floaty" and doesn't feel good to play. Here, Pittman quotes Game Feel (Swink, 2008), stating that in Super Mario Bros., the force of gravity triples at the apex of Mario's jump. (Swink: "At the apex of the jump, when velocity reaches 0, gravity is raised artificially by a factor of three, pulling Mario back to the ground with a much greater force than the one he overcame to get airborne in the first place" (2008, pg. 211). This "fast fall" technique makes the player feel "weighty" instead of "floaty." This is a simple technique that I've been teaching to my students for years.


Other modifications

Double jumping

Fast fall, double jumping, and variable-height jumps are all calculated using the same basic methods: use multiple parabolas or partial parabolas to determine the values needed. Pittman's methods give a great foundation for designing a platformer character controller from the ground up by the game's navigational requirements rather than fumbling around by trial and error.

There are still other important aspects of designing a platformer controller that are outside of scope of this lecture, such as coyote time, jump buffering, and hang time. Most of these involve setting timers and allowing the player to input a jump command when their character is not currently "grounded."

Saturday, April 15, 2023

New Digital Project Research and Notes

I've had a recommendation to think about creating a digital game project as a tool for my study of digital game aesthetics and spatiality. This would be similar to my other project exploring the history of virtual navigation in space, Traversing Virtual Dimensions, the inspiration for this blog's title.

This new research project would take the form of a simple digital game or several games. The user would be able to change the form of a game's spatial structure and projection dynamically, yet the core mechanics and spatial extents of the environment would remain the same. Such a project would ideally require several different methods of player navigation, so adapting my earlier work in Traversing Virtual Dimensions would be a good start. This would serve as a good testbed for exploring various spatial paradigms that I theorize are a way of understanding digital game styles across genres and technological platforms.

Eventually, such a tool can be useful for myself and others in research for A/B testing user experience with different spatial arrangements.

This page serves as an exploration of three similar projects that have been created by others.

Morf (Solarski Studio, 2011)

Changing the environment shape in Morf.

Morf was created as an exercise in understanding digital game aesthetics by exploring changes in the overall shape of an environment (in the above image, from "round" to "sharp") and how that changes the player's experience. Chris Solarski, the game's creator describes the project in his 2013 Game Developer feature, "The Aesthetics of Game Art and Game Design."

Morf is a simple browser-based game that I developed to explore the emotional links between character and environment shapes. You, the player, must guide a round character through two environments -- one round, and the latter, sharp. The surprise awaiting players is that, technically, both environments are identical -- it's only the superficial surface graphics that change.

Solarski noted the emotional changes in the different experiences of playing in visual harmony with one's surroundings (round character in round world) contrasted with that of playing in dissonance with one's surroundings (round character in sharp world). Players, especially non-gamers, showed a particularly heightened emotional response to the sharp world, which felt threatening and dangerous.

The game was created in Flash (R.I.P.) and is long gone from Solaski's web page where I played it years ago. Replaying the game required finding the Morf swf file on the Internet Archive, installing Adobe Flash Player debugger software, and finally running the swf file locally. Morf's different projected worlds are experienced in sequence, which is an effective tool for Solarski's purposes (you may not even notice that the two worlds are identical at first). For my purposes, I want to create a project where the game world's projection can be changed dynamically while playing.

Evoland (Shiro Games, 2013)

Evolution of the retail game through the course of gameplay.

Evoland started out as the winning entry for the Ludum Dare 24 game jam in 2012, which had a theme of "evolution." Developer Nicolas Cannasse refined the game into a commercial release in 2013, followed by a commercial sequel in 2015. Here is a description of the commercial game from the game's website:

Evoland is a journey through the history of action/adventure gaming, allowing you to unlock new technologies, gameplay systems and graphic upgrades as you progress through the game. Inspired by many cult series that have left their mark in the RPG video gaming culture, Evoland takes you from monochrome to full 3D graphics and from active time battles to real time boss fights, all with plenty of humor and references to many classic games.

The game starts as an action-adventure game in the style of early Legend of Zelda games. The game's visuals run the course of inspiration from Game Boy, NES, SNES (like Mode 7 style overworld environment), N64, and Sony PlayStation. Graphics, sound effects, movement controls, and game mechanics all "evolve" as the player continues their adventure. Some challenges require shifting perspective from 2-D to 3-D and back in order to solve them.

My study is on virtual spatiality, not graphics, although the two topics are corelated (most virtual spaces use graphic projection as a primary interface). I noticed examples of frame mobility early in the game, formal elements I define in my "Taxonomy of Virtual Spaces" (Rowe, unpublished). At first, Evoland uses a single fixed screen. The game quickly evolves with what it calls "basic scrolling," the game jam version has tile scrolling while the commercial version has discrete (or "page-flip") mobility as the player's view pans across the environment. Soon thereafter, the player gains smooth scrolling and primarily stays with that framing device. The game does return to discrete frame mobility when the game evolves to pre-rendered backgrounds in town with 3-D characters, much like Final Fantasy VII.

There are a few other games with similar "evolution through game graphics history" mechanics, such as High Strangeness, Upgrade Complete, and Genetos.

"Measuring How Game Feel is Influenced by the Player Avatar's Acceleration and Deceleration: Using a 2D Platformer to Describe Players' Perception of Controls in Videogames" (Gustav Dahl and Martin Kraus, 2015)

"Players control a rolling ball. Their task is to collect three stars." (Dahl and Kraus, 2015)

I've written about this game before when I reviewed literature about jumping in games. Dahl and Kraus developed a simple 2-D side-scrolling platformer game where the player controls a soccer ball rolling and jumping through a game environment. This is very similar to my project needs, except that I would make the spatial visuals dynamic as opposed to the jumping mechanic.





Monday, March 20, 2023

Winter 2023 Research Review and Spring 2023 Plans

 Winter 2023 Review

Preliminary cluster diagram of coding similarity, "Video Game Space and Motion" (Rowe, unpublished)

Spring 2023 Plans

My theory posits that a distinct way that humans experience digital games as aesthetic objects is through the embodied, "cyberkinaesthetic" experience of navigating virtual spaces.

The visuo-spatial configuration of a virtual space is the geometry of that space (defined by dimensionality, metrics, and extents), and the methods used to project that space onto the screen (or pair of screens, for binocular vision) of the game apparatus that serves as interface with the player.

A player has certain affordances within the game's field of action allowing them to take actions with other actors and navigate within virtual space. These affordances are moderated by the dynamics that determine the rules of interaction within the virtual space.

A game's spatial paradigm is defined by both the visuo-spatial configuration of its virtual space and the player's affordances for navigating that space.

I will be pushing my research toward defining specific spatial paradigms in my existing body of data.

  • Fine-tune Taxonomy of Virtual Spaces based on analysis of what attributes should be included or removed in order to be informative for my research. Make edits to Taxonomy document to match.
  • Complete existing qualitative analysis of game spaces for a broader selection of digital game titles using Taxonomy of Virtual Spaces.
  • Analyze player navigation in the above games and develop system for codifying the results.
  • Use statistical analysis to find patterns of similarity that signify Spatial Paradigms, Spatial Refinement, and Paradigm Shifts.


Saturday, February 25, 2023

Jumping Part 1: A Tale of Two Jumps

Jump button from a Donkey Kong (Nintendo 1981) arcade game cabinet 

Jumping is such a quotidian action in digital games that it seems like its been a part of gaming from the start. However, it wasn't until 1981 when Nintendo released Donkey Kong in the arcades, the first game to feature jumping (and the jump button pictured above). Sega's Jump Bug (1981) was released a few months later, the first game to feature both jumping and a smooth-scrolling screen frame. Jumping became the defining action of the platfomer genre, even though that genre predates jumping (platformers saw their debut back in 1980 with arcade titles Space Panic and Crazy Climber).


Jumping in Donkey Kong vs. jumping in Super Mario Bros. (images by Steve Swink, 2007. source: https://www.gamedeveloper.com/design/game-feel-the-secret-ingredient)

Mario's first Donkey Kong jump (and that of Donkey Kong Jr. (1982)) is very simple, mechanically speaking. Mario will always jump the same distance and to the same height every time, no matter how long the jump button is held down or how hard it is pressed. It follows a "specific, predetermined arc" (Swink, Game Feel (2009) pg. 201). Once jumping in a particular direction, there is no way to move the joystick in opposite direction to cancel the jump. This is what I refer to as a static jump, what Joshua Bycer calls a "commited jump" in his book, Game Design Deep Dive: Platformers. Additionally, Mario always runs at the same speed and stopes instantly, with no acceleration or deceleration. Similar static jumps are featured in jumping games that followed, like Irem's arcade hit Moon Patrol (1982) and Activision's Pitfall (1982) for the Atari VCS and Namco's Pac-Land (1984).

The static jump began as a purely defensive or navigational action to avoid threats, clear obstacles. or leap to a higher platform. Touching an enemy character typically meant instant death, so there was no concept for jumping onto enemies to defeat them.

By the time Shigeru Miyamoto and his team worked on Mario Bros. (1983), they started experimenting with Mario's (and brother Luigi's) movement. Gunpei Yokoi convinced Miyamoto that Mario should be able to jump with superhuman strength and fall great distances without fear of injury. Donkey Kong's short jumps and deadly falls feel cruel and punishing in comparison to Mario Bros.' tremendous leaps. Mario and Luigi also accelerate quickly from stopped to walking speed to running speed as they move horizontally (Swink 2009, pg. 202). Mario and Luigi also made a little slide as they decelerated to change directions. These jumps were still static, but the player characters were more controllable in their movement.

Nintendo's Super Mario Bros. (1985) offered an unprecedented level of control to the player during jumps with what I dub a dynamic jump. The longer the jump button is held down, the higher the character jumps. Depressing the "run" button lets the player accelerate their character from a walking speed to a fast running speed (walking max. speed is about 3/5 of running max. speed). The player is also able to accelerate horizontally, or "steer" their character in mid-air, during a jump. This opens up player control and gives the game a "highly fluid motion" (Swink 2007).

Note: Steve Swink's Game Feel (2009) is a book that I've referenced before and will likely return to many times. It still stands as the default text on the subject, but  hope that Swink gets the opportunity to create a 2nd edition for the book (something he's been hoping to do in order to update some information "where the thinking has evolved" (2010)). I bought the book new back in 2009 while I was working on fine-tuning controls for a console FPS game and thought it was a great leap forward in thinking and creating a language to think, plan, and talk about my design. His works define games around three principles of real-time control, spatial simulation, and polish. However, his work is different in examining the static/dynamic jump I analyze above.

The dynamic jump did not immediately change the world of platformers; many games created soon after SMB still featured the static jump (and some still do to this day). I see this additional control in jumping as a major evolution in the platformer genre, adding expressiveness and agency to the game action. Some of the most influential platformer series of the 1980s feature their own variations on the dynamic jump, like Mega Man/Rockman (full horizontal control during jump) and Sonic the Hedgehog (momentum-based movement, "vertical jumps" at same angle of slope character is standing on).

Continued in Part 2...

Spatial Models: Discrete vs. Continuous

Taxonomy of Virtual Spaces Wardrip-Fruin, Noah. (2020).   How Pac-Man Eats . Cambridge, Massachusetts: The MIT Press. Today, I return to the...