Robin Bain was on a downward spiral and prone to mood swings in the months before his death, a jury at the High Court in Christchurch has been told.
The Crown says David Bain, 37, killed his parents Robin and Margaret and siblings Arawa, Laniet and Stephen at the family's house in Dunedin on 20 June 1994.
The defence argues Robin Bain was depressed and mentally unstable, and killed the family present in the house before shooting himself.
The defence began its case at the retrial of David Bain on Monday.
Educational psychologist Cyril Wilden told the court he went to Taieri Beach School where Robin Bain was principal to give students trauma counselling after the killings.
Mr Wilden said he had been concerned about Robin Bain's mental state in the months before. When he went to the school it was in a "chaotic state", and two pupils told him Robin Bain had hit them.
He said that added to his impression that Robin Bain had been depressed or under emotional strain.
At the time of the killings, Robin Bain was estranged from his wife Margaret and living in a caravan near the family home in Every Street.
Mr Wilden said in his opinion, Robin Bain was depressed by 1994 and far from the good-humoured man he had known at university in the 1960s.
But under cross-examination, Mr Wilden conceded he was not a clinical psychologist and had not made a clinical assessment of Robin Bain's mental state.
Other defence witnesses also told the court that Robin Bain appeared depressed and withdrawn in the months before the killings.
Dunedin principal Kevin Mackenzie told the court that Robin Bain was clearly depressed. Mr Mackenzie said he and other colleagues thought Robin Bain had gone downhill in May, which they attributed to him missing out on jobs and struggling with the new Tomorrow's School's system.
Mr Mackenzie told the court a group of principals were so concerned about Robin Bain's state of mind they organised a seminar to try to help everyone through the tough times in the school system, which Robin Bain was the first to sign up for.
Mr Mackenzie said he went to the school in the week after the deaths and found Robin Bain's work had been below par, the office disorganised and the school untidy.
Robyn Davidson, who was principal of a school in the Taieri region and knew Robin Bain, told the court about seeing a dramatic change in his demeanour and work ethic. Mrs Davidson told the jury that Robin Bain was unkempt and emotionally flat, looked bedraggled and had bad personal hygiene, which she had never noticed before.
Another school principal, Malin Stone, described a school camp he and Robin Bain took their classes on, during which Mr Bain was withdrawn and unhelpful. Mr Stone said Robin Bain was gaunt, tired and unmotivated.
Under cross-examination, Mr Stone agreed that he did not work very closely with Robin Bain on a regular basis.
Students' violent stories published
The court was told Robin Bain's students had written violent stories for the school's newsletter the week before the killings. They included three describing the violent deaths of family members and others describing police being killed.
One story involved a porcelain doll that lost a fingernail every night as each member of a family died, and talked of the family members being shot and stabbed. Another boy wrote about killing his parents which was "fun".
The newsletter was published four days before the Bain family were shot.
Defence lawyer Michael Reed, QC, asked psychologist Cyril Wilden if he saw any connection with the newsletter and the timing of the deaths.
Mr Wilden replied he thought there may have been a link to the tragedy and said he thought it was disturbing that a school principal had encouraged his pupils to write the stories.
Mr Wilden told the court he thought the stories were particularly inappropriate in that school, as some of the children had been involved in the Aramoana mass shooting in 1990.
Dunedin principal Kevin Mackenzie told the court he later found out about what he called "disturbing stories" written by Robin Bain's pupils for the newsletter.
Mr Mackenzie said the stories Robin Bain's students wrote would have prompted him to take "drastic action" to determine what was behind them and to give a child who wrote such stories some help.
Under cross-examination, Mr Mackenzie said he only found out about the stories six years after the Bain family deaths, and did not know the stories may have been edited for publication by a teenage daughter of the school treasurer rather than by Robin Bain.