WordPress plugin: insert link to latest post (in category) on your menu

Instructions:

  1. Copy/paste this into your functions.php (TODO: convert it to a standalone php file, and make it into a plygin you can activte/deactivate)
  2. Create a new menu item of type “custom URL”
  3. Make your URL “http://#latestpost:category_name”
    • where “category_name” is the name of the category whose latest post you want to link to
  4. Make the name whatver you want to appear on the menu
  5. Profit!

Based on an idea (with some upgrading + bugfixes for latest WordPress in 2016) from http://www.viper007bond.com/2011/09/20/code-snippet-add-a-link-to-latest-post-to-wordpress-nav-menu/

/** Adam: add support for putting 'latest post in category X' to menu: */
// Front end only, don't hack on the settings page
if ( ! is_admin() ) {
    // Hook in early to modify the menu
    // This is before the CSS "selected" classes are calculated
    add_filter( 'wp_get_nav_menu_items', 'replace_placeholder_nav_menu_item_with_latest_post', 10, 3 );
}

// Replaces a custom URL placeholder with the URL to the latest post
function replace_placeholder_nav_menu_item_with_latest_post( $items, $menu, $args ) {

        $key = 'http://#latestpost:';

    // Loop through the menu items looking for placeholder(s)
    foreach ( $items as $item ) {
 
        // Is this the placeholder we're looking for?
        if ( 0 === strpos( $item->url, $key ) )
        {
 
        $catname = substr( $item->url, strlen($key) );
        // Get the latest post
        $latestpost = get_posts( array(
            'posts_per_page' => 1,
                'category_name' => $catname
        ) );

        if ( empty( $latestpost ) )
            continue;

        // Replace the placeholder with the real URL
        $item->url = get_permalink( $latestpost[0]->ID );
        }
    }

    // Return the modified (or maybe unmodified) menu items array
    return $items;
}

Better than Civ6? Bookmarkable links for Civ4 mod: Master Of Mana sources

Master of Mana was a great game – much better than Civ5, and from what we’ve seen of Civ6, Firaxis is still playing catch-up in a few areas :).

The author has disappeared, and his website has been taken over by scammers (not even going to link it), but the community has kept going the SourceForge-hosted copy of the source and continues to update it. The files are ordered confusingly (inherited from previous projects, and Civ4 itself, which was mainly shipped as a commercial game, not as a moddable game!). Here’s a few key links to find interesting / useful game-design gems:

The age-old question of Civ games: Roads and rivers in center of tiles, or edges?

Centers of tiles Edges of tiles
Screen Shot 2016-04-18 at 22.31.21

Screen Shot 2016-04-18 at 22.31.10

Pros and cons

  • Centers gives you STRAIGHT things (on a hex grid, it’s the only way to get straights!)
    • Roman Roads
    • Canals
    • Large rivers
  • Edges gives you meandering things (on a hex grid, centers only give wiggles at very large scale)
    • River valleys
    • Realistic medieval roads
    • Modern roads in mountains and hills (tend to wiggle crazily)
  • Movement is simplified with centers: If you’re on the tile, you’re on the road/river
  • Inhibition of movement is simplified with edges: Civilization games have traditionally given a move penalty AND a combat penalty to any tile-to-tile move that crosses an edge containing a river

My leanings…

One thing in particular that struck me from looking at the pictures:

Straight roads look so terrible that every single Civilization game since Civ1 has artifically wiggled them when rendering!

In particular, with 3D games (Civ4, Civ5 especially) this actively damages gameplay – it’s much too hard for the player to see at a glance which tiles are connected by roads, and to what extent. So much so that they cry-out for a “disable the wiggling effect on road-rendering” setting.

Also: I’m happpy to solve the “movement” problem by saying that if you’re in a tile that borders a road or a river, you are assumed to be “on” that road/river, with special-case handling under the hood that handles cases where two roads/rivers border the same tile. It increases the connectedness “for free” – but that’s how Civ games tend to do it anyway: encourage the player to put roads everywhere!

Thoughts on a postcard…

#unity3d remove yellow warnings you don’t need #unitytips

Screen Shot 2016-04-16 at 11.48.08

Warnings are very, very important in any compiled language: they tell you that the computer has checked your code and realised you “probably” created a bug; they even tell you something about what the bug might be.

