2014/10/01

Grid Framework version 1.5.1 released

This release is a hotfix for everyone who was using Playmaker

  • Fixed: Compilation errors when toggling on Playmaker actions.

Playmaker actions wil compile correctly now, anyone else was unaffected. So what happened? One of the problems when developing an extension that relies on another extension is that it will not compile if the dependency is not present. For Vectrosity is was easy, I just needed to assemble and array and the user would then send it over to Vectrosity. Or not, you could do something entirely different with it as well if you wanted, it's just an array of Vector3.

Playmaker is different though, the actions are classes derived from Playmaker classes, so if you don't own Playmaker the code will not compile. My solution was to do the following:

//#define PLAYMAKER_PRESENT
#ifdef PLAYMAKER_PRESENT
// code goes here
#endif //PLAYMAKER_PRESENT

This means the code will only compile if the keyword PLAYMAKER_PRESENT is defined, which it isn't since the first line is commented. To make the scripts compile you have to toggle them on through a menu item which then edits the scripts to un-comment or comment that line. Before I submit a new release I have to toggle the actions off and so I missed the compilation errors.

It's still a bad oversight on my side and I'm not trying to excuse my failure, but I wanted to share how this can happen. A better solution would be if plugins could define keywords globally, then Playmaker could announce its existence on its own instead of having to toggle things manually.

2014/09/16

Grid Framework version 1.5.0 released

Grid Framework version 1.5.0 has been approved by the Asset Store team. This version brings a great new feature for anyone interested in making isometric 2D games: shearing. Shearing allows you to slant a rectangular grid's axes without having to rotate the grid. Up until now the only way to achieve the isometric look was to rotate the grid or the camera in 3D space, but in 2D games the camera has to be perpendicular to the image plane and thus the grid as well. Now all you need to do is just set the shearing of the axes and you're good to go, everything else stays the way it was.

The shearing is stored in a new type called Vector6 that works very much like Unity's own Vector3. The Vector6 class resides in the new GridFramework.Vectors name space to prevent name collision with other custom types or a possible future official Vector6 type from Unity.

the GFBoolVector3 and GFColorVector3 classes have also been moved to that namespace and had their "GF" prefix stripped away. If you used them in your own scripts strip away the prefix and place a using directive at the start of your script, otherwise you have to do nothing.

Here is the full change log:
Introducing shearing for rectangular grids.

  • New: Rectangular grids can now store a `shearing` field to distort them.
  • New: Custom `Vector6` class for storing the shearing.
  • API change: The odd herringbone coordinate system has been renamed to upwards herringbone. The corresponding methods use the `HerringU` pre- or suffix instead of `HerringOdd`; the old methods still work but are marked as depracated.
  • API change: The enumeration `GFAngleMode` has been renamed `AngleMode` and moved into the `GridFramework` namespace.
  • API change: The enumeration `GridPlane` has been moved into the `GridFramework` namespace. It is no longer part of the `GFGrid` class.
  • API change: The class `GFColorVector3` has been renamed `ColorVector3` and moved into the `GridFramework.Vectors` namespace.
  • API change: The class `GFBoolVector3` has been renamed `BoolVector3` and moved into the `GridFramework.Vectors` namespace.
  • Enhanced: Vectrosity methods without parameters can now pick betweem size and custom range automatically.
  • Fixed: Vectrosity methods were broken in previous version.
  • Updated the documentation.

2014/09/09

Whitelisting subdirectories in Git

After having migrated the development of Grid Framework to Git I wanted to set it up to track only certain sub-directories. I turned out that whitelisting is quite tricky, so here is how I did it for people who might run into the same problem.

We'll use only one .gitignore file and it will be placed in the root of our repository, which is also the root of our project. We can do the usual blacklisting stuff like blacklisting ceretain file types and directories, but the Assets directory is where it gets tricky. Since the directory contains all sorts of other plugins used during development but not worth tracking, we can neither black- nor whitelist the entire directory.

