The GEEC at CoderDojo Athenry

We were fortunate to be visited on 8 April 2017 by Ciara and Connor, two engineering students from NUI Galway who are part of the Geec team, building the Galway Energy Efficient Car – this is an electric car that a group of students have built from scratch, that is capable driving very long distances. For example, they estimate that it could cover the distance from Galway to Dublin for 14 cents worth of electricity!

Ciara and Connor both explained their roles in the project and answered many questions from enthusiastic members of CoderDojo Athenry. The CoderDOjo members found the Geec and its underlying technologies very interesting. It was fascinating to see that skills that many of them are learning (such as Arduino programming, soldering, and App Inventor) can be put to such great use.

The Geec

A team, a project and a car. The Galway energy-efficient car (better known as the Geec) is an eco-car designed and built by engineering students from NUI Galway. In May 2015, we competed with 196 other teams at Shell Eco-marathon Europe, where every car was challenged to drive 16 km on a closed street circuit in Rotterdam using the least amount of fuel or energy. The Geec represented Ireland’s first ever attempt in this definitive global ultra-efficiency event. We finished in the top half of the leaderboard in prototype battery-electric class, with a score of 287 km/kWh – roughly equivalent to 8,000 miles per gallon for a petrol or diesel car.

The talk covered the basics of how the car has been designed, built and tested, with the main focus on the electronics and software involved in the car.

Ciara Finan

Ciara is a final year Electronic and Computing Engineering student in NUIG. Her role on the Geec team is to implement the Data Acquisition and Display system. The system collects data from sensors on the car and then has to accurately display them in real-time to the driver. All the data is used to write out driving strategies for the marathon. It entails designing, testing and building a circuit with various sensors, an Android app to display the data to the driver and a logging system to save the data for further analysis.

Connor Duignan

Connor is a final year student studying Electrical and Electronic Engineering in NUIG. His role on the GEEC team is designing the power electronics system, which delivers power from the battery to the motor. This involves both software and hardware, with an Arduino being used as the interface between the electrical and virtual sides of the system.

Creators: Text Based Adventure

The last two weeks we were looking at something quite different: a text-based adventure system built in Unity. This was inspired by the Henry Stickmin games and also by the old 80s-style choose-your-own-adventure books.

158788261_51be05e517_z

Basic Program Design (Story Card)

The user is presented with a “story card”. A card consists of some text describing their current situation and (normally) a number of options to choose from.

Screen Shot 2017-04-05 at 14.12.23.png

Depending on which option they pick, the story branches from there, card-by-card, until it reaches an end (a card with no options).

Setting up a card is straightforward:

Screen Shot 2017-04-05 at 14.15.27.png

You enter the card description (the text the user sees on screen), the text that the user will see on each option button (the program supports up to four at the moment) and the card (or branch, but we’ll get to that later) to jump to when that option is selected.

There’s also the mention of “States to Set True/False” and we’ll explain that next.

Story States & Story Branches

We could have programmed the system entirely using only cards, but there’s one situation where this becomes tedious. Imagine that you have a choice; hitting a button for example. The consequences of this choice won’t become apparent until later in the story. If we only had story cards, then we’d have to branch the story immediately at his point, replicating the same steps on both branches until the point at which the consequences of your action played out.

Fortunately, there is a better way.

First, to remember the value we introduce the idea of a “story state’. It’s just a container for a true or false value. Cards can set the value of specific states when they are activated as seen above.

Screen Shot 2017-04-05 at 14.14.09

So, that covers remembering values, how do we then make use of them? This requires a “story branch”. A branch references a state and two places for the story to go (either of these can be a card or another branch). The value of the state determines which is picked.

Screen Shot 2017-04-05 at 14.19.01

 

Game Manager

This class looks after the story. It is responsible for updating the UI to the details of the current card, for handling the use clicking on specific buttons and generally directing the flow of the story. It also needs a StoryCard to start off the story with.

Screen Shot 2017-04-05 at 14.21.33.png

Project

 

The project, including a very simple story using a number of cards and also a couple of states, can be found here. There are two scenes in the project, Adventure which contain a simple story and Basic which is a good starting place for your own story.

Creators : Breakout / Mouse Controlled Camera

Screen Shot 2017-03-16 at 15.25.41

This week we looked at a version of the classic game Breakout. It was an exercise in showing how a game developed with 3D assets can, nevertheless, appear like a 2D game given the correct choice of camera and lighting.

The camera for this game is an orthogonal one. Unlike a standard perspective camera, which mimics how we actually see the world, things don’t get smaller as they get further away with an orthogonal camera. This gives a very flat look where we don’t see the edges of the game area, blocks, bat or puck. In addition, the scene has a single directional light which shines directly downwards. Shining straight down means there are no shadows around the sides of the objects as there would be if the light was at an angle.

This game does not use Unity’s physics for the puck movement. I found that the physics just didn’t give the consistent behaviour you’d expect from this game. Accordingly, I programmed the movement of the puck myself. The maths is a little more complex than I’d like but the intention is to keep the puck moving at a constant speed, even after it hits something.

