Web Game Development advice

Started by
13 comments, last by Narf the Mouse 12 years ago

Java is comparable to Python in that it's interpreted, and people do seem to be doing intensive work in it. It's also fairly fast, as interpreted languages go.


This is wrong and has been for close to 10 years now, Java is normally JIT compiled like C# (allthough it can also be precompiled just like C or C++ (but the native compilers for Java are pure crap compared to the JIT compilers so there is no reason to use them really) and has the same performance as you'd get with modern C++ compilers when it comes to arithmetics, IO, etc, (There are performance pitfalls with Java though such as expensive native calls, poor trig performance on platforms with inaccurate FPUs and writing cache friendly code in Java is fairly difficult as you don't have all that much control over how memory is allocated (Its not easy to write cache friendly code in any language though but lower level languages tend to give you more tools for it). And ofcourse, most importantly for game clients, the JIT compiler takes some time to do its thing and the slow start kinda sucks there (For the server side of things however that is a non issue as the server is meant to start once and then keep running for a very long time (The server is also far more likely to run on an architecture that actually meets the accuracy requirements Java puts on math functions making the trig performance problem a non issue))

It should be noted that there are JIT compilers available for Python aswell. (The reference implementation is an interpreter but its not the only implementation you can use, if performance with the interpreter is a problem you can use IronPython, psyco, etc instead)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Advertisement

Neither is C#, though C# is somewhat better (Unity plugin, and I don't know what else, but it seems Microsoft designed C# for web support as well). Python I don't have a clue about, though I imagine it's in the same boat as C#.
Java is much better suited for web games, at least presently.


Can you qualify this statement? Specifically, why do you feel C# is unsuitable for web-based games? Are you talking client or server?

If you're talking client, then I wholeheartedly agree; Java or Flash are the ways to go. But server is a different story (as would be C++; for the most part, you require a HTTP, WebSocket, or CometD server for communications).

[quote name='Narf the Mouse' timestamp='1333395182' post='4927602']
[quote name='cristycs' timestamp='1333356999' post='4927408']
How scalable is C++ when it comes to web games?

C++: Very scalable. It's arguably the fastest object-oriented language, or among the top.
[/quote]
Your advice is very good and valuable, but just to nitpick slightly (We're on the internet after all wink.png), you didn't answer this question fully, but he has the impression that you did, so he's walking away with faulty information.

Question: "How scalable is C++ [color=#FF0000]when it comes to web games?"
Answer: Horrendous.

C++ is not made for web-based games, and if you want to get C++ games working in someone's web browser, you have to do weird stuff like having users download custom or uncommon plugins for their browsers just to play your game, presenting major security risks and driving away users, whereas some other languages (like Java) most of your userbase will already have the plugin installed.

C++ is not the ideal language for web games. Neither is C#, though C# is somewhat better (Unity plugin, and I don't know what else, but it seems Microsoft designed C# for web support as well). Python I don't have a clue about, though I imagine it's in the same boat as C#.
Java is much better suited for web games, at least presently.
[/quote] Thx I decided to start with C# and Unity for web, C# with XNA for windows and Java for cross-platform including web, but I will start with C# because is easyer to learn. But in the end I will end un with C++/C#/Java, C# and Java being the main focus.

"I was thinking he'd use C++/C#/Java/Python for the backend (or what runs on the server) and the weblanguage for the frontend (or what runs on the client)."

[quote name='Servant of the Lord' timestamp='1333403480' post='4927655']
Neither is C#, though C# is somewhat better (Unity plugin, and I don't know what else, but it seems Microsoft designed C# for web support as well). Python I don't have a clue about, though I imagine it's in the same boat as C#.
Java is much better suited for web games, at least presently.

Can you qualify this statement? Specifically, why do you feel C# is unsuitable for web-based games? Are you talking client or server?

If you're talking client, then I wholeheartedly agree; Java or Flash are the ways to go. But server is a different story (as would be C++; for the most part, you require a HTTP, WebSocket, or CometD server for communications).[/quote]
Client (hence the Unity Plugin comment). C# or C++ or even Python (almost any language, really) would work fine for a server, as you pointed out.

[quote name='Narf the Mouse' timestamp='1333395182' post='4927602']
Java is comparable to Python in that it's interpreted, and people do seem to be doing intensive work in it. It's also fairly fast, as interpreted languages go.


This is wrong and has been for close to 10 years now, Java is normally JIT compiled like C# (allthough it can also be precompiled just like C or C++ (but the native compilers for Java are pure crap compared to the JIT compilers so there is no reason to use them really) and has the same performance as you'd get with modern C++ compilers when it comes to arithmetics, IO, etc, (There are performance pitfalls with Java though such as expensive native calls, poor trig performance on platforms with inaccurate FPUs and writing cache friendly code in Java is fairly difficult as you don't have all that much control over how memory is allocated (Its not easy to write cache friendly code in any language though but lower level languages tend to give you more tools for it). And ofcourse, most importantly for game clients, the JIT compiler takes some time to do its thing and the slow start kinda sucks there (For the server side of things however that is a non issue as the server is meant to start once and then keep running for a very long time (The server is also far more likely to run on an architecture that actually meets the accuracy requirements Java puts on math functions making the trig performance problem a non issue))

It should be noted that there are JIT compilers available for Python aswell. (The reference implementation is an interpreter but its not the only implementation you can use, if performance with the interpreter is a problem you can use IronPython, psyco, etc instead)
[/quote]
Thanks, I had somehow managed to completely miss that fact in my internet browsing:( (I use mostly C#).

Well, as they say, many hands make light work. :)

(Or is that three heads are bitter than one?)

This topic is closed to new replies.

Advertisement