A formal grammar for Magic: the Gathering

I wrote an ANTLR4 formal grammar for Magic: the Gathering cards.

It turns this

A Magic: the Gathering card

Or, more specifically, it turns this

Reach
Undergrowth — When you cast this spell, reveal the top X cards of your library, where X is the number of creature cards in your graveyard. You may put a green permanent card with converted mana cost X or less from among them onto the battlefield. Put the rest on the bottom of your library in a random order.

Into this:

You can try it out here: https://soothsilver.github.io/mtg-grammar/ and you can download the grammar and the source code from https://github.com/Soothsilver/mtg-grammar.

Čtěte více

Rozbor slavnostních slibů Univerzity Karlovy

Na začátku a na konci studia na Univerzitě Karlově, včetně na Matematicko-fyzikální fakultě, kde jsme studoval já, studenti konají povinně sliby — na začátku slib imatrikulační a na konci slib promoční. Slib promoční se skládá, pokaždé v trochu jiné podobě, na konci bakálařského studia, na konci magisterského studia a na konci doktorského studia.

V tomto článku popisuji svoji interpretaci významu těchto slibů. Snažil jsem se dostat k nějaké oficiálnější nebo autoritativnější interpretaci slibů, a to komunikací s představiteli univerzity a hledáním v knihách. Něco jsem zjistil, ale zdaleka ne tolik, kolik bych chtěl. Jsem si celkem jistý, že někde ještě leží knihy, ve kterých je více materiálu, a že někde jsou lidé, kteří o tématu ví více. Buď jak buď, já se k nim nedostal. Nenašel jsem ani žádný rozbor slibů na internetu, proto jsem tedy vytvořil tento. Popisuje jen moji interpretaci, není to oficiální názor Univerzity.

Vynechám slib po doktorském studiu, protože k jeho úplnému pochopení tak, abych o něm mohl psát, bude pravděpodobně lépe nejprve studium absolvovat.

(Google dokument se stejným textem, pokud raději čtete tam)

Čtěte více

Existential Risk Prevention Authority

Existential Risk Prevention Authority is a strategy game developed for the GameJolt DreamHack game jam 2017.

In October 2017, a nuclear terrorist attack forces the world’s nations to wake up and join forces to prevent any possible threats to the extinction of humankind. You are placed in charged of the UN’s new Existential Risk Prevention Authority. Your mandate, supported worldwide, is to identify ways in which humanity as a whole can be destroyed and to ensure that such destruction will not come to pass. That in itself would be a herculean task, but as the emotions from the nuclear attack calm down, you will soon discover that the world’s „unconditional support“ for your mission is not as unconditional as it might seem.

Can you save the world from a nuclear apocalypse, an asteroid apocalypse or a pandemic apocalypse? And from all three at the same time?

Čtěte více

Magisterské státnice na Matfyzu

Tento článek popisuje, jak fungovala ústní magisterská státní zkouška z informatiky na Matematicko-fyzikální fakultě Univerzity Karlovy (MFF, Matfyz) v září 2017. (verze v Google dokumentu)

Přihlášení

Magisterská státnice se nazývá “ústní část státní závěrečné zkoušky”. Žádná písemná část neexistuje. Slovo “ústní” ji pouze rozlišuje od “obhajoby diplomky,” což je druhá část zkoušky. Není dělená na několik zkoušek podle předmětu (matematika/informatika) na rozdíl od bakalářské zkoušky. Na zkoušku je třeba se přihlásit před termínem uvedeným v harmonogramu, ale nelze se přihlásit dříve, než máte splněné všechny ostatní studijní povinnosti vyjma diplomové práce.

Čtěte více

omegaGo

omegaGo je klient pro deskovou hru Go.

Go je starodávná desková hra, která se dosud těší oblibě hráčů ze všech částí světa. Pokud jste ji nikdy nehráli, možná zkuste omegaGo – obsahuje užitečné návody a funkce a pomůže vám na vaší cestě: možná se vám hra zalíbí!

ONLINE HRA: Můžete hrát na serveru, který preferujete – buď na Pandanetu (IGS) nebo na KGS. Použijte stejné čisté rozhraní na obou serverech. Můžete dokonce hrát hru na obou současně, pokud se na to cítíte!

SGF EDITOR: Otevřete a upravujte soubory SGF anebo exportujte svoje hry jako soubory SGF.

QUESTY: Získejte body za vítězství a za dokončování questů, a získejte tak vyšší hodnosti v našem režimu pro jednoho hráče.

JINÉ FUNKCE: V omegaGo na vás čekají také další funkce jako tutoriál, encyklopedie, režim analýzy nebo problémy tsumego.

Čtěte více

Heart Horror

Heart Horror je bullet hell vesmírná střílečka hraná v prohlížeči.

Jádrem hry je vyhýbání se střelám, což částečně hráč dělá tak, že si zapamatuje vzory útoku bossů.

Avatar, kterého ovládáte, je mnohem větší než váš hitbox – nepřátelské střely se mohou dotknout lodi a přesto ji nezpůsobit zranění. Pouze když se střela dotkne samého středu lodi ztratí hráč život.

Čtěte více

„Chodička“

Když jsem byl menší, hrál jsem s bráchou hru „chodičku“ s dřevěnými kostkami. Chodička funguje tak, že dva hráči pohybují jednotkami z dřevěných kostek po koberci a snaží se obsadit budovy. Budovy produkují jednotky, a jednotky hráčů proti sobě navzájem útočí. Jeden z hráčů hraje typicky za „nepřítele“, který „přichází“, tzn. nemá základnu, ale jeho jednotky se spawnují na okraji území, který „hráč“ vidí.

Chodička je modelována částečně podle Dračího doupěte, ale hlavně podle počítačových real-time strategií jako Age of Empires a State of War.

Čtěte více

Gamedev Technical Best Practices

When you develop, i.e. create, a video game, you may want to follow this checklist of best practices. This is less important than the actual content or gameplay of the game but these items apply to the majority of video games:

  1. Enemies don’t respawn automatically unless the player is informed. By default, except for JPRG games, the expectation is that there is a limited number of enemies. No matter your genre, you must be consisent: enemies either respawn everywhere or nowhere. If there’s a special area with respawn, you must inform the player (for example, the character could be repeating „I don’t think they’ll ever stop coming.“).
  2. When there’s a time limit, you must show an actual countdown timer on the screen. No matter how bad the situation looks, the default assumption is that you can leave the game on for hours away from keyboard and nothing bad will happen. The characters can keep repeating things like „We need to hurry.“ or „There’s not much time left.“  but unless there’s an actual countdown timer in the HUD, you cannot punish a player for waiting.
  3. Mark all points of no return. In open world games, any points of no return must be clearly marked. If completing a question will cause a chapter to end, or if moving into a certain dungeon will end a part of the game or if talking to a certain NPC will move you in the finale, a big red dialog box should pop up in the player’s face, stating in no uncertain terms something like „This is a point of no return. If you proceed, the chapter will end and you will no longer be able to return to Littletown. Do you wish to proceed? [Yes, move on.] [No, not yet.]“ Do not use in-character dialog for this. Make it very clear by using a game interface element.

Čtěte více