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

Author Topic: design pattern behind replication?  (Read 1532 times)

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
design pattern behind replication?
« on: Aug 20, 14, 04:26:13 AM »

Hi!
I recently began to read c++ tutorials, but i am a complete beginner...

i am interested how is the replication system implemented under the hood. is it some kind of a well known design pattern?
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1149
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: design pattern behind replication?
« Reply #1 on: Aug 20, 14, 07:27:55 PM »

One basic idea behind replication is that every player in the game sees the same thing on their screen in the game. When a player joins the game the other player nodes and the computer controlled nodes are all replicated to the new player. That way they see the same thing.
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: design pattern behind replication?
« Reply #2 on: Aug 20, 14, 08:49:55 PM »

http://0fps.net/2014/02/10/replication-in-networked-games-overview-part-1/

A solid read on how things work in general the pitfalls and what to do with things overall.

The challenge with replication is it is never, nor can or should it ever be considered synchronized.

This leaves you to have to really understand all the in and outs of asynchronized architects.

The key is to replicate only the bare minimal data you have to replicate. This is why we have the Spatical awareness System, in HE so we can really pull down to the bare mins the data that has to be replicated.

You will also see that in most cases you have to define how data is replicated, as different types of data has different replication requirements.

A trade transaction is much more important to make sure it goes through first, than updating a players skill value. So you have to have a way to prioritize what data the server is to focus on and which ones can sort of be left alone if need be for a moment or two. Also you want to see what data can possibly get clustered together in larger batch processes. To ease the load on the server. But with both of those also comes the need for building out max thresholds to make sure data does get passed along.

For example if the server always pays more attention ot trades, then a players skill up data might never get a change to be processed, so need a way to say, focus on trades, but... if you see a skill up data piece come along and it's been waiting like a good puppy for 3 seconds, then go ahead and make it a priority the next time you look for things to replicate.

Can go into more details but that article is a decent start, there are like 4 parts to it.

Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: design pattern behind replication?
« Reply #3 on: Aug 21, 14, 05:45:42 AM »

Hi!

Interesting link, but i was hoping to get some insight in the specifics of the Heroengine implementation of the replication system.
http://hewiki.heroengine.com/wiki/Replication

I belive it is implemented in C++?
I would like to see for example code snippets... or access to full source implemetation of the replication system/ or documentation connected with the source.

I am curious about the topic, but i am aware that since heroengine is not open source, this info is hard to come by.

Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: design pattern behind replication?
« Reply #4 on: Aug 21, 14, 11:31:24 AM »

In general, in software with more than 5 million lines of code, across 4 languages, traversing client, server, network, and bandwidth: seeing code snippets of source would not be useful in anyway. Instead, engineers write wiki entries to summarize the aspects of the code base. When source code licensees are investigating game specific implementations, they would follow code comments after asking engine architects for good places to "dive in to" if the wiki entries don't point them to specific classes.

If you're looking to understand the concepts more clearly, then papers and discussions are the best place to read. Otherwise, just asking questions about functionality and wiki documentation, combined with in-engine testing is the best place to learn how things 'should' be working.
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: design pattern behind replication?
« Reply #5 on: Aug 22, 14, 08:03:04 PM »

There is some really good wiki entries on the exact way HE does replication, but I can also provide a bit more details. as well

Is there a particular part you are interested in more than others?

As you can see from my previous post there are a few dozen aspects to it. Give me a starting point and I can write you a wall of text, and usually where I get things wrong another dev or HE staff adds some corrections. But I have it down pretty tight, as it's a huge key to any game to fully understand it in and out forwards and backwards, and to implement it in super depth at each step of your design process.
Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: design pattern behind replication?
« Reply #6 on: Aug 22, 14, 08:06:04 PM »

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

Start there read and reread for understanding, then follow each link on it, and read and understand each of the smaller processes.

Feel free to ask any questions and we can clarify, or pick a topic and i'll try and translate the wiki into english for you.
Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]