..but the computer isn’t sure – if it could be sure, it would be a compiler Error (in red). So (in Unity) it’s yellow, and “optional”. But in those cases where it’s not a bug – and you know it! – it’s very annoying. Most IDE’s let you turn them on and off, Unity doesn’t … here’s how to fix it.
Continue reading

Simple #civ5 clone in Unity: hexes, movement, unit selection

Current features

commit 26eafb7865965fd5ef5ee3ad4863f00acf8d10a2

  • Generates hexes landscapes, with heights (Civ5 bored me by being flat-McFlat-in-flatland)
  • Every hex is selectable, using custom fix for Unity’s broken mouse-click handler (see below)
  • Any object sitting on landscape is selectable (ditto)
  • Selected units move if you click any of the adjacent hexes (shown using f-ugly green arrows on screenshot)

The green “you can move here” arrows look like spider-legs at the moment. #TotalFail. Next build I’m going to delete them (despite having spent ages tweaking the procgen mesh generation for them, sigh) and do something based on wireframe cages, I think.

Screen Shot 2016-04-11 at 22.59.25

Techniques

Hexes

I started with simple prototyping around hexes, but soon found that it’s worth investing the time to implement all the primitives in Amit’s page on Hexagon grids for games: http://www.redblobgames.com/grids/hexagons/

In practice, especially the ability to create a class that lets you do “setHex( HexCoord location, GameObject[] items )” and “getContentsOfHex( HexCoord location )” and things like “getNeighboursOf” … is very rapidly essential.

Mouse clicks in Unity

IMHO: work pretty badly. They require the physics engine, which – by definition – returns the WRONG answer when you ask “what did I click on?” (it randomises the answer every click!). They also fundamentally oppose Unity’s own core design (from the Editor: when you click any element of a prefab, it selects the prefab).

So I wrote my own “better mouse handler” that fixes all that. When you click in scene, it automatically propagates up the tree, finds any listeners, informs them what was clicked, and lets you write good, clean code. Unlike the Unity built-in version.

Procedural meshes for arrows

With hindsight, I should have just modelled these in blender. But I thought: I want a sinusoidal curve arrow; how hard can it be? I may want to animate it later, by destroying/adding points – that would be a lot of work with Unity’s partial animation system (it’s great for humanoids, less great for geometry) – but animating points in a mesh from C# code is super-easy.

In the end, I spent way too long tweaking the look, and on having 2-sided polygons that broke the Unity5 Standard shader by being too thin (on the plus side: I now know what that mistake looks like, and I’ll recognize it in future Unity projets. It has a very peculiar, unexpected, look to it).

