Game Development with Unity 2D – part 3: GUI, or No Text is an Island

This is the third part of a voyage in Unity 2D development, where we document in video the design and development of a simple strategic game reproducing the Battle of the Teutoburg Forest. Here are Part 1, Part 2, Part 4.

Video

In this part three we are going to have health bars, labels and winning conditions; here is the video (also directly on YouTube watch it in HD for a better experience):

Download the updated project here; note that it has a dependency to the Daikon Forge plugin, which you must get in order to make the project run. This time you can also download the playable game here (both Windows and OSX). As usual the class sources are on GitHub.

What follows are just the notes I used for recording the video.

Gameplay

See the gameplay part.

Save on run script: ttp://www.daikonforge.com/dfgui/save-on-run/

Game design: the 1-3 rule, extraordinary cases for 0.

GUI: All I wanted was adding a label

image

Confused about GUI

Discuss the options:

– Native GUI and messages

– 3D text

Native is GUI is just fine for prototyping. But… no text is an island.

Apart from implementation problems (discussed here), we may want GUI elements to move with game objects, and we want a feature set as complete as possible.

– NGUI or next GUI – confusion

So we went for:

Daikon Forge

Se this great component here: Daikon Forge

Unfortunately the free version of Daikon Forge is incomplete so you need a Daikon Forge license to run the complete project.

On Code

Internationalization

Capture_716

See I18n class.

Forking this game

A question I found is “How to make it turn based”: it would be very easy for this project.

Refinements in code

See Yield used for javelins audio.

Thanks and what’s next?

As usual many thanks to gurus Daniele Giardini and Stefano Cecere for technical advice on Unity.

Legionary animationFor Part IV (of course Roman numerals Sorriso) I would like to explore the world of game strategy AI “Artificial Intelligence” in order to make our opponent smarter.

Follow me on Twitter where I post about game design, game development, Unity 2D and soon a crowd funding initiative for Genio, a historic and educational game about “building the Renaissance”.

Social Share Toolbar

Comments

  1. Francesco says:

    Thanks for the great tutorial, i’m learning a lot from this!
    just one question: I was trying to make the game larger, so with many more gameobjects (units, trees, etc.). Having so many gameobjects it’s quite bad for performance, so i bet it would be better just to render the “static” sprites of the environment through code, not actually creating a gameobject for it. Would that be possible?

    • Hi, thanks. I’m a total novice on performance issues (we’ll get to them), so I cannot give you a competent answer. But from what you write, I would distinguish units, which will have to be distinct gameobjects, from the rest. The fact of instantiating via code or via the GUI I don’t see how it can make any difference in performance: you are creating game objects anyway, no? For the environment objects, if you don’t associate behavior to them, they could be just a unique background sprite; but for the game as it is now, each little wood has its collider, so… You could group more elements in a sprite and use a polygon collider.

Trackbacks

  1. […] we start our tutorial, lets look at others. Here are Part 1, Part 2, Part 3, Part […]

  2. […] of a simple strategic game reproducing the Battle of the Teutoburg Forest. Here are Part 1, Part 3, Part […]

  3. […] This is the fourth part of a voyage in Unity 2D development, where we document in video the design and development of a simple strategic game reproducing the Battle of the Teutoburg Forest; here we take a quick detour. If you missed them here are Part 0, Part 1, Part 2, Part 3. […]

  4. […] a more general discussion of grids in games. If you missed them here are Part 0, Part 1, Part 2, Part 3, Part […]

Leave a Reply to pietro Cancel reply

*