• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天行健 君子當自強而不息

            【ZT】我該使用何種語言

            目錄:
            1、C語言
            2、C++
            3、C++與C的抉擇
            4、匯編語言
            5、Pascal語言
            6、Visual Basic
            7、Java
            8、創作工具
            9、結論

            --------------------------------------------------------------------------------
              原 文:What Language Do I Use
              譯 者:Sunlxy
              版 本:the first edition(Ver 1.0)
            --------------------------------------------------------------------------------

              這是每個游戲編程FAQ里都有的問題。這個問題每星期都會在游戲開發論壇上被問上好幾次。這是個很好的問題,但是,沒人能給出簡單的答案。在某些應用程序中,總有一些計算機語言優于其他語言。下面是幾種用于編寫游戲的主要編程語言的介紹及其優缺點。希望這篇文章能幫助你做出決定。
              This is a question that belongs in every game programming FAQ. It seems to be asked in a game development forum several times a week. It's a good question, though, and not one with an easy answer. There are computer languages that work better for some applications than others. Here is a list of the major programming languages used to write games along with descriptions, advantages, and disadvantages. Hopefully this list will help you make a decision.

            1、C語言

              如果說FORTRAN和COBOL是第一代高級編譯語言,那么C語言就是它們的孫子輩。C語言是Dennis Ritchie在七十年代創建的,它功能更強大且與ALGOL保持更連續的繼承性,而ALGOL則是COBOL和FORTRAN的結構化繼承者。C語言被設計成一個比它的前輩更精巧、更簡單的版本,它適于編寫系統級的程序,比如操作系統。在此之前,操作系統是使用匯編語言編寫的,而且不可移植。C語言是第一個使得系統級代碼移植成為可能的編程語言。
              If FORTRAN and COBOL were the first compiled high-level languages, then C is their grandchild. It was created in the 70's by Dennis Ritchie as a tighter and more coherent successor to ALGOL, which was a structured successor to COBOL and FORTRAN. It was designed to be a smaller and simpler version of its predecessors, suitable for writing system-level programs, like operating systems. Before then, operating systems were hand-coded in assembly and were not portable. C was the first programming language that made portability a reality for system-level code.

              C語言支持結構化編程,也就是說C的程序被編寫成一些分離的函數呼叫(調用)的集合,這些呼叫是自上而下運行,而不像一個單獨的集成塊的代碼使用 GOTO語句控制流程。因此,C程序比起集成性的FORTRAN及COBOL的“空心粉式代碼”代碼要簡單得多。事實上,C仍然具有GOTO語句,不過它的功能被限制了,僅當結構化方案非常復雜時才建議使用。
              C is a language that supports structured programming. That is to say that C programs are written as collections of disconnected function calls that run top-down rather than a single monolithic block of code with program control-flow happening via GOTO statements. Hence, C programs are generally easier to follow than monolithic FORTRAN and COBOL spaghetti-code. Actually, C still has a GOTO statement, but its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated.

              正由于它的系統編程根源,將C和匯編語言進行結合是相當容易的。函數調用接口非常簡單,而且匯編語言指令還能內嵌到C代碼中,所以,不需要連接獨立的匯編模塊。
              True to its system-programming roots, it is fairly easy to interface C with assembly languages. The function-calling interface is very simple, and assembly language instructions can be embedded within C code, so linking in separate assembly-language modules is not necessary.

              優點:有益于編寫小而快的程序。很容易與匯編語言結合。具有很高的標準化,因此其他平臺上的各版本非常相似。
              Advantages: Good for writing small fast programs. Easy to interface with assembly language. Very standardized, so versions on other platforms are similar.

              缺點:不容易支持面向對象技術。語法有時會非常難以理解,并造成濫用。
              Disadvantages: Does not easily support object-oriented techniques. Syntax can be difficult and lends itself to abuse.

              移植性:C語言的核心以及ANSI函數調用都具有移植性,但僅限于流程控制、內存管理和簡單的文件處理。其他的東西都跟平臺有關。比如說,為 Windows和Mac開發可移植的程序,用戶界面部分就需要用到與系統相關的函數調用。這一般意味著你必須寫兩次用戶界面代碼,不過還好有一些庫可以減輕工作量。
              Portability: While the core of the language and the ANSI function calls are very portable, they are limited to control-flow, memory management, and simple file-handling. Everything else is platform-specific. Making a program that's portable between Windows and the Mac, for instance, requires that the user-interface portions be using system-specific function calls. This generally means that you need to write the user-interface code twice. There are libraries, though, that make the process a bit easier.

              用C語言編寫的游戲:非常非常多。
              Games Written in C: Lots and lots.

              資料:C語言的經典著作是《The C Programming Language》,它經過多次修改,已經擴展到最初的三倍大,但它仍然是介紹C的優秀書本。一本極好的教程是《The Waite Group's C Primer Plus》。
              Resources: The classic book about C is [The C Programming Language].It's gone through several iterations and has expanded to about three times its original size, but it's still a good introduction to the language. An excellent tutorial is [The Waite Group's C Primer Plus].

            2、C++

              C++語言是具有面向對象特性的C語言的繼承者。面向對象編程,或稱OOP是結構化編程的下一步。OO程序由對象組成,其中的對象是數據和函數離散集合。有許多可用的對象庫存在,這使得編程簡單得只需要將一些程序“建筑材料”堆在一起(至少理論上是這樣)。比如說,有很多的GUI和數據庫的庫實現為對象的集合。
              C++ is the object-oriented successor to C. Object-oriented, or OO, programs are the next step beyond structured programming. OO programs are built out of objects, which are packages of data and functions collected into discrete units. There are many libraries of objects available that make writing programs as simple as pulling together a collection of program "building blocks" (at least in theory). For example, there are many GUI and database libraries that are implemented as collections of objects.

              C++總是辯論的主題,尤其是在游戲開發論壇里。有幾項C++的功能,比如虛擬函數,為函數呼叫的決策制定增加了一個額外層次,批評家很快指出C++ 程序將變得比相同功能的C程序來得大和慢。C++的擁護者則認為,用C寫出與虛擬函數等價的代碼同樣會增加開支。這將是一個還在進行,而且不可能很快得出結論的爭論。
              C++ is the subject of controversy, especially in the game development community. There are features of C++, like virtual functions, that add an extra layer of decision-making to function calls, and critics are quick to point out that C++ programs can be larger and slower than C counterparts. C++ advocates point out, however, that coding the equivalent of a virtual function in C requires the same overhead. It's an on-going debate that's not likely to be decided soon.

              我認為,C++的額外開支只是使用更好的語言的小付出。同樣的爭論發生在六十年代高級程序語言如COBOL和FORTRAN開始取代匯編成為語言所選的時候。批評家正確的指出使用高級語言編寫的程序天生就比手寫的匯編語言來得慢,而且必然如此。而高級語言支持者認為這么點小小的性能損失是值得的,因為 COBOL和FORTRAN程序更容易編寫和維護。
              In my opinion, the overhead of C++ is simply the price you pay for a better language. This same debate went on in the 60's when high-level programming languages like COBOL and FORTRAN started to displace hand-coded assembly as the language of choice. Critics correctly pointed out that programs written in high-level languages were inherently slower than hand-tuned assembly and always would be. High-level language advocates pointed out, however, that the slight performance hit was worth it because COBOL and FORTRAN programs were much easier to write and maintain.

              優點:組織大型程序時比C語言好得多。很好的支持面向對象機制。通用數據結構,如鏈表和可增長的陣列組成的庫減輕了由于處理低層細節的負擔。
              Advantages: Much better than C for organizing large programs. Supports the object-oriented paradigm nicely. Libraries of common data structures, like linked lists and grow-able arrays, can remove much of the burden of having to deal with low-level details.

              缺點:非常大而復雜。與C語言一樣存在語法濫用問題。比C慢。大多數編譯器沒有把整個語言正確的實現。
              Disadvantages: Extremely large and complicated. Like C, the syntax lends itself to abuse. Can be slower than C. Not many compilers implement the entire language correctly.

              移植性:比C語言好多了,但依然不是很樂觀。因為它具有與C語言相同的缺點,大多數可移植性用戶界面庫都使用C++對象實現。
              Portability: Better than C, but still not great. While it shares the same disadvantage as C, most of the portable user-interface libraries are implemented as collections of C++ objects.

              使用C++編寫的游戲:非常非常多。大多數的商業游戲是使用C或C++編寫的。
              Games Written in C++: Lots and lots. Almost all commercial games are written in C or C++.

              資料:最新版的《The C++ Programming Language》非常好。作為教程,有兩個陣營,一個假定你知道C,另外一個假定你不知道。到目前為止,最好的C++教程是《Who's Afraid of C++》,如果你已經熟知C,那么試一下《Teach Yourself C++》。
              Resources: The latest edition of The C++ Programming Language is excellent. As for tutorials, there are two camps, ones that assume you know C, and ones you don't. By far the best ground-up C++ tutorials are Who's Afraid of C++ and Who's Afraid of More C++. If you already know C, try Teach Yourself C++.

            3、我該學習C++或是該從C開始(Should I learn C++, or should I start with C )

              我不喜歡這種說法,但它是繼“我該使用哪門語言”之后最經常被問及的問題。很不幸,不存在標準答案。你可以自學C并使用它來寫程序,從而節省一大堆的時間,不過使用這種方法有兩個弊端:
              I thought this bore mentioning, as it's the second most commonly asked question next to "which programming language should I use?"Unfortunately, the answer isn't black and white. You could save a lot of time by just teaching yourself C and writing apps, but there are two disadvantages to this approach.
            你將錯過那些面向對象的知識,因為它可能在你的游戲中使得數據建模更有效率的東西。
            You're missing out on what will likely be a much more effective way of modeling the data in your game. By not learning OO programming off the bat, you could be enforcing bad programming habits that you'll have to un-learn later. Trust me on this one.


            最大的商業游戲,包括第一人稱射擊游戲很多并沒有使用C++。但是,這些程序的作者即使使用老的C的格式,他們通常堅持使用面向對象編程技術。如果你只想學C,至少要自學OO(面向對象)編程技術。OO是仿真(游戲)的完美方法,如果你不學習OO,你將不得不“辛苦”的工作。
            Many of the biggest commercial games, including most first-person shooters, get by without C++. The authors of these programs, however, always insist that they're using object-oriented programming techniques even though they're using plain old C. If you want to just learn C, at least teach yourself OO programming techniques. OO is the perfect methodology for simulations (read: games), and you'll really be doing it "the hard way" if you push off learning OO.


            4、匯編語言(Assembly)

              顯然,匯編是第一個計算機語言。匯編語言實際上是你計算機處理器實際運行的指令的命令形式表示法。這意味著你將與處理器的底層打交道,比如寄存器和堆棧。如果你要找的是類英語且有相關的自我說明的語言,這不是你想要的。
              By default, assembly was the first computer language. Assembly language is actually a command-based representation of the actual instructions that your computer's processor runs. That means you will be dealing with the low-level details of your processor, like registers and stacks. If you're looking for a language that's English-like and is relatively self-documenting, this isn't it!

              確切的說,任何你能在其他語言里做到的事情,匯編都能做,只是不那么簡單 — 這是當然,就像說你既可以開車到某個地方,也可以走路去,只是難易之分。話雖不錯,但是新技術讓東西變得更易于使用。
              By definition, anything you can do in any other language, you can do in assembly, only not as easily --of course, that's like saying that anywhere you can go in a car, you can go on foot, only not as easily. While the statement might be true, the later technologies made things much easier to use.

              總的來說,匯編語言不會在游戲中單獨應用。游戲使用匯編主要是使用它那些能提高性能的零零碎碎的部分。比如說,毀滅戰士整體使用C來編寫,有幾段繪圖程序使用匯編。這些程序每秒鐘要調用數千次,因此,盡可能的簡潔將有助于提高游戲的性能。而從C里調用匯編寫的函數是相當簡單的,因此同時使用兩種語言不成問題。
              In general, assembly language is not used on its own for games. Games that use assembly language use it in bits and pieces where it can improve performance. For example, DOOM is written entirely in C with a couple of drawing routines hand-coded in assembly. They are the routines that are called a few thousand times a second, so making the routine as tight as possible really helped the performance of the game. It's fairly easy to write a function in assembly that is call-able from C, so using both languages wasn't a problem.

              特別注意:語言的名字叫“匯編”。把匯編語言翻譯成真實的機器碼的工具叫“匯編程序”。把這門語言叫做“匯編程序”這種用詞不當相當普遍,因此,請從這門語言的正確稱呼作為起點出發。
              Special Note: The name of the language is "assembly". The name of the tool that converts assembly language into true machine code is called an "assembler". It's a common misnomer to call the language "assembler", so start out on the right foot by calling the language by its proper name.

              優點:最小、最快的語言。匯編高手能編寫出比任何其他語言能實現的快得多的程序。你將是利用處理器最新功能的第一人,因為你能直接使用它們。
              Advantages: Is, by definition, the smallest and fastest language. A talented assembly programmer can write programs that are faster than anything that can be done in other languages. You'll be the first person to be able to take advantage of the processor's latest new features, because you can use them directly.

              缺點:難學、語法晦澀、堅持效率,造成大量額外代碼 — 不適于心臟虛弱者。
              Disadvantages: Difficult to learn, cryptic syntax, tough to do efficiently, and it takes much more code to get something done --not for the faint of heart!

              移植性:接近零。因為這門語言是為一種單獨的處理器設計的,根本沒移植性可言。如果使用了某個特殊處理器的擴展功能,你的代碼甚至無法移植到其他同類型的處理器上(比如,AMD的3DNow指令是無法移植到其它奔騰系列的處理器上的)。
              Portability: Zilch. Since the language is designed for a single processor, it is not portable by definition. If you use extensions specific to a particular brand of processor, your code isn't even portable to other processors of the same type (for example, AMD 3DNOW instructions are not portable to other Pentium-class processors).

              使用匯編編寫的游戲:我不知道有什么商業游戲是完全用匯編開發的。不過有些游戲使用匯編完成多數對時間要求苛刻的部分。
              Games Written in Assembly: I don't know of any commercial games that are written entirely in assembly. Some games, however, have the most time-critical portions done in assembly.

              資料:如果你正在找一門匯編語言的文檔,你主要要找芯片的文檔。網絡上如Intel、AMD、Motorola等有一些關于它們的處理器的資料。對于書籍而言,《Assembly Language: Step-By-Step》是很值得學習的。
              Resources: When you're looking for documentation for an assembly language, you're basically looking for the documentation for the chip. There is some online information at [Intel], [AMD][Motorola] for their processors. As for books, [Assembly Language: Step-By-Step] is well-reviewed.


            5、Pascal語言

              Pascal語言是由Nicolas Wirth在七十年代早期設計的,因為他對于FORTRAN和COBOL沒有強制訓練學生的結構化編程感到很失望,“空心粉式代碼”變成了規范,而當時的語言又不反對它。Pascal被設計來強行使用結構化編程。最初的Pascal被嚴格設計成教學之用,最終,大量的擁護者促使它闖入了商業編程中。當 Borland發布IBM PC上的 Turbo Pascal時,Pascal輝煌一時。集成的編輯器,閃電般的編譯器加上低廉的價格使之變得不可抵抗,Pascal編程了為MS-DOS編寫小程序的首選語言。
              Pascal was designed by Nicolas Wirth in the early 70's, because he was dismayed to see that FORTRAN and COBOL were not enforcing healthy structured programming disciplines in students. "Spaghetti code" was becoming the norm, and the languages of the time weren't discouraging it. Pascal was designed from the ground up to enforce structured programming practices. While the original Pascal was designed strictly for teaching, it had enough advocates to eventually make inroads into commercial programming. Pascal finally took the spotlight in a big way when Borland released Turbo Pascal for the IBM PC. The integrated editor, lightning-fast compiler, and low price were an irresistible combination, and Pascal became the preferred language for writing small programs for MS-DOS.

              然而時日不久,C編譯器變得更快,并具有優秀的內置編輯器和調試器。Pascal在1990年Windows開始流行時走到了盡頭,Borland放棄了Pascal而把目光轉向了為Windows 編寫程序的C++。Turbo Pascal很快被人遺忘。
              The momentum, however, did not stay. C compilers became faster and got nice built-in editors and debuggers. The almost-final nail in Pascal's coffin happened in the early 1990's when Windows took over, and Borland ignored Pascal in favor of C++ for writing Windows applications. Turbo Pascal was all but forgotten.

              最后,在1996年,Borland發布了它的“Visual Basic殺手”— Delphi。它是一種快速的帶華麗用戶界面的 Pascal編譯器。由于不懈努力,它很快贏得了一大群愛好者。
              Finally, in 1996, Borland released its "Visual Basic Killer", Delphi. Delphi was a fast Pascal compiler coupled with a gorgeous user interface. Against all odds (and the Visual Basic juggernaut), it gained a lot of fans.

              基本上,Pascal比C簡單。雖然語法類似,它缺乏很多C有的簡潔操作符。這既是好事又是壞事。雖然很難寫出難以理解的“聰明”代碼,它同時也使得一些低級操作,如位操作變得困難起來。
              On the whole, Pascal is simpler than C. While the syntax is similar, it lacks a lot of the shortcut operations that C has. This is a good thing and a bad thing. It's harder to write inscrutable "clever" code, but it makes low-level operations like bit-manipulation more difficult.

              優點:易學、平臺相關的運行(Dephi)非常好。
              Advantages: Easy to learn. Platform-specific implementations (Delphi) are very nice.

              缺點:“世界潮流”面向對象的Pascal繼承者(Modula、Oberon)尚未成功。語言標準不被編譯器開發者認同。專利權。
              Disadvantages: "World class" OO successors to Pascal (Modula, Oberon) have not been successful. Language standards are not adhered to by compiler-makers. Proprietary.

              移植性:很差。語言的功能由于平臺的轉變而轉變,沒有移植性工具包來處理平臺相關的功能。
              Portability: Dismal. The features of the language changes from platform to platform, and there are no portability toolkits to handle platform-specific features.

              使用Pascal編寫的游戲:幾個。DirectX的Delphi組件使得游戲場所變大了。
              Games Written in Pascal: A couple. The DirectX components for Delphi have made the playing field more level.

              資料:查找跟Delphi有關的資料,請訪問:Inprise Delphi page。
              Resources: The find out about Delphi, check out the Inprise Delphi page.


            6、Visual Basic

              哈,BASIC。回到八十年代的石器時代,它是程序初學者的第一個語言。最初的BASIC形式,雖然易于學習,卻是可怕的無組織化,它義無返顧的使用了GOTO充斥的“空心粉式代碼”。當回憶起BASIC的行號和GOSUB命令,沒有幾個人能止住眼角的淚水。
              Ahh, BASIC. Way back in the stone-age of the 80's, it was the first language for budding programmers. The original incarnations of BASIC, while easy to learn, were horribly unstructured, leading to the a rash of GOTO-laden "spaghetti-code". Not many people wipe away tears when reminiscing about BASIC's line numbers and the GOSUB command.

              快速前進到九十年代早期,雖然不是蘋果公司所希望的巨人,HyperCard仍然是一個在Windows下無法比擬的吸引人的小型編程環境。 Windows下的HyperCard克隆品如ToolBook又慢又笨又昂貴。為了與HyperCard一決高下,微軟取得了一個小巧的名為 Thunder編程環境的許可權,并把它作為Visual Basci 1.0發布,其用戶界面在當時非常具有新意。這門語言雖然還叫做Basic(不再是全部大寫),但更加結構化了,行號也被去除。實際上,這門語言與那些內置于TRS-80、Apple II及Atari里的舊的ROM BASIC相比,更像是帶Basic風格動詞的Pascal。
              Fast-forward to the early 1990's. While not the monster that Apple was hoping for, HyperCard was a compelling little programming environment that had no equal under Windows. Windows-based HyperCard clones like ToolBook were slow, clunky, and expensive. To finally compete with HyperCard, Microsoft licensed a neat little programming environment named Thunder, releasing it as Visual Basic 1.0. The user-interface was very innovative for the time. The language, while still called Basic (and no longer all-caps), was much more structured. Line numbers were mercy-killed. The language was, in fact, much closer to Pascal with Basic-style verbs than the old ROM BASIC that was built into every TRS-80, Apple ][, and Atari.

              經過六個版本,Visual Basic變得非常漂亮。用戶界面發生了許多變化,但依然保留著“把代碼關聯到用戶界面”的主旨。這使得它在與即時編譯結合時變成了一個快速原型的優異環境。
              Six versions later, Visual Basic is pretty deluxe. The user-interface has made some changes, but still retains its "attach bits of code to the user-interface" motif. This, in combination with instantaneous compiling, makes it a terrific environment for fast prototyping.

              優點:整潔的編輯環境。易學、即時編譯導致簡單、迅速的原型。大量可用的插件。雖然有第三方的DirectX插件,DirectX 7已準備提供Visual Basic的支持。
              Advantages: Neat IDE. Easy to learn. Instantaneous compiling makes for very fast and easy prototyping. Lots and lots of add-ons available. While there are currently third-party DirectX add-ons for Visual Basic, DirectX version 7 is going to include support for Visual Basic right out of the box.

              缺點:程序很大,而且運行時需要幾個巨大的運行時動態連接庫。雖然表單型和對話框型的程序很容易完成,要編寫好的圖形程序卻比較難。調用 Windows的API程序非常笨拙,因為VB的數據結構沒能很好的映射到C中。有OO功能,但卻不是完全的面向對象。專利權。
              Disadvantages: Apps are large and require several large runtime DLL's to run. While form and dialog-based apps are easy to make, writing good graphical apps is more difficult. Calling Windows API functions is clunky, because VB data structures don't map nicely to C. Has OO features, but is not fully object-oriented. Proprietary.

              移植性:非常差。因為Visual Basic是微軟的產品,你自然就被局限在他們實現它的平臺上。也就是說,你能得到的選擇是:Windows,Windows或Widnows。當然,有一些工具能將VB程序轉變成Java。
              Portability: Worse than dismal. Since Visual Basic is owned by Microsoft, you're pretty-much limited to whatever platforms they've ported it too. That means that you've got the choice of Windows, Windows, or Windows. Note that there are, however, a couple of tools that help convert VB apps to Java.

              使用Visual Basic編寫的游戲:一些。有很多使用VB編寫的共享游戲,還有一些是商業性的。
              Games Written in Visual Basic: A few. There are lots of shareware games done in VB, and a couple of commercial offerings.

              資料:微軟的VB頁面有一些信息。
              Resources: The [Microsoft VB page].

            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的主要負責人。如果你對他的文章有什么看法,請寫信給他。
             

            posted on 2007-05-13 00:09 lovedday 閱讀(785) 評論(0)  編輯 收藏 引用 所屬分類: ■ Game Program

            公告

            導航

            統計

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關鏈接

            搜索

            最新評論

            AV狠狠色丁香婷婷综合久久 | 久久精品极品盛宴观看| 精品久久久无码中文字幕| 国产精品日韩深夜福利久久| 性做久久久久久免费观看 | 热re99久久6国产精品免费| 91久久精品91久久性色| 亚洲欧美日韩精品久久亚洲区 | 狠狠色婷婷久久综合频道日韩 | 精品久久久久久国产三级| 免费一级欧美大片久久网| 新狼窝色AV性久久久久久| 99久久精品费精品国产| 成人久久免费网站| 伊人久久精品线影院| 一本色道久久综合狠狠躁| 久久久久夜夜夜精品国产| 国产69精品久久久久9999APGF | 亚洲AV无码久久寂寞少妇| 国产福利电影一区二区三区久久久久成人精品综合 | 久久久无码精品亚洲日韩蜜臀浪潮| 久久精品一区二区三区不卡| 色妞色综合久久夜夜| 国产精品久久久久久久午夜片| 香蕉久久av一区二区三区| 久久婷婷五月综合色99啪ak| 亚洲国产天堂久久综合网站| 国内精品久久久久影院一蜜桃| 国内精品久久久久影院薰衣草| 久久久无码精品午夜| 色综合色天天久久婷婷基地| 国内精品久久久久影院免费| 亚洲日韩中文无码久久| 伊人久久精品无码av一区| 欧美亚洲国产精品久久高清| 国产精品久久久久久五月尺| 久久午夜福利电影| 伊人久久精品影院| 亚洲国产美女精品久久久久∴ | 亚洲国产成人久久一区WWW| 伊人热人久久中文字幕|