简体   繁体   English

在nodejs上运行的sprite-kit游戏

[英]sprite-kit game running on nodejs

I'm very confused about how to create a true multiplayer game using sprite kit. 我对如何使用Sprite Kit创建真正的多人游戏感到非常困惑。 What I mean by "true multiplayer" is that players connect to a server and not share the same game screen (like an rpg). 我所说的“真正的多人游戏”是玩家连接到服务器,而不共享相同的游戏画面(例如rpg)。

The problem is, I can't find any tutorials on this, every tutorial is for games like candy crush where there's a connection to a server, but the game runs on the device. 问题是,我找不到与此相关的任何教程,每个教程都是针对诸如Candy Candy之类的游戏的,这些游戏都与服务器建立了连接,但是游戏在设备上运行。 The server is just used to access data, or save/update game progress. 该服务器仅用于访问数据或保存/更新游戏进度。

My question is specifically: how do I have some server provide the "world" for a game, where players can connect and each have their own camera, and do their own individual tasks. 我的问题特别是:我如何让某个服务器为游戏提供“世界”,玩家可以连接,每个人都有自己的摄像头,并完成各自的任务。 Is this how multiplayer games work, or am I missing the point? 这是多人游戏的工作方式,还是我错过了要点?

if I'm not missing the point, do I have to use a specific type of server? 如果我没有忘记要点,是否必须使用特定类型的服务器? (in other words, since the game is written using sprite-kit, something that can communicate with sprite-kit?) or can any server (like node) work? (换句话说,由于游戏是使用sprite-kit编写的,是否可以与sprite-kit进行通信?)还是任何服务器(例如节点)都可以工作?

I assume you are talking doing something like the game Destiny. 我认为您正在谈论做诸如《命运》这样的游戏。 If that is the case, you are going to have to design your own classes. 如果是这样,您将不得不设计自己的类。 To put something like that into a nutshell, you would probably have to use a similar principal as LOD (level of detail for graphics). 简而言之,您可能必须使用与LOD(图形的详细程度)相似的原理。 Meaning only draw in other players within a certain range of the user. 意思是只吸引用户一定范围内的其他玩家。 I would venture to guess that this can be done but a lot would depend on the network connection, information passed back and forth and the iOS processor speed. 我敢冒险猜测可以做到这一点,但很大程度上取决于网络连接,来回传递的信息以及iOS处理器的速度。

The standard features included in the GameKit framework are: GameKit框架中包含的标准功能包括:

Game Center offers a centralized game service that connects players to each other. Game Center提供了集中式游戏服务,可将玩家彼此联系起来。 Game Center implements many different features: Game Center实现了许多不同的功能:

Friends allow players to create anonymous online personas. 朋友允许玩家创建匿名的在线角色。 Users connect to Game Center and interact with other players through an alias. 用户连接到Game Center并通过别名与其他玩家互动。 Players can set status messages as well as mark other players as friends. 玩家可以设置状态消息,也可以将其他玩家标记为好友。

Multiplayer allows your game to create network matches that connect players through Game Center. 多人游戏允许您的游戏创建网络匹配,以通过Game Center连接玩家。 Players can invite their friends or be connected to anonymous players. 玩家可以邀请他们的朋友或与匿名玩家建立联系。 Most importantly, players can receive invitations to join a match even when your game is not running. 最重要的是,即使您的游戏没有运行,玩家也可以收到参加比赛的邀请。 Your game is running on each device and the instances of your game exchange match and voice data with each other. 您的游戏在每台设备上运行,并且您的游戏实例彼此交换匹配信息和语音数据。

Turn-Based Gaming provides store-and-forward network match infrastructure where the match is played out over a series of discrete turns. 基于回合的游戏提供了存储转发网络比赛基础结构,其中比赛通过一系列离散回合进行。 This kind of match can be played without requiring all of the players to be connected to Game Center simultaneously. 无需所有玩家同时连接到Game Center即可进行这种比赛。

Leaderboards allow your game to store and fetch player scores from Game Center. 排行榜允许您的游戏存储和从Game Center获取玩家分数。

Achievements provide the ability to track a player's accomplishments in your game. 成就提供了在游戏中跟踪玩家成就的能力。

Challenges allow a player to challenge other players to complete an achievement or to beat a leaderboard score. 挑战允许玩家挑战其他玩家以达成成就或击败排行榜得分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM