Jump to content
Posted 08 November 1999 - 10:28 PM
Posted 20 October 1999 - 06:31 AM
I would try doing something simple with DirectPlay (not a game, just some chat code, or something) and then try to build it from scratch using Winsock. You'll see the pitfalls, but also see how nice it is to be able to tailor your work. (Also affords you portability if you don't use any of Winsocks WSA_
Posted 20 October 1999 - 10:34 PM
Posted 21 October 1999 - 04:29 AM
Once you get a handle on the concepts you can move to Windows sockets or BSD sockets in C++/C. The concepts are generally the same, its just a more complicated syntax.
I would NOT recommend DirectPlay for someone just starting out. It is probably the worst designed interface of all the DirectX components, and the documentation is bad.
Posted 22 October 1999 - 02:14 AM
Posted 23 October 1999 - 04:38 PM
So even though dplay might have some pitfalls i say its very usefull.
Posted 24 October 1999 - 05:28 PM
I stand by Java sockets as the easiest way to get started with network programming - moving on to other things such as DirectPlay can be done later.
Posted 04 November 1999 - 11:33 AM
Posted 04 November 1999 - 04:08 PM
Posted 05 November 1999 - 11:28 AM
Oh, and garbage collection rules !!
Posted 05 November 1999 - 12:06 PM
Posted 06 November 1999 - 12:56 PM
If you sincerely believe that Java can't be high performing, try searching the web for a demo called "forward" by a group called "komplex" (ftp.hornet.org might have it). Also "apex" by "digital nerdz" is quite cool. Both will convince you, I'm sure
Posted 06 November 1999 - 04:08 PM
With Java, there's no way (or if there is, I will pick up Java again as a primary language) of telling java that THIS TIME is when you want it to deal with its automatic garbage collection, not when I'm in the middle of a tight loop or dealing with sending a network packet out.
However, Niels, I am writing a game engine right now to be interfaced with Java as the "logic" code for a series of games, since I like the simplicity of Java. Its just I don't think I would like giving up control in speed-critical code. That's why I moved away from VB in the first place.
Oh yeah, I can't find either of those Java demos. I'd love to see them, so if you have a copy putting it up would be real cool.
Posted 06 November 1999 - 05:39 PM
1) Java is portable, C/C++ is not. This is absurd. The ANSI C language is the single most portable development language in existence, and why, because it was designed with a STRONG relation to the basic architecture of the computers that are dominant in almost ALL markets. It is the ONLY language I know of that I can write a function implementing an algorithm once, and then compile it to run on 8 bit embedded machines, PCs, Unix servers, mainframes, AND consoles. THIS IS CROSS PLATFORM, and the added benifit is that the compiling process generates code as effiecient as the author of the specific compiler (for the intended target) can write. I acknowledge that you can compile Java to generate native object code, and so this is not an argument against the language itself, but just against the idea that BYTE code and Virtual Machines are the end-all of cross platform compatibility. Inheirently this is NOT cross platform, that would be like saying PLAYSTATION games are cross platform becuase someone writes an emulator for the PC. This is DICTATING the platform, not bridging differences in platform.
Side Note - I do not use C except when needed for embedded platforms, because I like C++'s power WAY TOO MUCH. And I will be the first to admit that C++ is not CURRENTLY cross platform in ANY way at all (the state of compilers is atrocious).
2) Java is simple. I dissagree. For anyone that has ever written a program in ANY procedural language (including assembly) I believe C/C++ to be much easier to learn, and I don't mean easier to get a window up and displaying "hello world" while a sound plays in the background. I mean "learn" in the sense that the programmer actually UNDERSTANDS what the program is doing, and can predict what the effects of a new change or addition will be. I admit that because of many built in functions/classes it is EASIER to acomplish a task in than for a first time C++ programmer, but the same is true for C++ if you add a good class library/framework. But C++ doesn't tie you to one framework, nor does it require you to understand the meta model to understand a simple program. Current computer architectures are inheriently procedural, they have the concept of stacks, address spaces, instruction pointers, and data built into their machine instructions; but any aditional framework on top of that is an EXTERNAL FRAMEWORK that is not necessary to understanding the machine itself. I admit the programming advantages of OOP are more than worth their miniscule trade off in size or speed, but they OBSCURE the learning of computer programming in general, because computers are NOT object oriented. Just ask yourself how many or the current programmers here understood BASIC or Pascal when you were just a child, then ask yourself if you could have learned Java, interfaces, polymorphism, etc. just as easily. More importantly, ask yourself if you ONLY learned the concepts of OOP, without first understanding the procedural nature of the machine, would you be able to make the right trade off decisions necessary to writting the kind of code required by a game.
3) Multiple inheritance is a useless feature that isn't worth the cost to add it to a language. In my experience this lack is major flaw of all OO languages that have it. Mulitiple inheritance is often the only method of implementing a good, clean OO system. Just look at how much nicer the C++ iostream hierarchy is because of it, and the STL iterator system makes good use of it. I personally use it in my own game designs, fo such things as tying together classes such as AutonomousObject and DisplayElement to create a class such as NonPlayerCharacter, or FreeOrbitingSatalite (this is not my best expample, but it's my quickest). I also realize Java has at least added the "interface" keyword to support this functionality, but it's usage is by no means as straight forward as multiple inheiratence (although I do have to say if the keyword was added JUST to replace the stupid =0 notation for pure virtual functions, but multiple inheritence was kept, it would be ok).
Oh well, enough for now....
[This message has been edited by Xai (edited November 06, 1999).]
Posted 06 November 1999 - 07:13 PM
Posted 07 November 1999 - 11:12 PM
However, there's a few things in what you say that I feel stems from misunderstandings:
Java IS portable - meaning the distributed code (binaries) are portable. And the Java run-time should not be compared to a Playstation emulator since the latter is mainly a HW emulator, the Java RT is not. There is a huge difference between an emulation of a system and a system that is "designed to be emulated", so to speak.
Reg. creating code as efficiently as the platform allow: That is exactly the problem with conventional programming languages (C/C++) - most code we write today is targeted at Java is simple compared to C/C++ because: 1) The file structure is simple - one file, one class. If you want to create a re-useable component, the .class is all you need. No .lib, no .h, no typelibraries etc.etc. 2) Garbage collection removes the most annoying pitfalls of C/C++. (And yes, you could write your own, but that is NO easy task if you want one that works fast without annoying artifacts) 3) Java is typesafe (which C is not) 4) A lot of the "smart" features of C++ (IMHO) only add to the confusion when learning the language: operator overloading, templates, multiple inheritance. Finally, reg. multiple inheritance - there are really good reasons not to have it. In particular that it can't be implemented in a clean way. Java has "interfaces" as the way to solve the problem. Intefaces are not a 1:1 substitute, but it works well in most situations. (I've missed mutiple inheritance a couple of times myself, but in the long run I prefer a clean language). Splat: You CAN invoke the garbage collector (System.gc() I believe) For cool stuff, check out the following sites: ftp://ftp.gathering.org/pub/TG/TG99/javademo/ ftp://ftp.gathering.org/pub/TG/TG98/java/ (forward.zip is available in the latter) /Niels
Java is simple compared to C/C++ because:
1) The file structure is simple - one file, one class. If you want to create a re-useable component, the .class is all you need. No .lib, no .h, no typelibraries etc.etc.
2) Garbage collection removes the most annoying pitfalls of C/C++. (And yes, you could write your own, but that is NO easy task if you want one that works fast without annoying artifacts)
3) Java is typesafe (which C is not)
4) A lot of the "smart" features of C++ (IMHO) only add to the confusion when learning the language: operator overloading, templates, multiple inheritance.
Finally, reg. multiple inheritance - there are really good reasons not to have it. In particular that it can't be implemented in a clean way. Java has "interfaces" as the way to solve the problem. Intefaces are not a 1:1 substitute, but it works well in most situations. (I've missed mutiple inheritance a couple of times myself, but in the long run I prefer a clean language).
You CAN invoke the garbage collector (System.gc() I believe)
For cool stuff, check out the following sites:
(forward.zip is available in the latter)
Posted 07 November 1999 - 11:15 PM
Posted 08 November 1999 - 11:15 AM
Java's "interface" and "final" are great, exactly what's lacking in C/C++. Interfaces, being supported natively and explicitly in Java, are a great asset, and I think mostly get rid of the need for multiple inheirtence (since all I use that for is multiple pure virtual "interface" classes).
As soon as we have run-time optimizing byte code virtual machines in Java, there will be few excuses not to use it.
However, I disagree in several respects. I think operator overloading is a natural extension of object oriented programming. In fact, I think operators should be expanded to allow an opbject to create new operators. This would facilitate a new means of interacting with objects, and would create code that more resembled english.
Also, templates in their current form are merely a simple convinience, but if they were designed into a language from the beginning and therefore more carefully implemented could also be VERY useful.
The beginner C/C++ student does not need concern himself with the more advanced concepts of C++. The beginner who uses CString to write simple text based console apps need not nor should know how CString really works inside.
That aside, I must say that forward demo is really cool.
Lastly, I'd love to talk to you about the Java - Game Engine interfacing DLL stuff, but either you need to email me or give me your email hehe
Posted 08 November 1999 - 10:28 PM
Reg. templates - I agree VERY MUCH that templates as a concept is brilliant - it is just that the C++ implementation suck so bad.
Reg. e-mail - Whoops, forgot I didn't make that public firstname.lastname@example.org should do the trick