There seems to be general agreement that magic should be implemented in such a way that it requires investment and sacrifice to exploit, is fundamentally related to the environment and religion, resembles in a familiar way many real world conceptions of magic, and is simple at first, but can be expanded with small or large additions that do not change too drastically the underlying system. This is a stab at coming up with a flexible, bottom-up magic system based on an equation of magic power (which I will refer to with the convenient term 'mana') to life, intelligence, and identity. The skeletal system, which I have emboldened out of guilt, is simple – the rest of this monstrous post is brainstorming about things the system would allow or ways in which it could go into detail. Keep in mind that because magic is usually an explanation for phenomena without obvious causes, introduction of distinct magic to the game brings overlaps between scientific and magical determinations for things, particularly involving religion, thought, capability, and nature; when a creature dies, for example, has it lost its soul with its heartbeat or vice versa?
Mana would be a quantifiable substance and animating force found, by those who know how to look, in all creatures, magical objects, and the environment in the form (or lack thereof) of spirits. It would come in complicated, mixable, and filterable flavors, of which every magical thing has one, that tie in to personality traits, spheres, and terrain and can differ in subtle or drastic ways. Spirits and appropriately skilled creatures (and in some cases magical objects) could magically manipulate each other and objects around them, releasing into the local area (no idea how local this should be, but I'm thinking on the scale of world map tiles) some of his/her/its mana in an amount proportional to the power of the magic being done, the magic-doer's lack of appropriate skill, and the difference in location and mana flavor between the magic-doer and the target. In other words, magical influence could be procured by practicing/studying magic, assimilating one's own mana to that of the target by manipulating either or both, increasing one's proximity to the target (touching might help), or simply hoarding a lot of mana. It might also add some depth if there are ways to exploit the mana of a third party over which one has much influence, rather than one's own.
The amount and average flavor of all mana in a world would be constant – also fun worldgen parameters. To be perfectly clear, mana would never be regenerated for its user, and running out of or low on it would not be a common or pleasant occurrence. When mana is used or something with mana is destroyed, it becomes part of the environment and forms one or more spirits, which have locations, but no bodies or appearance, and wander around the local area, sometimes using their power to do things like enchant various features of the landscape, generate illusions, reanimate corpses, or absorb one another. The flavor of the spirits' mana in a region at worldgen would be appropriate to the local terrain. Their behavior is determined by the flavor of their mana (a phenomenon that could replace the good/evil map properties) and the more they acquire of it, the less tied to the area and the more intelligent they become, sometimes to the point where a spirit can influence people to worship it as a god. When a worshipper of a spirit dies, his/her/its mana might go to that spirit, wholly or in part, perhaps requiring a certain ritual burial/cremation. A powerful deity might invest some mana into one of its followers both to give him/her special powers and to have more direct control, or create an incarnation of itself over which it has full control.
Every species would have an ideal flavor and quantity of mana for an individual, of which the flavor is that of its ideal environment, and the quantity generally greater for more intelligent creatures. When a creature is born, its mana is drawn from the environment, in an amount determined by what is ideal and what is available, as with its flavor, which could be filtered out, but perhaps in a smaller quantity when there is a big difference in flavor. When they die, their mana goes to their current environment, their object of worship, or a combination thereof (or maybe in some cases some sort of ghost). In this way would the magical nature of creatures relate to their environment, a species' ideal environment be determined, and more populated areas be less magical. Different species would have different tolerance for variation from ideal mana flavor and quantity, making those with more such tolerance better equipped to do magic. Unlike spirits, which are defined by their mana and change their nature with it, creatures suffer from having unnatural amounts and flavors of mana. Too little mana might make a creature less intelligent, driven, capable, caring – whatever one might associate with soullessness; too much mana might make a creature overly emotional and exerting, and some of the mana surplus might spontaneously perform magic; an unnatural flavor of mana might result in mostly undesirable physical and mental changes related to the flavor, such as blindness, hallucination, changes in size or personality, real-world medical symptoms, loss of mana over time, invisibility, even partial or full transformations into other animals, plants, or objects.
Magical objects would have magical powers triggered by their use or by magic. These powers would be determined by the mana flavor and form of the object. If an object is designed to do something, a magic one should be able to do it magically. When infused with enough mana, things resembling creatures – statues and especially corpses – should be able to move without expending too much mana and think for themselves as an animal with as much mana would, only with less feeling. Runes could be used to 'program' an object to use certain powers under certain conditions which may not require use or knowledge of magic to bring about – for example, to make a weapon that helps swing itself. Books and scrolls would be best suited to complicated runic magic. Dwarves would invest a significant fraction of their own mana into artifacts they create (perhaps after receiving mana from an inspirational spirit). Magical objects might also show up around a fortress if dwarves accidently or otherwise make things out of trees, gems, bones etc. enchanted by local spirits. Like creatures, objects would have limited (safe) capacity for mana, perhaps determined by its material. I don't think I need to give more examples of what crazy kinds of magic objects might appear in the game.
Spells would be learned, written down, discovered naturally, and often hidden jealously. Spells that trigger a power of a target (who may not know how to use that power) over which one has magical influence would replace spells involving things like rays and projectiles, or at least be cheaper and/or more powerful alternatives thereto. There would be two or three fundamental spells for manipulating mana: the first transfers a portion of mana from one thing to another or into the environment, the cost of which depends on one's influence over the mana donor and the distance from donor to recipient (which would be zero in the case of the environment); the second is just like the third, only it filters out a specified flavor of mana, and is more costly, perhaps depending on the difference in flavor between the mana being filtered out and being expended; the third spell, which seems crude to me, but is the only way I can imagine certain desired forms of magic working, forms a mystical 'link' between one person/thing and another, which would guarantee a minimum level of mutual influence despite any variance in location or mana flavor. These links would vary in strength (effectiveness), which would be determined by the mutual influence at the time it is formed and the amount of mana expended in forming it. The disadvantage of being linked, is that influence over that to which you are linked carries over to you, depending on its strength. Links are a handy way to implement teleportation, summoning and telepathy without abandoning the distance as an obstacle for magic or forcing players as powerful wizards to move a cursor miles away. Body parts like blood, hair, and horns and frequently used objects could naturally form weak links to their owners (maybe stronger for blood). Spells that provide information would also be an important part of doing magic: these would allow you to detect collections of mana around you, depending on their size and your influence over them, and recursively to discover what they know and are linked to. One should also be able to transfer their mind to someone/something else, (spirits should be able to split their minds and directly control any number of things, but for the sake of playability I think creatures should be limited to one mind) though one should be able to simply use magic to impel someone to do something, perhaps by causing them to hallucinate. There would probably be a need for spells that prevent other spells from happening Of course, different flavors of mana would be better suited to different types of magic; I imagine, for example, that the desert would be have the best mana for magic involving sensing and illusion, and mountain mana would be particularly effective in objects, but not as much in animals.
From this system arise four extreme types of mage, of which combinations are certainly possible. The first accepts the consequences of corrupting his mana and thus forsakes his mortal from and sanity. Such a mage would be very powerful but short-lived, at least short lived as an identifiable sentience. The second, to avoid the plight of the first, takes mana from others of her own species who, by the way, make obedient if somewhat stupid minions if left a substandard amount of mana. This practice would not endear her to many. The fourth endeavors to gain as much power as healthily and ethically possible by leading a life of incessant study of magic and where to find it, only the most prudent expenditure of mana, and plenty of travel to take from a healthy balance of mana flavors and to collect existing magic objects rather than make her own. Such a life would require substantial funding, either inherited or granted from someone wealthy, perhaps procured through magical favors or promises thereof. The fourth submits himself as a pawn to one or more powerful spirits, counting on them to filter out a healthy flavor of mana to him when he needs it.