Day 2: Switches and Cities

Wow. I am really happy today.

My wife went for a conference for one and a half weeks (which is NOT why i am happy 🙂 ) but I will visit the rest of my family for most of that time from tomorrow onwards.

I hope to get inspiration for the coming weeks and help out here and there whenever I am not working on the project.
That is one good reason to be happy, but the other one is that I feel I made some nice progress today.

Planning the project

After I brought Dani to her train, I starting planning and setting milestones for the upcoming weeks. I want to follow short iterations as I really enjoyed working with agile methodologies, and want to continue that as much as I can even alone.
As mentioned above, I plan to not from my home office desk, but also work from other places and I am frankly not a paper guy – at least not for something I want to remember. My project is hosted on Gitlab as a private repository – there is a free plan for hosting even private projects, in contrary to GitHub for example.
Aaaand it also comes with some project management capabilities in the free version :o. Kudos for that!
So after I planned my milestones with some sketch of their content as well as the first tasks for the first milestone, I started to enter that into my Gitlab.
So my plan is to launch in the app store Mid November and until then have several stages of polishment. After that I want to add some features that are not necessary, but that I want to have: Like ways to compare yourself with the world (of the other 5 people, that played the game).
GitlabMilestones
Here you can see my milestones. Its 6 weeks Mondays – Fridays. Probably too ambitious.

Starting to code

One of the first things that needed doing, was the possibility for the user build switches. Initially I want to restrict the available tiles to straights, curves and “simple switches”.

The last version of the code was very brute forcey, but I came up with a better way, which will allow me to easily add further tiles: each Tile gets a number depending on the sides that are connected. And each possible edge sets a bit of that number. Its not rocket science, but it helps 🙂

firstSwitches
This system was in place before I went for lunch. You can still see the white tiles.

 

The Afternoon

In the afternoon, I added the simple switches as pictures, just to get it into a presentable shape. I am happy with how it worked out. I am working with Gimp, and use the #steamlords palette from “Slynyrd” @rayslynyrd https://twitter.com/rayslynyrd but it is current “extended” it with gimps color gradient. I am not yet sure about the final style, and if I might not need more colors for the ground, rails and wooden planks. Also I am not sure, I can make the city tile addons (see below) visually distinct, but I will see that in the next days.

buildingsandsomeswitches
Here is with updated switches and a first version of the cities.

Cities!

The last thing I managed to build today, is a system to add Cities to the board. In my initial design, cities were only allowed in straight tiles, and were not even cities but depots.

The games underlying idea is making something fun with finite automatons. Initially the trains would pass depots and attach cars, but then a problem comes, once the trains would get to long. Also, I would need to pixel a depot with a car as well as a switch that leads to the depot, all on the same tile. To little space on a tile, especially for mobile.

So I switched to cities, and trains will now have to visit cities in a certain order, which is essentially the same, but less of an headache for the length of the train – I can now have a fixed train running around the board.

In the current concept, the city should be made invisible when the user hovers over it, since it might block the underlying rail structure. It took me quite to set the alpha value of the color:  In the Unity Editor you can set the color values to something between 0 .. 255. And that is what I did in my script:

Color half = new Color (255,255,255,128);  //sounds right for a RGBA color value

Well… not so fast. The thing did not get transparent at all. I was scratching my head. Trying the to change getComponent<spriteRenderer>().material.color, which was even funnier, because the sprite was looking really bad afterwards…

As always, in the end its debugging to the rescue:

ColorCode

The values need to be floats between 0 and 1. 128 (or any other number > 1) is capped at 1 -> no transparency. I am not sure about the whole system, but maybe a warning would be nice?

Here is the final version of the stations for today.

day2end
The days work: cities get transparent when hovering.

What do you think? Could this be fun? Is the 18 colors steamlords palette enough for desert, rails, and cities and the whole UI?

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s