Incoming Breaking Changes – New Maths API

Our new maths API will make your life so much easier, but it will require updating your game.

Maths

One of the first things that is written for a new game engine is the Maths library. A critically important base for your engine and used by almost every game that is written using the engine. The Maths library must be fast, consistent and succinct.

The PlayCanvas engine was first started almost 3 years ago, so the Maths library is already a venerable old friend. But it’s a friend that is in need of a facelift. (!? – Ed) So in the next few days we’ll be releasing Maths v2.0 for our Engine.

What does this mean for you?

First let’s give you a little sample of how the Maths library is going to work.

Here is some code from our recent Ludum Dare game Going Around.

 // In this code, we get the camera position,
// We convert a mouse click into world space
// Then we calculate the ray end point from
// the mouse click using a variety of vector operations
 pc.math.vec3.copy(camera.getPosition(), this.rayStart);
camera.camera.screenToWorld(event.x, event.y, 1, this.rayEnd);
pc.math.vec3.subtract(this.rayEnd, this.rayStart, this.rayEnd);
pc.math.vec3.normalize(this.rayEnd,this.rayEnd);
pc.math.vec3.scale(this.rayEnd, RAY_LENGTH, this.rayEnd);
pc.math.vec3.add(this.rayStart, this.rayEnd, this.rayEnd);

context.systems.rigidbody.raycastFirst(this.rayStart, this.rayEnd, this.onRayHit.bind(this));

This is what this will look like in the new API.

this.rayStart.copy(camera.getPosition());
camera.camera.screenToWorld(event.x, event.y, 1, this.rayEnd);
// subtract, then normalize, then scale by RAY_LENGTH, then add
this.rayEnd.sub(this.rayStart).normalize().scale(RAY_LENGTH).add(this.rayStart);
context.systems.rigidbody.raycastFirst(this.rayStart, this.rayEnd, this.onRayHit.bind(this));

As you can see we now support chaining vector operations together. This makes the code more concise, and also more readable. If you read through the line you can see we subtract, normalize, scale then add. All into the same vector.

This shows you how it will work for vector3’s, but these changes apply to all our maths primitives, such as Matrices and Quaternions.

So, hopefully, you can see that the new maths library is going to be an all round better beast, but obviously it does mean breaking changes. Even though our engine is pre-1.0, we never issue breaking changes lightly. It’s a pain for you and it’s a pain for us. But in this case it’s important that such a fundamental piece of the engine is easy to use and “just right”.

When is it going to break?

We doing the final round of testing at the moment, just to make sure everything works perfectly. We’ll be deploying the into the engine very soon  (today or tomorrow). This is a heads up so you know why we’re doing it.

After we deploy, we’ll be updating all the samples and examples to use the new API. This will take a little bit of time, so some of them may not but up-to-date immediately

 

Friday Assets mega-update

Drag and Drop, uploading and thumbnails, no longer a pain in the asset.

This week has been the week of the Asset at PlayCanvas. We taken a long hard look at how we add and use Assets and we’ve buffed and polished the process, taking off the ragged edges so that your workflow is now super smooth. Plus our big new feature, the PlayCanvas Asset Library. Find out more below

Use pre-made 3D models in your game

Use pre-made 3D models in your game

Uploading to the Designer

You can now drag and drop files from your desktop straight into the Designer. This means you never need to leave the Designer tab. Even better, if you drag an 3D model file (like an FBX) into the 3D view, your model will be uploaded, converted and a new Entity with model component all set up will be created for you. So it’s super easy to get models into your Pack.

Asset Explorer Polish

Up until now the Asset Explorer wasn’t terribly useful. We hid it away at the bottom of the screen and we didn’t really tell anyone about it, because there wasn’t much to it. Now, though, we’ve given it a complete revamp. We’ve added one-click filters for listing only the assets you’re interested in. Plus, now there are texture thumbnails and you can now drag assets from the Explorer into other part app, but more of that next…

Drag and Drop Everywhere

You can now drag Assets from the Asset Explorer and drop them into many different places. The first is simple, if you drop a model asset into the 3D view, you’ll get a new Model Entity. But also you can drag Assets and drop them into Asset pickers in any of the components that accept assets. This applies to models, animations, audio, etc, but also when you are editing Materials, you can just drop the textures into the slots. Speaking of textures…

