I assume you mean party/party costs and not solicitor/own client costs and that your question is confined to that of a civil proceeding (given your reference to an pi matter).
The basal proposition is that: 1) The court has a general discretion as to who pays what costs and the amount of those costs and 2) That discretion, in the normal run of the mill case is exercised by the unsuccessful party paying the costs of the winner, that is on a standard costs basis, unless indemnity costs are awarded.
However, a successful party can, in limited circumstances have their costs taken away from them due to their conduct. The court can deprive a successful party of it's costs due to point 1 outlined above, the discretion. This will happen in instances when a party withholds true facts from another, where a party may fail to show true grounds of a defense/claim until it is amended very late in the trial. Either party failing to cooperate with one another or at mediation, etc.
I think the classic case is Verna Trading v New India