• Advertisement
Sign in to follow this  

How to program with multiple languages on one project?

This topic is 1920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a beginner in programming. I am able to program fairly well in Blitz Plus, and I just started teaching myself C#. I've gotten together with a group of friends to attempt to create a Mario/Mega Man esque game. There are two programmers on the project, myself(I will be programming in Blitz Plus) and another friend(who is somewhat of a beginner in Java, and wants to program in that.) I've read that in many projects, programmers use several languages. I'd like to do this in my project, but how would this work? Also, how would our code interact with each other? For example, if I declared a variable in my program, how would the programmer using Java interact with it? How would we combine our work together once we are finished? If anyone could tell us a way to get our code to work together, it would certainly be helpful. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Just let me add something. If you guys really want to program one in java and the other in C#, I see as an option, one of you could program content creation tools, such as map editors and stuff, while the other codes the actual game. If you store your data in xml or a sqlite database, it could work. But youll most likely have to share libraries anyway, so this is not a very good idea.

If you guys are beginning, stick to one tool.

Share this post


Link to post
Share on other sites
[quote name='nicksaiz65' timestamp='1350250088' post='4990157']
There are two programmers on the project, myself(I will be programming in Blitz Plus) and another friend(who is somewhat of a beginner in Java, and wants to program in that.)
[/quote]
No.

Let's be honest regarding your experience levels, with the fact that you describe both of you as "beginners". One of you is going to have to change their mind and use the language the other one is programming in. Especially with both of you having little experience as programmers.

Like Arthur mentions, most of the time when "multiple languages" are used on the same project, it's for things like back-end tools, scripting languages, and so on. (Ex: I've written 3 tools for myself so far on my project: a map editor, a packaging tool for resources, and a UI configuration builder). But you won't find a game where one engine programmer is using C# to write the 'Camera' class and another is using Java to write the 'GameObject' class. It's much, MUCH easier to just get all programmers on the same page where the main code is concerned: 9 times out of 10 it's C++ in the AAA world (thanks in part to legacy engines and frameworks), indie projects pick whatever they want.

Granted, you CAN marshal between languages using things Serapth mentioned, but that's well beyond both of you right now. And entirely unnecessary for the scope of your game.

Share this post


Link to post
Share on other sites
Pick a language that makes the most sense for the game you are designing and learn that. Using two languages for central components is just dumb. I can see using different language for some scripting or web based components, but otherwise it will be way easier if you both use the same language.

To me it sounds like you should spend more time learning the basics of programming before working on something as complex as a game. If you really do understand the fundamentals of programming picking up Java should be fairly easy, at least for the basic stuff to get you going on your project. I would personally recommend moving to something like C# or java anyways, as they are far more popular than Blitz Plus.

Share this post


Link to post
Share on other sites
[quote name='derda4' timestamp='1350364718' post='4990624']
Much simpler would be to use a multiplatform language alike c++.
[/quote]
No offence intended, but that just isn't relevant advice to the topic at hand. Multi-platform development is not what is being discussed here.
[size=3][b]//EDIT[/b]: I'm telling you this rather than voting down the post, so that you might be more careful to avoid non-relevant posts in future.[/size]

Share this post


Link to post
Share on other sites
I think when you see multiple languages used it tends to be more in a pattern of the engine being written in one language and featuring a script interpreter for another. One example would be civilization 5. Its written in C++ I think yes also has lua embedded into it for mods etc (infact a large amount of the vanilla game is implemented through the modding API).

Multiple languages for one engine however, not so likely. Can be done, .net for instance doesnt care very much about what language you wrote X class in, set up a VB.net class library, write some classes, make another class library project in Boo. You can use both class libraries from C#. Its the same deal with JVM languages. Theres also IKVM for some java .net compatibility although I've never looked at it. But generally unless your going the scripting route single language is the way forwards.

Share this post


Link to post
Share on other sites
I personally would learn a lot more about c++/c first. Then start combining languages. I personally like gluecode between c++ and lua to create games. Data driven design + OOP = Awesomeness. Java is extremely horrible with memory efficiency. I personally would never use java to create games period. Just a personal opinion though. C++ is the way to go when combining two languages.

Share this post


Link to post
Share on other sites
[quote name='DevAssassin' timestamp='1350427974' post='4990908']
I personally would learn a lot more about c++/c first. Then start combining languages. I personally like gluecode between c++ and lua to create games. Data driven design + OOP = Awesomeness. Java is extremely horrible with memory efficiency. I personally would never use java to create games period. Just a personal opinion though. C++ is the way to go when combining two languages.
[/quote]
DevAssassin, I'm sorry but what?
Java is not horrible with Memory Efficiency, I have no idea where you heard that from.
Also, the only language you've ever programmed in is C++(Maybe LUA, but I'm assuming nothing else)
Also, how do you know C++ is the way to go?

I'm sorry, but you might have just skewed the OP's opinions by saying many things you probably heard on some random guys blog, because most of what you said isn't true.

Share this post


Link to post
Share on other sites
[quote name='nicksaiz65' timestamp='1350250088' post='4990157']
I'm a beginner in programming. I am able to program fairly well in Blitz Plus, and I just started teaching myself C#. I've gotten together with a group of friends to attempt to create a Mario/Mega Man esque game. There are two programmers on the project, myself(I will be programming in Blitz Plus) and another friend(who is somewhat of a beginner in Java, and wants to program in that.) I've read that in many projects, programmers use several languages. I'd like to do this in my project, but how would this work? Also, how would our code interact with each other? For example, if I declared a variable in my program, how would the programmer using Java interact with it? How would we combine our work together once we are finished? If anyone could tell us a way to get our code to work together, it would certainly be helpful. Thanks.
[/quote]
Blitz plus would be good for a toolkit / level editor, and the GUI. However I don't recommend using it for actual game programming. You're friend could program the actual game in Java. You probably shouldn't start out with Mega Man / Mario for your friends sake, because if he hasn't programmed any (many) games you'll end up with a spaghetti codebase / no game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement