Unity3D高级手册0800:Web播放器流

2014-09-11 22:26:24|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:Unity3D, 游戏, 虚拟现实|来源:唯设编程网

Unity Manual > Advanced > Web Player Streaming

Unity手册->高级->web播放器流

Web Player Streaming is critical for providing a great web gaming experience for the end user. The idea behind web games is that the user can view your content almost immediately and start playing the game as soon as possible instead of making him wait for a progress bar. This is very achievable, and we will explain how.

Web播放流是至关重要的提供良好的WEB游戏体验为最终用户。WEB游戏背后的想法是用户可以查看你的内容几乎尽快立即开始播放,而不是让他等待一个进度栏的游戏。这是完全实现的,我们将解释如何。

Tuning for Portals 调整门户

This section will focus on publishing to online game portals. Streaming is useful for all kinds of contents, and it can easily be applied to many other situations.

本节将集中发布到在线游戏门户网站。流媒体是有益的各种内容,并且可以很容易地应用到许多其他情况。

Online game portals expect that some form of game play really starts after downloading at most 1 MB of data. If you don't reach this makes it that much less likely for a portal to accept your content. From the user's perspective, the game needs to start quickly. Otherwise his time is being wasted and he might as well close the window.

在线游戏门户网站预计部分游戏的形式真正追求最多1 MB的数据下载启动。如果你没有达到这使得它不可能为一个门户网站接受你的内容。从用户的角度来看,游戏需要快速启动。否则,浪费他的时间,他也学关闭该窗口。

On a 128 kilobit cable connection you can download 16 KB per second or 1 MB per minute. This is the low end of bandwidth online portals target.

在一个 128千比特电缆连接,您可以下载16kB的每秒或每分钟1 MB。这是在线目标门户网站的带宽的低端。

The game would optimally be set up to stream something like this:

游戏将设立最佳流像这样:

  1. 50 KB display the logo and menu (4 seconds) 50KB显示标识和菜单(4秒)
  2. 320 KB let the user play a tiny tutorial level or let him do some fun interaction in the menu (20 seconds) 320 KB让用户发挥小教程水平或让他做一些有趣的互动在菜单条里(20秒)
  3. 800 KB let the user play the first small level (50 seconds) 800 KB让用户打第一个小级别(50秒)
  4. Finish downloading the entire game within 1-5 MB (1-5 minutes)  完成在1-5 MB的完整游戏下载(1-5分钟)

The key point to keep in mind is to think in wait times for a user on a slow connection. Never let him wait.

关键的一点要记住,想一想通过慢速连接用户是在等待时间。从来没有让他等待。

Now, don't panic if your web player currently is 10 MB. It seems daunting to optimize it, but it turns out that with a little effort it is usually quite easy to structure your game in this fashion. Think of each above step as an individual scene. If you've made the game, you've done the hard part already. Structuring some scenes around this loading concept is a comparative breeze!

现在,不要惊慌,如果您的网页播放器目前是10 MB。看来优化是艰巨的,但结果是一点点的努力通常是很容易的以这种方式结构化你的游戏照。想想每个个别场景上述步骤。如果你做的游戏中,你已经做了困难的部分。构建解决此加载的概念是一个比较轻微的一些场面!

If you open the console log (Open Editor Log button in the Console window ) after or during a build, you can see the size of each individual scene file. The console will show something like this:

如果你打开控制台日志(打开编辑器登录到控制台窗口按钮)后或在编译过程中,你可以看到每个=的场景文件的大小。控制台会显示这样的:

***Player size statistics***

Level 0 'Main Menu' uses 95.0 KB compressed.

Level 1 'Character Builder' uses 111.5 KB compressed.

Level 2 'Level 1' uses 592.0 KB compressed.

Level 3 'Level 2' uses 2.2 MB compressed.

Level 4 'Level 3' uses 2.3 MB compressed.

Total compressed size 5.3 MB. Total decompressed size 9.9 MB.

This game could use a little more optimization! For more information, we recommend you read the reducing file size page.

此游戏可以用多一点的优化!欲了解更多信息,我们建议你阅读减少文件大小页面。

The Most Important Steps最重要的步骤

  1. Load the menu first. Showing an animated logo is a great way to make time go by unnoticed, thus letting the download progress further. 第一加载菜单。显示的动画图案是一个伟大的方法使被忽视时间,从而让更多的下载进度。
  2. Make the first level be short and not use a lot of assets. This way, the first level can be loaded quickly, and by keeping the player occupied playing it for a minute or two you can be sure that the download of all remaining assets can be completed in the background. Why not have a mini tutorial level where the user can learn the controls of the game? No reason for high-res textures here or loads of objects, or having all your enemies in the first level. Use the one with the lowest poly-count. And yes, this means you might have to design your game with the web player experience in mind.
<12>
发表评论0条 】
网友评论(共?条评论)..
Unity3D高级手册0800:Web播放器流