Skip to main content

Why Easel?

Easel is a 2D game programming language designed to match how humans, not computers, think about game logic. It also can make your game multiplayer completely automatically!

  • If you're a first-time coder, you'll find Easel powerful enough to be interesting, but simple enough to be accessible.
  • If you're an experienced developer, you'll enjoy the productivity boost that comes from Easel's unique blend of declarative and imperative programming styles. Declarative programming languages are about expressing what you want to do, not how to do it. Easel is an imperative programming language that gives you full control when you need it, but it feels like a declarative programming language because so many common game features are first-class concepts in the language.

Either way, no matter who you are, you'll love making games with Easel!

tip

Try our Quickstart tutorial to see what Easel is capable of for yourself.

A programming language for humans

Most game engines require you to organize your code in the way the computer executes it. Particularly, other game engines often use a frame-by-frame model, even though many things in games live for longer than a single frame. This forces you to invert your code in order to carry state from one frame to another. In Easel, you create behaviors which can live as long as you want, and you can simply await for the next relevant event, even if it is many frames in the future. This results in code that is much more natural and easier to understand.

Behaviors

Imagine a spellcasting game where a wizard can launch a fireball every few seconds. This is how you could code it in Easel:

on ButtonDown(KeySpacebar) {
Spawn projectile { Fireball }
await Tick(3s)
}

This behavior waits for the Spacebar to be pressed, then it spawns a fireball, and then it waits for 3 seconds before repeating the process. Unlike some game engines, in Easel a behavior can simply await for something to happen, even if the waiting crosses multiple frames. This allows you to express your step-by-step sequence of actions in a straightforward manner. The logic always flows top-to-bottom and does not jump around like in a frame-by-frame state machine.

Behaviors are a simple but powerful building block that lets you express your game logic in a way that is easy to understand. An Easel game may consist of hundreds of behaviors, all executing concurrently.

Hierarchical

Some game engines also have an await feature but people often avoid using it! Why?

When you have hundreds of free-running threads of logic, you must make sure to stop them at the right time. If left to run amok, they can cause all sorts of bugs and errors. Think of a fireball's animation continuing to run when the fireball has already hit something and disappeared. This could crash your game!

Easel solves all of these problems in a simple way. Take a look at the example below:

Spawn fireball {
// ...
on Paint { // Fireball animation
Spark(...)
}
on BeforeCollide { // Despawn fireball upon collision
Expire
}
}

In the example above, we spawn a fireball entity with a couple of behaviors (on Paint and on BeforeCollide). When an entity dies, all of its behaviors die with it. Easel does this automatically. You don't need to worry about stopping the behaviors manually like in some game engines.

Most importantly, the hierarchical layout of the code implies that the behaviors belong to the fireball, without you needing to explicitly say so. The structure of the code implicitly stops you from making mistakes!

In Easel, it is impossible to create a behavior that outlives its parent. This avoids the most common type of bug that can occur in game engines that use await. Easel makes this powerful programming construct safe, allowing you to use it freely everywhere without worrying about bugs.

tip

What if you want to create a behavior that outlives its parent? Spawn a new entity, give the new entity the behavior. This is very easy to do using Easel's hierarchical programming style:

on BeforeCollide that {
Spawn freeze {
give that.SpeedModifier(-0.5)
once Tick(5s) { Expire }
}
}

No need to define freeze in a separate function. In Easel, this can all be defined in-place. Less jumping around the codebase.

Dynamic

Some game engines also have behaviors, but they are fixed and always live for the full duration of their entity. That means to turn behaviors on or off, or modify the behaviors, you need to add extra state flags and conditional logic, which clutters up your code.

In Easel, behaviors can be added, removed or replaced at any time. For example, this is how you could add a thrust behavior to a ship, but only while the Spacebar is pressed:

Spawn ship {
// ...
on ButtonDown(KeySpacebar) {
behavior<thrust> on BeforePhysics {
ApplyImpulse(0.75 * Direction(Heading))
}
}
on ButtonUp(KeySpacebar) {
delete behavior<thrust>
}
}

Reactive

Games are about change. Easel has been specifically designed with a number of first-class features to make it easy to react to change. For example, this is how you would code a health bar that changes color based on the player's health:

