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

Re: client server part 2




Here are some possible changes (horror!)

This is all sort of off the top of my head, and just for ideas.


client functions:
  * inputs (vision, noise, touch)
  * output (voice, attacks, interactions, movement)
  * user outputs (display info)
  * user inputs (convert user input)
We want the client to do as much work as possible without the option
to cheat. Its better if the server does the fairness so people can
modify their own clients.


server functions:
  * translate client 'local view' into a global one.
  * take client 'suggestions' on actions and do them.
Should 'play' the game and let the clients handle the users.

---------------------------------

I like the current initalisation, mostly. :-)

I like the idea of sending the archtype file so we can rely on some
data in the client.







So lets look at an average move shall we, as thats where most of the
time will be spent (assumeing we dont have 13.2 million archtypes to
transfer :-)

I shall use examples here and talk about the fields in detail later.


The server send what the user can detect in general detail.

S: MAP 6--5,0-4 wood_floor 7,-1-5 brick_wall 7--5,6 brick_wall
S: MAP 3,3 gold coin
S: MAP -14,22 smell_orc { strength 2.342 }
S: MAP 4,4 noise_creak { strength 1.2 }
S: MAP 0,0 touch_polished_wood

Note theat the smell_orc may be an average or innacurate in location.
Clients are free to ignore extra inputs or maybe they should be able
to turn them off to save bandwidth, by:
C: UNMAPSENCE smell

I know the { } stuff would be a bastard to do, but what the hell. I
am just going to rave in steam of conciousness mode and maybe
something useful can come from it.

Or we could have:
S: MAPSCROLL -4-3,-4-4 -3-4,-4-4	scrolls the map across
then we refresh the changed bits or something. Dunno. I would prefer
to resend it all and maybe inpliment 'memory' in the server in future
versions.



After the sences, then the detailed stuff:
S: ITEM 144 xy 2,2				the orc that just came out the door.

Lets say the client has not seen 144 before, the following would
happen, but hopefully the server would send details of all objects as
they came into view.

C: ITEMGET 144
S: ITEM 144 Arch orc State rabid Carries { Sword Bow_Tie 146 }
S: ITEM 144 eyes 1.4 Color pus_yellow

Note, the Color pus_yellow would only be needed if orcs in the
archtype file were normally a different color.

Item 146 may be a standard set of orc equipment or something. Its not
requested because the client does think it yet needs to draw it. I
suggest an ability of items to be lists of other items, so one can,
say, design a standard orc and just copy him/her everywhere.



After that, comes the results of the last move.

S: ITEMDEL 142				that orc we killed
S: ITEMCOPY 146 147 xy 1,1		copy orc equipment to body pile
S: ITEMADD 147 arch sword xy 1,1 ...	and the sword
S: ITEMADD 147 arch orc_chop xy 1,1 ...	for hungry little adventures

Note this all falls down a bit when it comes to things like setting
things on fire I guess. I dont know.



After wait delay (or whatever) the server sends:
S: SYNC
This gives the client time to respond to the data and display the
results.



Now the client gets to respond all stuff before the SYNC is ignored
probably so you only get one move per sync.

C: MOVE 0,-3
this client is attempting to move 3 squares, so the server may break
this into 3 moves over time (to allow things like automatic long distance
navigation.) or just say "sod off"
S: SODOFF ;-)


Lets say the user wants to pick up the orc_chop
C: ITEMMOVE 147 2033 arch orc_chop
S: OUTPUT string pickup up 2 orc chops from the rotting remains
S: ITEMMOVE 147 2033 arch orc_chop weight 2.3 nrof 2 material entrails

or something.





So a command summary so far:
     MAP x,y item x,y item item item x,y item 
which places the output the character to the user.

Then items, items are send to the client and the client displays
them. Item can be picked up and played with really.
     ITEM		display item
     ITEMWHAT		get more item details
     ITEMDEL		forget it
     ITEMCOPY		make a duplicate of an item
     ITEMADD		add an item to a list of items

Wait then ok, draw stuff now.
     SYNC

Client move
     MOVE
(or use INPUT/OUTPUT I like this option better actually, its more
general.)


ideas?

cam





--
`Rev Dr' ,    << skeptic, virtual goth >>
  +61 3 905 3403/809 1523      >> BSD Unix, C/C++, genetics, vi, ATM, HW  <<
  Monash University of Oz.    << Clemens & McGoohan: cool minds & great TV >> 
______ GCS d? p--- c++++ l u++ e++ m+ s/+ n- h f+? g+ w+++ t++ r++ y+ ______
UNIX is like the maritime transit system in an impoverished country. The
ferry boats are dangerous as hell, offer no protection from the weather
and leak like sieves.  Every monsoon season a couple of them capsize and
drown all the passengers, but people still line up for them and crowd aboard.