Skip to main content
Log in

A knowledge-based approach to multiplayer games in peer-to-peer networks

  • Regular Paper
  • Published:
Knowledge and Information Systems Aims and scope Submit manuscript

Abstract

Multiplayer computer games frequently rely on centralised (client–server) solutions, with limited scalability and a single point of failure. Replicating servers and performing load-balancing mitigate some issues, but create other problems like synchronising information among servers and controlling network traffic. In this paper, we present a fully distributed peer-to-peer approach to multiplayer computer games. Our approach uses explicit knowledge about the game to support a peer-to-peer mechanism for requesting and providing information to participants. Although we use games to explore our approach, the ideas can be adapted to many other knowledge-intensive activities such as decision-making and reasoning.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

Notes

  1. http://clarkparsia.com/pellet/.

References

  1. Adams E (2009) Fundamentals of game design. New Riders, San Francisco

    Google Scholar 

  2. Alstad T, Dunkin JR, Detlor S, French B, Caswell H, Ouimet Z, Khmelevsky Y, Hains G (2015) Game network traffic simulation by a custom bot. In: 2015 9th Annual IEEE international systems conference (SysCon), IEEE, pp 675–680

  3. Androutsellis-Theotokis S, Spinellis D (2004) A survey of peer-to-peer content distribution technologies. ACM Comput Surv 36:335–371

    Article  Google Scholar 

  4. Bai X, Vasconcelos W, Robertson D (2010) Okbook: Peer-to-peer community formation. In: The semantic web: research and applications, pp 106–120

  5. Barabási AL, Albert R, Jeong H (2000) Scale-free characteristics of random networks: the topology of the world-wide web. Phys A Stat Mech Appl 281:69–77

    Article  Google Scholar 

  6. Bertasi P, Bianco M, Pietracaprina A, Pucci G (2007) Obtaining performance measures through microbenchmarking in a peer-to-peer overlay computer. In: Complex, intelligent and software intensive systems, 2007, IEEE, pp 285–290

  7. Bharambe A et al (2008) Donnybrook: enabling large-scale, high-speed, peer-to-peer games. SIGCOMM Comput Commun Rev 38:389–400

    Article  Google Scholar 

  8. Biström J (2005) Peer-to-peer networks as collaborative learning environments. In: HUT T-110.551 seminar on internetworking

  9. Bland JM, Altman DG (1995) Multiple significance tests: the Bonferroni method. BMJ 310(6973):170

    Article  Google Scholar 

  10. Bonifati A, Chrysanthis PK, Ouksel AM, Sattler KU (2008) Distributed databases and peer-to-peer databases: past and present. SIGMOD Rec 37:5–11

    Article  Google Scholar 

  11. Buford JF, Yu H (2010) Peer-to-peer networking and applications: synopsis and research directions. In: Shen X, Yu H, Buford J, Akon M (eds) Handbook of peer-to-peer networking. Springer, Berlin, pp 3–46

    Chapter  Google Scholar 

  12. Castano S et al (2003) Helios: a general framework for ontology-based knowledge sharing and evolution in p2p systems. In: DEXA

  13. Clarke I et al (2001) Freenet: a distributed anonymous information storage and retrieval system. In: International workshop on designing privacy enhancing technologies

  14. Fan L et al (2007) Mediator: a design framework for P2P MMOGs. In: Proceedings of the 6th ACM SIGCOMM workshop on network and system support for games

  15. Fitting M (1996) First-order logic and automated theorem proving. Springer, Berlin

    Book  MATH  Google Scholar 

  16. Giarratano J, Riley G (2005) Expert systems: principles and programming. Thomson Course Technology, Portland

    Google Scholar 

  17. Gibson M (2015) A knowledge-based approach to multiplayer games on peer-to-peer networks. PhD thesis, University of Aberdeen

  18. Glinka F et al (2007) RTF: a real-time framework for developing scalable multiplayer online games. In: Proceedings of 6th ACM SIGCOMM workshop on network and system support for games, pp 81–86

  19. Glinton R, Scerri P, Sycara K (2010a) Exploiting scale invariant dynamics for efficient information propagation in large teams. In: Proceedings of the 9th international conference on autonomous agents and multiagent systems, pp 21–30

  20. Glinton R et al (2010b) The statistical mechanics of belief sharing in multi-agent systems. Inf Fusion 11(3):256–266

    Article  Google Scholar 

  21. Glorioso A, Pagallo U, Ruffo G (2010) The social impact of p2p systems. In: Shen X, Yu H, Buford J, Akon M (eds) Handbook of peer-to-peer networking. Springer, Berlin

    Google Scholar 

  22. Grosan C, Abraham A (2011) Rule-based expert systems. Intelligent systems, intelligent systems reference library, vol 17. Springer, Berlin, pp 149–185

    Google Scholar 

  23. Gruber TR (1995) Toward principles for the design of ontologies used for knowledge sharing. Int J Hum-Comput Stud 43:907–928

    Article  Google Scholar 

  24. Gummadi KP, Dunn RJ, Saroiu S, Gribble SD, Levy HM, Zahorjan J (2003) Measurement, modeling, and analysis of a peer-to-peer file-sharing workload. In: Proceedings of the nineteenth ACM symposium on Operating systems principles, ACM, New York, NY, USA, SOSP ’03, pp 314–329

  25. Hahn SH, Lee JY, Yoon J, Choi HK, Moon YH (2004) Controlled peer-to-peer knowledge sharing. Asia Pacific Tech Monitor, pp 49–53

  26. Hoschek W (2002) A unified peer-to-peer database protocol. In: Proceedings of the international IEEE/ACM workshop on grid computing, ACM

  27. Kokkinidis G, Christophides V (2005) Semantic query routing and processing in P2P database systems: the ICS-FORTH SQPeer middleware. In: Current trends in database technology-EDBT 2004 workshops. Springer, pp 433–436

  28. Kwok J, Gao S (2004) Knowledge sharing community in p2p network: a study of motivational perspective. J Knowl Manag 8(1):94–102

    Article  Google Scholar 

  29. Liu L, Antonopoulos N (2010) From client-server to p2p networking. In: Shen X, Yu H, Buford J, Akon M (eds) Handbook of peer-to-peer networking. Springer, Berlin

    Google Scholar 

  30. Loke SW (2006) Declarative programming of integrated peer-to-peer and web based systems: the case of prolog. J Syst Softw 79(4):523–536

    Article  Google Scholar 

  31. McKinsey & Company (2015) Global media report

  32. Meech A (2010) Business rules using OWL and SWRL. Adv Semant Comput 2:23–31

    Google Scholar 

  33. Montresor A, Jelasity M (2009) Peersim: a scalable P2P simulator. In: Proceedings of the 9th international conference on peer-to-peer, pp 99–100

  34. Nejdl W et al (2002) EDUTELLA: a P2P networking infrastructure based on RDF. In: Proceedings of the 11th international conference on World Wide Web

  35. Ng T, Chu Y, Rao S, Sripanidkulchai K, Zhang H (2003) Measurement-based optimization techniques for bandwidth-demanding peer-to-peer systems. In: INFOCOM 2003. Twenty-second annual joint conference of the IEEE computer and communications. IEEE Societies, IEEE, vol 3, pp 2199–2209

  36. Pandurangan G, Raghavan P, Upfal E (2003) Building low-diameter peer-to-peer networks. IEEE J Select Areas Commun 21(6):995–1002

    Article  Google Scholar 

  37. PwC (2017) Perspectives from the global entertainment and media outlook

  38. Rasti AH, Stutzbach D, Rejaie R (2006) On the long-term evolution of the two-tier gnutella overlay. In: INFOCOM 2006. 25th IEEE international conference on computer communications

  39. Rodrigues R, Druschel P (2010) Peer-to-peer systems. Commun ACM 53(10):72–82

    Article  Google Scholar 

  40. Sowa J et al (2000) Knowledge representation: logical, philosophical, and computational foundations, vol 594. MIT Press, Cambridge

    Google Scholar 

  41. Stoica I et al (2003) Chord: a scalable peer-to-peer lookup protocol for internet applications. IEEE/ACM Trans Netw 11:17–32

    Article  Google Scholar 

  42. Suznjevic M, Saldana J, Matijasevic M, Fernández-Navajas J, Ruiz-Mas J (2014) Analyzing the effect of TCP and server population on massively multiplayer games. Int J Comput Games Technol 2014:602403-1–602403-17

    Article  Google Scholar 

  43. Taylor I, Harrison A (2008) From P2P and grids to services on the Web. Springer, Berlin

    Google Scholar 

  44. Zhao BY et al (2004) Tapestry: a resilient global-scale overlay for service deployment. IEEE J Select Areas Commun 22:41–53

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Michael S. Gibson.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix A: Information and model examples

