This week I made simple interstellar travel UI. It was a strange journey.

I originally started my design by going to 70×22 sized screen in order to make it work with people with poor eyesight (many who are also retro game players). Then I studied various console window and font sizes. Finally I presented my prototype UI to local university game club and got feedback and ideas concerning better ways to do it.

Ultimately I decided to make the game UI as following: There are 9 cells in game The topmost and bottom three are one line thick. They are intended for basic status information. The middle 3 cells are divided into three columns at 25% and 75% of width. These three cells are used for most of the game play. 1) Leftmost cell has a menu of available player choices. 2) Middle cell has activities that menu choice caused. 3) Rightmost cell is reserved for showing additional information in context of menu.

This system is essentially similar to showing activity as pop-up windows.

At this moment I can only go through menus so UI does not actually ”do” anything. However, I know know to easily add additional menus with choices to different screen cells. This means the basic game play mechanic of meaningful choices can now be implemented.

Other things I did:

I did basic groundwork of language support for globalization and localization. This was a matter of simply using existing C# support. At this moment I only support fi-FI culture and do this by forcing game to use it. In future additional cultures will be added.

I have decided that time is the essential element of my game. Thus game time moves forwards on every activity player does and certain issues are timed to happen at certain intervals such as wages and income and expenses. I used C#’s existing DateTime object to store this value. Time is constantly shown in every UI screen as well.

Activities with future potential:

Now I can rotate between interstellar and interplanetary travel screens. These are different GameEngine objects that will run different GameSystems.

Next I tested UI menus that show where interstellar jump is possible. I made star system list a JSON file to test out number of star systems. I intend to use data driven design so moving as much to JSON files as possible is a good exercise towards that goal. I have been thinking to save the current game state as a single JSON file. I studied Newtonsoft’s JSON.NET framework to C# and I am seriously considering using it as part of my work.

Next Week:

I intend to create a character and save her data to JSON file and then read it when I continue my campaign. If I can master dynamic JSON files I’ll also intend to add freely selected initial star system to Character Creation system.

If I have additional time I’ll start to work on messaging system necessary. This should employ Observer pattern. I do not expect it to be ready but I want to test it.

My Roguelike III Part 2

What kind of publicly available tools do you use to develop your roguelike(s)? What for? Have you built any of your own tools? And if so, what do they do?

I use Microsoft Visual Studio 2017 Community Edition because it is free and available for free for personal use. My project is for personal use and it uses C# as language.

My preferred text editor is notepad++. It has support to most common languages and it is easy to use and free. I think it works quite well for editing JSON files.

I have built no personal tools per se. However, I typically create a simple C# program to simulate what happens to test any game design question I have. For instance, when I was thinking over character life path system I tested out mortality related rolls to gain ”correct” expected lifetime. In my view a reasonably good simulation can be achieved by running a simple simulation 10000 times and looking at statistical output.

I prefer to use git with ”Git Desktop” as a version control.

General Coding Advice…

I found this from Roguelikedev in reddit: ”So, if you have any bite-sized (byte-sized?) piece of advice that you’re proud of – or some day-to-day lessons that you’ve learned to do (or to avoid) since you started programming games, let us know!”

I suggest following to my students:

1) Always write a comment on what you intend to do first. I use this technique to check internal logic of my thinking and thus make sure program works on float chart level at least.

2) Always compile after two or three lines written. I use this technique to ensure that my local variables and functions are both syntax wise correct and they actually return sensible values.

3) Always test after each part has been written and successfully compiled. I tend to write my programs in small chunks and test each part as they come available. This may disrupt ”coding flow” but it makes sure code committed is functional.

4) Review what you have written afterwards. It never hurts to look at what has been written and how beautifully code flows. If there are something that looks messy it is advisable to think if it should be defused now rather than later.


My Roguelike III Progress Report 1

I decided to start coding my game yesterday (Friday). I wrote 8 hours and managed to make following things:

1) Game consists of a GameContext that can switch between GameEngines. It allows me to have different kinds of game loops for different game play modes. I tested its functionality and I could switch between these modes on the fly.

2) I created generic implementations for GameSystems, GameObjects and GameComponents. This should make it easy to build necessary systems, objects and components in future.

3) I got the game starting and run. It compiles and runs as it should in Visual Studio 2017 Community Edition.

Next week will be about creation of a game mode for interstellar flight. It needs to have a screen allowing showing several star systems and allowing spaceship to move between systems. I need functional UI for this. Thus I am thinking UI size and necessary keyboard functionality. I intend to have 2-3 star systems and 1 space ship at start.


My Roguelike III Part 1

What languages and libraries are you using to build your current roguelike? Why did you choose them? How have they been particularly useful, or not so useful?

My choice of language is C# and I intend to use .NET libraries as much as possible. My game will be made using console only.

I chose this setup because it is a good way for me to learn more of C# and what it can and cannot do. I believe it is also simpler than adding more complex graphics display. I also teach game development.

I believe that making a simple game is a good way of learning how game engine works and what AI does. This is a hobby project but I intend to use it to my advantage in future if it works. Every year I teach game design courses where I also need to teach both C# programming as well as basics of AI and game engines. Thus this project could serve as a simple tutorial for my students. My current crop of students liked my previous programming pattern examples so I was encouraged to try this.

I believe that C# is very powerful object oriented language and it has a good support for data management. Thus I believe it can be used safely as a language to demonstrate object oriented programming, programming patterns and data-driven design to students as well as to my own pleasure.