Author Topic: Which language and library to use  (Read 35042 times)

QubeNub

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
    • Email
Which language and library to use
« on: July 01, 2014, 11:38:52 AM »
Hello folks,

I'm about to start writing a game which i have been gathering ideas about for some time now. It will be a roguelike focussed on magic, spellcrafting, time travelling, proc. gen. content and maybe more.

The problem is that I can't decide which language to program in and which library to use for the display.
I've tried things like LWJGL, LibGDX, Libtcod and even only using Java AWT to write to the screen.

Now the ideas that I have mean that the game will need A LOT of processing power during things like time travelling and such.
I want to use a language/library that is optimized and fast.
I'm a developer by profession so the language choice doesn't really matter.

I was hoping that people here could make some suggestions and maybe tell why you made that suggestion?

Thanks in advance!

QubeNub

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Which language and library to use
« Reply #1 on: July 01, 2014, 11:49:39 AM »
I'm a developer by profession so the language choice doesn't really matter.

In roguelike world it doesn't mean anything if you are a developer. Well, maybe you get slightly better starting skills. If you were any good at programming you would already know that language does matter. Some languages are better for large scale programs. Speed can become a problem with complex gameplay, because there is more AI and generic program flow stuff than things related to graphics.

QubeNub

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
    • Email
Re: Which language and library to use
« Reply #2 on: July 01, 2014, 11:55:14 AM »
What I meant is that I will be able to work with almost any language, I don't really know which languages are faster than others in terms of logic.

reaver

  • Rogueliker
  • ***
  • Posts: 207
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #3 on: July 01, 2014, 11:58:06 AM »
Use the language you're the most proficient with. Unless it's COBOL, Fortran or sth like that.

guest509

  • Guest
Re: Which language and library to use
« Reply #4 on: July 01, 2014, 12:23:42 PM »
Python and Libtcod seems to be very popular.

I stuck with Gamemaker, but will probably move on soon to something else. Maybe the ToME engine.

QubeNub

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
    • Email
Re: Which language and library to use
« Reply #5 on: July 01, 2014, 12:56:01 PM »
Yes, Libtcod looks exactly the kind of library I want to use.
But I don't know for sure if python has good performance when doing a lot of calculations/memory read/writes.

Omnivore

  • Rogueliker
  • ***
  • Posts: 154
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #6 on: July 01, 2014, 01:11:43 PM »
Python's performance is largely irrelevant.  It is great for prototyping (looks much like pseudo-code) and it is easy to profile.  When you identify a section of code that is a performance bottleneck, you can implement that section in another language as a lib and call it from Python (or just use Cython which is a mix of C and Python).  Python has a ton of libraries available that are already tested and optimized which may fit your needs (Cython + NumPy is excellent for high performance arrays).

The major reason to use Python or similar (Lua w/LuaJIT for example) is it allows you to quickly get a working prototype and test your ideas.  It gives you a 'fail fast' - quick iteration development cycle.  I find it also helps to avoid premature low level optimizations and concentrate on algorithmic optimization.


Eben

  • Rogueliker
  • ***
  • Posts: 339
  • Karma: +0/-0
  • Controversializer
    • View Profile
    • SquidPony!
Re: Which language and library to use
« Reply #7 on: July 01, 2014, 11:08:14 PM »
If you know Java:

https://github.com/SquidPony is a Java full-service text and graphical tile roguelike (or any grid game really) library. I've used it for all of my several 7dRLs and several other projects. Which is no surprise, I made it :D

You can see in my source for Assault Fish (at the link above) how to do some really cool things with it, like Perlin Noise and transparent overlays, and animations.

You can also see other things I've done with it at my site http://squidpony.com/

(cross posted since it applies here too. kinda surprising there's a sudden interest in Java, it's been all Unity for the last year)

guest509

  • Guest
Re: Which language and library to use
« Reply #8 on: July 02, 2014, 12:35:31 AM »
Have to 2nd Eben here. If you've seen his games you can tell he knows what he's talking about.

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #9 on: July 02, 2014, 04:41:06 AM »
It's kind of surprising to hear a developer ask someone else's opinion about what language s/he ought to use for a project.

I mean -- you know these languages, right?  You know your own skills?  You know what you want do do?  And it still isn't obvious to you? 

I don't claim that there's any objectively obvious choice; just that you of all people ought to know exactly what language you can achieve your objective in.  There's some combination of things you want to do, some list of attributes you want your final game to have?  And that doesn't inform your language choice?

For example, if you want other people to contribute much, you'll probably avoid really complex languages that not very many people can code in.  If you want to make a game that plays in a straight console mode, you'll pick a language that has bindings to the ncurses library.  If you want to make a game that allows you to write plugins and just add them to your code so that work seamlessly without you having to touch any of the existing code, you'll use a language that allows you to define a plugin interface.  If you want to make an Android game, you'll probably write in Java.  If you want to make a Unix game, you'll need to play nice with system calls defined in C, which means either writing in C/C++ or picking a language with a good FFI or a good set of bindings for all the system stuff you need.  If you want to train yourself to have better Lisp-fu, you'll probably use Lisp. 