Appendix A: Information and model examples

In Sect. 2.3, we provided notations to show what peers require to propagate information over a network and to play a game. To further explain the use of the notations and how they are to be used, we present an example game and explain how the notations are to be used in our models and algorithms. The example game is similar to the one used in our evaluation, discussed in Sect. 5.

Figure 5 shows a representation of a strategy game that we plan to use as an example game for our solution.

Fig. 5
figure 5

Example game

Figure 5a shows the players, their roles and how they are connected to each other in a P2P network; Fig. 5b shows an example grid world arranged in a 5X5 grid with a selection of resources, gold (g), crop (c) and tree (t), with player positions, A to I (first letter of a player’s name); and Fig. 5c shows which roles can convert a resource from the grid world, consume into a scoring resource, produce.

The objective of this game is for each player to accrue as much money, food and wood processed resources by obtaining gold, crop and tree raw resources, respectively, as possible before time runs out. Since each player can only obtain one type of raw resource from the grid, they will have to cooperate with other players to be able to obtain the other resources they cannot collect themselves. For players to find out the resource located at a cell, they can contact players with a security role which are most likely to know what each cell contains.

1.1 A.1 Predicates

Example 1

The player Alice is represented as Peer(AliceBanker); the predicate symbol Peer denotes the individual Alice as having the id of Alice and the role of Banker.

