log #6: too many things to fit in one title

Time interval: 2023-02-18/2023-04-08

It’s been a long time since the last post. I’ve done many things, but never really bothered to make a post about them. I’ll summarize them in this one.


I decided to release a demo to the people in the tophat discord server. Make sure you join too, so you don’t miss out on more frequent updates about the game, and other tophat/Umka related stuff. I fixed some issues preventing the game from running on Windows and got the following feedback:

  1. the controls combine mouse and keyboard too much, ideally one peripheral should be used
  2. it is unclear how to use the item transfer
  3. there should be an ability to pin certain items
  4. a score/money system shall be introduced to reward/punish players
  5. there seems to be a frame drop when a train spawns in

mouse movement

As suggested, I implemented a point and click movement system similar to games like Diablo or Dota. This proved to be a great fit for the game.

I implemented it using the all new nav.um tophat module. On every frame I generate a mesh from all the entities.

    for i,e in this.ents {
        if e.t & TagColl == 0 {


Then, upon a click of the mouse I generate the path, which is then followed by the player, similarly to how trains follow the rails. The performance is okay, however I think I need to regenerate the path at some frequency to account for moving entities.

optimize ysort

The aformentioned performance issue was caused by the ysort function called every frame. This was found out by Vasiliy using UmProf.

The ysort functoin uses a custom Quicksort implemented in Umka. Furthermore, the comparison function calls tophat’s th.Quad.getDims, which takes a bit of time. I rewrote the ysort in C using UMI modules and now it works well.


This solution tackles the third issue. After a long time spent trying to add a pin feature to pop-ups, I decided it would be better to make a new feature altogether - windows. Esentially items now open in windows, which can be freely dragged around the game screen. In the future they will have more functionalities like resizing, fullscreen, stay on top etc.

Implemented these windows I discovered shortcomings in how my item system is designed. For this reason I’m going to rewrite it from scratch.

random schedules

After my own playtesting, I realised the game was a bit repetetive. I decided to add randomly generated schedules. Turns out they work really well, so this is the direction I’m going to be headed in. There are still some unexplored areas in the schedule generation, which I hope to explore in the future.

new ui

All the game’s UI has been updated to use the new, unreleased, ui.um from tophat. I will talk about this more later.

the game setting

I also decided on the game setting. The game will take place in the interwar period in the area of the Jizerskohorská železnice (see map. I’m planning on adding a realisting representation of the Frýdlant station to the game, followed by Tanvald and maybe Liberec in the future.