After using @unity3d for almost 10 years, I want to share the TEN small features that are really helping me develop games faster.

Starting with my favourite... 😎

1⃣ Inspector Maths

You can write ACTUAL mathematical expressions in the inspector! 🤯

Check the other ones!

🧵👇
2⃣ Animation Curves

Unity supports a super easy way to create smooth paths through ANIMATION CURVES. Perfect for blending & animating properties.

Creation:
public AnimationCurve Curve;

Usage:
float x = Curve.Evaluate(t);

#unitytips

docs.unity3d.com/ScriptReferenc…
3⃣ Gradients

The equivalent of AnimationCurve for colours is Gradient. You can use it to create and sample smooth gradients.

Creation:
public Gradient Gradient;

Usage:
Color c = Gradient.Evaluate(t);

#unitytips

docs.unity3d.com/ScriptReferenc…
4⃣ Multi-Object Editing

In Unity, you can select multiple objects and change their properties together.

If a field shows a "—", it means that the selected objects have different values.

For custom editor inspectors, have a look at [CanEditMultipleObjects].

#unitytips
5⃣ Vertex Snapping

In Unity you can hold [V] to select and snap to vertex.

This is very helpful to make sure two objects are *really* next to each other.

#unitytips
6⃣ Inspector Headers

In Unity, you can use [Header("x")] to create (guess!) a header in the inspector.

This works for shader code as well—although you need to remove the ".

Another helpful attribute is [Space]. Also use it as [Space(10)].

#unitytips

docs.unity3d.com/ScriptReferenc…
7⃣ Start as a Coroutine

In Unity, you can convert the Start function into a coroutine.

Before:
void Start () { ... }

After:
IEnumerator Start () { ... }

This trick also works with OnCollision— & OnTrigger— methods.

#unitytips
8⃣ Wait for a coroutine

If you use coroutines, you might be familiar with stuff like:
yield return new WaitForSeconds(1f);

In Unity, you can actually wait for another coroutine to end:
yield return StartCoroutine(MyCoroutine());

#unitytips

alanzucconi.com/2017/02/15/nes…
9⃣ Pause on Error

If you can enable the "Error Pause" option in the Console windows, Unity will automatically pause every time there is an error.

This can be super helpful for debugging purposes!

#unitytips
🔟 Lerping between Materials

In Unity, you can "blend" between two different materials using Material.Lerp.

This will lerp all properties with the same name.

Usage:
renderer.material.Lerp(material1, material2, t);

#unitytips

docs.unity3d.com/ScriptReferenc…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Alan Zucconi

Alan Zucconi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @AlanZucconi

25 Jan
These are FIVE TRICKS that my colleagues and I have learnt from one academic year or REMOTE TEACHING in HIGHER EDUCATION. 📚🎓

Every class is different, and every lecture has their own teaching style. But feel free to share this thread if you think it might help someone!

🧵👇
1⃣ 𝗦𝗲𝘁𝘂𝗽 🖥️

If you are using PowerPoint with a second monitor, you can actually resize the "Presenter View" window:

1⃣🖥️
🔴Shared screen with slides

2⃣🖥️
🔵Presenter view with notes
🟢MS Teams chat

So you can share your screen, see your notes & read questions!
2⃣ 𝗖𝗹𝗮𝗽𝗽𝗶𝗻𝗴 𝗼𝗻 𝗠𝗦 𝗧𝗲𝗮𝗺𝘀 👏

Every time a student present their work in front of the class, I invite everyone to clap. 👏

A remote alternative is to encourage students to raise and lower their hands on MS Teams quickly.
Read 7 tweets
23 Jan
BEHAVIOUR TREES are the cornerstone of ARTIFICIAL INTELLIGENCE for #gamedev.

But they can be difficult to "grow". 🌱

I have selected FIVE rather approachable papers that use EVOLUTION to grow behaviour trees AUTOMATICALLY, so you don't have to. 🌲