1.2 A.2 Collection of predicates

Example 2

Let us assume that the player Alice has the following processed resources: 20 money, 5 food and 10 wood. Since these resources are part of Alice’s game state, which is part of the game knowledge base, these resource quantities can be represented as \(\varPi _{resources} = \{Quantity(Money, 20), Quantity(Food, 5), Quantity(Wood, 10)\}\).

Example 3

A rule relies on a set of predicates (the antecedent) being true before the rule can be fired. This involves using conjunctions, represented as “\(\wedge \)”, to show that all predicates in a set must be true for the antecedent to be true. A conjunction of predicates is represented as

$$\begin{aligned} \varPi ^{\wedge }= A(x) \wedge B(x, y) \wedge C(x, z) \wedge D(y, z) \end{aligned}$$

1.3 A.3 Knowledge base

Example 4

Part of Alice’s knowledge of the game state is represented as

$$\begin{aligned} \overline{\varPi }_{game}&= \{ { Myself }(Alice), Cell\_Resource(Cell_1, Gold),\\&\qquad Role(Banker, Gold, Money), \ldots \} \end{aligned}$$

Example 5

Part of Alice’s knowledge of the network is represented as

$$\begin{aligned} \overline{\varPi }_{network}&= \{ Peer(Bob, Farmer), Neighbour(Bob), Knows(Bob, Charlie),\\&\qquad \ldots \} \end{aligned}$$

Each of the specified predicates has a meaning in our solution:

  • \({ Myself }\) represents which player is being controlled by a peer.

  • \(Cell\_Resource\) represents a cell position and what raw resource it contains.

  • Role represents the role name and what raw and processed resources it consumes and produces, respectively.

  • Peer represents other peers and their roles known to a peer.

  • Neighbour represents peers directly connected to a peer.

  • Knows represents how two peers are directly connected to each other.

1.4 A.4 Rules

Example 6

Let us assume

$$\begin{aligned} { Myself }(x) \wedge Peer(x, y) \wedge PositionedAt(x, z) \ \wedge \\ Cell\_Resource(z, w) \wedge Role(y, w, v) \wedge action{:}Action(Gather, w) \\ \Rightarrow IncreaseResource(x, v, 10) \end{aligned}$$

is a rule which means “if the player x is at a cell position z, has the role y to gather the cell’s raw resource w and the player wants to perform the ‘gather’ action (from player input), then increase the player’s processed resource v related to the raw resource and role by 10”. Let us also assume that Alice’s knowledge of the game is

$$\begin{aligned} \overline{\varPi }_{game} = \{\ldots , { Myself }(Alice), Peer(Alice, Banker),\\ Cell\_Resource(Cell_1, Gold), PositionedAt(Alice, Cell_1),\\ Role(Banker, Gold, Money), Quantity(Money, 10) \ldots \} \end{aligned}$$

