Wednesday, November 3, 2010

Frustrations on programming languages

So, I'm honestly a bit demotivated to work on Magecrawl. Part of it is that I'm in the middle of porting it to Silverlight as a way to get a tiles version with little work that will work on Windows/Mac/Linux. Then this week, I come across these articles.

While it isn't like they are canceling Silveight, their "change in focus" and the fact that Mono is currently two major versions behind has me a bit worried. I don't want to sink another 20+ hours fixing things up, and then in a year or two have to move to another UI layer. I also don't want to loose being able to work on it on my Mac, and right now I'm in that boat.

More fundamentally, I'm frustrated that there doesn't seem to be a "good" way to do cross platform UIs for my game. I'm going to rattle though the programming languages I know or are good options. None of them right now seem to be a good fit.

C# - Silverlight: Only Mac/Windows right now. Linux is an unknown period of time away. A bit worried about its future, but probably best option right now.

C# - libtcod: Works everywhere, but no tiles UI.

C# - winforms - Yeah, it might technically work on Mac/Linux, but there are licensing concerns that make ppl not want to install it.

C# - GTK# - Doesn't look native on ANY platform except Gnome.

C/C++ - Any number of frameworks here, QT being the most obvious framework or OpenGL. Ignoring the rewrite aspect, I'd rather not chase memory errors in an unmanaged language when I'm not being paid for it.

python - pygame would be the most logical choice. I don't think I want to write in a dynamically typed language.

objective C - See C/C++ for the unmanaged language type. It also wouldn't work well on Windows/Linux, and I have no clue what GUI framework to use. 

Java - Seriously? Swing looks terrible anywhere, and with Sun Oracle trying its best to kill developer uptake, that isn't an option.

In writing this article, I've come across opentk, which appears to be a open gl binding for C#. While I'd have to learn yet another UI framework, at least I know it'd work everywhere...


Risto Saarelma said...

Most games just roll their own GUI on top of SDL or OpenGL or something instead of using a standard application toolkit. Games that use application GUI toolkits may get accused of looking like a spreadsheet instead of a fun game. You should at least list this option as well when considering what to do. If it doesn't suit your project, write down why.

jice said...

Sad but true. There is no perfect language yet. What about javascript and lua ? What's the issue with dynamically typed languages?

Traz said...

Implement your own UI using OpenGL. :)

netcore37 said...

Seeing that you ponder even languages that are not C# it probably means you are not afraid of rewrites so I would do a shameless plug and suggest having a look at TE4 ( which is the engine behind ToME4.
It is however not specific to ToME4 and can be (and is) used to create other roguelikes.
Game modules are made in Lua (and most of the engine too) and it works on linux/windows/osx with OpenGL display.

Contact me if you want some help, details, ... I usualy lurk on the tome forums, :)

Ed said...

What "licensing concerns" prevent the use of Winforms in Mono?

Sire said...

jice might be convinced to add better tiles support for libtcod, he hacked together a demo for goblincamp.

ask him! :)

donblas said...

Ed - . Roughly, many Linux projects from what I can tell don't install that winforms support by default due to patent concerns.

donblas said...

jice - I don't like dynamically typed languages because I love compile errors. In my experience with python, I've run into multiple times where I an a syntax error inside the catch statement that wasn't hit until the first time I got that error. You can mitigate this with lots of unit testing and a lint-like program however. I also have a strong C/C++/C# background, and thus like the syntax more, but I can work around that.

donblas said...

risto - The last entry roughtly fits what you were talking about I think. In short, I could write a UI on to of SDL or opengl, but then I'd have to write implementations of list boxes, message boxes, scroll bars, etc. Right now, I think magecrawl on SL looks pretty decent so far, but yeah that is an option.

Seikken said...

You could check out BennuGD:

Gregory said...

@Seikken That BennuGD looks interesting. I haven't ever seen that before.

I wouldn't rule out Java as there are quite a few options built off of LWJGL. I doubt the Oracle issues will have much impact over this sort of thing (but you never know I suppose) JavaMonkeyEngine is really nice for 3d. Slick 2d is a nice 2d framework:

I've been itching to check out Panda3D -- It seems like a nice blend of C++ & Python:

Regardless of which direction you go there are options for UI libraries where you just provide the "skin" really (so you don't go rewriting the basics of list boxes, buttons, etc...)

TWL (This is my personal favorite)

If you are thinking of using SDL or OpenGL in C/C++ there are some options I think:


Good luck. It will be interesting to see what you find.