Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: Which language to use?  (Read 4172 times)

G-Flex

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #15 on: April 22, 2011, 09:43:26 pm »

You probably don't need the power and complexity of c/c++.

You don't need a crap language like vb.

Java and C# are good places to start, with plenty of room to grow. They both have a good basic syntax, they both can produce GUI's easily, they both have reasonable performance. Java is faster but with some annoying quirks in some areas, C# is slower but less rigid. Java has decent libraries for OpenGL graphics, C# has libraries for DirectX graphics.

Not to mention that Java and C# are abstract/high-level enough to be used for high-level programming purposes comfortably. C is low-level as hell and you'd be pretty insane to use it for game design, and C++ tries to add abstraction to it but does a pretty halfassed and inconsistent job of it.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Which language to use?
« Reply #16 on: April 22, 2011, 09:54:04 pm »

C# is pretty great.  I recommend using SDLdotnet.  Your cross-platform compatibility won't be great, but C# is great to learn on, incredibly non-painful, ridiculously easy to get started on (compared to C++ and its setting up the right environment and libraries and etc), and you'll get to learn SDL which also exists on C++.

The only way C# could possibly be friendlier is if it gave you a massage, then made you coffee.

Only use XNA if you really want to use 3D.  It's easy mode where *serious* game development is concerned, at the point where managing your assets becomes a big deal, but hard mode compared to simple 2D.  Also, even in a 2d game, XNA needs graphics cards with Shader 2.0 to work (which isn't all of them, as I discovered unhappily when trying to show off my stuff).
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Re: Which language to use?
« Reply #17 on: April 23, 2011, 12:13:23 am »

Alright, based on what I hear from you guys C# seems to be the best opening move for me. Any favorite resources to recommend for learning C# then? Books? Online tutorials? Arcane rituals?

Also, as a somewhat newbie in this forum, I have to say I am very impressed with how helpful and supportive this community is. Thanks a lot for your advices and guidance, you guys are awesome. It is all greatly appreciated. :)
Logged

Grishnak

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #18 on: April 23, 2011, 04:34:14 am »

Im going to toss a plug for Python. Its easy to use, fast to learn, fast to write in and has immense amounts of resources for just about everything, including OpenGL and SDL.  Especially if you are new to programming, the Python syntax is dirt easy to learn and is a great entry point to programming.  It also forces you to indent good, making your code look better in other languages.

If you know nothing about programming, seriously stray away from c/c++. They are extremely unforgiving to someone that doesnt know what they are doing. All they are going to do is give you a huge headache.
Logged
I'm a saint when it comes to pirating.  I've ripped and burned many a .iso, went .rar at my maties and sailed the .7z's.
Blog for my new roguelike Lost Horizon. <- kind of on hold
My SoundCloud
My Youtube Channel

QuintonMedina

  • Escaped Lunatic
  • I like doing various types of dance form.
    • View Profile
Re: Which language to use?
« Reply #19 on: April 23, 2011, 04:35:55 am »

f you have understood the backbone of programming, then it would be a fairly easy task for you because once you have understood how a compiler works, then it would seem like you are changing keywords between different programming languages C and C++.

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: Which language to use?
« Reply #20 on: April 23, 2011, 05:03:08 am »

In one day of reading Python tutorials, I went from knowing nothing, to having written a very short text adventure game, with some randomness, RPG-esqe things like HP and taking damage. It's a good place to start if you know absolutely nothing, and you have a good tutorial.
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Which language to use?
« Reply #21 on: April 23, 2011, 08:50:43 am »

If you don't want to spend a lot of time learning, use the language you already know or something close to it. If you want to invest in learning a language but you don't want to write a lot of code, then I'd probably go with Python, Ruby or Perl, which should have plenty of information available and you can get a lot of effect out of a little bit of code with them (Java tends to be very verbose for simple tasks, though C# and D are better at that from what I've heard. C and C++ aren't verbose per definition, but you'll need a lot of libraries or write a lot to get the same functionality as with the other mentioned languages).
« Last Edit: April 23, 2011, 08:52:52 am by Virex »
Logged

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Re: Which language to use?
« Reply #22 on: April 23, 2011, 11:20:35 am »

In one day of reading Python tutorials, I went from knowing nothing, to having written a very short text adventure game, with some randomness, RPG-esqe things like HP and taking damage. It's a good place to start if you know absolutely nothing, and you have a good tutorial.

You just made a very compelling case for python.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Which language to use?
« Reply #23 on: April 23, 2011, 11:28:12 am »

I would advise against python unless you plan it as a part-time business and then move on into a bigger project.

Python is REALLY slow in comparison to C++, I had to rewrite (or ask others to rewrite because I am quite a bad programmer) my Python stuff into C scripts for Civilization IV scripts, since a few simple scripts drastically increased time between turns and made the game choppy.

Also please consider the fact that the only element which defines the appurtenance of string in Python is tabulation!

So
Code: [Select]
    string a
    string b
    string c

and


Code: [Select]
    string a
        string b
    string c

are totally different codes!

