Skip to main content

Having fun with Unity and PlayMaker

While I normally post on architectural CAD, BIM and visualisation, this post will show you a more playful endeavour: making a small Game.

Udemy Learning Platform

I've started migrating my tutorial videos to the Udemy platform instead of Youtube playlists, as they allow a more structured and focused learning experience. Whenever you engage in a course, you have access to it forever. They also have mobile clients, so you can watch on your iPad and work on your computer at the same time, if you want. The mobile app can even download videos for offline viewing or play them at a higher speed.

Game Mechanics

Last week, I released my first actual game-oriented course. It is a small clone of a Flappy Thingy, but only focusing on the game mechanics: moving things, reacting on collisions and keeping track of a score. I completely skip the actual game art, the textures, the sounds and effects, as I think that if you are making such a game, you'd better tweak it completely so it doesn't resemble another game. Better yet, extend the dynamics into something original.

While I am aware that architects are usually not making games, you might want to add some Game Mechanics in your architectural visualisations, to make them more compelling and engaging and have small rewards for your virtual visitor.

If you have an account on Udemy, you can register for the course. The price at the time of writing this post is $29. While I am a bit wary of going a more commercial road, I can also announce that the course will be increased to $39 when I release a second chapter very soon. There I tackle a little brick out game, to stay with the same theme.

flappy_capsule_pm-2015-01-30-08-57.png

https://www.udemy.com/create-flappy-game-mechanics-with-unity-and-playmaker/?couponCode=flappy-mechanics-for-9

This link will give you the course for $9 and you’ll get access to all future updates.

Unity & PlayMaker

You need Unity of course, but the free version is just fine. However, you also need PlayMaker. This is a visual programming system for Unity, so you can create interactive games and apps, with no direct coding.

You add Finite State Machines (FSM) to GameObjects, which encapsulate the behaviour. In these FSMs, you define States. At any point in time, an object is on only one state. Each state can have multiple Actions, which do something. You can also define Transitions, to go from one state to another. Transitions require Events and Events can be called in many Actions.

Let me clarify this with a Flappy example from the first chapter. The bird, which is simply a 3D capsule, has an FSM to control its movements. We’ve called this “Flapping”.

It has a state called “idle”. This is the START state, as indicated by the START event above it. Inside the idle State, we are waiting for the player to press any button or press the mouse or touch the screen. This is captured in the Any Key Action. This action calls the “up” Event we defined.

There is a transition from the up event on the idle State to the “Flap Up” State. In this new state, a physics impulse force of 45 is added to the GameObject in the Up direction (Y in this case). After this force is added (by the Add Force Action), there is a very short Wait Action (0.05 seconds) and then we transition back to the idle State through the FINISHED Event that is provided by PlayMaker for us.

hero_flapping_detail-2015-01-30-08-57.png

The rest is explained in the course. You can also download a finished example as a Package to import into Unity, but I suggest you re-create it step by step, to have a better understanding.

Don’t forget: there is a second chapter upcoming and if you register for the course, you’ll get this with no additional cost.

Any feedback or reviews on the course are highly appreciated! But be honest and fair.

Comments

Popular posts from this blog

Improve usage of BIM during early design phases

When I was collecting ideas for a book chapter on BIM (that seemed to never have emerged after that), I collected 10 ideas, which I believe still reflect good recommendations to improve the usage of BIM during the early design phases. These ideas are related to BIM software, but you can apply them in any flavor, as long as you can model with Building Elements, Spaces and have control over representation. Introduction This article gives an overview of several recommendations and tips, to better apply BIM applications and BIM methodologies, in the context of the early design phases. Many of these tips are applicable in any BIM application and they are based on experience gathered from teaching, researching and using BIM software. Sometimes they could help software developers to improve the workflow of their particular BIM implementation. Tip 1 : Gradually increase the amount of information In the early design phases, the architect makes assumptions and lays out the main design in

Getting BIM data into Unity (Part 9 - using IfcConvert)

This is part 9 of a series of posts about getting BIM data into Unity. In this post, we’ll discuss the IfcConvert utility from the IfcOpenShell Open Source IFC Library to preprocess an IFC model for integration with Unity. This is (finally?) again a coding post, with some scripts which are shared to build upon. Conversion of IFC into Unity-friendly formats The strategy with this approach is that you preprocess the IFC-file into more manageable formats for Unity integration. Most Web-platforms do some sort of pre-processing anyway, so what you see in your browsers is almost never an IFC-file, but an optimised Mesh-based geometric representation. However, it wouldn’t be BIM-related if we’d limit ourselves to the geometry, so we will parse the model information as well, albeit using another, pre-processed file. IFC to Wavefront OBJ I used a test IFC-model and used the IfcConvert-utility converted it into OBJ en XML formats. The default way to use it is very simple:

Getting BIM data into Unity (Part 8 - Strategies to tackle IFC)

This is part 8 of a series of posts about getting BIM data into Unity. In this post, we’ll discuss IFC as a transfer format towards Unity. As with the previous post, this is not a coding post, although hints and examples are provided. Open BIM and IFC Everybody who ever met me or heard me present on a conference or BIM-lecture will not be surprised to hear that I’m a strong believer in the Industry Foundation Classes (IFC), an open standard, with already two versions published as an ISO standard, being IFC2x2 and IFC4 (but surprisingly not IFC2x3 which is widely used). In the ideal world, this would be the format to use to transfer BIM data into another environment, such as Unity. So what are our options? Looking in the Unity Asset Store Assimp is a library which supports multiple formats, including IFC. https://assetstore.unity.com/packages/tools/modeling/trilib-unity-model-loader-package-91777   I did a few attempts, but alas without any success. It is possib