Moving data from MySQL to Google Sheets with PHP

I recently needed to pull data from a database and add it to a google spreadsheet. Google provides an API for working with Sheets, but like many of their APIs, the documentation isn’t great. I’ve got my program working and figured I’d document my steps for future me and anyone else who needs it.
Continue reading “Moving data from MySQL to Google Sheets with PHP”

Board game programming tutorial – Part 3

This is the third part in my tutorial for converting a board game for a touch table using Unity.

The first part covered all our reuse code and conventions, setup the project and created a main menu.

The second part built the UI for a very simple game called “No Thanks!”.

This part will write the events to control the game, add buttons to the UI for the players to use to play the game, and finally add animations to the game.

Continue reading “Board game programming tutorial – Part 3”

Board game programming tutorial – Part 2

This is the second part in my tutorial for converting a board game for a touch table using unity.

The first part covered all our reuse code and conventions, setup the project and created a main menu.

This part will build the game and player UIs for a very simple game called “No Thanks!”.

Continue reading “Board game programming tutorial – Part 2”

Board game programming tutorial

Now that I have created several board game conversions in Unity, I thought that it might be useful to create a tutorial that describes the process that I go through to make a game.

In this tutorial, I’ll start with a common set of code from prior games and some basic art. I’ll create a new Unity project, import all the reuse code and plugins that I use, and make a complete game.

There is a set of videos to go along with this post which show all the steps that I perform in the Unity game builder.

I’ve also saved my Unity project at a few points along the way so that you can skip ahead or make sure that your project matches mine.

In this post, I’m going to cover all the reuse code and the reasoning behind it. I’ll setup the project, import all the plugins, scripts and assets that I’ll need. Then I’ll build the main menu.

In the next post, I’ll build the UI for the game itself and create the scripts for modeling the game. In the third and final part, I’ll add game control events and animations. Continue reading “Board game programming tutorial”

Touch table Village

I’ve completed a touch-table version of the board game Village.

Village has an interesting mechanic where you manage the life and death of your workers. All your workers start as farmers and can be trained as specialists. Actions take “time” to perform, and when enough “time” has passed, a worker dies. A limited number of each type of worker is rewarded with fame and victory points upon death while the rest get an anonymous grave. The key is making the best use of your workers and their time while  trying to arrange a good death.

Continue reading “Touch table Village”

Websocket server for remote connections to touch table games

I am considering creating a system for touch table games so that they can be played both by people sitting around the table and by individuals at their own computer.

This post will talk about what I’d like to do and show the steps that I’ve taken to setup a websocket server on my domain and to connect to it from Unity.

Continue reading “Websocket server for remote connections to touch table games”

Age of Discovery and more about complexity

I’ve completed the touch-table version of Age of Discovery and this article compares this project to my previous project which was Medici.

ageofdiscoveryboardFor both being touch-table conversions of board games, they were very different projects. Medici was small and took less time than I expected it to. Age of Discovery was a large project, and it ended up being even longer than expected.

 

Continue reading “Age of Discovery and more about complexity”

Touch Table Medici and a discussion of project complexity

I’ve completed a touch-table version of Medici

mediciboard

Medici was an interesting project because of how simple it was. It is my first conversion project that has taken significantly less time than I thought it would and is also the quickest that I’ve been able to make a new game.

Continue reading “Touch Table Medici and a discussion of project complexity”

Programmatic use of windows search

I recently wanted to add a photo search capability to my Timeline program and discovered that you can open a windows explorer with a custom search. You can also type these searches directly into the address bar in a windows file explorer.

The key is the search-ms protocol. It allows programs (like windows explorer) to directly query the windows search index. The parameters to this command are somewhat obscure, but it is very flexible and it can be used to perform any search that you could perform with the graphical search function in the windows file explorer.

For my application, I wanted to search for all photos that were taken between two dates (the start and end date of an event on my timeline). The idea is to quickly find all the photos that I took on a trip or at an event.

The general syntax for the search-ms command is:

search-ms:query=<query string>&
          crumb=<location and display parameters>&
          syntax=<NQS or AQS(default)>

The query string can be any valid SQL or AQS search. For my application I wanted to query on the date my photo was taken which windows stores as “datetaken” and I wanted to query over a range of dates. Dates have to be in the YYYY-MM-DD format, and a range is specified with “..”.

I used the crumb specifier to target a just the “My Pictures” special folder. To specify a location you put crumb=location:<URL encoded path>. For a special folder you do crumb=location:shell%3a<folder name>.

So my final query string is:

search-ms:query=datetaken:2015-01-01..2016-01-01&crumb=location:shell%3aMy%20Pictures

You can type or copy this into your search bar to see all the photos you took in 2015.

From C# you can start a process by giving the name of a file that has a default program association. So launching a file explorer with a custom search is as easy as:

System.Diagnostics.Process.Start("search-ms:query=datetaken:" + 
  Start().ToString("yyyy-MM-dd") + ".." + End().ToString("yyyy-MM-dd") +
  "&crumb=location:shell%3aMy%20Pictures");

Touch Table Castles of Burgundy

I’ve completed a touch-table version of Castles of Burgundy. In the board game, players build up their estate with tiles drawn from a common area. Each turn, players roll two dice and use the results to pick tiles, place tiles or sell goods. Placed tiles give the player victory points, extra actions, or advantages in later turns. Each player manipulates their own estate and only interacts with the other players through competition for the tiles in the center.

pic919792

 

Continue reading “Touch Table Castles of Burgundy”