Spawn ship {
// ...
with Health {
PolygonSprite(color = (Health / MaxHealth).Mix(#ff0000, #00ff00))
}
}

This code might look simple, but it is actually a number of powerful concepts working together:

  • Each time the Health property changes, it sends a signal.
  • The with block creates a behavior that repeats on every signal, i.e. property change.
  • The block creates or replaces the PolygonSprite with a new one of a new color each time. How does it know which PolygonSprite to update? Easel assigns an implicit ID to the PolygonSprite based on its line number and position in the code, so it can find the same sprite again next time.
  • The hierarchcal structure of the code implies that both the PolygonSprite and the with behavior belong to the ship entity. When the ship entity despawns, both the PolygonSprite and the with behavior are automatically removed. No need to manually clean up!
  • One more thing. A with block differs from an on block in that it executes once first, then once again each time a property has changed. This is a useful distinction because if Health and never changes, there will still be a PolygonSprite displayed,

All of these features combined, built into the Easel programming language, make it easy to write code in Easel that reacts to changes in the game state, and make dynamic, interactive, ever-changing worlds.

Effortless multiplayer

Multiplayer can add a new level of fun and meaning to your games. Unfortunately, multiplayer is possibly the most difficult part of game development, often requiring years of experience. You have to deal with issues like synchronization, authority, prediction and networking. That's a lot to learn with when you just want to make a game!

Easel lets you code multiplayer like singleplayer. Code as if all players are in the same game world, and Easel takes care of everything for you. You can focus on making your game fun!

Mistakes are impossible

Even once you learn how to make a multiplayer game, part of the difficulty with multiplayer is you cannot miss anything. Everything needs to be done in a multiplayer safe way. It can normally be summed up as two rules:

  • All code must be deterministic. That is, every device on every platform must always produce the same output given the same input. Random number generators, trignometric functions (like Sin and Cos), floating point math, order-of-execution of concurrent threads, and many other things can easily break determinism.
  • The code must only modify the state it has authority over. If it does not have authority, it must send a request to the server or other client to make the change on its behalf.

If even one part of your game is not multiplayer-safe, then your entire game desynchronizes. In a game made of tens of thousands of lines of code, it is easy to get wrong, even if you know what you're doing.

Unlike other game engines, in Easel, you cannot get multiplayer wrong because the multiplayer is built into the programming language itself. Every single line of code you write in Easel is guaranteed to be multiplayer safe. That is why we say that everyone can make a multiplayer game in Easel, even if it is your first day of coding.

Easel makes multiplayer so effortless that anyone can make multiplayer games, regardless of their experience level!

State-of-the-art netcode

Easel uses an advanced client-side prediction technique called rollback netcode to make multiplayer games feel smooth and responsive, even when players are far apart.

info

Rollback netcode is a technique for hiding latency in multiplayer games. It works by having the game predict the game state even before all player inputs have arrived. When late inputs arrive, the game rolls back to the point in time where the input occurred, and then re-simulates the game from that point forward using the complete set of inputs. As players generally only send a few inputs a second, the prediction is correct most of the time. That is why rollback netcode is able to hide latency so well in practice.

  • State-of-the-art rollback netcode: Easel's rollback netcode implementation is one of the most advanced of any game engine. Amongst other things, it performs incremental snapshotting and rollbacks, meaning only changes are snapshotted and rolled back, not the entire game state, which improves performance dramatically.
  • Perfectly-located servers: Easel uses a peer-to-peer relay architecture to minimize latency between players. It is like having a virtual server located at the exact midpoint between all players. Sometimes the virtual server is in geographically impossible locations, like the middle of the ocean, which means players experience lower latency than traditional server-based architectures could ever hope to achieve.

There is a lot more we can say about Easel's advanced netcode implementation. See Rollback Netcode for more information.

Easel's netcode is incredibly advanced, but you don't need to understand it to use it! Just code as if all your players are in one shared world, like a singleplayer game, and Easel takes care of the rest. Like magic!

Beginner-friendly

Easel was designed to be a great choice as your first programming language.

No installation required

The first hurdle to learning to code is often the installation process. Other programming languages require you to download and install a text editor, the programming language's runtime, and so on. This can be a huge obstacle for beginners. Because Easel is a web-based game engine and development environment, you can start making games immediately without installing anything. You can even use Easel on a Chromebook, which is perfect for schools.

If you are experienced with coding, you can still use your own text editor if you prefer!

One-stop shop

Everything you need to know about Easel is explained in one place - the Easel documentation (which you are reading right now!). In other programming languages you may sometimes need to find and learn a number of third-party libraries in order to make a complete game. Even just finding these libraries can be a challenge for beginners. With Easel, it is easy to find and learn everything you need to know in one place.

Learn by example

Every Easel game can be remixed with a click of a button, which is a great way to learn to code. Instead of being overwhelmed by the blank page of a text editor, you can start with a game that you already know and love. You can then change the game in small ways, and see the results immediately. As you get more confident, you can make bigger changes, and eventually you can make your own games from scratch. There is no need to learn everything at once.

Shareable

Once you have made your game, sharing it with others is as simple as sharing a link. Your friends and family can play your game instantly, without needing to install anything. Sharing with other people is a great way to stay motivated.

An excellent next step after Scratch

Easel is a great next step after visual programming languages like Scratch or MakeCode. In many ways, Easel is more similar to Scratch than it is to traditional text-based programming languages like Python or JavaScript. Both Easel and Scratch have are made up of entities with behaviors that execute concurrently. You can send signals between entities to communicate. However, Easel has a built-in physics engine, built in multiplayer support, and many more advanced features that make it a powerful tool for making games.

Easel is the perfect stepping stone from Scratch towards more advanced text-based programming languages.

A complete toolbox

Batteries included

Easel has all the features you need to make a 2D game: graphics, audio, physics, user interfaces, persistence and more. You can make a complete game without needing to learn any other tools.

Instant deployment

Once you have made your game, the next challenge is sharing it with others. For a multiplayer game, this would normally involve wrangling with servers and deployment pipelines, but with Easel, publishing is as simple as clicking a button. One click and your game is live on the web for anyone to play. You can then share the link with your friends, and they can play your game instantly. You can even update your game on the fly. Easel takes care of everything for you.

Summary

Easel's way of making games is unique. It is powerful enough to be interesting, but simple enough to be accessible. It tames the most difficult parts of coding games, and gives you simple, logical building blocks that let you get straight to the fun part. Even if you've never coded before, you can make games with Easel. Easel is both a great way to learn to code, and a powerful tool for experienced developers.

If you want to learn more, try out the Quickstart tutorial.