[gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: brianevans <brianevans@xxxxxxxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 09 Mar 2005 10:35:32 -0600
>I am not going to argue with anyone over the difference between fashion
>and habit :-). How about we call it cultural inertia? We can let the
>term cover every factor from fashion to habits as well as factors like
>the preponderance of books and libraries.
Well, I know it seems piddly, but to me theres a difference between people
using things because it's new and trendy and cool, and people using things
because they've been using it for years and it works.
I would argue that Java is the fashionable trendy language
nowadays. Especially in the business sector.
But I agree to your term. We're not really interested in sociology here,
after all. :)
>Lets face it, it is much
>easier to find a book written about doing game programming in C++ than
>in about any other language. I'm not saying the other books don't exist.
>They do. But a quick look at the games section at B&N shows what we are
>talking about, tons of books based on C++, nearly none on Java.
>
>Then there is the huge number of libraries written in C and C++ that you
>can "just use" in C++. To use them in Java you have to write an
>interface using JNI. Every written a JNI interface? I have, it is a pain
>in the @$$. So, Java by itself has created a huge barrier to people
>using it for games by making it so hard to access C/C++ libraries.
I have yet not delved into what seems like the wonderful world of JNI
interfaces. Yes, sarcasm. :) Whenever you get something so successful and
established, so driven by cultural inertia, it becomes hard to get rid of,
even in the face of superior technology. Witness: Microsoft, x86, web
browsers/applications and, yes, C++. Now, I'm not yet ready to concede
that Java is superior technology. However, Java is more modern, has a lot
of attractive features, and appears to have fixed a lot of performance
issues whose reputation it can't quite shake loose. In C++'s defense (or
not), the language has stagnated. Maybe the people in charge of the C++
standards are to blame, I don't know. Why they haven't integrated
something like Boost into the standard when C++ desperately needs a library
like Boost is beyond me. Perhaps 'D' is the next step for C++:
http://www.digitalmars.com/d/overview.html But new languages mean doing
everything over again.
> > It was not that long ago that we had sub Ghz processors
> > and memory was expensive, compared to now. On Win95/98 era hardware
> > (100-500 Mhz machines, 64-128MB ram), the only choice that made sense for
> > serious games was C/C++. Java has just recently (2001+ at least ;) )
> > become viable for games, IMO, because the JVM's have gotten better, and/or
> > the increase in hardware performance and available memory hides the
> > performance hit. I would not have considered it viable for any but the
> > most basic of games in 2001.
>
>Can't disagree with you on that. 'though, I know people were trying to
>do serious games in Java as early as 1996. But, that was mostly for the
>server side on networked games. Even back then a Java server running on
>a 100Mhz Pentium could saturate a T1.
>
> > I'm not talking about mobile games. Any mobile class game will get
> laughed
> > out of the serious PC game arena.
>
>Ok, I think we need to define what you mean by "serious game" because I
>take any game that generates revenue seriously. :-) What do you mean by
>the phrase?
That's a fair point. If a game makes money, certainly it should be taken
seriously. However, the level of expectations for a phone game, when
compared to a PC game, is vastly different. It's akin to comparing a
gameboy game to a gamecube one, except more exaggerated.
But I didn't mean just any PC game that makes money. I meant the
commercial games that all the gamers get excited about, and sorry, I
haven't heard a gamer rant about the greatness of bejeweled lately. :) You
know the ones that push the technological edge like Rome Total War, Doom 3
and Half Life 2. The ones that independent developers like us have no hope
whatsoever of developing. :P
The point is well taken. I would probably be happy with writing a game
that made money, but I wouldn't be satisfied. I think I would have to
write a game that I and others would want to play that did at least one
thing in a fairly novel way to be truly satisfied. Oh yes, money would be
nice too. :)
>More examples of cultural inertia.
>
>Yep. No question.
>
>Define "memory efficiency". Do you mean total memory used? Or do you
>mean time spent managing memory? Or, do you mean (ok, I know you don't
>mean) programmer time spent on memory management.
I can tell I need to be careful here. :) I meant memory size efficiency,
but its not really just size, more along the lines of only using the memory
I have to at a certain time to perform a task. Java does have the memory
size overhead of the JVM, and as you said they trade size for
performance. I did not mean programmer time spent on memory management,
unless that programmer was going for a real time java app. :)
>Yep, most programmers do not know who to program using a garbage
>collector. Even in Java you can statically allocate variables, even
>string buffers, so that the GC *never* gets invoked and you never get a
>GC hiccup. If you must dynamically allocate memory you can do thing like
>calling the GC explicitly at reasonable times to collect garbage before
>it causes a GC stall. The fact that Java is noted for GC stalls tells
>you something about the lousy job they have done on the storage
>allocation system. :-(
I confess I don't know all the tricks to avoid GC hiccups, I just know some
exist. Sometimes its nice to be able to explicitly allocate and deallocate
memory. That hybrid system listed in 'D' sounds intriguing, maybe optimal.
I wonder why java didn't let you override. I guess they were afraid of
giving programmers a hand grenade because they might blow themselves up
with it. Sometimes you need a hand grenade though.
>I have in fact written simple games and a real time telephone link using
>Java and did not *ever* have a pause due to the GC. But, then, I *do*
>know how to program using a GC.
It's nice to know its possible. :) I just wish you didn't have to rely on
certain restrictions to do it.
>It is interesting to look at languages like Perl and Python that both
>have garbage collection and do not suffer from GC stalls (at least not
>that you would notice) To the best of my knowledge those languages use
>reference counting storage allocators. A lot of C++ programs also use
>reference counters through a smart pointer type. Reference counting
>allocators use much more of the total runtime than garbage collecting
>allocators do. But, they spread it out over time so you don't notice it.
> >From a total run time point of view reference counting is a horrible
>thing, but from a psychological point of view, it wins every time.
>
>BTW, both Python and Perl are also compiled some version of byte code
>and interpreted.
I like Perl and its mutant cousin PHP. I have yet to program in Python,
but I know people swear by it. I saw some benchmarks that had Perl an
order of magnitude or two behind both C++ and Java (1000 seconds vs 10
seconds). Which, if they are to be believed, shows that I was wrong
about Java being interpreted class, and that Java is a lot faster than true
interpreted languages.
I would guess its a response time thing. Most people don't care of things
take a little while longer, as long as the app doesn't freeze and hang up a
"out gathering twigs and memory" sign on the front window.
>If you write Java code that dynamically allocates lots of memory and do
>not control the operation of the GC you will still run into GC stalls.
>The size of the memory tends to make the initial stall even longer than
>before.
Hopefully the size of the memory would allow you to avoid doing that while
actually in a game, or at the least hold off until between levels.
>This is very rare these days and any such code would be put in a library
>and accessed through JNI. Which is, for example, exactly how the SIMD
>blit code in SDL is accessed from Java.
Yes, you're right. The JNI stuff actually sounds cool, in that its cool
that java can actually call C++ libs. But its not java that's doing the
low level stuff. Then again if you're writing ASM its not really C/C++ either.
>Ok, this statement doesn't have any meaning. It is an appeal to an
>authority based on a personal opinion. An argument cannot be based on a
>personal opinion of what someone else may or may not do. Unless, of
>course, you are actually Carmack masquerading as Brian.
>
>Thought I would just point that out.
>
>BTW, my personal opinion is that Carmack wants to spend his time
>building spaceships and will do what ever he needs to to get the cash he
>needs to build spaceships, including writing video games. Of course,
>that is only my opinion.
It's a valid opinion. I think he's bored with programming games (arguably,
game engines). I wasn't appealing to Carmack on an authority basis, but
more on a personality basis. He's the type of programmer who will go low
level, or tweak things to push the edge. Java just isn't the language for
him. And I'm flattered, but no I'm not Carmack. :P But I did read a book
about him (Masters of Doom) and id, so I'd say I'd have some basis for
knowing something about his personality. But you're right, it doesn't mean
anything more than what I think Carmack would not do, given the facts I
know about him. I do doubt that you could write Doom3 in Java right now,
as it runs pretty slow as it is on current hardware. But maybe that's just
my "Java is slow" prejudice getting in the way again.
> > Maybe you will do something that requires
> > hand-optimized Assembly loops?
>
>Separate file, JNI interface. Of course, as I said before, JNI is a
>PITA.
>
> > Maybe the JVM can optimize it enough for
> > you? Granted, most of us will probably never need that control.
> >
> > If you're writing a Bejeweled clone, I doubt any of this matters. If you
> > were writing Quake 2 in 1997, you had to pick C/C++. If you were writing
> > Quake 2 now, maybe you could use Java. If you were writing Doom 3 now,
> I'd
> > think you'd have to use C/C++. But for most of the games most of us can
> > make right now, it really doesn't matter, though its nice not to have to
> > worry about a JVM being installed. But then again, it would be nice
> not to
> > worry about memory leaks. Ahhh, tradeoffs.
>
>Exactly!
Finally! More like it. Hehe.
We probably will see a trend reversal soon. CS students at UT these days
get Java as their entry language (which really sucks as the intro level CS
class they made me take, after I had already taken the entry level C++
class, was HASKELL taught by a HASKELL ZEALOT!). Anyway, they get out
thinking that Java is the best language ever. And it IS trendy, especially
in the business sector.
So maybe fashion has more to do with it than I originally thought. Fashion
gets the cultural inertia ball rolling, and habit keeps it bouncing
along. It will probably start with the Java phone games and then trickle
upwards into PCs.
>But it is so much fun!
And educational to be sure. But its a lot of time spent developing the
tool to make your game, when you could just buy the tool and have fun
modifying the tool to make your game. Most independent devs frankly won't
have the time or ability to write a full featured engine that can handle
complicated games. I know I don't at the moment.
> >
> > Geez, I write too much.
> >
>
>We both suffer from that disease :-). I think this is a good discussion
>though.
I hope so. Tell you what though, I'm running out of steam. You got me
saying that Java is not as slow as I thought it was and is a valid choice
for games. I really don't see it being used for AAA commercial cutting
edge games in the short term, but it is wrong to simply write it off for
every game idea since it will be a valid choice for most of them.
So I would say I learned quite a bit. :) (phew.)
brian.
> > brian.
> >
>
> Bob Pendleton
> >
> >
> > ---------------------
> > To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> >
> >
> >
>
>
>
>---------------------
>To unsubscribe go to http://gameprogrammer.com/mailinglist.html
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] Fast development over multiple platforms, which language?
- From: Jason Clark
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Scott Harper
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Szasz Pal
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Bob Pendleton
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: brianevans
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Bob Pendleton
Other related posts:
- » [gameprogrammer] Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- » [gameprogrammer] Re: Fast development over multiple platforms, which language?
- [gameprogrammer] Fast development over multiple platforms, which language?
- From: Jason Clark
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Scott Harper
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Szasz Pal
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Bob Pendleton
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: brianevans
- [gameprogrammer] Re: Fast development over multiple platforms, which language?
- From: Bob Pendleton