From the rule and Alice’s KB, we can infer that \(x = Alice\), \(y = Banker\), \(z = Cell_1\), \(w = Gold\) and \(v = Money\). This results in the rule being processed as

$$\begin{aligned} { Myself }(Alice) \wedge Peer(Alice, Banker) \ \wedge \\ PositionedAt(Alice, Cell_1) \wedge Cell\_Resource(Cell_1, Gold) \ \wedge \\ Role(Banker, Gold, Money) \wedge action{:}Action(Gather, Gold) \\ \Rightarrow IncreaseResource(Alice, Money, 10) \end{aligned}$$

where all predicates (except Action) are internal in type. Since the antecedent of the rule is true and the “gather” action was performed, this will update the knowledge to be

$$\begin{aligned} \overline{\varPi }_{game} = \{\ldots , Quantity(Money, 20) \ldots \} \end{aligned}$$

where Alice’s Money quantity has risen from 10 to 20.

1.5 A.5 Non-monotonic operations

Example 7

We want a rule to specify “if the player is not at the same position as another player and chooses to move to the other player’s position, then reposition the player to the other player’s position”. This can be defined and annotated as:

$$\begin{aligned} internal{:}{ Myself }(x) \wedge internal{:}PositionedAt(x, y) \ \wedge \\ internal{:}Peer(z) \wedge external{:}PositionedAt(z, w) \ \wedge \\ internal{:}NotEqual(y, w) \wedge action{:}Action(Move, z) \\ \Rightarrow PositionedAt(x, w) \end{aligned}$$

where the predicates \({ Myself }(x)\), PositionedAt(xy), Peer(z) and \(NotEqual(y, w)\) can only be satisfied by the player being controlled by peer x’s knowledge base, PositionedAt(zw) can be satisfied by retrieving player z’s position w from the P2P network and the predicate Action(Movez) meaning player x wants to perform the ‘move’ action and move to where player z is. The action predicate can only be entered by the player as part of player input, but can be removed by housekeeping rules once the action has been committed. Since the predicate PositionedAt(zw) cannot be satisfied until position w has been retrieved from the network, this rule cannot be processed until w is available. Since a non-monotonic rule language is being used, when this rule fires, player x’s old position of y will be updated to position w.

1.6 A.6 Roles

Example 8

The farmer role consumes terms about the game resource crop and produces terms about the game resource food. This can be represented as

$$\begin{aligned} \mathbb {r}_{Farmer} = \langle Role, Farmer, \{Crop\}, \{Food\} \rangle \end{aligned}$$

1.7 A.7 Peers

Example 9

Let us assume Alice has encountered every peer in the network. Alice itself will be \(\mathbb {p}_{ myself } = \langle Peer, Alice, Banker \rangle \), Alice’s neighbours are

$$\begin{aligned} {\mathbb {P}}_N= \{\langle Peer, Bob, Farmer \rangle , \langle Peer, Daniel, Lumberjack \rangle \} \end{aligned}$$

and Alice’s participants are

$$\begin{aligned} {\mathbb {P}}_P= \{ \langle Peer, Charlie, Security \rangle , \langle Peer, Eric, Banker \rangle ,\\ \langle Peer, Frank, Farmer \rangle , \langle Peer, George, Lumberjack \rangle ,\\ \langle Peer, Harry, Security \rangle , \langle Peer, Isaac, Banker \rangle \} \end{aligned}$$

1.8 A.8 Messages

Example 10

Let us assume in this example that all peers know about each other as well as their connections among each other. Alice wants to send a query to Charlie about \(Cell_2\)’s resource because Alice does not know what \(Cell_2\) holds and knows Charlie will be best at answering this query. Since Charlie is a participant, but Bob (a neighbour) is associated with Charlie, the message path is represented as \(L= \langle \langle Peer, Alice, Banker \rangle , \langle Peer, Bob, Farmer \rangle , \langle Peer, Charlie, Security \rangle \rangle \). Therefore, \(\mathbb {p}_{start} = \langle Peer, Alice, Banker \rangle \) and \(\mathbb {p}_{end} = \langle Peer, Charlie, Security \rangle \). Also, since the message is first passed to Bob, \(\mathbb {p}_{sender} = \langle Peer, Alice, Banker \rangle \) and \(\mathbb {p}_{receiver} = \langle Peer, Bob, Farmer \rangle \). The query predicate is represented as \(\pi = Cell\_Resource(Cell_2, x)\). Since this is a new message and has not been sent yet, the message path index \(hops = 1\) to denote that the last handler of the message is Alice. Alice has not sent any messages so far, so the message ID is represented as \(\langle \langle Peer, Alice, Banker \rangle , 1 \rangle \). The message is thus represented as

