织梦CMS - 轻松建站从此开始!

罗索

当前位置: 主页>基础技术>Soft.Eng>

用什么语言和编译器来做游戏?三【转】

罗索客 发布于 2008-06-11 23:02 点击:次 
标签:游戏开发 娱乐 分类:游戏开发 7、Java Java是由Sun最初设计用于嵌入程序的可移植性“小C++”。在网页上运行小程序的想法着实吸引了不少人的目光,于是,这门语言迅速崛起。事实证明,Java不仅仅适于在网页上内嵌动画 — 它是一门极好的完全的软件编程的小语言。
TAG:

标签:游戏开发 娱乐 分类:游戏开发

7、Java
  Java是由Sun最初设计用于嵌入程序的可移植性“小C++”。在网页上运行小程序的想法着实吸引了不少人的目光,于是,这门语言迅速崛起。事实证明,Java不仅仅适于在网页上内嵌动画 — 它是一门极好的完全的软件编程的小语言。“虚拟机”机制、垃圾回收以及没有指针等使它很容易实现不易崩溃且不会泄漏资源的可靠程序。
  Java was originally designed by Sun to be a portable "small C++" that could be used in embedded applications. The idea of running little applications in a web-page really captured people's imaginations, so the language caught on quickly. It turned out that Java wasn't just suitable for embedding animated banners in web pages --it was a downright nifty little language for application programming! The "virtual machine" nature, garbage collection and lack of pointers made it easy to make bulletproof apps that didn't crash and had no resource leaks.

  虽然不是C++的正式续篇,Java从C++ 中借用了大量的语法。它丢弃了很多C++的复杂功能,从而形成一门紧凑而易学的语言。不像C++,Java强制面向对象编程,要在Java里写非面向对象的程序就像要在Pascal里写“空心粉式代码”一样困难。
  While not an official "sequel" to C++, Java borrows very heavily from C++ syntax. It dumps many of the more difficult C++ features to reveal a rather compact and easy-to-learn language. Unlike C++, Java enforces object-orientation with a heavy hand. Writing a non-OO app in Java is as difficult as writing spaghetti-code in Pascal.

  优点:二进制码可移植到其他平台。程序可以在网页中运行。内含的类库非常标准且极其健壮。自动分配合垃圾回收避免程序中资源泄漏。网上数量巨大的代码例程。
  Advantages: Binaries are portable to other platforms. Apps can run embedded in web pages. The included class library is reasonably standardized and extremely robust. Automatic allocation and garbage collection all but eliminates resource leaks in applications. Zillions of code examples on the web.

  缺点:使用一个“虚拟机”来运行可移植的字节码而非本地机器码,程序将比真正编译器慢。有很多技术(例如“即时”编译器)很大的提高了Java的速度,不过速度永远比不过机器码方案。早期的功能,如AWT没经过慎重考虑,虽然被正式废除,但为了保持向后兼容不得不保留。越高级的技术,造成处理低级的机器功能越困难,Sun为这门语言增加新的“受祝福”功能的速度实在太慢。
  Disadvantages: Uses a "virtual machine" to run portable byte-code rather than native machine code, so apps are slower than true compilers. There are technologies (like "Just In Time" compilers) that greatly improve the speed of Java, but the speed will likely always lag behind true machine-code solutions. Early features like the Abstract Windowing Toolkit were not well thought-out and, while officially abandoned, have to hang around for backward compatibility. Is very high-level, which makes dealing with any low-level machine features very difficult. Sun is pretty slow in adding new "blessed" features to the language.

  移植性:最好的,但仍未达到它本应达到的水平。低级代码具有非常高的可移植性,但是,很多UI及新功能在某些平台上不稳定。
  Portability: The best of the lot, but still not what it should be. The low-level code is very portable, but a lot of the UI and newer features are wobbly on some platforms.

  使用Java编写的游戏:网页上有大量小的Applet,但仅有一些是商业性的。有几个商业游戏使用Java作为内部脚本语言。
  Games Written in Java: Lots of little applets in web pages, but only a couple of commercial offerings. Several commercial games use Java as the internal script language.

  资料:Sun的官方Java页面有一些好的信息。IBM也有一个非常好的Java页面。JavaLobby是一个关于Java新闻的最好去处。
  Resources: [Sun's official Java page] has some good info. IBM also has an excellent [Java page]. The [JavaLobby] is the best place to go for news about Java.


8、创作工具
  上面所提及的编程语言涵盖了大多数的商业游戏。但是也有一个例外,这个大游戏由于它的缺席而变得突出。
  All of the programming languages mentioned above cover pretty-much every commercial game out there. There is one exception, but it's such a big one that it would be conspicuous by its absence.

  “神秘岛”。没错,卖得最好的商业游戏不是使用以上任何一门语言编的,虽然有人说“神秘岛”99%是使用 3D建模工具制作的,其根本的编程逻辑是在HyperCard里完成的。
  Yep, the best selling commercial game of all time wasn't written in any of the above languages. While some would say that 99% of Myst was written using 3D modeling tools, the underlying program logic was done in HyperCard.

  多数创作工具有点像Visual Basic,只是它们工作在更高的层次上。大多数工具使用一些拖拉式的流程图来模拟流程控制。很多内置解释的程序语言,但是这些语言都无法像上面所说的单独的语言那样健壮。
  Most authoring tools are a bit like Visual Basic, only they work at a much higher level. Most of the tools use some kind of click-and-drag flowchart motif to model control flow. Many contain embedded interpreted programming languages, but these languages aren't nearly as robust as the standalone languages mentioned above.

  优点:快速原型 — 如果你的游戏符合工具制作的主旨,你或许能使你的游戏跑得比使用其他语言快。在很多情况下,你可以创造一个不需要任何代码的简单游戏。使用插件程序,如 Shockware及IconAuthor播放器,你可以在网页上发布很多创作工具生成的程序。
  Advantages: Fast prototyping --if your game fits the motif the tool's made for, you can probably get your game running faster than any other language. In many cases, you can make a rudimentary game without writing any code. You can broadcast many authored apps on web pages with plug-ins like Shockwave and IconAuthor Player.

  缺点:专利权,至于将增加什么功能,你将受到工具制造者的支配。你必须考虑这些工具是否能满足你游戏的需要,因为有很多事情是那些创作工具无法完成的。某些工具会产生臃肿得可怕的程序。
  Disadvantages: Proprietary, so you're at the mercy of the tool-maker as to what features will be added. You've gotta really look at these tools to see if they'll do everything that your game's gonna require, because there are things that authoring tools simply can't do. Some of these tools produce frighteningly bloated apps.

  移植性:因为创作工具是具有专利权的,你的移植性以他们提供的功能息息相关。有些系统,如Director可以在几种平台上创作和运行,有些工具则在某一平台上创作,在多种平台上运行,还有的是仅能在单一平台上创作和运行。
  Portability: Since authoring tools are proprietary, your portability is limited to whatever they offer. Some systems, like Director, can author and run on several platforms. Some tools can author on one platform but play on several. Some are single-platform beasts.

  使用创作工具编写的游戏:“神秘岛”和其他一些同类型的探险游戏。所有的Shockwave游戏都在网络上。
  Games Written in Authoring Tools: Myst and a few other "exploration" games of the same genre. All of the Shockwave games on the web.

  资料:Director、HyperCard、SuperCard、IconAuthor、Authorware。


9、结论(Conclusion)
  你可能希望得到一个关于“我该使用哪种语言”这个问题的更标准的结论。非常不幸,没有一个对所有应用程序都最佳的解决方案。C适于快而小的程序,但不支持面向对象的编程。C++完全支持面向对象,但是非常复杂。Visual Basic与Delphi易学,但不可移植且有专利权。Java有很多简洁的功能,但是慢。创作工具可以以最快的速度产生你的程序,但是仅对某一些类型的程序起作用。最好的方法是决定你要写什么样的游戏,并选择对你的游戏支持最好的语言。“试用三十天”的做法成为工业标准是件好事情。
  You probably were hoping for a more cut-n-dry conclusion to the "what programming language do I use" dilemma. Unfortunately, there's no solution that's optimal for all applications. C is suited for fast and small applications, but doesn't support OO programming well. C++ has very complete OO support, but is frighteningly complicated. Visual Basic and Delphi are easy to learn, but are non-portable and proprietary. Java has a lot of neat features, but is slow. Authoring tools can get your app working quickest, but are only useful for a narrow range of applications. It might just be best for you to figure out what kind of game you're writing and pick the language that would best support your game. It's a good thing that the "try it free for 30 days" offer has become the industry norm :-)
--------------------------------------------------------------------------------
作者简介
  John Hattan是位于德克萨斯州的Watauga里最大的软件公司 — Code Zone的主要负责人。如果你对他的文章有什么看法,请写信给他。

(iwgh)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/200806/6984.html]
本文出处: 作者:iwgh
顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容