Game Programming and Development Tools

java vs. python – dXter

dXter

Member

Posts: 59
From: Texas, the US of A
Registered: 09-26-2006
Hey y'all, just wanted to know what you thought about java and python for game programming. I've been learning java for about a year or so now (it's basically my first programming language, besides a bit of BASIC I did a few years ago); I don't know any Python, but I've heard it's a lot simpler and faster than java/C++. Is it really very much simpler, even if in java a game programming library (like GTGE) is used? Does Python have any disadvantages that come along with its simplicity?

------------------
Jesus looked at them and said, "With man this is impossible, but with God all things are possible."
--Matt. 19:26

"Time is an excellent teacher, but eventually it kills all of its students."

luke

Member

Posts: 311
From: I use your computer as my second Linux box
Registered: 10-30-2005
I haven't a clue about Python, although I would say that in order to draw anything on the screen with java, you need to be very well organized because you will end up using/making sooo many classes. But other than that Java is ok for 2d games.

------------------
If you can see Chuck Norris, He can see You.
If you Can't see Chuck Norris, you may be seconds away from death.

ArchAngel

Member

Posts: 3450
From: SV, CA, USA
Registered: 01-29-2002
from what I know of java and what I hear of python, python's better unless you want to make a web game.

Java is heavily webbased and because everything has to run through the JVM, in a manner of speaking, it's not too fast of a language. I've been programming in Java for over 2 years now, and it wouldn't be easy to make a nice game. I have, always, tho, considered on making a turnbased RPG...

------------------
"Patience, my good citizen, patience. It's bad enough to rob a man of his dream"
-Sydney Carton, Tale of Two Cities
Soterion Studios

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by dXter:
Is it really very much simpler, even if in java a game programming library (like GTGE) is used? Does Python have any disadvantages that come along with its simplicity?

Python is simpler, somewhat, than either Java or C++. However, it is much slower than Java, and very much slower than C++. The disadvantage of Python is that it is not compiled. It is parsed in real time by the Python interpreter. So, you take a significant speed hit for that reason. You wouldn't want to use Python for speed critical sections of code, like physics, AI, rendering, input, etc. Some say it's great for prototyping ideas since the syntax is easier and it has dynamic typing and flexible containers built into the language. I wouldn't use it for any action/real time games, but it would be fine for board games, card games, strategy games, etc.

------------------
+---------+
|steveth45|
+---------+

TwoBrothersSoftware

Member

Posts: 141
From: Janesville, Wi USA`
Registered: 08-05-2006
quote:
Originally posted by steveth45:
I wouldn't use it for any action/real time games, but it would be fine for board games, card games, strategy games, etc.

Having tried it for RTS once I wwould agree.

Love the interactive mode - you run your program with a -i
when it dies (if it does) aqll you variable are intact as are all your functions you just type away looking at your data and the subroutines till you find the bug.

I do think everyone should learm python if for no other reason - it makes the best command line calculator that I have found any where

D-SIPL

Moderator

Posts: 1345
From: Maesteg, Wales
Registered: 07-21-2001
I don't think it's fair to even begin to compare the two Python rocks my script driven world!!

------------------
"One World. One Web. One Program." -Microsoft promotional advertisement
"Ein Volk, ein Reich, ein Fuhrer!" -Adolf Hitler
"I believe in freedom... not freedom like America, freedom like a shopping cart"

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
If you've done some basic and are looking for a good, simple language I'd suggest maybe taking a look at DarkBASIC, it's a 3D and 2D game oriented programming language that has alot of really awesome stuff built in. You can load 3D objects and level with one command, set up collision with 3 more commands, move your cameras and all objects with a single command as well. Then, on top of that you can add lots of plug-ins and stuff like that to give to acess to the AGEIA PhysX engine, AI functions, automatic Euler rotation support, all with very few commands and alot of power. If you're looking for something more driven toward simplicity and game design you might want to check it out.

www.darkbasic.com should get you there

------------------

How far that little candle throws its beams; So shines a good deed in a naughty world.

Portia The Merchant of Venice

kenman

Member

Posts: 518
From: Janesville WI
Registered: 08-31-2006
Two totally different reasons for liking each one. Python has a quicker learning curve.
Lava
Member

Posts: 1905
From:
Registered: 01-26-2005
quote:
Originally posted by Ereon:
If you've done some basic and are looking for a good, simple language I'd suggest maybe taking a look at DarkBASIC, it's a 3D and 2D game oriented programming language that has alot of really awesome stuff built in. You can load 3D objects and level with one command, set up collision with 3 more commands, move your cameras and all objects with a single command as well. Then, on top of that you can add lots of plug-ins and stuff like that to give to acess to the AGEIA PhysX engine, AI functions, automatic Euler rotation support, all with very few commands and alot of power. If you're looking for something more driven toward simplicity and game design you might want to check it out.

www.darkbasic.com should get you there


BlitzbBasic is also really good. And it's as easy DarkBasic and it's the competitor of it. Check it out:

www.blitzbasic.com

------------------

dXter

Member

Posts: 59
From: Texas, the US of A
Registered: 09-26-2006
Thanks Ereon and Lava, I'll look into DarkBASIC and BlitzBasic (oooooo...competition). Just one question: are higher-level programming languages in general slower than lower level languages like C++?

------------------
Jesus looked at them and said, "With man this is impossible, but with God all things are possible."
--Matt. 19:26

"Time is an excellent teacher, but eventually it kills all of its students."

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
Yes, they're slower, but they are SOOOO much easier to use and learn. With dedicated game languages like Blitz and DB though the speed hit isn't nearly as bad as with, say, Python, because the rendering engine and all that stuff is already built and optomized for you, so that it runs your commands as quickly and efficently as possible with as little slow-down as possible. The main difference that I've seen between DB and Blitz is that DB is more hardcore 3D oriented and makes extensive use of DirectX, while Blitz focuses more allaround and doesn't rely so heavily on an external setup like DirectX. At the end of the day if you're going to use and interpreted lang like one of these you need to get something that will compile to a .exe (like Dark and Blitz) and get something focused and optimized for what you want to do with it (or, in the case of DB, know enough C++ to write your own DLLs and add new commands that do things more efficently, not sure if you can do that with Blitz, Lava can correct me if I'm wrong). The further up the "totem pole" you go the slower things tend to become, but also the easier and simpler it is to work with.

------------------

How far that little candle throws its beams; So shines a good deed in a naughty world.

Portia The Merchant of Venice

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
java is NOT only good for web based stuff :P it DOES excel for that but its still a blast to code for other things. and since i seem to be the only java spokesperson here..... GTGE rocks!
SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
I used to be very pro-Java. Been touting it for years. But C# has really swayed me.
ArchAngel

Member

Posts: 3450
From: SV, CA, USA
Registered: 01-29-2002
yeah, seriously. I've been coding java for over 2 years, and C#... bout a month. I like C# more. even considering it's kinda a Microsoft ripoff of Java...

------------------
"Patience, my good citizen, patience. It's bad enough to rob a man of his dream"
-Sydney Carton, Tale of Two Cities
Soterion Studios

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by dXter:
Hey y'all, just wanted to know what you thought about java and python for game programming. [....] I don't know any Python, but I've heard it's a lot simpler and faster than java/C++.


I don't know how it compares in speed to Java, but practically no interpreted language can match the speed of a well programmed C++ program. But of course, you don't need all that speed unless you're looking for a way to max out a 3.0 Ghz Dual Core opteron CPU with 8GB of RAM with number cruncing or something resource intensive.

quote:
Is it really very much simpler, even if in java a game programming library (like GTGE) is used?


Python has a very easy, simple to use game programming library called Pygame. I believe you will find it easier to use Pygame than GTGE.

quote:
Does Python have any disadvantages that come along with its simplicity?


None that I can think of, other than hand writing GUIs, but then, I've always had trouble handwriting GUIs.

I've really struggled learning Java so when I saw Python I really went for it. Just to pique your interest, Battlefield 2, NASA, Google, and Civilization IV use Python.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

Lava
Member

Posts: 1905
From:
Registered: 01-26-2005
quote:
Originally posted by Ereon:
Yes, they're slower, but they are SOOOO much easier to use and learn. With dedicated game languages like Blitz and DB though the speed hit isn't nearly as bad as with, say, Python, because the rendering engine and all that stuff is already built and optomized for you, so that it runs your commands as quickly and efficently as possible with as little slow-down as possible. The main difference that I've seen between DB and Blitz is that DB is more hardcore 3D oriented and makes extensive use of DirectX, while Blitz focuses more allaround and doesn't rely so heavily on an external setup like DirectX. At the end of the day if you're going to use and interpreted lang like one of these you need to get something that will compile to a .exe (like Dark and Blitz) and get something focused and optimized for what you want to do with it (or, in the case of DB, know enough C++ to write your own DLLs and add new commands that do things more efficently, not sure if you can do that with Blitz, Lava can correct me if I'm wrong). The further up the "totem pole" you go the slower things tend to become, but also the easier and simpler it is to work with.


Yes you can creat new commands, or functions. And many people have made DLLs to add on to their Blitz games.

Also one reason to choose Blitz over Dark, is that there are *alot* more games with BlitzBasic. Look at games section on DarkBasic's site and BlitzBasic's. Also if CodersWorkshop was up, it's showcase would be a prime example.

Even though BlitzCoder is closed, the showcase part of it works, see here some of the games made for Blitz:
http://www.blitzcoder.com/cgi-bin/showcase/showcase_frontpage.pl

------------------

[This message has been edited by Lava (edited October 06, 2006).]

kenman

Member

Posts: 518
From: Janesville WI
Registered: 08-31-2006
Java vs. python

There is jython www.jython.org

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
lol. forget jython, java, C++, DB, BB, anything!! PYTHON ALL THE WAY. ok, maybe not, but it still rocks, and: DB and BB you have to pay for, jython's too much like java, java's more complicated, C++ is really complicated... plus Python is free, cross-platform, and it has Pygame!! and great syntax too. this doesnt mean python is the perfect language. like steveth45 pointed out, it does take a speed hit from the fact that it's interpreted. but the fact that it is interpreted is also awesome.

------------------

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
There's quite a few BASIC language's for creating games -
EthosBASIC
PlayBASIC
GLBasic
+ the others mentioned here and more.

C++ is probably best for game programming but it's so complicated...

Lazarus

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by Lazarus:

C++ is probably best for game programming but it's so complicated...


If it's more complex, that's because it is more powerful. C++ is learn once, use everywhere. For each of the "Basic" engines, you have to learn its specific proprietary "Basic-like" scripting language and fork over a bunch of money. If you learn C++, you can use any of a number of free 3D engines, have code that's reusable in different contexts, and build a skill that could actually land you a decent job someday.

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
i know. thats why i said python isn't the perfect language. im just pointing out a few of the reasons that python might be a good choice. i like C++ myself. i just use Python a lot, cuz its simple and easy. plus I like its syntax. guess i did kinda sound like i was bashing all of those, huh? just suggesting that he should use python. especially since he said he was looking for simplicity =D

------------------

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
quote:
Originally posted by steveth45:
[QUOTE]Originally posted by Lazarus:
[b]
C++ is probably best for game programming but it's so complicated...


If it's more complex, that's because it is more powerful. C++ is learn once, use everywhere. For each of the "Basic" engines, you have to learn its specific proprietary "Basic-like" scripting language and fork over a bunch of money. If you learn C++, you can use any of a number of free 3D engines, have code that's reusable in different contexts, and build a skill that could actually land you a decent job someday.

[/B][/QUOTE]

True, but still, learning all the in's and outs of C++, plus struggling with compilers... it's a real pain in any case.
Several programs that come as source that I've used are a terrible pain to compile, and there are usually errors. In fact I've never come across one without any. (Dev-C++ is a pain sometimes)

Lazarus

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
quote:
Java is heavily webbased and because everything has to run through the JVM, in a manner of speaking, it's not too fast of a language.

I have to disagree on all points.

a) Making applets and other web stuff is possible (and common), yes, but only a small part of the language. It is perfectly capable of producing regular applications, and although it has plenty of web functionality, it is in no way tied to the web. I can create an ordinary desktop application just as easily as I can create a web application or server application.

b) The latest benchmarks have the latest JVMs being quite close to C++, and some even claim a bit faster.

c) It is possible to use a static compiler to compile Java, if you really wanted to.

quote:

I don't know how it compares in speed to Java, but practically no interpreted language can match the speed of a well programmed C++ program.

FYI, Java stopped being interpreted a long time ago. A few years back, it started becoming compiled with JIT technology, and now Sun's current JVMs use Hotspot.

Indeed, I use a Java-based raytracer called Art Of Illusion for rendering 3D graphics, and its rendering times are no slower than equivalent C++ based renderers.

Java's weakness for writing games is, unfortunately, 3D realtime graphics. Its 3D API never really became popular, and being a separate download means you can't count on people having it, ande I don't think it's being maintained very well. Unfortunately, that means that most Java games are 2D.

------------------
"The very idea of freedom presupposes some objective moral law which overarches rulers and ruled alike." -- C. S. Lewis (1898 - 1963), "The Poison of Subjectivism" (from Christian Reflections; p. 108)

My webpage

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by Lazarus:

Several programs that come as source that I've used are a terrible pain to compile, and there are usually errors. In fact I've never come across one without any. (Dev-C++ is a pain sometimes)
Lazarus


I used to use Dev-C++, that is your problem, not C++ itself. Trust me. Dev-C++ doesn't even do debugging properly (the last time I used it), it uses a complicated imported Gnu tool chain that was never designed for Windows. Visual C++ Express 2005 is free, fast, and easy. If you are developing for Windows, you have to use the right tools. Besides, Microsoft's C++ compiler produces code that is significantly faster than MinGW which is used by Dev-C++.

------------------
+---------+
|steveth45|
+---------+

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Why'd I ever download Dev-C++? It's a total nightmare. A few months ago I was trying to compile an app and it choked on the header files because of the comment style! (// instead of block /* */)

Visual C++ Express 2005 sounds good, guess I'll dl it.

Lazarus

[This message has been edited by Lazarus (edited October 07, 2006).]

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
i like Dev-C++.

so there.

ha.

losers.

Visual 2005 Shmisual 2005.

j/k lol.

never tried it. hmm... its free you say? when christmas break rolls around (or maybe thanksgiving break) ill dl it.

------------------
that post was really cool ^

|
[|=D) <---|| me

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Better have a fast connection(400 odd MB)
TwoBrothersSoftware

Member

Posts: 141
From: Janesville, Wi USA`
Registered: 08-05-2006
quote:
Originally posted by Lazarus:
Why'd I ever download Dev-C++? It's a total nightmare. A few months ago I was trying to compile an app and it choked on the header files because of the comment style! (// instead of block /* */)
[This message has been edited by Lazarus (edited October 07, 2006).]

Interesting enough I use the same comment structure and it tolerates it. I do my developement under Linux and port carry the project over

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Strange.
buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
yeah we got a pretty fast one.

------------------
that post was really cool ^

|
[|=D) <---|| me

jestermax

Member

Posts: 1064
From: Ontario, Canada
Registered: 06-21-2006
dev-c++ works fine with any comment structure...
i used it to code my game engine (i stopped working on it for now) and the only thing i find lacking in it is the debugging feature which i still have no idea how to make work.
Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
When using something else than MS compiler and linker don't you have to build every library from the source your self if the .obj file is not available? I find this quite overwhelming when trying to port from VS to devCpp.

------------------
1Jo 2:9-10 He that saith he is in the light, and hateth his brother, is in darkness even until now. 10 He that loveth his brother abideth in the light, and there is none occasion of stumbling in him.
Joh 17:26 And I have declared unto them thy name, and will declare it: that the love wherewith thou hast loved me may be in them, and I in them.

[VoHW] (Help needed) [Blog] - Truedisciple (mp3)

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by jari:
When using something else than MS compiler and linker don't you have to build every library from the source your self if the .obj file is not available?


Yes, but even with VC++ express I generally recompile projects that I link to. The whole point of open source software is that you can change the source code as necessary. If you try to play any of the Irrlicht-based games I've made with a 'vanilla' Irrlicht.dll, you're in for a surprise... it won't work. Irrlicht development is moving so fast that the official releases are generally superceded by the SVN code quickly. Plus, there are also patches on the net that haven't even made it into the source that I need. It's true, you are more likely to have a project that comes with a VC compatible .lib than MinGW compatible object/library files, but it's good practice to recompile your libraries anyways.

In Linux-land, software is encouraged to dynamically link to the code libraries built into most distributions. This is just not very practical for games which are made and broken by small changes in library code. Games need to ship with their own .dll's or statically link to the code libraries they use to ensure functionality.

------------------
+---------+
|steveth45|
+---------+

Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
Thanks for clearing that our for me steveth45! Rant:
I have actually compiled OS software but mostly in linux where its much easier to compile many libraries since the packages are made for the GCC system - or however you would say that. Last time I tried using devcpp I just couldnt get all the libraries to compile, too many problems and one was that asm had different syntax. But that was then and maybe I'll try this again sometime.

------------------
1Jo 2:9-10 He that saith he is in the light, and hateth his brother, is in darkness even until now. 10 He that loveth his brother abideth in the light, and there is none occasion of stumbling in him.
Joh 17:26 And I have declared unto them thy name, and will declare it: that the love wherewith thou hast loved me may be in them, and I in them.

[VoHW] (Help needed) [Blog] - Truedisciple (mp3)

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
Dev-C++ has a package manager that can download all kinds of libraries and packages and install them for you. i used that to install Irrlicht, SDL, and several other packages. it works good.

------------------
that post was really cool ^

|
[|=D) <---|| me