First we'll blacklist all the contents of the Assets directory. Note that this does not blacklist the directory itself, just its contents, but since Git operates on files the effect is the same. The difference is that blacklisting an entire directory prevents us from ever whitelisting any of its contents.
Assets/*
Now we can whitelist a subdirectory and its meta file:
!Assets/Grid\ Framework/
!Assets/Grid\ Framework.meta
Simple enough, but what if we want to whitelist only a specific subdirectory of a subdirectory? The Editor directory contains code from other plugins as well, so we don't want to track the entire thing. In this case we need to repeat the same process as above but one level deeper.
!Assets/Editor/
!Assets/Editor.meta
Assets/Editor/*
!Assets/Editor/Grid\ Framework/
!Assets/Editor/Grid\ Framework.meta
First we whitelist the Editor directory, then we immediately blacklist its contents and whitelist a specific subdirectory. This way none of the other editor extensions will be tracked. We can repeat the same process for the Plugins directory.
!Assets/Plugins/
!Assets/Plugins.meta
Assets/Plugins/*
!Assets/Plugins/Grid\ Framework/
!Assets/Plugins/Grid\ Framework.meta
And yes, you do have to repeat all these steps for every level of subdirectories. You don't have to whitelist subdirectories of already whitelisted directories, so any subdirectory in "Assets/Editor/Grid\ Framework/" is already tracked. Also note the backslash in the path, it is necessay to escape the space character.

UPDATE: Whitelisted the Unity meta files of whitelisted folders as well, just in case. Of course if you are not using Unity you need to figure out if and what meta files you have instead and if they need to be tracked as well.

2014/08/24

Shearing

As I mentioned last time the upcoming release will be a maintenance release with some much-needed cleanup. While I'm still waiting for approval I have been working on a new feature for rectangular grids that I had wanted to do for quite a while now, but couldn't until the cleanup: I'm talking about shearing.

This is an un-rotated rectangular grid with skewed axes to create the popular 2:1 isometric look. This is quite powerful, because it allows for isometric 2D graphics to be used with Grid Framework. Getting an isometric look in a 3D game is very simple, you just rotate the camera until it looks right. However, in a 2D game the camera has to be perpendicular to the image plane and objects are just drawn as if they were at an angle, so rotation is out of question.

Shearing is fully implemented, I just need to write the documentation for it. It works with arbitrary numbers and for all axes along any other axis, so you can shear your grids any way you want. It will be a feature for the 1.5 update once the upcoming 1.4.2 release gets approved.

2014/05/09

Grid Framework version 1.4.1 released

Actually it has been up for almost a month already, but I have been busy. Anyway, this is the long-awaited release that brings PlayMaker support to Grid Framework, so here is the change log:

  • Introducing Playmaker support: Almost the entire Grid Framework API can no be used as Playmaker actions (some parts of the API are ouside the capabilies of Playmaker for now)
  • Updated the documentation to include a chapter about Playmaker and how to write your own Grid Framework actions.
  • Fixed: the origin offset resetting every time after exiting play mode.
  • Fixed compilation error in one of the Playmaker actions (setter and getter for depth of layered grids) 

If you're wondering why I skipped 1.4.0, it's because I discovered a bug right after submission, so I submitted 1.4.1 right afterwards, thus skipping over the release of 1.4.0. As always you can read about how to use the new PlayMaker actions or write your own ones  in the documentation.

As for future plans for Grid Framework, I still have a place that I want to optimise before considering new features, and it will require a good amount of digging, but the result will be cleaner and easier to maintain code.

2013/12/10

Grid Framework version 1.3.5 released

Grid Framework version 1.3.5 has been approved last week, here is the changelog:

  • Added a new event for when the grid changes in such a way that if would need to be redrawn.
  • Some of the exmples were broken when Unity updated to version 4.3, now they should be working again.
  • Overhauled the undo system for the grid align panel to remove the now obsolete Unity undo methods.

I promised I would be working on Playmaker support, so what's going on here? I have been bogged down a lot with studies and real life stuff oder the last months (nothing bad though, don't worry), so things were going slowly, but they were moving. The current problem is Playmaker itself; from what I have used it is a fantastic system to crate game logic and totally worth it, however, when it comes to extending it things aren't that nice anymore.

I am in contact with a staff member who is helping me out, so I'm not entirely reliant on the lackluster documentation, but there is a lot of ugly code redundancy that cannot be avoided. I'm still working on it and it will come out eventually, but it will take more time. How much? I don't really know, it depends on how rigid or flexible Playmaker turns out to be.

2013/09/20

Grid Framework version 1.3.4 released

This is a small update, it adds the ability to offset the origin of the grid. It also adds a chapter to the manual about extending Grid Framework with your own code. There is nothing in there experienced .NET user wouldn't know, but I figure some user might not know about extension methods and might do things in a hacky way, so I added the chapter to it, along with example code.