Suggestion: csv output of battle stats

From Flexible Survival
Jump to: navigation, search

Overview

This is a suggestion/request of sorts. The intention is to allow players to parse battle output more reliably.

Currently there are two methods that I am aware of to determine the health and energy of players and ferals: hp and fprompt.

hp outputs a table of coloured bars which is a good visual aid. fprompt outputs a much leaner version of this content that is easier to parse but is less immediately interpretable by eye. My current solution to parsing fprompt is to capture each line, format it then add it to an array.
Here's my output as an example, the battle stats are in the top, right pane: 900px


This works most of the time but there are two issues that make it unreliable and inconvenient.

1. Sometimes a line gets garbled and thus it is missed resulting in incomplete status. 2. Some ferals (Primes, backups, others) do not have a number and period at the start of the string which makes them harder to categorise. They can, of course, be categorised by looking for "Prime" and "backup" in the name but this leaves the (admittedly unlikely) possibility that a player may choose a name with one of these strings in it at some future point.


Solution

A single comma-seperated value (CSV) line. e.g.
ENEMIES,rgb,13. Bouncy Half-Gryphon Bartender 12302/13886 72/100,ENEMYPETS,rgb,Pet 1: Blah 11607/11607 129/150,PLAYERS,rgb,Anwen 11519/11519 28/98,PETS,rgb,GRIND(Anwen) 8798/8798 54/106,THINGS,rgb,Tactics Soldier(!) 0/104 100/100,END

where rgb is the applicable colour value.

Breakdown of sections:

ENEMIES,rgb,13. Bouncy Half-Gryphon Bartender 12302/13886 72/100,...
ENEMYPETS,rgb,Pet 1: Blah 11607/11607 129/150,...
PLAYERS,rgb,Aluthal 11713/12091 100/100,...
PETS,rgb,GRIND(Anwen) 8798/8798 54/106,...
THINGS,rgb,Tactics Soldier(!) 0/104 100/100,...
END

Summary

CSV is trivial to parse, the output would be unambiguous and there is no fear of missed lines (either it's there or it isn't!). Section names (ENEMIES, THINGS) could be shortened if necessary.