CraftStudio educational group licenses

If you’re an educator or teacher interested in using CraftStudio with your students, I got good news for you! I just added support for educational group licenses to the CraftStudio website:

EducationalGroupAccount

As well as in CraftStudio itself:

LauncherStudentLogin

Logging in as a student requires the launcher version >= 1.2.0 (you can get the latest launcher version from craftstud.io/download).

How it works

The Educational group license lets you set two different passwords:

  • one for your own usage as the teacher
  • one for your students (which you can change at any time when you need to make sure previous students aren’t using it anymore)

Your students can then log in with whatever name they choose followed by “@youraccount”, as long as there are available seats. Whenever a student closes CraftStudio, the seat is made available again for someone else to hop in.

No need for each student to memorize (or forget) their own password, you can simply set a group password when the session begins and share it with the group on a whiteboard, a video projector or through instant messaging.

Interested?

If you want to get a CraftStudio educational group license with your chosen number of seats at a discounted price, get in touch with me and we’ll work out the details together.

This is the first iteration of this educational support and CraftStudio is still in beta, so as always, I’m eager to gather feedback: if you’re using CraftStudio in school-like settings, let me know what your needs are!

CraftStudio Beta 1.1 – Export to any platform!

Hi all!

Sorry for the late post, I was caught up with finishing our Ludum Dare game, PaperCoaster:

New export dialog

The launcher has been updated to download the runtimes for all 4 supported platforms: Windows, OS X, Linux and the HTML5 Web player.

Inside CraftStudio itself, clicking the “Export project” button will now offer choosing which platform to export to:

ExportSettingsPopup

Note that the Linux and Web runtimes are still very young and have a few bugs. Most notably, the Linux runtime doesn’t support locking the mouse properly and the Web player doesn’t support physics (will spit out an error) or audio (won’t play any sound) just yet. I’m doing my best to get those fixed as soon as possible.

New physics scripting functions

The physics API released along with CraftStudio Beta was pretty barebones. Here are some updates:

Continue reading

CraftStudio Beta release date & Sparklin Wars

Taking a quick break from working on the physics engine integration for the upcoming CraftStudio Beta release to write a bit.

CraftStudio Beta is almost there

I still have a nice big pile of work left, but I settled on a date for CraftStudio Beta and have started getting in touch with the games press…

So, without further ado: CraftStudio Beta will be released a week from now, on Wednesday, April 24th.

ConfirmNewFriend

I’m very excited (and quite anxious) to get it out. I’ve accumulated a lot of very cool new features and improvements (if you follow me on  Twitter, Google+, Facebook or Tumblr,   you might have caught some glimpses of them) and I can’t wait until you can get your hands on it. Also made a shiny new trailer…

I also can’t wait to get back to regular, day-to-day releases. Big updates are stressful because there are many moving parts and (self-imposed, but still very real) deadlines.

Sparklin Wars

(NOTE: Just to make things clear, this is not directly related to CraftStudio)

For those who missed it, I spend a couple of nights last week writing a multiplayer Web shooter called Sparklin Wars.

SparklinWars01

I’ve been itching to write more multiplayer games for a long time and since CraftStudio still hasn’t gained networked multiplayer support (I wonder what the devs are doing, srsly ;) ), I decided to see what I could cobble together in as little time as possible with only Web tech. I spent a full night of 10 hours writing the first version and since it was quite fun, I decided to spend another few hours fixing some bugs and adding some more features.

What I built it with (i.e. technical stuff)

The tech stack is a tiny bit hairy, but it’s made of frameworks / libraries that fit very well together and it’s a big part of why I was able to whip up something arguably pretty cool in so little time.

On the server-side, I got myself some Node.js, running the Express.js Web app framework. I use CoffeeScript for all scripts to make JavaScript more fun & less verbose. My HTML templates are written in Jade and my CSS is all Stylus. Jade and Stylus are basically to HTML and CSS what CoffeeScript  is to JavaScript: DRYer, more productive, less cluttered.

Level files are simple PNG images loaded with png-js.

Level02Bigger