I should have just made them in Blender, and – if I got as far as wanting to animate them – re-modelled in source code later (or found a “convert blender file to C vertices array” script, of which I’m sure there are hundreds on the web. Doh!

#lessonLearned.

Office suites (Word, Excel, Apple, Google) in 2016: Power-user experience

Every week, I have to use six different Office Software Suites:

  1. At school: Microsoft Office 2013
  2. At university: Microsoft Office 365
  3. At work: OpenOffice
  4. At home: LibreOffice
  5. Everywhere: Apple Keynote
  6. Everywhere: Google Docs

As an expert computer user (former SysAdmin), I’m often asked for help by people with non-computing backgrounds. When they see how many different suites I’m using, they’re … surprised, to say the least. Here’s a quick snapshot of what and why.
Continue reading

What makes a great #Unity3d asset? Which do you recommend?

Unity is still the only major game-engine with an effective, established Asset Store. This is an enormous benefit to game developers – but do you feel you’re making full use of it?

I’ve bought and used hundreds of Unity plugins, models, scripts, etc from 3rd parties. I’ve found some amazing things that transformed my development.

TL;DR: please share your recommended assets using this form: http://goo.gl/forms/G3vddOdRL3

Things we want to improve

This is a shortlist; if you’ve got areas you want to improve, please add a comment.
Continue reading

Which languages need Entity Systems libraries right now?

A few months ago I ran a survey to find out which programming-languages people were using with Entity Systems:

https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform

I’m about to publish a Patreon article on Entity Systems (here if you want to support me), but I wanted to put something up on my blog at the same time, so here’s a quick look at the stats.
Continue reading

LFG: I’m looking for CTO/TechDirector/Head of Mobile/Consulting roles in CA, TX, London, and Asia

TL;DR: experienced CEO/CTO/TechDirector with long background in programming, sales, and business management (Corporate, iPhone/Android, Games, Education) looking for strategic roles in USA, UK, and Asia.

After a year-out to do a post-graduate degree in Education, I’m looking for something new and exciting to do next. My primary goal is to boost a company or team rapidly and show significant outcomes – increased revenue or other KPI’s – either through Consulting or full/part-time senior leadership.
Continue reading

Improved interactive GUI for Snap-and-Plug (glue/vertex snapping for complex objects in #Unity3d) #screenshotsaturday

Some screenshots from today’s improvements. I’m moving gradually towards releasing version 2. Shortlist of changes/improvements below…

From this mess … to this:
Screen Shot 2016-03-12 at 14.59.24 Screen Shot 2016-03-12 at 20.43.32
Building some odd machines to test it works:
Screen Shot 2016-03-12 at 15.00.21 Screen Shot 2016-03-12 at 19.50.44

Features and fixes recently added

  • Use shaded, materialed meshes for in-editor handles, instead of flat ugly rectangles and tris
  • Click/tap a socket’s handle to directly select it in the Scene view
  • Meshes are resized to fit the user-selected “socket size” variable
  • Only handles that are facing you are rendered; HUGE improvement for complex levels/machines/buildings/etc
  • Only handles you can see are clickable/draggable; HUGE improvement for complex scenes (where accidental clicks happened too often!)

Making a night-vision shader for animals in #unity3d

In the FPS roguelike I’ve been working on, a core feature is that each ability modifies how you interact with the world – you see things differently, you move differently, etc.

Night Vision

I’m working on a tiny level demo to show some of my ideas together. I want one character that can see in the dark, something like the “InfraVision” of D&D.

Spec:

  • Character can see independent of the existence of lights in scene
  • Vision is imperfect, significantly weaker than daylight vision, in terms of details, colours, etc
  • Vision enables easy location + identification of other creatures

Screenshots

Here’s my orc (a test avatar I already had) sitting on top of a building:

Screen Shot 2016-01-19 at 03.23.56

Step 1: cancel the lighting

We use Unity’s “GetComponent.SetReplacementShader( Shader, “” )” to change the shader to a simple “Unlit” shader (Unity provides a built-in one).

	[ContextMenu("Enable dark vision")]
	public Shader shaderDarkVision;

	public void Start()
	{
		if( shaderDarkVision == null )
			shaderDarkVision = Shader.Find("Unlit/Texture");
	}
	public void EnableDarkVision()
	{
		GetComponent<Camera>().SetReplacementShader( shaderDarkVision, "" );
	}

Screen Shot 2016-01-19 at 03.23.45

Step2: Add a vignette to nerf it

I want the DarkVision to be significantly less perfect than daylight vision, so let’s add a simple vignette (Unity has downloadable examples of this shader in their docs, but I only found it after I’d got mine working!).

This took me a long time to get working, just to get accurate screen-positions of shader pixels – so much of Unity’s semi-proprietary Shader language is still undocumented, after many years. I knew all the maths, and had implemented the effect in OpenGL / GLSL in minutes, but it took an hour or so in Unity. And once it was working, I got sidetracked in tweaking the exact curve of darkness of vignette.

Screen Shot 2016-01-19 at 03.24.22

Step3: Convert to grayscale (infravision should be colourblind)

This was easy – simply average the r/g/b components of your Color, somethign like:

avg = (color.r + color.g + color.b ) / 3f;
color = float4( avg, avg, avg, color.a );

Screen Shot 2016-01-19 at 03.21.43

Step 4: several hours of experimenting with wild effects

I had some problems with this:

  1. It was too easy to see “everything”
  2. With no lighting-calcs, it was fugly
  3. With no lighting-calcs, it was VERY hard to do depth-perception. In a complex street, you got lost trying to tell which objects were near, far, blocking your way, or not.
  4. WAY too much detail on the textures is showing through: DarkVision should lose most detail, while keeping overall shapes clear

Here’s some of the things I tried and discarded. Note how the screenshots are from many positions – I ran around a lot, testing how effective the different shaders were for hunting a quarry (or fleeing an angry mob of AI’s).

Screen Shot 2016-01-19 at 02.57.08 Screen Shot 2016-01-19 at 01.34.27 Screen Shot 2016-01-19 at 02.26.02

Step5: FAILED: use depth-buffer shading

Unity staff: please write clear, correct, up-to-date documentation on depth-buffering as supported (or not) by your proprietary Shader Lab language, and with clear details on how this works in Unity5, not some hand-waving Unity4-maybe-Unity5-not-sure gumph.

I simply couldn’t get it to work. Using the proprietary built-in depth-buffer samplers either failed outright (0.5 across the sampler), or gave bizarre results.

Rumours suggest that we have to write 3 shaders: 2 for your proprietary system, and a third where we re-implement depth-buffer access by hand. This seems to me unlikely – I am sure Unity can handle that for you. This is the kind of feature that Unity’s ShaderLab does well (but no-one documents, and so it goes under-used by devs).

When you find or reverse-engineer instructions, ShaderLab is excellent. It’s such a pity that so often … you can’t.

Step6: Combine object-normals with plain greyscale

Ultimately, I fell back on “Fine, I’ll use the most basic bits of Shaders that even Unity can’t make confusing” – object normals. I faked shading Old Skool: each surface is darkened by dot-producting the forwards vector ( which by definition is (0,0,1) after the MVP multiplication stage) with the normal vector. That gives a float from 0 to 1, showing how much the surface is facing towards/away from the viewer.

Screen Shot 2016-01-19 at 03.26.07

I’m not delighted with this – it’s not quite the effect I was aiming for (I REALLY wanted to wipe more of the diffuse detail, but…). However, it does work quite nicely, and for now it’s more than good enough.

Benefits of final version

Here’s why I like it:

  1. Runs 100% independently of my main lighting – I never have to re-write it when changing lighting.
  2. Provides huge advantages at night time, or in low-light situations. More so the less lighting there is
  3. Provides depth-cues to the player, so that running quickly through streets (or tunnels) is still pretty easy to do
  4. Limits the over-powered nature by cutting down peripheral vision
  5. Runs very fast on GPU, despite crappy hand-written shader code (mostly because it doesn’t use any lighting calculations)

Survey: which language(s) do you use along with an #entitysystem in #gamedev?

A lot of us have been looking at alternative engines recently, and for me the biggest challenge is that the intersection between “game engine I can use easily” and “programming language I am willing to use” is quite small.

That got me thinking: if you started a new commercial ES today, what language does your audience want?

Short Google form

FYI: I picked the top 10 global languages by popularity, and then cherrypicked from the next 50 or so on http://sogrady-media.redmonk.com/sogrady/files/2015/07/lang-rank-615-wm.png – favouring ones where I have met people that I know are using them in gamedev today.

Support me on Patreon for early access to new Entity Systems articles

I love researching and writing about Entity Systems, but it takes me days or weeks to make a single article. I’ve written almost nothing for the past 18 months because on my current salary I can’t afford the time off work.

So … now I’m crowdfunding the long, detailed, in-depth ES articles. This gives me a way to spend the time I need to write each one while still paying rent, food, etc.

You don’t have to sign-up – I know there’s lots of people like myself who are in bad financial situations, and I hope all the articles will be made free eventually. But if you’ve found my ES articles useful, and you want more of them, and you can spare $5 once every couple of months, please do.

You can sign up here: https://www.patreon.com/tmachine

Brief look at obvious #UX mistakes in Civilization 5 (and why you should never buy another Firaxis game)

Civilization was one of the best games ever designed and shipped.

Civ5 is tragic. It’s one thing to launch a AAA title full of nerfed gameplay and obvious, in-your-face bugs, but quite another to leave them unfixed for years after. It’s one thing to officially fix your bugs only in pay-for add-ons – but quite another to keep those add-ons at full price for years after they released.

Here’s a quick view of what’s still broken in Civ5 today, if you buy it direct in the online stores:

  • The game autosaves every 10 or so turns; this has NEVER been correct for Civilization (from memory, the original game used to save every other turn by default (maybe not; running out of disk space was a real concern back then); modern teams at Firaxis seem to be too amateurish to implement this. Civ 4 used to crash so much that putting it on “save every turn” was a requirement).
    • No-one at Firaxis should be “unaware” of the need for every-turn autosaves
    • I struggle to think of a rational explanation; best I can think of so far is some weak game-designer thinking that autosaves are “cheating”, so they decided to deliberately break the concept so it only half worked.
    • I haven’t yet found an easy way to un-break this in civ5. Given how crucial it is to the game, and how it’s been present in every previous version, it should be in the game-options, but it’s not. That’s two bugs for the price of 1!
  • The user-interface for moving units is more broken than in any version of Civ to date. Civ1 had a perfect system (but predated the existence of a mouse on every computer): units moved where you told them by pressing numeric keypad keys. Civ3 and Civ4 had “automatic” pathfinding that was badly broken: it often walked your units into 100% certain death for no reason.
    • Civ5 takes this one further: if a unit is selected and you move across another unit, civ5 moves BOTH units, causing double the catastrophe.
    • This automated action – that IME is almost NEVER what the player wanted to do, and is extremely destructive, frequently causing game-losing events – cannot be undone. This breaks the cardinal law of user-interfaces: if you do an automated, un-asked-for, action (which you generally shouldn’t) … then you MUST provide an Undo.
  • Civ5 also has a strangely bad algorithm for pathfinding: it generally takes 1-4 seconds to run the algorithm during which time the game lies about the game-rules, and claims that your unit is “immovable”.
    • This appears to be a junior programmer discovering “asynchronous” coding for the first time in their life, and not realising the obvious side-effects
    • I have no idea why the algorithm is so insanely slow. It is slowest in a huge game, but even in a tiny game, with nothing happening, and only a tiny game-world, it randomly takes anywhere from no time to 1-2 seconds to “switch on”
  • The buttons for “required” actions are deliberately placed in the worst-possible positions: the far OPPOSING corners of the screen.
    • This breaks the most basic and obvious guidelines in UX design
    • For bonus points, the buttons don’t get larger on large/wide screens. Those buttons are so small and so far away you rarely see them, let alone find it easy to press them
    • It’s as if the Firaxis team were out to beers with the misguided team at Microsoft who decided that Windows 8 would rely upon a single “magic pixel” to activate core functions, and thought: “hey, I know how we can really mess-up our players! That impossible-to-hit pixel idea is great! It’ll make the game so much harder!”
  • The interactive HUDs giving critical information on the global state of politics, that made Civ4 a significant improvement over previous versions – and that were extended massively by the community, increasing gameplay without removing any challenge … have been deleted.
    • The question begs: we know Firaxis has many people who’ve played the previous civs; how on earth did they forget how critical and popular the dashboards were?
    • The game is almost unplayable without dashboards. It’s a waste of time: you have to play solo, or click through a series of menus every single turn simply to find out the current status of your opponents. A massive step backwards in gameplay.
    • Best explanation I can think of: failed game-design strategy to “make it more mass-market friendly”.

That last point leads into the legion of game-design failures in Civ5. As I understand it, most of the game was “Designed” around the idea of dumbing-down: apparently the Youth of Today are so stupid and lazy that they cannot play games that are deep, enjoyable, or interesting. The way to make money is to make games idiot-proof with as few options as possible and no meaningful decisions.

Ironically, this is the exact opposite of what the legions of Civ fans had shown they valued in the Civ franchise, via the overwhelmingly popular mods for civ4. Master of Mana added depth, difference, more depth, more variety, more difference, and yet more depth, across the board. It hacked the tech tree into becoming 5 different tech-trees, all running in parallel (WTF? Oh, yes!) – and players loved it.

One day, I may write a post on the flow of game design, successes and failures, and the #facepalm that civ3 and civ5 were (between the two of them, both abject failures). Strangely enough … the two things in civ5 that I remember the community being most afraid of (hexes and 1-unit-per-tile) … seem to have worked fine. The radical changes were a success; it was all the easy, “you can’t possibly screw this up”, parts that the dev-team screwed up. And that is why I consider civ5 “tragic”: they got the hardest bits right, despite the odds … and tripped over their own shoelaces messing-up the easy bits.

Civ4 had a similar trajectory, with two differences:

  1. It appeared to be a legitimate mistake: they didn’t realise until after shipping how broken their own game was
  2. Within a couple of years, the add-ons were being bundled with the core game for free, or at most five dollars. As they should be: they were mostly re-adding content that had been removed, and fixing launch-bugs, with only a tiny sprinkling of extra content/changes.

For Civ5, someone in charge (publisher? studio director?) appears to have decided: “hey, we shafted the consumers and exploited the franchise well there – but we could do so much better! Let’s do it deliberately this time: save money by deliberately shipping incomplete product, then use online market-controls to force everyone to pay 3 times to get a working game! We’ll be RICH!”.

In their defence, Firaxis did ship one major content update for free, which was wonderful: they added retina support. That’s unnecessary (not a bug, retina’s didn’t exist when it came out) and nice to have – but in no way justifies ignoring the rest.

Simple #unity3d bugs and flaws fixed by Entity Systems – number 1

I periodically write massive long documents detailing all the bugs in Unity that I know, have memorized, and have to workaround on a day-to-day / hour-to-hour basis. But it makes me so angry and frustrated – so much terrible coding, so little technology-leadership at the company – that I end up deleting it. Life is too short to be daily reminded how crappy (and yet easy to fix) our tools are.

Then, every 6 months or so, when people ask me for simple examples of how ECS’s fix Unity, I have to wrack my brains for something simple.

So I’m going to start blogging simple examples as I run into them, with only enough context for me to understand them. Here’s the first…
Continue reading

Unity: the “real” version 5 just released (#Unity3d 5.2 fixes many severe issues!)

A new version of Unity is now out – https://unity3d.com/unity/whats-new/unity-5.2 – and it’s a doozy.

I don’t normally blog a blow-by-blow account, but this set is particularly interesting.

It suggests the tech team has been focussed on fixing many “critical but un-sexy” problems. That is a noticeable change in direction from the past few years. Possibly this is a one-off to get Unity 5 working properly.

If you’re still using Unity 4.x, it is finally safe to move to Unity 5.

Unity 5 is not a complete replacement for Unity 4 – there are still major featuers of 4.x that have been removed from Unity 5 and have no upgrade-path – but it’s finally production-ready (or very nearly). That … is big news!

Hilighted improvements / fixes / changes

Please note: there will be a lot of negative comments here; that is inevitable, considering most of the change-list is “things that were broken, or wrongly implemented, or poorly designed – and are now not”.

To be clear: I’m pleased and excited by the overall shape of these changes.

Graphics: Added CullingGroup API, which allows you to specify a large set of bounding spheres that are integrated into the culling pipeline and subjected to frustum and occlusion culling

Unity has (amazingly) never had built-in culling accessible by developers, which is almost unheard-of in game-engines. This suggests we’re getting towards it (although spheres are only a first-approximation for culling, and I wonder how deep the interaction is with Unity’s pipeline here. I’d assumed we’d get access to something more like BSP)

Application.UnloadLevel. Unloading scenes is now possible while the game is running. References to lightmaps are cleared but you have to call Resources.UnloadUnusedAssets() to actually unload them.

Scenes in Unity are very much FUBAR as a concept – they were created by people who had very little understanding of computer-game design and development. Ideally, we’ll see Unity remove the whole “Scene” concept in a future major release, but in the meantime this is a significant step towards reducing their weaknesses, which is good to see.

Layout elements under a ScrollRect component may not work properly

No s***, Sherlock! Yeah, most people using Unity’s “new GUI” have found it’s fundamentally broken in a bunch of places. Good to see Unity working on this, and hilighting some of the issues – but really they need to create an entire webpage listing “the following parts are broken, don’t use them – or beware if you do”.

Right now, you tend to waste hours, half-days at a time … re-discovering known bugs in Unity’s GUI.

Scene view picking in linear color space does not work for DX11 when MSAA is used (quality: fantastic)

If you’re on Windows and have the highest quality settings, this is lethal: Unity simply doesn’t work. But it’s coming in an emergency patch very soon.

Mecanim: Playable API.

If this does what I think it does, then it was essential back when Mecanim was released (3 years ago); glad to see it’s finally here.

between 5% and 30% lower CPU cost for rendering

That’s an enormous speed-up for an engine as old as Unity – this is big news. Reading between the lines, the speed up is partly a side-effect of them making it a bit more multi-threaded (which became normal for game engines many years ago).

If we thought that was a lot, wait till you see:…

Particle rendering optimizations (especially for VR), with speed improvements varying from 15% to 50%

… 50% performance improvement! Wow. Name-checking VR here is probably the key item. We keep seeing VR’s extreme performance-requirements forcing engine-makers to up their game, and dig deep to find perf boosts. The “minimum” hardware reqs for basic VR rigs are very high even now, several years after Oculus Rift launched.

UI now uses multithreaded batching & geometry generation backend

This was the minimum we expected from the “new GUI” when it launched in Unity 4.6 almost a year ago. This fix brings the GUI most of the way towards being “production ready” … ironically, 6 months after Unity changed their website to hide the existence of the “old (but works) GUI” and pretend it didn’t exist.

Added parameter QueryTriggerInteraction to all physics queries (raycast, spherecast, overlap) to allow any query to override whether or not the query should hit Triggers

This is patching a MAJOR design bug in core Unity that has plagued Unity for many years. I want to play with this some more, and see how much we can un-**** Unity’s ****ed ray-casting system using it.

(I don’t believe any experienced game-developer would have accepted Unity’s original design here – it was clearly a terrible approach that would cause never-ending head-aches when making games. It mixed concepts that were very obviously unrelated and distinct)

Fixed Function shaders work on all platforms now (including consoles)

This one has been blogged about extensively by some of the graphics team, IIRC.

In my experience, Unity’s shaders have been OK, with a few that were terrible (e.g. all the Mobile ones), but the framework which holds them has generally been excellent: it’s isolated us from the pain and suffering of GPU-specific shader bugs. This house-cleaning doesn’t make much (if any) difference to most of us, but apparently keeps Unity’s internal code clean in a way that will facilitate rapid changes and improvements going forwards.

2D Rect Mask

TL, DR: “we finally implemented masking properly in the new GUI”.

See previous comments on the new GUI, and how it’s getting much closer to production-ready.

UI: Dropdown control

Yes, really – Unity has finally added the “dropdown”, which has been a global expectation in UI design for 20+ years (it was made compulsory in web-browsers back in the 1990’s).

Editor: Remove legacy Mac OS X corner window resize behaviour

Apple told devs to remove this … um … about 3 or 4 years ago? At first, it was broken (couldn’t resize windows), then it was annoying (Unity added optional resizing on all edges, but put an illegal resize-hot-corner in bottom right that broke all EditorWindow code, because they made it a private API).

Working around that on Mac … forced you to mildly break things on Windows.

TL, DR: custom editors (as found in many/most of the best Asset Store plugins) will now be a little less-broken across the board.

Substance … All crashes and hangs at build time, level load/change time, playmode entry/exit should be gone

Yay! I’ve not been using Substance, but I’ve met several developers who’ll be breaking over the champagne over this, given how miserable they’ve been about crashes and hangs with this in the past.

CanvasRenderer now takes a Mesh instead of List this allows for the use of imported meshs as part of the UI

Without this feature, the new GUI was not usable in most non-trivial games. It’s hard to over-estimate the importance of this for declaring the new GUI production-ready.

Allow sprites to be dragged into scene view in 3d mode

Small but sweet. It’s a little thing, but makes a big difference to the frustration level of the user; in my experience, these things are often the real reason why you sacrifice the cost-savings and benefits of your own engine and use something like Unity instead.

i.e.: with your own engine, you can’t afford the time/money to polish every small interaction; 3rd-party game-engines can shine here, and should take more advantage of it.

I sometimes mention stuff like this as suggesting that Unity’s senior management team are out-of-touch with their product. Unity’s early community loved it largely because of small things, but as Unity grew, the company stopped sweating them. I suspect time will eventually tell that was a huge strategic mistake.

Improved Export Package window (now uses a proper tree view)

This window hasn’t correctly worked for at least three years; converting it to a “proper tree view” might – finally! – make the “Export Package” function do what it’s defined to, instead of exporting the wrong things, breaking keyboard and mouse interactions, etc.

(most of the bugs appeared to be a side-effect of the non-maintained, half-implemented, custom tree view code)

Make sure ObjectField and Object Selector shows icons for game objects and prefabs

Co-incidentally, I tweeted about this recently: Unity could make their engine noticeably faster to develop with if they provided visual feedback on these fields.

It’s embarassing, almost shameful, how poor the UX is on these fields today. By the sounds of things, this patch merely makes them “less crap”, rather than fixing them – but the last 5 years has been so awful that any improvement is welcome!

Selection.selectionChange callback triggered when selection changes

To call this “important” is somewhat of an understatement.

Substantial areas of the Editor API’s are surprisingly poorly maintained by Unity. The bugs undermine people each time they try to use one of Unity’s overwhelmingly greatest features: its extensibility.

Graphics: Added a quality setting ‘Shadow near plane offset’ to allow working around shadow pancaking artifacts

If this does what I suspect, it will make it trivial to fix a lot of common, frustrating “why do my shadows suck? OMG! UNITY SUXXS!!!!” situations.

Mecanim Improvements

SO MANY.

I don’t use Mecanim: it’s been slow, clunky, buggy – and it solved the wrong problems at launch. It felt more like a marketing excuse rather than a developer feature. For me, working x-platform and often on mobile: not very useful.

However, looking at how long the list of fixes is … it might finally be worth using it. In context of all the other changes we’re seeing – maybe production-ready for general use now?

(modulo: the performance. Last time I checked, it was still way too slow for cross-platform games unless you were happy to have a relatively small number of animated objects)

Go check it out! If you’re a long-time Mecanim user, let us know what you think of this list of changes!

Now a TerrainData object embedded into a scene (created by script) allows scene objects being selected as tree prefabs

Unity’s Terrain system was implemented using a nasty, ugly hack that should never have been used.

As I understand it, that was in itself an attempt to workaround some problems with the fundamentally broken – and allegedly “unfixable” – Serialization system that is core to Unity, but is too much code for anyone to fix (and will be thrown out / fixed / replaced around Unity v6 or v7. Maybe).

This change reeks of a “workaround to a workaround”: you can’t create TerrainData in the scene (which should be the ONLY option!), but you can artifically create one if you write a script to do it for you. Either way, it’s good news – TerrainData Assets are a common source of project-corruption, because they’re abusing a feature that wasn’t intended for this.

Stacktrace logging: Allow to log full (native/managed) stack trace when log is printed, the option is available in the console window in top right corner popup menu.

OMGWTFBBQ!!!!!!!!!!!111!11111!!!!11!!!1!

I frequently discover major bugs in Unity core; there is never anything I can do about it because Unity strips / deletes all stack traces (in most cases) before outputting anything.

If this fix does what it says on the tin … WOOOHHHOOOO! … we can finally workaround Unity crashes (by debugging them!) and give Unity much more detailed and accurate bug-reports (leading to greatly increased chances of them fixing bugs).

Cross those fingers…

Fix Cursor

As I recently tweeted, Unity’s support for custom mouse-cursors was recently broken. That’s a huge pain given most games today use custom cursors. Several fixes here, looks like they’ve cleaned them all up (I hope).

Fix possible data loss on Windows when renaming folder with locked files

:O

Fix occasional recycle bin bypassing when deleting assets on Windows

:O

Serialization: Fixed not being able to serialize a field called “Base”

:O

UI: Stop disabled graphics from blocking raycasts

If this is what I think it is, it’s another example of “should have been fixed before 5.0 was released” – but I’ve had so many problems with the bad system of Unity raycasts that I go out of my way to avoid them anyway.

Core: Fixed hang when passing large arrays to the Undo system

Sounds unexciting, but … I think I’ve encountered this on some of my projects: unexplained hangs that came out of nowhere and destroyed my ability to keep working on one particular game, related to Undo.

Note: I keep saying this in public: Unity’s Undo system simply Does Not Work, it’s appallingly buggy. As far as I can tell, the person who originally wrote it had little or no experience of what they were doing, and didn’t consult the literature to find out how to implement Undo systems correctly.

Some days, I genuinely feel it would be better for everyone if Unity removed the “ctrl-z” keyboard combo, because so often when you press those letters you corrupt your game project. A lot of the time, you don’t notice that Unity has just corrupted your project – not until much later, and then you don’t realise that it was Unity’s broken Undo that caused the corruption. Instead, you blame yourself, or your co-workers. Seriously, it’s that bad.

(I’ve stopped bothering logging bugs against it)

Importing: Changes to scripts are now correctly processed synchronously, fixing a range of issues with scripts relating to asset processing at import time

Subtle, but … I suspect this fixes a LOT of bugs we see on larger Unity projects, where you’re frequently hot-loading complex sets of scripts, assets, inter-related dependencies, custom asset-processors, etc.

…the end

So that’s it. What do you think? Any other major items you notice in the release notes that will make your life significantly better?

What’s still broken?