OK, let me explain, and apologise for perhaps introducing a misleading expression.
The default
FH generation numbering is, as
Gowermick says, ascending through
Descendants forward in time.
So if a person is generation 1, then their children are generation 2, and grandchildren generation 3, and so on.
For ancestors the generation numbers go in reverse -1, -2, -3, and so on.
BUT there are differences between
=RelationCode(...,GENERATION,1) and
Diagram > Boxes > Generation.
1)
=RelationCode() uses the two
Individuals supplied, whereas
Diagram Generation works from the
Diagram Root.
2)
=RelationCode() assigns the
Root person to generation
0, whereas
Diagram Generation starts from
Gen. 1.
Firstly regarding
Diagrams:-
If say Gwilym is the
Diagram Root then he will be coloured as
Gen. 1.
His children will be coloured as
Gen. 2 and grandchildren as
Gen. 3 and so on.
His parents, aunts & uncles will be coloured as
Gen. 9 or whatever is the right-most tab.
His grandparents, etc, will be coloured as
Gen. 8 or whatever is the penultimate tab.
Then continue left through the tabs for further ancestor generations.
I suggested this technique as an easy way of colouring the generations, without a detailed explanation of the numbering, as I only though the colours mattered, but clearly it has confused things.
Secondly regarding
=RelationCode(...,GENERATION,1):-
The standard usage is
=RelationCode(Root-Person,Current-Person,GENERATION,1) and usually
Root-Person is
FileRoot().
If
Current-Person is in same generation as
Root-Person then they are generation
0.
Descendants of the
Root-Person have +ve generation numbers 1, 2, 3, et seq, working forward in time.
Ancestors of the
Root-Person have -ve generation numbers -1, -2, -3, et seq, working backward in time.
So a descendant always has a higher generation number than their ancestors, i.e. 3 > 1 and 1 > -1 and -1 > -3 etc.
That answers your question about going back before generation 0 as they simply keep counting backwards -1, -2, et seq.
BUT you want generations numbered the opposite way with
Ancestors of
Root-Person having +ve numbers 1, 2, 3, et seq.
So in my function the two Individuals are reversed thus
=RelationCode(Current-Person,Root-Person,GENERATION,1).
That causes the numbers to go in the opposite direction and has led to the confusion - SORRY

This numbering has the same answer to how are the
Root-Person's children numbered - they are -1, etc.