The home of Stainless
  • Starflight
    • Hacking
    • Remake
    • Archive
  • XNA
    • Planet generation >
      • Planets 1 Mercators
      • Planets 2 Bump maps
      • Planet 3 Ice worlds
      • Planets 4 Gas giants
      • Planets 5 Airless rocks
      • Planets 6 Molten planets
      • Planets 7 Bug fixes and improvements
      • Planets 8 Clouds
      • Planets 9 Atmospheric Scattering
      • Planets 10 Rings and stars
    • Remakes >
      • Ultima 4
      • World map
    • Facial Animation >
      • Importing the expressions
      • Loading the base mesh
      • Using the mesh
    • Spherical Harmonics >
      • GPU based
    • Sand
    • Alpha blending bug
  • Contracting
    • Clients
  • Blog
  • New Games
    • Onslaught
    • Towers
    • Two Towers
    • FOFT
    • Convoy
    • IL2 Mod tool >
      • Gallery
    • Downloads
  • Magic System
    • Genetic Magic
  • DevMaster Competition
  • Reality
    • Chapter 1
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Part Two
    • Chapter 6

Genetic Magic System

One of the things I always found a little strange about magic in RPG's like D&D is the way you get spells.

Spells popping into your head just because you get a few more experience points seems wrong to me. Learning spells that have already been created from a book is fine, but how were the spells created in the first place?

So after the problem knocking around in my head for a long time, my subconscious has finally worked out a way of allowing players to design their own spells.


The basic idea is to break down spells into gene's which each perform a function. Putting these gene's together in different forms produces different results.  

Gene pool

Taking the basic D&D magic spells as an inspiration, let's just break down a couple of simple spells.

Level 1 Magic Missile
    Breaking this down becomes "move energy to target, damage target".

From this we can see we need to move energy and apply it to something. So we can create our first two genes.

TRANSPORT  and DAMAGE

This is too high level though, transport energy how? Damage what? So let's break down the transport gene.

The spell could be a line of sight spell, the payload just is thrown in a direction. It could be a directed spell, the magic user guides the payload to a target. Or it could be a homing spell, once cast it is fire and forget and will seek out it's victim.

Rather than have three different transport genes, let's use a notation similar to a chemical formula. We'll use the letter T to define the gene and a subscript to define the type. So we now have three transport genes. T1,T2,and T3.

However T3 needs something to target, so we need gene modifiers. Let's just add a single letter modifier to the end of the gene for now, it will become obvious why later. So T3a to T3z.

So is that it? Well actually no. Spells have a range. So let's put a single digit in front of the gene to specify the range.

So the gene is now of the form <range digit><gene type><guidance type><modifier>

This is the form we will use for everything now.

So let's look at how we can apply this same format to the damage gene.

The range digit now represents the amount of damage the payload can do, the guidance type becomes what the gene damages, and the modifier becomes how it damages it. Poison, fire, electricity, etc.

Hey this is starting to look like it could work.

Extending the gene pool

What else do we need?

Well that's up to the game designer, but if you were trying to create all the spells from D&D you would need a more extensive gene pool. 

TRIGGER  On an event do something
SPLIT        Split the gene stream into multiple streams
MODIFY   Change something

For each of those all you need to do is specify what the three parameters map to and you can create any spell.

MODIFY+HEALTH+UP           = a healing spell
MODIFY+EYES+FREQUENCY  = thermal vision

The only limitation is the number of bits of data you use for each part of the gene and the number of genes you define.

Game limiting

With this system, we can create massively powerful spells. So we need to use the number of genes and the type of genes to come up with an energy requirement to cast the spell. 

That way we don't have first level mage's casting a single spell and destroying an entire army.

1T19S3T3a9Da

Break this down and it represents move one unit of range, split stream into 9 missiles each of which is a homing missile with maximum damage.

It's a MIRV.

Not something a first level mage should be able to cast.

I think you should also use the number of genes in the spell as a difficulty rating. During game play you use the characters skill level and difficulty to test for a miss cast spell.

Design system

 1T19S3T3a9Da is not very easy to read, end users will not enjoy designing spells if that is what they have to work with.

But the system works really well as a binary tree, so you can easily come up with a graphical system.

During the game the player "acquires" the building blocks. How this happens is up to the game designer, they pop into your head when you level up, or you buy them from shops, or whatever.

So a level 1 mage might only know transport type 1 and later acquire type 2 and 3, and so on.

Then you have a graphical drag and drop system to build spells.

I don't have the time to draw something up now, but it's not a complex task. 

Spell miss fire

This is one of the really cool things about the system. Since it is just a stream of genes, you can take a copy of it, randomly change a few bits, and recast the spell.

The number of bits you change is proportional to how bad the miss fire is.

Any gene's that don't map to effects are ignored.

So say the play fails to cast a simple fireball spell, but only just fails the skill test. We change a single bit. This single bit changes the initial transport gene to random rubbish. So that is ignored. The rest of the spell is the same, so the fireball goes off at the end of the mage's finger tip. Ouch.

Or you cast a healing spell and the modify health up gene changes to a modify health down.

Or modify health up becomes modify race up. Turning that weak Orc you planned to kill into a red dragon.

Evil, but fun.

Summary

Using the idea of genes to create spells could add a whole new level to a fantasy RPG. 
Spell miss fires could add real fun to a battle.

I really like the idea, and it can be applied to other genre's very easily.

Have a play and see what you come up with.  
Powered by
✕