Game Development Community

Networked GUI updates

by Terence Tan · in Torque Game Engine · 01/30/2007 (9:17 pm) · 0 replies

Right now we are working on some of our non-game UI (i.e. shop screen, weapon character upgrade screen) and I was justing trying to figure out the best way to update data so that works in both single player environment but also in a multiplayer one.

An example would be our weapon update screen where I would have to get/display (from the server I am assuming in multiplayer):
- Current weapon stats
- Cost to upgrade and stats of upgraded weapon

Based on some prior experience with building client/server apps I would take following approaches:

Approach A
a) Hook up 'onWake' part of the GUI to send a request to the server
b) Server would send a pack of data based on the clients request(via a NetEvent? perhaps)
c) If user clicks on any parts of the UI, that would generate other events to the server
d) server would respond to UI events with either confirmation or not.
e) Once the user clicks 'OK' to confirm the data, the server will then 'process' the collected data.

Approach B is similar to A but client would validate all game data and basically send the validate data back to the server all at once when the player hits 'OK' rather than responding to UI events. That means, the server will also have to revalidate all the data from the client.

My question is:
a) What would the best approach for this. Using out of band NetEvents or building it into GameConnection? Is there a way to do it PURELY with scripts..
b) Is there a generic way to implement this other than making all 'data' strings. My previous experience, I send blocks of data that i were endian friendly and casting things into their proper structs. Obviously this works well with C/C++ code

I think most people doing MMOG games would have to do something like this?

Edit: CommandToServer and CommandToClient doesn't look like a good idea especially with many parameters. I am thinking I would to create a generic net event with key/value pairs. I am also thinking I need to create some lobby/session management code.