sheesh knowledge exchange isnt that hard to do.
Lets asume the knowledge about Salvia and its antiseptic effects for the threads sake. This Knowledge is one "single item" known by elves (thanks to the raws) at the beginning of the game.
In terms of database programming you would have three tables.
Civs table - with the civ obvisiously.
Knowledge table - has the fact that Salvia is antiseptic (etc)
and a Knownby table - This "list" does know which civ knows what by a "civ id" and the "Knowledge id".
The knownby table may look like this (abstracted):
Civilisation | | Knowledge |
Elveciv1 | | Effect of salvia |
If now a dwarfen doc and a Elven doc meet and the two talk they can trigger a Knowledge exchangefunction which just checks if the elve knows about something that the dwarf doesnt know. If the elve now does know something that the dwarf doesnt know the function just adds a entry to the "Knownby" table. So after the function is done the Table looks like this:
Civilisation | | Knowledge |
Elveciv1 | | Effect of salvia |
Dwarfciv1 | | Effect of salvia |
edit:
For a even better system you can aply for a civ a Commonknowledge table and for single entitys (adventurers, wandering docs etc.) a table that handle uncommon/additional knowledge.
This works also for almost everything beginning from Philosophical/religious ideas over how to make tunics to Medical knowledge.
edit2:
This is only
knowledge exchange. creating new knowledge based on experiments is another thing but thanks to the detail of DF and the comming random stuff, atleast for medicin, art, and alike
relativly easy.