In C for example it would be
Code: [Select]

[code]
    string a
    string b
    string c

and


Code: [Select]
    string a {
        string b
    }
    string c

I hope you see the difference. When you write a 10000 string program a single missing/added/disappeared tabulation can screw the whole problem, and in many cases you won't be able to find it unless you read it from the start to the end...
« Last Edit: April 23, 2011, 11:30:23 am by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

HideousBeing

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #24 on: April 23, 2011, 01:54:27 pm »

Python is slow, but it's really easy to pick up and use really really quickly. Google has a pretty good python tutorial/class.
I don't know how good stuff like pygame is, but I'm sure some good 2D stuff could be done.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Which language to use?
« Reply #25 on: April 23, 2011, 04:52:49 pm »

Python is REALLY slow in comparison to C++, I had to rewrite (or ask others to rewrite because I am quite a bad programmer) my Python stuff into C scripts for Civilization IV scripts, since a few simple scripts drastically increased time between turns and made the game choppy.
If you did a lot of string processing, then that is understandable. Strings in Python are, if I recall correctly, immutable, so each time you change something about a string you're assinging a whole new string. Doing a lot of small string manipulations in a language that uses immutable strings is going to be slow no matter how you turn it.
Logged

Grishnak

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #26 on: April 23, 2011, 05:34:51 pm »

Python isnt as slow as you think, if you take care to not do a lot of super intensive stuff constantly or nesting tons of loops inside a main loop. Obviously you cant write an engine like CryEngine in Python,  but you can do some pretty nice stuff in Python.

You could additionally write your own pyd's in a lower level language like I do. With swig and some .bat files its actually quite a painless process once you get everything working. Just write anything that is going to be slow, or you need to be really fast (like physics calculations) in something like c/c++ and you have the speed of a lower level language, while still using Python.

The point is, Python is extremely flexible and, at the very least, it can get you a prototype of your game, or help you find out if certain features are going to work/are interesting, with very little headache, and a LOT faster than if you are working only with a low level language.


Edit:
Plus the extremely dynamic nature of Python makes it rock. Not having to declare what type a variable is, and being able to change it on the fly rocks. Dynamic arrays (lists) are also convenient.

Also, to show you the huge difference in c++ and Python, here is a "Hello World" Example for both.


C++
Code: [Select]
#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

Python
Code: [Select]
print "Hello World!"

:D
« Last Edit: April 23, 2011, 05:41:51 pm by Grishnak »
Logged
I'm a saint when it comes to pirating.  I've ripped and burned many a .iso, went .rar at my maties and sailed the .7z's.
Blog for my new roguelike Lost Horizon. <- kind of on hold
My SoundCloud
My Youtube Channel

Xgamer4

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #27 on: April 23, 2011, 07:14:23 pm »

Not having to declare what type a variable is, and being able to change it on the fly rocks.

Yep. Right up until you have to manage reasonably complex code that takes advantage of this, and then it becomes an absolute nightmare to even think of debugging and troubleshooting. Plus you can wind up with very strange errors when the interpreter treats a variable as something different than you expect. In general, changing the type of a variable throughout a program is horrible practice.
Logged
insert something mind-blowing/witty here*

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: Which language to use?
« Reply #28 on: April 23, 2011, 07:27:43 pm »

Grishnak hit the nail on the head, for me.

Quote
C++
Code: [Select]
#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}
Python
Code: [Select]
print "Hello World!"

This. This is why, if you know nothing about loops, conditionals, variables, calling variables, blah blah blah.....Python reduces the amount of syntax you need to know before you start. (Which as always been my barrier to advanced languages. Indentation in Python was the biggest "Oh I get it" moment for me. Compared to...all that shiz you need just to get started in C.)

I'm not saying he should run wild with Python. Deon makes the point that Python has its limitations, especially in respect to other games. But as a do it yourself entry point, Python doesn't seem bad. I feel more confident about moving on to other languages once I got something working in Python. That said, there's a lot I still didn't cover that I will probably work with before attempting C.
« Last Edit: April 23, 2011, 07:29:29 pm by nenjin »
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Which language to use?
« Reply #29 on: April 23, 2011, 08:45:59 pm »

More like

Code: [Select]
#include <iostream>
int main (){
  std::cout << "Hello World!";
  return 0;}

Only including functional lines, or

Code: [Select]
#include <iostream>
int main (){
  std::cout << "Hello World!";}

if you don't mind doing things improperly. Compiles just fine with g++.


Also, with an appropriate library, it would take the exact same amount of code to send the line somewhere else. Say, perhaps, that you have an IRC client library that implements main() and everything involving setting up a TCP connection to a default server...

Code: [Select]
#include <irc/basic_client.h>
void startup(){
    irc::send << "Hello World!";}

(Bit of an extreme example, but still... Since Main is just another function that just happens to be called at startup, and the standard I/O is just another library available, it *IS* possible to replace the regular system with something else.)
« Last Edit: April 24, 2011, 12:06:15 pm by qwertyuiopas »
Logged
Eh?
Eh!
Pages: 1 [2] 3