Real-time communication is handled by Socket.io which is a WebSockets wrapper (with fallbacks to long-polling & such for older browsers). WebSockets are TCP-based which means there’s bound to be some latency issues but overall, for most people and considering the incredibly basic network implementation I wrote (no client-side prediction or anything)  the game runs impressively well. It was very playable with 20+ people on, which I didn’t expect at all.

On the client-side, rendering is handled by the great Three.js WebGL engine (the same engine that powers the CraftStudio Web model viewer and the upcoming CraftStudio Web player), along with the IEWebGL for good old Internet Explorer.

I also threw in some jQuery in the mix to handle DOM for the chat and scoreboard with less pain.

Future plans

So the game, although still terribly basic both in gameplay and graphics (I’m not even mentioning the terrible sound effects), has proven to be quite addictive.

Being entirely Web-based and letting people join with a single nickname is a huge boost for getting people to play something. Players just link it on Twitter or to their friends and 2 minutes later, dozens of people pour in shooting at another other like crazy :D .

Obviously this has led to some team-killing issues that will have to be dealt with. I’m thinking of having a public room for unauthenticated users and a more restricted room where people have to authenticate with a social account so we can do votekicks, bans & things like that.

Anyway, there are lots of ideas in my mind as to what this could become and the experiment has informed my work towards networked multiplayer in CraftStudio games too… I can’t say too much just yet but expect some cool stuff in this regard in the weeks after CraftStudio Beta is released.

MonoBoxedLua, sandboxed Lua for Mono/.NET

Heads up: This is a developer-oriented post

CraftStudio games are scripted in Lua, a nifty, lightweight scripting language. Since CraftStudio itself is written in C#, I needed a way to interface the C# CraftStudio engine with the game’s Lua scripts.

To do that, I forked MonoLuaInterface (which is itself a fork of LuaInterface) into MonoBoxedLua and made the following changes to make it into a more sandbox-like library:

  • MonoLuaInterface provided a two-way link between C# and Lua, allowing Lua to tap into any .NET libraries, so I removed that part.
  • I also disabled some Lua system libraries or functions which allowed direct access to the OS and disk input/output.

Today, prompted by a thread on the CraftStudio forums, I added a sample project to the repository showing how to expose functions and pass arguments (and properly dispose of them to avoid leaking memory).

Make your own Lua API from C#

The idea is very simple: create a new class which instantiate a Lua object and will contain all your API functions. Let’s call it MyLuaAPI:

using System;
using LuaInterface;

namespace LuaInterfaceSample
{
    class MyLuaAPI
    {
        public Lua      Lua;

        public MyLuaAPI()
        {
            Lua = new LuaInterface.Lua();
        }
    }
}

Now just add a public method you’d like to make available to your Lua scripts:

public void MyCoolFunction( int count )
{
    Console.WriteLine( "Got {0}!", count );
}

And change the constructor to expose the function to Lua like so:

public MyLuaAPI()
{
    Lua = new LuaInterface.Lua();
    Type self = GetType();

    Lua.NewTable( "MyLuaAPI" );
    Lua.RegisterFunction( "MyLuaAPI.CoolFunction", this, self.GetMethod( "MyCoolFunction" ) );
}

And voilà, all done! You can now instantiate your Lua API from your main program and use it:

using System;

namespace LuaInterfaceSample
{
    class Program
    {
        public static void Main()
        {
            var luaSample = new MyLuaAPI();
            luaSample.Lua.DoString( "MyLuaAPI.CoolFunction(5)" );
        }
    }
}

0.1.33.0 – Visual blocks for raycasting!

Hi and welcome to yet another CraftStudio update!

Here’s a quick look at the changes:

  • Visual Scripting
    • Added various new scripting blocks for dealing with Ray, Plane and Quaternion
    • Added math functions for rounding / flooring / ceiling numbers
  • Fixed parameter bug in the “arctangent” block
  • Fixed some issues with handling of craftstudio:// links and DNS resolution

And… that’s pretty much it!

Raycasting blocks

Raycasting is useful for hit testing or collision detection.