Let's start with...📝

🧵👇 ImageImage
1⃣ "Evolving Behaviour Trees for the Commercial Game DEFCON" (2010)

🔹Chong-U Lim
🔹Robin Baumgarten
🔹Simon Colton

researchgate.net/publication/22… ImageImage
2⃣ "Learning of Behavior Trees for Autonomous Agents" (2015)

🔹Michele Colledanchise
🔹Ramviyas Parasuraman
🔹Petter Ögren

arxiv.org/abs/1504.05811 ImageImage
Read 8 tweets
22 Jan
Fifty years have passed since CONWAY'S GAME OF LIFE firstly appeared on a column called "Mathematical Games" on @sciam.

While most Programmers & Computer Science enthusiasts are familiar with it, not many know that the game is actually TURING COMPLETE.

Let's see why. ⠠⠵

🧵👇
The quickest way to prove that a system is TURING COMPLETE is to show that it allows for the constructions of LOGIC GATES. 🖥️

So, let's see how the 𝗔𝗡𝗗, 𝗢𝗥 and 𝗡𝗢𝗧 gates can actually be constructed in Conway's Game of Life...
Firstly, we need to find a way to encode binary signals.

One very popular choice is to use a stream of GLIDERS. The so-called GOSPER GLIDER GUN can generated a new glider every 30 generations. 🔫

Hence, receiving a glider every 30 generations counts as a "1".
Read 11 tweets
19 Jan
This is a story about the importance of being the first one to cover a topic.

📙 "Artificial Intelligence for Games" by @idmillington & @funge, was published in 2009.

And it featured a diagram which has now possibly become the most popular Behaviour Tree seen in Colleges.

🧵👇 Image
I first realised I had seen this Behaviour Tree before when I noticed the "Barge door" node in someone else's slides.

And from that moment onwards, I have been finding variations of that very Behaviour Tree in virtually every game AI presentation.

Jeremy Gow, Goldsmiths 👇 Image
So, I went on a journey to find out how many other presentations I could discover, which features a variation of that original Behaviour Tree...

Simon Colton & Alison Pease, Imperial College London 👇 Image
Read 12 tweets
9 Jan
If you are interested in learning AI and how it can be used in #gamedev, you should start with BEHAVIOUR TREES! 🌲🧠

As the cornerstone of game AI, BTs are used in:

• Halo 2 🪖
• Bioshock 💉
• GTA V 🚗
• Façade 🍈
• Alien: Isolation 👽

Let's see how they work! 👇

🧵 A screenshot of "owl-bt", an editor for Behaviour An example of Behaviour Trees in Unreal Engine.An example of Behaviour Trees in Unity, with an asset called
Many of you are familiar with FINITE STATE MACHINES: the most popular pattern for character controllers.

While FSMs are graphs, BTs are (unsurprisingly!) trees. 🌲Their leaves are the ACTIONS 🦾 and PERCEPTIONS 👁️ your agents can perform and sense.
Each node in a BT can be in any of the three following states:

• ✔️ SUCCESS: the node was executed successfully
• ❌ FAILURE: the node could not be completed
• ⏳ RUNNING: the node is still being executed
Read 11 tweets
8 Jan
Most #gamedev are familiar with A*, the most used pathfinding algorithm in games.

⚠️ But did you know that there's a very common scenario in which A* DOES NOT find the shortest path? 😱

Let's see why A* won't work in "Portal", and how we can fix it!

🧵
All pathfinding algorithms work by iteratively exploring nearby cells in the grid.

⬅️ Breadth First Search explores them in the order in which they are discovered.

➡️ Dijkstra's Algorithm, instead, keeps exploring the SHORTEST PATH FIRST.

(gif by @redblobgames)
That is also why Dijkstra's algorithm is sometimes referred to as the SHORTEST PATH FIRST algorithm.

Ultimately, it is that property that ensures its OPTIMALITY (= it will always find the shortest path between any two points).
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!