HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Passing a Lookuplist between Server and Client  (Read 819 times)

GFG_Ulfrpsion

  • General Accounts
  • *
  • Posts: 40
    • View Profile

In the game my team is developing, we have a skill system that utilizes 60 different skills each with their own independent level. We were considering using a Lookuplist for the character and passing it back and forth between the client and server, but that seems a bit unrealistic. Has anyone had experience passing a lookuplist to the client that could maybe give me some insight? Has anyone developed a skill system rather than a class system and have some input on how you managed that data?

Thanks!
« Last Edit: Nov 02, 12, 10:04:53 PM by HE-Cooper »
Logged

JoshHalls

  • Founding Professional
  • *****
  • Posts: 335
    • View Profile
    • The Repopulation
Re: Passing a Lookuplist between Server and Client
« Reply #1 on: Mar 05, 12, 09:55:26 PM »

You could, I believe you have to marshal it first.

http://hewiki.heroengine.com/wiki/Marshal

You might be better off with Nodes and replicating them depending on how much data is attached to the skill.  It would be preferred if you are going to have anything more than a simple lookuplist (such as id to skilllevel map).
Logged
Co-Owner/Programmer - The Repopulation

GFG_Ulfrpsion

  • General Accounts
  • *
  • Posts: 40
    • View Profile
Re: Passing a Lookuplist between Server and Client
« Reply #2 on: Mar 07, 12, 10:11:12 PM »

I'm not sure I really understand replication in terms of what I want to achieve in a skill system.

For each player, there are 60 skills available. Each skill has a level, experience, and a bank of skill points. The players will need to store this information with their characters.

I'm guessing based on what I've read from replication, each skill will be a persistent node created on the character's creation. I would want to store these nodes either on the character or have them stored on a skill manager of some sort which is stored on the character.

I would then have a replication group handle replicating this skill manager and the skills it has stored to the client-side character? Have I misunderstood this or does that seem right?
Logged

HE-JAY

  • HeroEngine
  • *****
  • Posts: 122
    • View Profile
Re: Passing a Lookuplist between Server and Client
« Reply #3 on: Mar 09, 12, 11:10:49 AM »

What you propose (passing lookuplists manually back and forth from client to server) is certainly doable and one way of going about it, but I believe replication is a far surer bet.

Replication is - at base - a cleaner, more robust way of making remote calls from client-to-server (or vice-versa) when the intent is to deliver a piece of data or a message.  You 'could' send explicit calls every time something changes (placing the burden of managing that logic on script implementation), or you could set fields up to replicate automatically when they change (leveraging lots of nifty features like 'atomic sets', 'replication priority', etc) and then respond in script at the destination to process logic that results from the update.

Logically speaking, the object which 'owns' the data is also usually the correct object to own a replication group which replicates that data.  If your abilities belong to the player, the player's replication group (probably a private one replicated only to them) may be an appropriate home for such replications. You could also - if you desire - create an skill system anchor (or manager) which would individually replicate ability set nodes (or some-such) to players, but it stands to reason that "wherever the player goes, its skills go with him/her".
Logged

GFG_Ulfrpsion

  • General Accounts
  • *
  • Posts: 40
    • View Profile
Re: Passing a Lookuplist between Server and Client
« Reply #4 on: Mar 09, 12, 03:49:21 PM »

Okay. I did a little more research and found this to be almost exactly what I'm trying to do:

http://wiki.heroengine.com/wiki/Data_storage_options#Data_storage_with_the_Character_Node

In the example given on that page:
Quote
Character abilities in Hero's Journey are at some level customizeable by the player. The basic implementation of immutable data is in the form of a Spec (check out storage in specs on this page) and the mutable data is stored in a node derived from the SpecDerivedObject class. Each character has an abilities node which is associated to the character node via a base_hard_association. Each ability is in turn associated to the character's abilities node.
This provides for character specific storage of mutable data for a particular ability, while maintaining the smallest possible memory footprint by storing the immutable data in a spec.

From this, I'm just confused on how the mutable data is stored in a node derived from a SpecDerivedObject class. I understand that the SpecDerivedObject is an instance of an object created by the SpecOracle, but how would I go about persisting the instance with the character, and how would I communicate this to the client?

I'm sure it will make more sense when I look into the Engine for all the abilities scripts (I haven't had time since my last post to do more than read the wiki), but I appreciate the help so far!  ;D
Logged