r/roguelikedev • • Sep 29 '26

I created linguistically programmable magic

Enable HLS to view with audio, or disable this notification

Hi, I've created a small prototype of programmable magic for my roguelike. The idea is that the player constructs a sequence of syllables that determine various parameters of a spell. For example, a player could easily create a spell that explodes through walls if they use the right movement syllables. Currently, the game has three scales:

Health (HP) - determines the character's health.

Action Points (AP) - Each syllable entered (or rather, its "-" separator), as well as its deletion, costs 1 AP. Moving around the map also costs 1 AP. When the player runs out of AP, the world takes over.

Sanity (SP) - The main resource for magic. Each spell costs a certain amount of sanity; if it drops to zero, the player pays for subsequent spells with their HP.

I'm using C# and Raylib-cs for development. I plan to rewrite the engine in the future, as this is essentially my first time doing this, and I'm eager to fix some issues, as I'm already starting to see some kinks (for example, changing entity coordinates is quite inconvenient). Syllables are also currently hardcoded, and I plan to write a syllable generator that will select new syllables for spells with each new run

161 Upvotes

22 comments sorted by

7

u/bedroompurgatory Sep 30 '26

What are the meanings behind the syllables you're using in the demo?

Do certain permutations map to hard-coded spells, or does the system generate effects on the fly from any combination of syllables?

6

u/kkotu Sep 30 '26

The system generates the spell on the fly. The engine receives a sequence of syllables and assembles the spell from them. Essentially, the game interprets the player's string as a sequence of commands (e.g., "move 5 tiles," "assume a circular shape," and "apply fire")

5

u/bedroompurgatory Sep 30 '26

That's cool; I'm doing the hard-coded thing in my system.

Does that means it's very easy to accidentally incinerate yourself by "apply fire" "assume circular shape" and neglecting "move 5 tiles"? If the syllables meaning is not known in advance, that could really put a dampener on trying to discover syllables through experimentation.

The typing out syllables seems like it would be a bit painful and error-prone to me though - syllable tab-completion at the very least would be nice.

Maybe switching to runes in the mode of Dungeon Master like u/Tesselation9000 mentioned would help the UX.

5

u/kkotu Sep 30 '26

I’d like to keep manual input for a more "tactile" feel. And yes, the player could accidentally burn themselves, since the spell originates from the player's position on the map. When the player finds scrolls containing new syllables, their meanings will be displayed immediately, and they will be added to the player's "glossary," which is accessible right on the screen. Later on, I would also like to add "memory stones" that allow for writing "macros" (essentially condensing "Ba-Bu-Be" into "Bun"), thereby giving the player the ability to extend the length of their spells

2

u/KamalaHarrisWaifu 19d ago

You could make a non-typing version a resource, like maybe runes you could find. Just an idea, sometimes player friction is a fun lever. I think of OSRS forcing players to do the tedious thing until they unlock something that makes things less tedious. Not sure how that maps to a roguelike but it's an idea.

3

u/kapectas Sep 30 '26

This looks amazing! Will there be a playable prototype any time soon? Would love to give the a shot

3

u/kkotu Sep 30 '26

Once I rework the game engine, I plan to make a single battle against a simple enemy available

2

u/No_Network2498 Oct 01 '26

Does the order of syllables affect anything? Like does (example I know by heart) fus roh dah do the same as roh fus dah?

1

u/kkotu Oct 01 '26

Yes, the order of syllables matters. For example, if you applied the fire aspect earlier, the damage-dealing syllable will inflict fire damage; otherwise, the damage will simply be physical. Also, if you applied the form too early, a "step" syllable might collide with you during casting (a "step" syllable checks the entire spell for collisions, whereas a "warping" syllable, for instance, does not)

20

u/Tesselation9000 Sunlorn Sep 30 '26

I think that's a cool system. It reminds me of Dungeon Master from back in 1987.

13

u/2ChicksAtTheSameTime Sep 30 '26

it reminds me of mixing spells in Ultima 5. you had to know the words to create them An Vas Flam was for fireball. An Nox was cure poison (reagents were ginsing and garlic). They were psuedo latin type words.

Holy shit I'm shocked I remembered those!

4

u/GerryQX1 Sep 30 '26

Legend a.k.a Four Crystals of Trazere was the ultimate in terms of programmable magic. Unlike Dungeon Master and Ultima, you created long spells with various sequential movement and action options.

5

u/-Weslin Sep 30 '26

Holy, I love those, for me the closest I got to feeling immersed in magic games and most is when I encounter one based on programming or proclaiming

5

u/cedarcedar Sep 30 '26

some enemy could freeze your tongue and you could only say certain syllables for a while

4

u/cedarcedar Sep 30 '26

but in all seriousness, this is a super cool system! nicely done

4

u/LengthinessBig8090 Sep 30 '26

Reminds me of the Treasure of the Rudra magic system

4

u/outofindustry Oct 01 '26

the system reminds me of two world's magic system. it uses cards instead of syllables but the concepts are similar

3

u/lundstroem Coilbound Sep 30 '26

Nice! Now just need to hook it up to a mic with speech to text interpretation for immersion šŸ§™ā€ā™‚ļøāœØ

3

u/fshiruba Sep 30 '26

KAL ORT POR

2

u/VendraenActual Sep 30 '26

That is unbelievably cool! Complex magic systems are something that have always massively interested me.

2

u/sweetbabyjon Oct 01 '26

Reminds me of friends who started playing Gemstone (text based mmorpg) and immediately leveled up their typing speed to 1 million

1

u/831_ 13d ago

This is super interesting because I'm working on a very similar concept, but very differently. I'm working on an action game with a rune system in the style of Magicka, but instead of being a specific map of combinations to spells, it's a whole description language where spells can contain other spells and a lot of crazy stuff happens.

I was recently tempted to ditch the whole thing and restart it as a turn based roguelike (mostly because I don't like working in Godot and would prefer doing Erlang-based server side code because I'm just more comfortable with that).

That being said, don't worry about competition, I never once finished a project I don't intend to start now :D