Additionally, we worked quickly on implementing a mouse controlled camera. In the hierarchy, we created a camera rig from two empty objects, one inside the other, and put the camera object inside the second. Changing the Y rotation of the first empty then turned the camera around the vertical while changing the X rotation of the second tilted the camera around horizontal. The visual below show what a real world camera rig that behaved this way might look like; rotating at the base and at a horizontal pivot.

Screen Shot 2017-03-16 at 15.53.28

In our scripts we referenced the usual horizontal and vertical input axes:

     float horiz = Input.GetAxis ("Horizontal");
     float vertical = Input.GetAxis ("Vertical");

but in the Input Manager (Edit|Project Settings|Input) we switched these from the arrow keys to the mouse axes:

 

Screen Shot 2017-03-16 at 15.35.08 (Edited)

The Breakout project can be downloaded here and the mouse controlled camera project can be downloaded here. These projects are both saved with Unity 5.5.2f1, so please use that version or later when opening them.

 

 

 

Creators – Projects

material-design-joystick-wallpaper-flat-video-game-1486908

This week we spoke about possible projects. We also looked at games that you like so that we could draw inspiration from them.

When it comes to projects, there are a few questions you need to ask yourself:

What is the type of game you want to make?

Take a look here for an exhaustive list of game genres: https://en.wikipedia.org/wiki/List_of_video_game_genres

What is the setting for your game? Do you have a character in mind?

These choices will determine the look and tone of your game and are good things to decide early on.

What do I already know that will help create my game?

From what we’ve seen already this year, what things will your game need that you already know how to do?

What do I not yet know how to do?

There are things you might like to be able to do that you’re not sure about how to achieve; these are things to raise with your mentor. He’ll focus on these in the next few weeks. Also; check the Asset Store. There are many free things there that might help you complete your game. If you’d ultimately like to do everything yourself, look at these as items as placeholders to get the basic game working that you might eventually replace.

Finally remember:

BE REALISTIC IN YOUR AMBITION

You will find it hard to get time to work on your project and it’s your first project on your own in most cases. The most important things are to show something that is yours and something that is fun. Showing something that is overly complex but that is not fun is not as good.

Get your thinking caps on!

Week 4 2017 – Explorers – Piano

Hello everyone,

Thank you all for coming yesterday on such a lovely day.

This week we did a simple Piano.

piano

We only had to draw two keys, and then could duplicate these and change the names. The same applied to the code. The code is the same for each key apart from one small change so the note is the appropriate for the key.

REMEMBER! You need to make four changes each time you duplicate:

Change the name of the spite to the next Note

Change the name of the TWO costumes

Change the NOTE played

Piano2

Piano3

Remember, no sessions for the next two weeks. Have a nice break and for anyone with confirmations to attend next week I hope the weather is extra nice for you.

See you back on the 4th of March

Here are notes from this week in PDF cda-s6-week-4-17-piano.pdf

Martha

Explorers Week 2- 2017, Paint.net

Hello everyone,

Today we took a look at Paint.net, which is a drawing program. I quickly went through the menus but the best way to learn a program like this is to use it and experiment with it.

PAINTNET

The main reason we looked at it this week was because we will need it next week as we begin our modelling and stop/motion animation. After we take our photos we will be able to “clean them up before we bring them into Scratch as our Sprites.

snake

Next week, if the Moms and Dads could bring along a camera or phone along with the lead to attach these to your laptop.

And of course most important of all bring your imagination!

Here the full notes from todays session in PDF form. cda-s6-week-2-17-learnaboutpainting.pdf

Creators – Unity Terrain

Screen Shot 2017-01-31 at 22.17.05.png

This week we looked at the Environment asset pack and the creation of terrains.

Terrains are, at their core, nothing more than a grayscale image (shades of black & white) where the colour values are interpreted as representing heights. Black is is interpreted as zero height, white is interpreted as maximum height (as defined in the terrain’s properties) and every shade of grey in-between represents an intermediate value. The terrain editing tools provides brushes in a variety of shapes to raise or lower the terrain as desired.

Terrains in Unity don’t just allow us to define their heights. They also allow the painting of the terrain with a combination of different textures. In the Environment asset pack there are a selection of useful textures for painting a natural looking environment. These are a grass texture, several rocky textures and a sand texture.

Screen Shot 2017-01-31 at 22.18.36.png

Trees and grass are also enclosed in the Environment asset pack. These are also painted onto the texture with a brush, or in the case of trees, autofilled to a requested total number.

Once we had our terrain built, we added a character controller from the Controllers asset pack to enable us to walk around in it. We finished the session experimenting with the water prefabs that come with the Environment pack.

Please note that I won’t be at Dojo next Saturday (4th Feb 2017). Nonetheless, you are welcome to attend and join another group for the day if you wish to do so.

Creators – Unity Standard Assets

This week, in a fun and pretty free-form session, we looked at the Unity standard assets packs to get an appreciations of the wealth of valuable content they contain. 
We looked first at the Characters asset pack and tried the first-person, third-person and car controllers. 

We also used the Prototyping pack to place some basic house shapes and other basic level layout in our scene. 

Finally we played around with some of the effects in the Particles pack to see what was available there. 

Next week we will continue with another a session in a similar vein and explore the Environment assets pack and the creation of terrains to model exterior spaces. 

All ninjas are encouraged this week to play around with the standard assets, time permitting, and we may look next week at anything you’ve managed to create.