Programming - which language for this project?
21-04-2004, 15:09
|
#1
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Programming - which language for this project?
I want to start work on a very large project soon and can't decide which language to write it in.
Basically, the program will be a "life simulator" on a very basic level - think of a group of ants running around, gathering food and giving birth to more etc.
This program will run as a server and will work on it's own in the background with no need for any interaction.
The way interaction will occur is by outputting lots of figures, e.g. current virtual time, number of inhabitants, ages of inhabitants, current location in the "world", via TCP/IP (local or remotely) to any client program that requests it.
I imagine that I will be using MySQL (separately or the embedded version) to store all the data produced.
It really gets interesting when it comes to the client software, because the server only outputs data over TCP/IP connections this means that a Perl/PHP script on a remote server can grab the data for use on a webpage or even a DirectX game could use this to give a visual display of what's going on in this virtual world (again on the local machine, on the network or on the internet).
I'm a bit stuck on the language to use though, I thought about using C but dismissed this.
I could use any of the following though:
C++
Anything which uses Microsoft .NET, e.g. VisualSomething
PHP
Perl
Python
The last three wouldn't really be suitable though because they just execute once and that's it - they wouldn't be able to run forever in the background (with some exceptions, like Perl:Tk but even this is still calling other functions from within the main loop).
Any other recommendations?
|
|
|
21-04-2004, 15:20
|
#2
|
|
Inactive
Join Date: Jul 2003
Posts: 1,395
|
Re: Programming - which language for this project?
Sounds like the sort of thing I'd love to do, I'm very interested in Agent Programming.
Quote:
|
Originally Posted by Richard M
C++
|
Good for Object Orientated programming which will be a considerable bonus from the sounds of things. Tricky to use though and you'll have to find all of the relevant libraries for networking etc.
Quote:
|
Anything which uses Microsoft .NET, e.g. VisualSomething
|
Well, out of all of the either VC++ or C# will do the job
I'd agree, a scripting language really wouldn't be suitable at all for this kind of thing.
My personal choice would be to go for Java, the benefits of it are that threading, tcp/ip and SQL are all part of the standard package which makes things a lot easier. On the downside, the performance isn't quite as good as C++, though recent VM's aren't lagging far behind. J2SEv.1.5 also has some nice new features.
|
|
|
21-04-2004, 15:26
|
#3
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: Programming - which language for this project?
Hmm....Visual C++ sounds good, AFAIK the .NET SDK comes with a compiler too.
|
|
|
21-04-2004, 17:47
|
#4
|
|
cf.mega poster
Join Date: Dec 2003
Age: 51
Posts: 7,101
|
Re: Programming - which language for this project?
Why no Java in your list of potential languages? Assuming that you know C++, you wouldn't have any problems with Java.
|
|
|
21-04-2004, 17:56
|
#5
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: Programming - which language for this project?
I don't know C++ all that well and have only briefly played with it. 
I am quite experienced with PHP though, which is very similar, syntax wise.
Maybe I'll look at Java too then but the first time I saw Java code, I couldn't make any sense out of it. :pp
|
|
|
21-04-2004, 18:20
|
#6
|
|
Inactive
Join Date: Jul 2003
Posts: 1,395
|
Re: Programming - which language for this project?
Quote:
|
Originally Posted by Richard M
I don't know C++ all that well and have only briefly played with it. 
I am quite experienced with PHP though, which is very similar, syntax wise.
Maybe I'll look at Java too then but the first time I saw Java code, I couldn't make any sense out of it. :pp
|
Ah, I didn't realise you didn't know much C++, my advice would be to steer well clear. I'm currently doing a module of C/C++ and I'm finding it all a bit of a nightmare with pointers, references and no garbage collection. If you take another look at Java, the syntax is very close to C++ (Algol-like syntax? I forget) but has a lot more built-in error checking and the garbage collection makes life so much easier.
|
|
|
21-04-2004, 19:14
|
#7
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: Programming - which language for this project?
Thanks for the advice, I think I'm going to go with Java then. 
Did you know that you can even use OpenGL with Java? I didn't until now:
https://jogl.dev.java.net/
|
|
|
21-04-2004, 19:18
|
#8
|
|
Inactive
Join Date: Jul 2003
Posts: 1,395
|
Re: Programming - which language for this project?
Quote:
|
Originally Posted by Richard M
Thanks for the advice, I think I'm going to go with Java then. 
Did you know that you can even use OpenGL with Java? I didn't until now:
https://jogl.dev.java.net/ 
|
I did  but I swear that project didn't exist when I looked into it about a year ago, can't remember the name of the one I looked at, it was an open-source project and had magic or wizard or something in the title
Good luck with the project, I'd be very interested in seeing it once it's done.
|
|
|
22-04-2004, 01:12
|
#9
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: Programming - which language for this project?
Hey Richard.
It sounds like Java would probably be best for you. Sockets are a doddle. 2D graphics and images are easy to use/munipulate (3D too). You can use ODBC for Java (JDBC) if you really need to store/retrieve data in a database. TBH the data sounds pretty primative, so you could probably store it locally. Don't forget vectors which are pretty powerful and can do DB-like storage. It's all nice and high level.
Next one down i'd say would be VC++. With MFC and below, sockets are alright, along with 2d graphics, but it is much more work - but a little faster and more flexible. Visual Basic does all that too, but is a bit more higher level.
I wouldn't recommend using a scripting language like PHP. I don't know much about Perl, but although PHP has good Socket support and excellent MySql support, it isn't very good for something animated that is going to need refreshing pretty quick. It's also liable to let you down on graphics (You'd probably have to render the images in PHP and layer/position them in HTML - not the end of the world).
HTH
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 22:21.
|