Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Sunday, January 1, 2023

Unity WebGL tips / advice in 2023

I recently released a Unity WebGL game and the process was a bit painful. Here's what I learned...

In summary: 

  • I was using built-in pipeline and didn't try URP. (HDRP is definitely out of the question btw)
  • Unity WebGL support isn't bad, and WebGL performance is even OK, as long as you treat it like a ~2015 mobile device in terms of capability and performance. Don't throw a lot at it, especially because iOS browsers can't do a lot...
  • ... because it's 2023 and iOS WebGL performance is still pretty shitty even with Apple's promised ANGLE WebGL 2.0 support. You should expect to do a lot of mitigations and workarounds just so iPhones and iPads don't explode. Meanwhile, Windows and Android browsers are generally solid and reasonable. (In case you can't tell, I'm pretty annoyed with Apple.)
  • Here's what'll happen to you: your WebGL build tests on your desktop browser will work fine and you'll be pleasantly surprised... and then you'll try it on an iPhone and it'll be a mild disaster where you spend a week or two fixing all the various ways it explodes.

(Note: this is current as of Unity 2021.3.11 LTS + iOS 15.)

Monday, November 11, 2019

Practical primer to using Unity Timeline / Playables


I recently used Unity Timeline to do cutscenes in a game. Once you figure out how to use it, it works great, but that learning curve of expectations and setup is pretty annoying.

To review: Timeline is a sequencing tool. It's good for higher-level logic where you need to coordinate a bunch of objects at once. For many games, that usually means choreographing cutscenes or sequences. Many different engines and toolsets have sequencer tools and they all generally have the same workflow -- you make tracks and you put actions on those tracks. (see also: UDK Matinee, UE4 Sequencer, Source 1 Faceposer, Witcher 3's cinematic tool)

Note that Timeline is not an animation tool, it's higher level than that. Think of it like a movie director, it coordinates animation, audio, characters, and FX together, but doesn't actually make or process those assets.

In this intro workflow post, I'll start with SETUP TIMELINE, then SETUP DIRECTOR and MAKE CUTSCENES and CONTROL THE DIRECTOR VIA C# SCRIPT, and lastly how to MAKE CUSTOM TIMELINE TRACKS.

Thursday, July 12, 2018

Tips for working with VideoPlayer and VideoClips in Unity


Traditionally, game developers use Unity for real-time 2D and 3D games and shun any use of pre-rendered video, partly out of design dogma but also because the MovieTexture system was a nightmare. However, the recently overhauled VideoPlayer functionality means that *video* games are now much more doable. You can now feasibly make that Her Story clone you always dreamed of!

I'm currently making a video game that makes heavy use of video, chopped into many different video clips. It's been fun trying to figure out how to build basic video functionality like playlists and clean transitions between clips, except in Unity.

The thing they don't tell you about re-inventing wheels is that it's fun and exciting to re-invent the wheel, and it gives much more appreciation for the craft that goes into wheels. It was fun to think about how a live telecast cues up video footage on multiple monitors, and how a real-world broadcast works, and I learned a lot about why they do it like that.

Let's talk video in Unity.

Friday, May 18, 2018

So you want to try playing Thief 1


I've been streaming some Thief 1 for the past month, which has gotten some people interested in trying the game for themselves. You definitely should, especially if you like eclectic first person games, immersive sims, open world games, or walking simulators... it's almost 20 years old, yet it still feels really different and fresh and distinct from anything today.

That said, it can be a bit tricky to play for modern tastes, so here's a bit of advice for getting into Thief:

Tuesday, April 24, 2018

Advice for making a game design / game dev portfolio


After advising several game dev students on their portfolio websites, I realized I was basically giving the same advice and pointing out the same kinds of issues, and maybe I should write about it. So here's some thoughts for students making a portfolio:

First, figure out your audience. Who is your portfolio primarily for? If you want to get a AAA game job, you should try to tailor it to the norms of that industry -- if it's for some sort of school admissions application, then think about what an admissions committee would want to see. A small indie studio will want to see that you're versatile and that you won't need much supervision to solve problems. Each situation will have different expectations for a portfolio.

