programming language used?

Ask, comment, read.
stevedev
Cadet
Posts: 2
Joined: Thu Mar 22, 2012 12:56 am

programming language used?

Unread postby stevedev » Thu Mar 22, 2012 1:03 am

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

User avatar
Tomislav Uzelac
2x2 Games
Posts: 1325
Joined: Mon Apr 04, 2011 11:24 pm
Location: Zagreb, Croatia

Re: programming language used?

Unread postby Tomislav Uzelac » Mon Mar 26, 2012 12:43 pm

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

stevedev
Cadet
Posts: 2
Joined: Thu Mar 22, 2012 12:56 am

Re: programming language used?

Unread postby stevedev » Mon Mar 26, 2012 1:00 pm

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

User avatar
Tomislav Uzelac
2x2 Games
Posts: 1325
Joined: Mon Apr 04, 2011 11:24 pm
Location: Zagreb, Croatia

Re: programming language used?

Unread postby Tomislav Uzelac » Mon Mar 26, 2012 2:43 pm

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.

davek
Newcomer
Posts: 1
Joined: Sat Oct 20, 2012 9:14 am

Re: programming language used?

Unread postby davek » Sat Oct 20, 2012 9:19 am

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?

User avatar
Tomislav Uzelac
2x2 Games
Posts: 1325
Joined: Mon Apr 04, 2011 11:24 pm
Location: Zagreb, Croatia

Re: programming language used?

Unread postby Tomislav Uzelac » Mon Oct 22, 2012 10:14 am

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! :)

real76
Cadet
Posts: 2
Joined: Sun Oct 21, 2012 11:22 am

Re: programming language used?

Unread postby real76 » Mon Oct 22, 2012 7:07 pm

Any plans for an iPad version? Maybe with Pythonista (http://omz-software.com/pythonista/)... Would be a great platform to play it on tour ;-)

Flatwater
Second Lieutenant
Posts: 9
Joined: Sun Jul 14, 2013 2:38 pm

Re: programming language used?

Unread postby Flatwater » Sun Jul 14, 2013 2:43 pm

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

User avatar
Tomislav Uzelac
2x2 Games
Posts: 1325
Joined: Mon Apr 04, 2011 11:24 pm
Location: Zagreb, Croatia

Re: programming language used?

Unread postby Tomislav Uzelac » Mon Jul 15, 2013 9:36 am

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!

lhughes41
Cadet
Posts: 2
Joined: Wed Sep 25, 2013 5:57 pm

Re: programming language used?

Unread postby lhughes41 » Wed Sep 25, 2013 6:08 pm

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....


Return to “Unity of Command”

Who is online

Users browsing this forum: No registered users and 1 guest