techninja / ninjanode

A node.js implementation of the ninjaships.js library, made into a complete HTML5 multiplayer game!
14 stars 8 forks source link

Revamp system message rendering to have some variety #12

Open techninja opened 11 years ago

techninja commented 11 years ago

Instead of simply "User slammed into user", should alternate between a set listing of phrases. Rendering may need to be given back to the server side to ensure all users see the same messages

grayside commented 11 years ago

Alternately, if the server says "p1 hit p2 for the nth time" then the client-side JS can use p1:p2:nth to determine the text. Dunno which is better, just saying.

techninja commented 11 years ago

That is actually how it works currently! A system message comes in and gives source, target type of events, also includes type of weapon involved. Client side then renders the message into text and posts it. The whole reason I would change this to serverside, is to keep it random, AND have a separation of the two systems. If random from the serverside, it would have to know how many different messages there were. If random from clientside, users might all see different messages. Kinda sounds like I need to make it rendered server side just to keep the division clean: clients simply output system messages as they come in.

grayside commented 11 years ago

Where that best fits I don't have an opinion. I'm just saying that you could have a simple rotation and just use a msgid to increment across it.

Serverside is good though because you could expose the play-by-play via a readonly client

techninja commented 11 years ago

Yep, agree there. I think the whole reason I moved it client-side was because It doesn't require a server restart to see changes ;)