A portfolio is more curated than a personal site. A personal site can be whatever you want, and represent all your diverse interests and complex personality. In contrast, someone hiring for a programmer job doesn't care whether you play guitar or whether you draw sometimes, and anyway, they have 50 more applicants to look at! Your still life paintings are important to your identity, but probably irrelevant to a gameplay programming position, so you might want to consider keeping your portfolio separate from your personal website.

Next, here's some more specific advice:

Friday, March 30, 2018

GDC 2018: How To Light A Level, slides and transcript


This post is aimed at beginner / intermediate designers. It's a summary of the talk I gave at the GDC 2018 Level Design Workshop with David Shaver (Naughty Dog) for the "Invisible Intuition" double-feature session.

David's slides on blockmesh / layout are here (PDF) with case studies from The Last of Us / Uncharted. You can also get my full slide deck PDF here, and my speaker notes PDF here... but I don't know when GDC will upload the talk to YouTube, sorry.


A very brief and simple history of light starts with the sun. Then let's not forget about fire, controlled burning in gas lamps, incandescent light bulbs with a filament... and these days, there’s a stronger focus on more energy-efficient fluorescent lights, and LED lighting is also becoming more common.

It’s tempting to think of this as a story about technology and progress and older light sources becoming obsolete... but the light bulb did not make the sun obsolete, and the LED does not make fire obsolete! We still use fire as a light source all the time -- in our birthday candles, in our campfires, in our romantic candle-lit dinners -- in fact, I hate those little fake flickering LED candles, because a real flame has a unique quality to it, you know?

Fire hasn’t disappeared from the world, but rather our culture around fire has changed. That is, fire used to be a common and practical tasklight in Shakespeare's time, but now it feels more like special decoration for a special occasion. As a designer, you need to sensitize yourself to how light feels and conveys these ideas, because this is how you communicate those moods to the player.

Tuesday, March 13, 2018

Tips for talking to Robert Yang at GDC


Everyone's doing a bunch of GDC advice for first-time GDC attendees on Twitter, so I thought I'd chime in with a few tips of my own. Here's a helpful tutorial for how to have a successful social interaction with me, assuming you'd ever want to:
  1. Do you see me? I look like this. Or try to sneak a peek at the name on the badge. It should say "Robert Yang" on it.
  2. Are you sure that person isn't Brendon Chung? Brendon looks more like this; we're about the same height, but he's a bit more handsome and has a deep voice, and I have larger lips and generally sound louder and shriller.
  3. If we met at some past event or party one time, and I don't regularly interact with you in-person or on Twitter, then there's a good chance I won't remember you or your name. (I'm sorry in advance.) If you want to remind me that I should've remembered your name, you can briefly mention something like "we met at GDC last year" -- but don't mention a specific number of months, days, or hours, because then it'll seem like you've been pedantically tracking our non-relationship.
  4. (For advanced users only:) I don't respond well to praise or compliments, unless you deliver the compliment in a tone that borders on sarcastic / flippant while still remaining essentially earnest. Your goal is to perform a chipper yet world-weary knowingness.
  5. If we're talking but you don't want to talk to me anymore, then just say something like "well it was nice talking to you" and walk away. If we're in a group or cluster of people, then just let the conversation naturally die down, and then turn to someone else and subtly emote that you're not paying attention to me anymore.
  6. Whatever you do, don't tell me that you read this guide.
If you're looking for a more genuinely useful primer for going to GDC, see "GDC Advice for young first-time attendees, 2017 edition"

Saturday, September 23, 2017

Writing stories / dialogue for Unity games with Yarn

I've been using Yarn for a little while, and I've grown to prefer it as my "talking to NPCs" solution for game development. If you're not familiar, Yarn and Yarn Spinner are a pretty powerful Twine-like plugin for Unity (though it could technically work in any C# game engine) that's geared towards writing video game dialogue, and it was most famously used for Night In The Woods.