Texture Thumbnails

Texture assets now have thumbnails

Texture assets now have thumbnails

We’ve started working on thumbnails for all Assets, but as a quick starter, textures now display with the proper thumbnail. No more guessing which one is the normal map when you’re setting up your materials. Thumbnails for more Asset will be done soon.

Asset Library

Have we saved the best feature until last? Maybe. Certainly the Asset Library is going to make it much easier for our new users to get something looking pretty. We’ve teamed up with lovely folks at http://3dmodels-textures.com/ and http://www.propsplanet.com/ to give you a selection of 3D models which you can use to get started. Click the big red Asset Library button to open up a list of models and one-click to add them to your Project.

We encourage you to check the free assets from the kind folks and then head over to their websites and see all the other awesome stuff they have on offer.

See Your Friends!

See what all your friends are looking at, as remote user cameras show up in the Designer.

The new features keep on coming from the PlayCanvas mines of awesome, and today’s is a biggie.

We’re now displaying the camera’s of all the users who are viewing your pack. Now it’s really starting to feel like a collaborative process when you are building your game.

So, invite your friends and get building!

Let us know what you think about this feature in the forums

Starter Kits

Get hacking on a game instantly with our Platformer and FPS starter kits.

Today we’ve launched a new feature to help get you up and running in PlayCanvas super-quick. Instead of starting with the dreaded blank project, now you can instantly get yourself a game to start hacking on.

We’ve got two styles of game to start with. You can use a starter kit right now, or go to your profile, select Create New Project and select the Starter Kit from the top.

platform game starter kit

The Platform Game Starter Kit

FPS Game Starter kit

The FPS Game Starter Kit

This is just the first two we’ve got up and running, with more improvements to come. Head over to the forum with suggestions for more starter kits.

Featured games, featured projects and activity stream

The all new front-page shows an overview of all PlayCanvas activity.

Cloud Gate (The Bean)

New shiny thing

Today we’re launching the new front-page for PlayCanvas users. When you log in and visit http://playcanvas.com/ you’ll now get a nice overview of activity across the whole PlayCanvas community.

Feature Games and Projects

We’re highlighting the more interesting public projects and games so that you can get inspiration from what other people are building. If you want to get your project in the featured section make sure it’s got nice image uploaded for the project, and let us know about it via the forums or twitter.

Activity

The activity stream shows recent changes to projects that you own. So you can see your team’s activity or just remember what you were last working on.

Announcements

Finally, we’ve included a little space for announcements from us. Check here when you log in, and we’ll keep you up-to-date with the latest new features we’ve deployed.

Importing in the cloud, the new asset pipeline

Taking the pain away from converting and uploading assets.

We’re really excited to announce the launch of our new asset pipeline feature, which allows you to import all your assets into PlayCanvas via your web-browser.

You will no longer have to download and install command line tools to convert your art into the PlayCanvas format. Simply drag an FBX or COLLADA file into the browser and we’ll do the rest.

Will has put together this 5 minute video which shows you how quickly you can get a model and animation from a site like Mixamo into your PlayCanvas game.

New Feature: Github and private repository support

Github Octocat

Google I/O certainly kept us busy last month, but we’ve still found the time to keep pushing out those features.

This weeks big ticket item is integration with Github and support for private repositories on both Bitbucket and Github.

Don’t reinvent sliced bread.

When we started developing PlayCanvas, we knew that we wanted to change the way games are made, but we didn’t want to reinvent everything. Programmers have been honing the software development craft for decades and we don’t want to mess with that, which is why we knew integration with source control systems would be essential.

Up until now we supported public Bitbucket repositories but as of today we’re pleased to extend our support to the web’s most popular code hosting site, Github.

Github really is a best of breed web application, and their ideals are tightly aligned with ours. Seamless collaboration and workflows, and now using Github with PlayCanvas is just as seamless.

We love you all equally

We love Github, but me, I’m a Mercurial man, which is why we’re giving equal love to Bitbucket and Github with our second feature to announce, syncing private repositories.

To use Github or Bitbucket accounts select your account settings page from the top navigation and go to Services. One click to authorise your account and then you can sync any of the repositories from your Bitbucket or Github user. Now head over the Code tab in your Depots and fill in the details of which repository you want to link up with your project.