$$\begin{aligned} \mathbb {m}= \langle \langle \langle \langle Peer, Alice, Banker \rangle , 1 \rangle , \\ \langle Peer, Alice, Banker \rangle , \langle Peer, Bob, Farmer \rangle , QUERY \rangle , \\ \langle Cell\_Resource(Cell_2, x), \langle Peer, Alice, Banker \rangle , \langle Peer, Charlie, Security \rangle , \\ \langle \langle Peer, Alice, Banker \rangle , \langle Peer, Bob, Farmer \rangle , \langle Peer, Charlie, Security \rangle \rangle , 1 \rangle \rangle \end{aligned}$$

1.9 A.9 Priority of roles to handle predicates

Example 11

Let us consider a predicate \(Cell\_Resource(Cell_2, x)\) which means a peer does not know what raw resource (variable x) is at \(Cell_2\). This will mean the peer will have to send a query to complete this predicate. If just the variable x was used to select a role from \(\mathbb {K}\), the peer will not know how to instantiate x. By providing the whole predicate \(Cell\_Resource(Cell_2, x)\), the knowledge base system will infer that the predicate is constructed as \(Cell\_Resource(cell, resource)\). By looking at roles which can produceresource terms, a peer with the Security role will most likely provide the term to satisfy x, thus producing a ground predicate as a reply for the query. If no peer with the Security role can provide an answer to x, other roles may be attempted. For this example, the roles Farmer, Lumberjack and Banker are attempted, in order, afterwards. There is no particular reason for this ordering; it is for the game designer to choose.

If, however, the predicate is \(Cell\_Resource(Cell_1, Tree)\), then the peer wants to inform this ground predicate to other peers who may benefit this knowledge. To process which role should benefit from this ground predicate, the knowledge base system will deduce that the Tree constant is to be informed. This then leads to working out that peers with the role Lumberjack will consume the Tree. These predicates and roles lead to the construction of

$$\begin{aligned} \mathbb {K}= \{ \langle Role\_Priority, Cell\_Resource(c, x), \\ \langle \mathbb {r}_{Security}, \mathbb {r}_{Farmer}, \mathbb {r}_{Lumberjack}, \mathbb {r}_{Banker} \rangle \rangle , \\ \langle Role\_Priority, Cell\_Resource(c, Tree), \langle \mathbb {r}_{Lumberjack} \rangle \rangle \} \\ \end{aligned}$$

where c is a variable representing any cell in the grid map. Predicates \(Cell\_Resource(c, x)\) and \(Cell\_Resource(c, Tree)\) are not in list format to highlight the difference from the \({\mathbb {k}}\) predicates.

1.10 A.10 Priority of peers processing predicates

Example 12

Let us assume in this example that all peers know about each other as well as their connections among each other. Alice needs to send a query message about the predicate \(Cell\_Resource(Cell_2, x)\) because a rule will not apply without initialising x. By looking at the roles best suited to satisfying this predicate, \(\mathbb {K}\), the peers most likely to provide x are, in descending order: Charlie, Harry, Bob, Frank, Daniel, George, Eric and Isaac. This means the priority of peers answering this predicate will be

$$\begin{aligned} \mathbb {J}= \{ \langle Peer\_Priority, \langle \mathbb {p}_{Alice}, 1 \rangle , \\ \langle \mathbb {p}_{Charlie}, \mathbb {p}_{Harry}, \mathbb {p}_{Bob}, \mathbb {p}_{Frank}, \mathbb {p}_{Daniel}, \mathbb {p}_{George}, \mathbb {p}_{Eric}, \mathbb {p}_{Isaac} \rangle \rangle \} \end{aligned}$$

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Gibson, M.S., Vasconcelos, W.W. A knowledge-based approach to multiplayer games in peer-to-peer networks. Knowl Inf Syst 61, 1091–1121 (2019). https://doi.org/10.1007/s10115-018-1295-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10115-018-1295-6

Keywords

Navigation