Yarn is fairly lightweight, extensible, and it basically gets out of your way. Want to make a really big long monologue, or 100 little pieces of dialogue snippets? Yarn works well for both of those use-cases. (If you want something that's more focused on manipulating very long dense passages of text, you might want something more like inkle/ink, the system that powers the huge 750,000 word narrative game 80 Days.)

To try to provide more resources for other Yarn users, or potential Yarn users, here's a write-up with some advice and a short guide to working with Yarn...

Thursday, September 14, 2017

How to Graybox / Blockout a 3D Video Game Level

from de_crown, by FMPONE and Volcano

UPDATE, 11 NOVEMBER 2021: this blog post is OK, but I would recommend reading the "Blockout" page in my free online work-in-progress level design book instead.

ORIGINAL POST:

While planning a level design class, I googled for a good article about blocking-out or grayboxing a 3D level design prototype. I didn't really find one that actually went into "how" you might actually go about grayboxing a level, so I guess I have to write it.

Grayboxing is a level design practice where you build a rough block-out version of your level using blocks (usually gray boxes) so that you can iterate and test the layout as soon as possible. Almost every 3D game engine has some sort of box primitive tool -- if you know how to use that, then you can graybox.

Before you graybox, you must make sure you've established a general game design direction. You should generally know how this level might fit into your game or workflow. There's no point in grayboxing if you don't even know what the player should be doing, or what this level is supposed to convey. Is the level supposed to be easy or hard? Does it focus on combat or non-combat? Should it feel scary or safe? Level design must always exist in the context of a larger game design, or else you're just wasting your time.

Then, open up your 3D game engine, and let's start laying down some boxes...

Thursday, August 24, 2017

Road trip sketches; notes on extracting and visualizing Half-Life 2 levels in Maya


So I'm working on (another) article about level design in Half-Life 2. I chose the d2_coast03 map of the Highway 17 chapter, which is the first real "coastline" road trip section of the game, and is probably the most successful. Look at how big and open it is. Would you believe this is a map in a game celebrated as a meticulous roller-coaster? In my mind, it's contemporary with a lot of vehicle-based first-person open world game design trends that started around the same time in 2004, and they even pulled it off in an engine architecture that's still kinda based on Quake 1.

Tuesday, June 7, 2016

Working with custom ObjectPreviews and SkinnedMeshRenderers in Unity


Unity's blendshape controls -- basically just a list of textboxes -- were going to cause me a lot of pain. After wrestling with broken AnimationClips for my previous attempt at facial expressions in my game Stick Shift, I decided to actually invest a day or two into building better tools for myself, inspired partly by Valve's old Faceposer tool for Source Engine 1.

To do that, I scripted the Unity editor to draw a custom inspector with sliders (based on Chris Wade's BlendShapeController.cs) along with an interactive 3D face preview at the bottom of the inspector.

The workflow I wanted was this:

Friday, February 13, 2015

How to make stuff look at stuff / demystifying turns and rotations, and working with quaternions in Unity C#

Julia set fractal thing of a quaternion function... I actually don't really know what that means, but it's pretty.
This is kind of a blog post more for my Unity students, but I figure other people on the internet might find it useful -- let's demystify working with rotations in Unity, and explore some useful techniques for doing so.

There are 2.75 ways to store rotations in Unity: (1) quaternions and (2) euler angles (directional vectors are the 0.5, and some math functions secretly take radians instead of degrees, that's the 0.25)...

Euler angles are the typical 0-360 degree system taught in most junior high / high school geometry classes, while radians are in "units of pi" and represent the curvature of a circle. Then there's quaternions, which are scary 4 dimensional representations of a rotation that you may have never heard of / can barely spell! Fortunately, you don't need to know quaternion math in order to work with rotations, Unity will handle conversions for you.

Okay, so first let's explore a most common problem: how do you make stuff look at stuff in Unity?

Monday, January 19, 2015

How to record animated GIFs and videos of your games with free tools

I feel like a lot of developers and artists just take some screenshots or photos to document their work, and then move on... don't! Think of your project as an engine to generate even more art.

Plus, making animated GIFs of your games and work process is fun!... and uh making videos is still a little painful, though it's a bit of a necessity for any news media or publications to talk about your game. It used to be much worse, if that's any solace? (It's probably not.)