What is the normal turn-based rpg game engine

what is the game engine (or the code) that are used to make complicated turn-based rpg like final fantasy?