And so on.  I mean, seriously...  you want to do the project, but you don't already know what language you want to write it in?  How's that even possible?


Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Which language and library to use
« Reply #10 on: July 02, 2014, 07:51:43 AM »
The major reason to use Python or similar (Lua w/LuaJIT for example) is it allows you to quickly get a working prototype and test your ideas.

Python has been quoted as extremely great language yet where are all roguelikes written in python?

Aukustus

  • Rogueliker
  • ***
  • Posts: 440
  • Karma: +0/-0
    • View Profile
    • The Temple of Torment
Re: Which language and library to use
« Reply #11 on: July 02, 2014, 08:00:40 AM »
The major reason to use Python or similar (Lua w/LuaJIT for example) is it allows you to quickly get a working prototype and test your ideas.

Python has been quoted as extremely great language yet where are all roguelikes written in python?

Probably some guys who started programming started before Python was invented and do not want to change language. Or they want to work on a lower level than Python.

Omnivore

  • Rogueliker
  • ***
  • Posts: 154
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #12 on: July 02, 2014, 08:06:55 AM »
The major reason to use Python or similar (Lua w/LuaJIT for example) is it allows you to quickly get a working prototype and test your ideas.

Python has been quoted as extremely great language yet where are all roguelikes written in python?

http://www.roguebasin.com/index.php?title=Python#Roguelike_games_in_Python

If you notice, you'll see a lot of 7drl and alpha tags, Python is great for prototyping and fast development.  I'm not sure how many finished roguelikes were prototyped in Python and then gradually migrated to C.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #13 on: July 02, 2014, 08:42:47 AM »
It's kind of surprising to hear a developer ask someone else's opinion about what language s/he ought to use for a project.

I mean -- you know these languages, right?  You know your own skills?  You know what you want do do?  And it still isn't obvious to you? 

I don't claim that there's any objectively obvious choice; just that you of all people ought to know exactly what language you can achieve your objective in.  There's some combination of things you want to do, some list of attributes you want your final game to have?  And that doesn't inform your language choice?

For example, if you want other people to contribute much, you'll probably avoid really complex languages that not very many people can code in.  If you want to make a game that plays in a straight console mode, you'll pick a language that has bindings to the ncurses library.  If you want to make a game that allows you to write plugins and just add them to your code so that work seamlessly without you having to touch any of the existing code, you'll use a language that allows you to define a plugin interface.  If you want to make an Android game, you'll probably write in Java.  If you want to make a Unix game, you'll need to play nice with system calls defined in C, which means either writing in C/C++ or picking a language with a good FFI or a good set of bindings for all the system stuff you need.  If you want to train yourself to have better Lisp-fu, you'll probably use Lisp. 

And so on.  I mean, seriously...  you want to do the project, but you don't already know what language you want to write it in?  How's that even possible?

I would go further than this. If you're writing a roguelike and you don't already have a team, the team is you (and if you have a team, you should be talking to your team, not random people on the internet). If you don't actually know a programming language and how to program in it, then you don't have a serious project and you won't have a serious project for years. If you do know a programming language and it's not LOGO or something along those lines, then you know you can write a roguelike in that language. If you know a programming language that's exotic enough that there would be issues of distribution and whatever else, then you probably know what you're doing and wouldn't be asking a question like this.

In other words, these questions get way too much indulgence. Here's a flow chart:

Code: [Select]

   do you know a programming language?   ---->  NO
                     |                          |
                     |                          |
                     V                          V
                    YES         then stop talking about your "roguelike project"
                     |
                     |
                     V
   then write the game in that language


The basic error here is thinking that it makes a huge difference what programming language you use. Guys, they're all Turing equivalent and they're all built to perform roughly the same kinds of tasks (particularly the ones someone asking a question like this might know or have heard of). Yes, there are some differences on the margins, but this is a boring conversation that happens thousands of times a day all over the internet. Any mentally awake programmer (that is, someone who may conceivably write a roguelike game) would be aware of some this discussion (or better, have the sense not to seek it out).

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Which language and library to use
« Reply #14 on: July 02, 2014, 08:45:28 AM »
Yes, Libtcod looks exactly the kind of library I want to use.
But I don't know for sure if python has good performance when doing a lot of calculations/memory read/writes.

Backend of Eve Online has loads of Python code in it (Stackless Python, but Python still). And with Python you might get the program up and running faster too (shorter development cycle).

But it really would make sense to use the language you're most proficient with, especially if your goal is to write a game and not to learn a new language.

If I were to write a new roguelike, I would choose Python, because the ease of development and pleasantness of the language. I could write CPU intensive parts with C/C++, but most likely I wouldn't have to. Definitely I would do that only after observed performance problems and proper profiling. Distributing the game in easy to run format would require some extra steps, but it's doable.

If I wanted to easily share the game with other people, I would pick C#, because it's a modern language that is pretty pleasant to work with and the resulting program is easier to distribute than Python program. However, I would have to pay attention to differences between Mono and MS CLR implementation and support if I wanted people with different OSes to play the game.

If I wanted to learn something exotic, I would choose Erlang or F#, just because :) (or write my own language)
Everyone you will ever meet knows something you don't.
 - Bill Nye