There are two ways to use the new raycasting blocks: you can either request only the distance from the ray’s origin to the first hit on the model / map / plane you’re targeting, or request more detailed information. If you request more detailed information using “Hit info” instead of “Hit distance”, you’ll get a table containing various properties.

Here’s a sample with a model renderer:

HitInfoModelRenderer

Click to enhance (or get your head real close to the screen)

As you can see, the returned hit info contains a distance property (a number) and a normal property (a vector perpendicular to the hit surface).

Here’s what it looks like with a map renderer:

HitInfoMapRenderer

As you can see, there are two more bits of information available: the location of the hit block (returned as a table containing x, y, z properties) and the location of its adjacent block (the block through which the ray went just before hitting this one). The adjacent block location would be useful for building games like Minecraft, you could use it to place a block next to an existing block.

CraftStudio 0.1.31.0!

… Hi! Guess what? Here’s a new release!

Visual scripting improvements

  • Blocks can now be dragged by holding down Alt. This is useful for quickly grabbing a block without having to look for a part that can be dragged
  • Added blocks for dealing with angles & trigonometry: cosinus, sinus, tangent, arctangent and degrees / radians conversion
  • Added mouse input blocks: get mouse position or offset since last frame, make mouse cursor (in)visible, (un)lock mouse

Texture blur fix!

This bug has been plaguing CraftStudio since the very beginning, but it was very rare and I didn’t have a reproducible test-case until now. Thanks goes to Mattht for sending me a model where it happened reliably.

Basically sometimes the DPI resolution of an image was miscalculated (it would end up being 95.9866 instead of 96 for instance), inducing subtle but terrible blurring.

Once the issue was isolated, it was very easy to fix: CraftStudio now forces the DPI to 96 whenever a texture is loaded.

Miscellaneous changes

Added an “Open Projects folder” button in the Server Manager (which doesn’t work on Mac yet. I’ll fix it ASAP.)

Mitigate ability to grief on the Community Hub by limiting the number of assets a simple member can trash

CraftStudio 0.1.30.0

Hi all!

I just pushed an update with the following changes:

  • Fixed a  Windows 8-specific crash. If your launcher crashes on startup, try reinstalling from craftstud.io to get the latest 0.5.2.0 version.
  • Added visual scripting blocks to start / stop animation playback on a model renderer
  • Added a block to query whether the model renderer is currently playing an animation
  • Fixed the “Create sound instance” visual scripting block (it didn’t work)
  • Prevented trying to parent a visual scripting block to itself on the server-side
  • Replaced double-dashes with proper emdashes in chat server messages

Oh and by the way, the free week-end is still going on. If you’re still on the fence whether CraftStudio is for you or not, take this opportunity to get a feel of what the full experience is like :) .

Free week-end for the Global Game Jam!

Hey everyone,

CraftStudio is awesome for game jams: collaborating in real-time makes for a great, productive experience. So starting in two hours, I’m running a free Premium week-end for CraftStudio to celebrate the Global Game Jam!

What does that mean?

Everybody gets to access all premium features of CraftStudio for the duration of the week-end: scripting and export for all!

It’s a great occasion to learn you some scripting. You could start by following along this video tutorial.

For more in-depth tutorials, check out the wiki!

What’s CraftStudio capable of?

Plenty! Here’s a game that we made over 48h for the latest Ludum Dare (another game jam):

Watch this YouTube playlist to see more!

What’s the Global Game Jam?

It’s a global game-making event that runs over the week-end.

All details can be found here: http://globalgamejam.org/

CraftStudio 0.1.29.1

Howdy! This is just a minor bugfix update with the following changes:

  • Projects can now be reordered by dragging them in the projects list (no need to open the Manage popup for that anymore)
  • Fixed whole window blur when hovering 3D viewports on the Mac version
  • Improved the networking library packet resending mechanism (should help at least a bit with stuck exports & such)
  • Fixed crash when clicking on the map viewport while the map is loading (introduced in the previous update, thanks Erwan0fil for the report)
  • Fixed serialization of “Set Orientation” visual scripting blocks
  • Fixed buggy migration of “Set Map Block At” visual scripting blocks