Page 1 of 2

programming language used?

Posted: Thu Mar 22, 2012 1:03 am
by stevedev
I'm enjoying the game and admire what your team has accomplished. As someone who is interested in diving into game development, can you share what programming language UoC was developed in? Is there an interview regarding your development backgrounds? How you guys got started from a dev perspective?

I apologize in advance if this was answered elsewhere.. if so I missed it!


Thx,
-Steve

Re: programming language used?

Posted: Mon Mar 26, 2012 12:43 pm
by Tomislav Uzelac
Hi Steve,

the game is entirely written in Python (http://python.org/). We use a few external libraries to put our platform together: cairo (http://cairographics.org/), pygame (pygame.org), etc.

Doing it in python means we were able to make it sweet and bug free (it's only 50k lines of code, including the editors) but at the same time there is some pain when we move it to a new OS as we need to compile our platform ourselves first - Mac was a bit of a headache for example.


Cheers,

Tomislav

Re: programming language used?

Posted: Mon Mar 26, 2012 1:00 pm
by stevedev
Thx Tom for sharing. Was Python something you guys learned from scratch? Did you have previous experience in other languages? As someone who has been immersed in the web app world, it's been difficult for me to decide on a particular language as I don't have that raw object oriented c/c++ background. But when I look at Python pieces of code, it reminds me of a Javascript/Actionscript type language and I feel it might be a better fit for me. Are there specific Python books/resources you would recommend that helped you to keep things moving?

Thx.
-Steve

Re: programming language used?

Posted: Mon Mar 26, 2012 2:43 pm
by Tomislav Uzelac
Well obviously I think Python is superior, I wouldn't have chosen it to do this (rather large) project otherwise. Absolutely the best place to start with Python is Guido's tutorial: http://docs.python.org/tutorial/

Doing a game completely in python is still pretty difficult though... especially so without low-level programming knowledge (mine is in C and assembly), this stuff creeps up on you all the time. :?

If you want to try this route still, http://pygame.org/ is the place to start. We use pygame for UoC too, with the addition of cairo as a more capable software renderer. Alternatively, you might want to take a look at something like Unity 3D which supports both JavaScript and C# I think.

Re: programming language used?

Posted: Sat Oct 20, 2012 9:19 am
by davek
Tomislav - I'd love to know more about the development process, tools, dev environment (I recall you mentioned Linux in another thread) and difficulties in porting to OS X. Have you posted elsewhere (or considered writing) about this?

Re: programming language used?

Posted: Mon Oct 22, 2012 10:14 am
by Tomislav Uzelac
I didn't really post anywhere. It's a lovely setup, and TBH I thought more people would notice but you're one of the few who ever asked.

We indeed develop on Linux. It's actually much easier as all required libraries (cairo, numpy, etc.) come with the system. You just use apt-get (or synaptic, whatever) to get yourself up to date.

It's too bad that linux systems in the wild are so heterogenous that we belive it to be a major pain to package all the required dependencies etc. I hope the new efforts by Valve (to support linux in steam) would add up to something, as Linux is really the sanest platform for development.

Right now I simply don't have the time to post about this in more detail, but as soon as things subside a little why not.

Cheers! :)

Re: programming language used?

Posted: Mon Oct 22, 2012 7:07 pm
by real76
Any plans for an iPad version? Maybe with Pythonista (http://omz-software.com/pythonista/)... Would be a great platform to play it on tour ;-)

Re: programming language used?

Posted: Sun Jul 14, 2013 2:43 pm
by Flatwater
I think this program is a great example of what Python can do. I've enjoyed playing and re-playing every scenario in both the original and Red Turn.

Would you be willing to share which program you used to create the standalone Windows exe from your Python scripts? I've looked at pyinstaller and cx-freeze, and both seem functional, but I was wondering if you had better results with something else?

Thanks, and I'm looking forward to the next expansion!

Flatwater

Re: programming language used?

Posted: Mon Jul 15, 2013 9:36 am
by Tomislav Uzelac
Flatwater wrote:Would you be willing to share which program you used to create the standalone Windows exe from your Python scripts?


Hi! No secrets there, we used py2exe on windows and pyinstaller on linux.

For the next game, Spooner elected to use cx-freeze. I'm not sure why but as you said all these different packages are perfectly servicable.

Cheers!

Re: programming language used?

Posted: Wed Sep 25, 2013 6:08 pm
by lhughes41
I have been working on a wargame intended for commercial release for some time in pygame/python. I pretty much have the graphics engine done via pygame and python.
However, I was in a rather depressed mood about it this morning from a performance standpoint (scrolling) and reliability (I just tried upgrading to python 2.7 and pygame 1.9.2a0 and had issues) and was thinking I had been a fool and should have done Unity3D. Then I researched prior professional games in pygame (I knew there were some) and was STUNNED to find yours! I am already an owner of your fine game and thought it was a standard C type game given its graphical quality and performance. You have given me new hope and confidence to continue by your example. So thank you!

Since you seem willing to help I wanted to clarify one thing. I am using pygame for my blitting and onscreen rendering. But I am finding that it seems pretty unfriendly these days to providing any hardware surfaces, and the pygame developers seem to be discouraging this. So I am thrown back on software rendering. Slower. My question to you is did you use pygame for your blitting and drawing to screen or did you somehow use this cairographics tool you are referencing?
If I may be so bold what versions of pygame and python did you use and did you also fall back on software rendering? (I had hoped to do just do windows and be able to thereby hardware render).
I will try not trouble you with too many more questions. I really just want a bit of "head in this direction" kind of guidance please! Think of yourself as helping to grow the community of pygame/wargame developers!

p.s. I am studying cairographics. It looks like vector drawing support so far. My game is heavily blitting. So concerned I may still end up lost in the woods... The 'cleaness' of your graphics makes me suspect your game is not doing much blitting....