Procedural Dungeon Generation

Procedural generation is incredible. It is the key to writing games with endless content. Without it, Minecraft couldn’t have (nearly) infinite worlds with infinite terrain. Spelunky would only contain a few rooms, and we could learn the layout and enemy placement instead of learning the game mechanics. These are only a few examples, but there are a lot of games that use this mechanic for generating content. In this article, I’d like to show you my way of generating a random dungeon that can be later used in a game. ...

March 10, 2022 · 8 min · pshegger

gRPC for Kotliners

This is the talk I gave at the November 2019 Kotlin Budapest meetup. You can find the slides here and the sample code at GitHub.

November 14, 2019 · 1 min · pshegger

@GenerateForMe

Write once, use everywhere Sooner or later every developer meets the following scenario: you have written the same piece of code multiple times, maybe with some minor differences, and you don’t want to do it again. You analyze the situation and decide to create a separate function so the next time you need it you just have to call it. Sometimes it’s not enough so you create a new abstraction layer and write a class which does what you need. But what happens if you cannot create an abstraction which is suitable for you and it’s easy to use whenever you need it. That’s when Annotation Processing comes for your help. ...

November 11, 2019 · 10 min · pshegger

Help Yourself and the Compiler with Contracts

What are contracts? In the world of Kotlin, contracts represent a deal between the developer and the compiler. As a developer you can share insight of your code with the compiler and it can use this extra info for better code analysis. Currently there are two kinds of contracts available: callsInPlace which tells the compiler how many times a lambda is called, and returns/implies which indicates that a defined condition is true if the function returns a specific value. ...

March 21, 2019 · 4 min · pshegger