Pixar Animation Studios' João Victor showcased a cool new project and shared an in-depth breakdown explaining how it was set up.
According to the creator, the game, which tasks the player to control the I-hating lamp and jump over the letters "P", "I", "X", "A", and "R", was built using Maya and is available in various Pixar departments, allowing the studio's workers to play it and compare their scores afterward. To help us better understand how the legendary intro was turned into a game playable in Maya, the artist has also shared a comprehensive breakdown, explaining the entire development process behind the project.
And here's the full breakdown shared by João:
Inspiration
Hi, my name is João Victor, I am currently working as Character Modeler, Rigger, and Tools Developer at Pixar Animation Studios. I always tried to explore 3D packages further than common uses. In 2011, I started making games in viewports of 3D applications with Tetris and Shot. Both were developed in 3ds Max using the MAXScript language, vectors, and detector rays.
Then, inspired by Google Chrome's Dinosaur Game, I decided to make something in the same format, so I thought that the Pixar intro would be a good fit.
Game Code Structure
Installation
When the player runs the Setup file in the installation package, the code identifies the operational system and takes different decisions based on the possibilities (Linux, Mac, or Windows). All the project files are copied to the local space, so the player doesn't need to be connected to the network to play, and the game can be faster.
The installation function also set up a new shelf called "Go Junior!" in Maya, where the player can click the button to start the game. It is possible to play with the keyboard by inserting short command lines that call the respective functions in Maya's Hotkeys available features.
Game Code Core
The core of the code is a while loop which checks on each step of the counter if the game should still be running.
Inside this loop, I have an incremental counter that enables me to identify how long the player is running the game, so based on this information, I can set higher frequencies in order to have higher speeds for all levels. While running each one of these counter steps, the code executes:
- Letters being duplicated.
- Letters moving along X-axis.
- Lamp models being hidden and unhidden.
- Lamp models running pre-animated alembic files.
- Lamp light updating positions.
- Flame aligned and animated via deformer attributes while the lamp is in "flying" mode.
- Collision checker verifying if the bounding box of the lamps crossed the bounding box of the letters.
Switching Lamps
My approach to animating the lamps was loading external alembic files, as it would be harder to switch the .abc paths. I used three lamp models (running, jumping, and flying). Each of the three models has a particular alembic file that makes the lamp behave as it should, so I can hide and unhide each one depending on the action taken by the player, and while playing, only the unhidden lamp has its alembic counter running.
Rigging and Animation
The rig was made pretty simple with some controls to rotate the head, stretch the body and keep the pieces' pivots in place, so I could animate small cycles of running (10 frames), jumping (30 frames), and flying (18 frames).
Checking Collision
To check the collision of the lamps with the letters, I have dictionaries with pre-registered vertex IDs for each letter (P, I, X, A, and R). I used that to identify the position of those vertices in X and Y to verify if any collision happened. I have a tolerance variable that makes the game easier or harder as well.
Collision Detected
When a collision is detected, I run a function that changes the lamp material's attributes, so for a while, it becomes red and transparent, showing that the player lost one of the five chances, and I just hide one of the chances icons.
Moving Lamp in X
It's possible to move the lamp in X using the right and left buttons. It simply moves the lamp group some units in these directions.
Ranking
When the player loses all chances, the system records how long this player was able to have the game running, so it is directly related to the scores, which are updated in a .txt file in the network, building the players ranking with their usernames.
Models
All models were created by the Sets and Props Artist Ana Ozenda. The lamp was modeled in high poly resolution, then we needed to decrease the poly count so that at the end of the day, we could find a good balance between poly count and performance.
Conclusion
I did this game as an exploration project in my spare time, little by little, and it was a great opportunity to practice programming and problem-solving situations. The fewer applications I have open at the same time, the faster the game runs, and the game can be played intermittently, generating infinite score numbers. I wanted to thank my friend James do Carmo Correa for helping me with Maya threads issues.
You can check out more of João's projects here. Also, don't forget to join our 80 Level Talent platform and our Telegram channel, follow us on Threads, Instagram, Twitter, and LinkedIn, where we share breakdowns, the latest news, awesome artworks, and more.