Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monster damage indicators.



Mark Wedel <master@rahul.net> recently wrote:


> Actually, the way the present implementation is going, it is binary
>based.
>
> The problem with having the client have embedded strings, howerver, is this:
>
>1) Any time a new string is added, a new client is needed (with this
>updated string).  To add support to know what all strings a client knows
>gets to be pretty messy.
>

I was working on a scheme to solve this problem in netrek a while back,
and I came up with a decent solution:

Basically, instead of sending full text strings, you send a 'format
string' and then short abbreviated messages that use the format string later.

I.e. format string 12 might be:
"you hit %M %D"  and later packets would say something like 'msg 12 15 5'
Which means display the text:
"you hit the Blue Dragon and it looks barely scratched"
it replaces the %M with a monster name string from an index (in this case,
monster 15 is 'Blue Dragon' and %D with a damage level string ( say, 0-10,
where 0 is a string for 'unhurt' and 10 might be 'you killed it!'

If you want to get really fancy, have the client query the server back for
format strings it doesn't know about.  In the simplest implementation, you
just remember which format strings the client knows about, and send them
over before you use them!

 Eric Mehlhaff, mehlhaff@CSUA.berkeley.edu