Hacker News new | ask | show | jobs
by Ideka 4407 days ago
This is certainly a thing of beauty. See, for instance, the way the trainers are defined:

https://github.com/kanzure/pokecrystal/blob/master/trainers/...

It almost looks like a high-level language.

2 comments

This is a pretty commmon technique in video games generally referred to as "data driven design". Basically put as much of the runtime decisions that are made into a data value that can be tweaked by designers without having to ask an engineer to do it each time.
Final Fantasy for the NES seems to be designed the same way. A lot of the spells are actually "call function A with strength N, call function B with strength M and flag X". And with a large enough vocabulary of functions and flags, you get fire spells, healing spells, instant death spells, protection spells, etc.
It's also common in embedded systems since it makes for extremely compact code. The data basically gets used as "instructions" for an application-specific virtual machine/interpreter (which may or may not be Turing-complete - most usually aren't.)
It's... beautiful.