简体   繁体   English

独立的javascript应用程序,html5画布游戏…最理想的是使用V8,或基于浏览器调整游戏

[英]Standalone javascript applications, html5 canvas games…ideally with V8, or adjusting game based on browser

Other than just sniffing browsers and telling anyone not using Chrome tough luck on purpose (75%+ of the internet?), I'm looking for different options to make an executable out of a canvas game, if that's even possible. 除了嗅探浏览器,并告诉任何不故意使用Chrome的人(互联网上超过75%的运气),我什至在寻找其他方法来使画布游戏中的可执行文件成为可能,甚至是可能的。

The idea is to control the performance of my game by including v8 to users who don't have chrome installed.....is there a way to interface with it?? 这个想法是通过向没有安装chrome的用户添加v8来控制我的游戏的性能。....有没有办法与之交互? Something like a web "wrapper" like Flash's plugin so you could install a v8 "plugin" cross browser??? 类似于Flash插件的网络“包装器”,因此您可以安装v8“插件”跨浏览器???

The canvas game works with safari and firefox, but at 50-60% of the performance experienced in google chrome. 画布游戏可与野生动物园和Firefox配合使用,但性能可达到Google chrome的50-60%。

Another discrepancy is with Firefox if I make the game map more than 100x100 tiles, it chokes when generating the map and gives a "stop script" popup, if you hit "continue" it throws another popup for "out of memory, close your stuff to prevent data loss". Firefox的另一个差异是,如果我使游戏地图超过100x100瓦片,则生成地图时会窒息并给出“停止脚本”弹出窗口;如果您单击“继续”,则会抛出另一个弹出窗口,表示“内存不足,请关闭您的东西”以防止数据丢失”。

Using the same code in Chrome or safari, I tested maps with 500x500 tiles (yes that is 250,000 tiles, where firefox choked on 10,000 tiles....) which runs smoothly/consistently in both Chrome and Safari, though safari is 60% of the frame rate chrome manages. 在Chrome或safari中使用相同的代码,我测试了具有500x500瓦片(是250,000瓦片,其中Firefox在10,000瓦片上cho住了...)的地图,尽管Safari的60% chrome的帧频管理。

I haven't yet found a limit to what chrome can handle, and using culling to only draw tiles around the view it's the same frame rate with 250,000 tiles as it was with 100 tiles (more than 200fps in chrome with 250k tiles!!!!! small view though), the only thing that changes performance is the size of the canvas element/view. 我还没有发现Chrome可以处理的限制,并且使用剔除仅在视图周围绘制图块时,使用250,000张图块时的帧频与使用100张图块时的帧率相同(在使用25万张图块的chrome中超过200fps !!!) !!小视图),唯一改变性能的是画布元素/视图的大小。 Meanwhile Firefox can't even calculate the zones, let alone draw all the tiles inside the proper zones. 同时,Firefox甚至无法计算区域,更不用说在适当区域内绘制所有图块了。 (it does work over 100fps with maps 10k tiles or less) (使用10k或更少的地图时,确实可以以100fps的速度运行)

It's tempting to allow anyone with a browser that supports html5 to play the game, but at the same time, user's opinion of your game will be MUCH MUCH MUCH better if the PERFORMANCE IS TWICE AS GOOD as the crappiest version that "can" play your game. 诱使任何人使用支持html5的浏览器进行游戏,但是同时,如果性能是“可以”玩游戏的最糟糕的版本,那么用户对您的游戏的看法将更好得多。游戏。

I'm reading about V8, and how you can incorporate it into your own c++ applications, or run it standalone?? 我正在阅读有关V8的信息,以及如何将其整合到自己的C ++应用程序中或独立运行它? Has anyone developed a wrapper to make a self contained executable for html5 canvas games?? 有没有人开发一个包装器来为html5画布游戏制作一个自包含的可执行文件? Or a web wrapper to embed an interface to V8 or something??? 或Web包装器将接口嵌入到V8之类的东西???

I just installed chrome myself this week, after trying to target as many browsers as I could in the past, and it changed the way I think, now it's just not as good once you've had over 200fps to then play the same game with under 100fps..............And as much as I've thought it was idiotic to require chrome (seen lots of html5 devs begging people to use chrome) I've come to the realization I was ignorant, and now I think the only way to enforce the full potential of my efforts is to drop coverage for all browsers except ones that can output a set level of performance. 在尝试定位过去尽可能多的浏览器之后,我本周才自己安装了chrome,它改变了我的思维方式,现在一旦您以超过200fps的速度玩同一款游戏,它就变得不那么理想了。在100fps以下................我认为需要chrome实在是很愚蠢的(看到许多html5开发人员恳求人们使用chrome),我已经意识到是无知的,现在我认为增强我的全部潜能的唯一方法是降低所有浏览器的覆盖范围,但那些浏览器可以输出一定级别的性能。


Otherwise the only thing I can figure is to make a different version of whatever games I develop for firefox with a smaller viewable window, smaller map, etc, then on other browsers, check performance and scale the view/map size based off what browser they're using. 否则,我唯一能想到的就是用更小的可见窗口,更小的地图等来制作我为firefox开发的任何游戏的不同版本,然后在其他浏览器上检查性能并根据使用的浏览器缩放视图/地图的大小正在使用。

Another temporary idea I was thinking of, if a user has google chrome, the game window will be 700x500px on the screen, if they have safari, drop it to like 500x375px to achieve the same frame rate, and if they have firefox the window will be like 400x300px. 我想到的另一个临时想法是,如果用户使用的是谷歌浏览器,则游戏窗口在屏幕上的大小为700x500px,如果用户使用的是野生动物园,则将其降到500x375px以达到相同的帧频,如果用户使用的是Firefox,则窗口会就像400x300px

At the same time, if a user is playing the game with Firefox, in the 400x300px window, I would include an obvious(blinking? lol) border around the window 700x500px showing how big the game window would be if they were using chrome? 同时,如果用户正在使用Firefox玩游戏,则在400x300px的窗口中,我会在窗口700x500px周围添加一个明显的(闪烁的大声笑)边框,显示如果他们使用chrome,则游戏窗口的大小多少? Does that sound like motivation? 这听起来像动机吗? Then they can get a taste of the game, if they like it they might find it worthwhile to install chrome to view the full size game???? 然后他们可以体验一下游戏,如果他们喜欢它,他们可能会发现值得安装chrome来查看完整尺寸的游戏?

For IE<9, you can do what you're after with Google Chrome Frame . 对于IE <9,您可以使用Google Chrome浏览器内嵌框架进行后续操作 This works like a Flash-style plugin, which you can prompt users to install. 它的工作方式类似于Flash样式的插件,您可以提示用户进行安装。 It isn't available for Firefox or Safari, as far as I know. 据我所知,它不适用于Firefox或Safari。

While I'm aware of several frameworks for desktop apps using HTML and Javascript , they generally seem to use WebKit, so I would expect performance to be comparable to Safari at best ( Titanium Desktop from Appcelerator is another option, but also WebKit-based). 虽然我知道使用HTML和Javascript的桌面应用程序的几种框架 ,但它们通常似乎都使用WebKit,因此我希望性能最多可与Safari媲美(Appcelerator的Titanium Desktop是另一种选择,但也是基于WebKit的)。 。

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

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