The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 06, 2024, 08:14:16 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  How do I actually view the UQM source code?
« previous next »
Pages: [1] 2 Print
Author Topic: How do I actually view the UQM source code?  (Read 5597 times)
EHO
Zebranky food
*
Offline Offline

Posts: 6



View Profile
How do I actually view the UQM source code?
« on: December 28, 2011, 08:10:40 am »

Hi All,

I'm getting into programming and thought it would be neat to get to pick through the UQM source code to get a better idea of how the original team built their game (SC2 was an all time favorite with me and my gaming buddies back in the day (yes, I'm getting old!) so I'm excited to check this out).

How do I actually open the uqm-0.7.0-source.gz file that I'm able to download from the uqm-0.7.0-source.tgz link on the Downloads page? (Is that OK that it downloaded as a .gz file and not a .tgz as named in the link on the Download page? That struck me as a potential problem).

I've been using Dev C++ for some other programming exercises. The most recent version of the SDL I've found for that is 1.2.4. Does anyone know how I can use the 1.2.14 version in Dev C++ that's required for use with UQM 0.7.0? If I'm not able to use Dev C++, can anyone recommend another compiler?

Thanks in advance for any help you can offer Smiley
Logged
Quinarbre
Frungy champion
**
Offline Offline

Posts: 60



View Profile
Re: How do I actually view the UQM source code?
« Reply #1 on: December 28, 2011, 12:47:42 pm »

Hi,

First of all, what's your current level in programming ? If you're quite new to it, then the UQM source code is probably not the best option. It's scattered over 600 code and header files, and I'm not even not counting the custom libraries. At best you could find some functions that are quite easy to understand as standalone routines, but you'd have to search for them in quite a haystack.
On the other hand, if you're getting into separate compilation, then it's interesting to look at and quite well organized.

Anyway, to open a .gz file, use for instance 7zip (assuming you're using windows). MSVC is known to be usable to compile UQM, I don't know about Dev C++.
Logged
EHO
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: How do I actually view the UQM source code?
« Reply #2 on: December 28, 2011, 04:50:26 pm »

Hi Quinarbre,

Thanks for the tip on 7zip. I had tried something called gzip but it apparently didn't want to run on my machine (yes, a PC)? Not quite sure what it was up to!

7zip appears functional for me.

Unfortunately when I try to extract the source file, I get an error in 7zip stating "Data error in 'uqm-0.7.0-source'. The file is broken". Even though I close the extraction, it does create a folder and extracted file. The extracted file has no file extension. What type of file should extract out of the process?

600 code and header files sounds pretty complex for my skill level! That said, this is probably exactly why I'd like to have a look at the code. I'd like to see just how complex a game of this nature can be. Exploring something outside of my comfort zone should teach me a few things. Also, SC2 is one of my all time favorite games so I have a high level of intrinsic motivation to try and figure a few things out from this.

Thanks Smiley
Logged
Alvarin
Enlightened
*****
Offline Offline

Gender: Male
Posts: 801



View Profile
Re: How do I actually view the UQM source code?
« Reply #3 on: December 28, 2011, 05:20:39 pm »

I have absolutely no knowledge of the code, but just wanted to wish you good luck.
Logged
onpon4
Enlightened
*****
Offline Offline

Gender: Male
Posts: 709


Sharing is good.


View Profile WWW
Re: How do I actually view the UQM source code?
« Reply #4 on: December 28, 2011, 05:22:24 pm »

I don't know your C or C++ level, but it sound like you're not familiar with UNIX or UNIX-like OSes. If you're learning C or C++, I would STRONGLY encourage you to do it on a UNIX-like OS (i.e. Linux). Both C and C++ are pretty much made for UNIX and compiling code on Windows is a huge hassle.

Also, if you're completely new to programming, it's just my opinion, but I don't think C is a good starting point. Start with an easier, high-level language. Python is what I'd recommend, but I'm biased. You might also want to try Ruby or Perl (I'm not familiar with those, so I can't recommend them). Heck, even C++ would be much better than C, if only because you'll learn object-oriented programming.

As has been said, the UQM source isn't a good place to start. It's all over the place (split into tons of source files that are tough to follow) and extremely lacking in comments. Of course, it might be worth looking at, but the vibe I get is that you're a beginner, in which case it isn't going to be helpful.

Regarding 7-Zip, I'm not sure, but it could I suppose be that the download wasn't finished or something. Maybe try re-downloading the source or something? Regarding the one extracted file, in UNIX, plain text files usually don't have an extension (Windows uses the extension ".txt"). If it's a text file (though it might not be; it could be a Linux binary as well), you can open it with Wordpad.
« Last Edit: December 28, 2011, 05:24:20 pm by onpon4 » Logged

JHGuitarFreak
Enlightened
*****
Offline Offline

Posts: 1374



View Profile WWW
Re: How do I actually view the UQM source code?
« Reply #5 on: December 29, 2011, 12:12:44 am »

I don't know your C or C++ level, but it sound like you're not familiar with UNIX or UNIX-like OSes. If you're learning C or C++, I would STRONGLY encourage you to do it on a UNIX-like OS (i.e. Linux). Both C and C++ are pretty much made for UNIX and compiling code on Windows is a huge hassle.

Aww, that's not fair.
I've had equally troubling times compiling on unix based systems.
In fact I could argue that Windows isn't that difficult at all.
Especially when all you want to do is browse through the source code and compile a native binary

On another note, Dev C++ is gonna take you a lot of work for it to compile UQM.
I suggest Visual Studio or MinGW/MSyS since there are a sort of "how to" files inside the source archive that tells you what you need for both.
They are titled, "INSTALL.mingw" & "INSTALL.msvc" respectively. Just open them up in Notepad or Wordpad or whatever kind of text editor you use.
Logged

The artist once again known as Kohr-Ah Death 213.

Get your MegaMod HERE
oldlaptop
*Smell* controller
****
Offline Offline

Posts: 337



View Profile
Re: How do I actually view the UQM source code?
« Reply #6 on: December 29, 2011, 01:46:42 am »

Aww, that's not fair.
I've had equally troubling times compiling on unix based systems.
In fact I could argue that Windows isn't that difficult at all.
Especially when all you want to do is browse through the source code and compile a native binary

Probably the big thing on a good UNIX/Linux is that it tends to be easier to get a working toolchain or new libraries ready to go. On a Debian based system, for instance, it's exactly one command to get a working toolchain, and generally one command to get any given library set up (there's a GUI way as well). It still gets complicated quickly if you need multiple versions of a library, or a library that's not in the package repositories, or if the library has requirements the package manager can't handle (GNUstep comes to mind).

Back on topic, that download sure sounds like it's corrupted. It should contain a directory looking more or less like this:

http://sc2.svn.sourceforge.net/viewvc/sc2/trunk/sc2/
Logged

Play Supermelee online in #uqm-arena!
Netmelee Improvement Mod
JHGuitarFreak
Enlightened
*****
Offline Offline

Posts: 1374



View Profile WWW
Re: How do I actually view the UQM source code?
« Reply #7 on: December 29, 2011, 02:00:06 am »

Well jumping to a Unix based system when you've used Windows however many years just to compile code.
Sure setting up Visual Studio might take about as long as it would take to install Linux but MinGW sets up in a few minutes then all you'd have to do is download the required SDK/Libraries/Headers.

Heck if he needs 'em I got two different sets of required libraries one for MinGW and the other for Visual Studio just to make it that much easier.

But then again this isn't a conversation about which is a better code compiling platform, this is a thread about how to view and compile code on the platform the OP specifies...  Grin
Logged

The artist once again known as Kohr-Ah Death 213.

Get your MegaMod HERE
EHO
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: How do I actually view the UQM source code?
« Reply #8 on: December 30, 2011, 07:11:01 am »

I have absolutely no knowledge of the code, but just wanted to wish you good luck.

Thanks... I need it! Smiley
Logged
EHO
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: How do I actually view the UQM source code?
« Reply #9 on: December 30, 2011, 07:22:50 am »

I don't know your C or C++ level, but it sound like you're not familiar with UNIX or UNIX-like OSes. If you're learning C or C++, I would STRONGLY encourage you to do it on a UNIX-like OS (i.e. Linux). Both C and C++ are pretty much made for UNIX and compiling code on Windows is a huge hassle.

Also, if you're completely new to programming, it's just my opinion, but I don't think C is a good starting point. Start with an easier, high-level language. Python is what I'd recommend, but I'm biased. You might also want to try Ruby or Perl (I'm not familiar with those, so I can't recommend them). Heck, even C++ would be much better than C, if only because you'll learn object-oriented programming.

I am pretty novice however I'm actually strongest with C++ having taken a beginning course in it. I've used Python a bit but really prefer C++ having had that class.

I'm in the process of having to reinvent my career (yet again!). I'm looking to take some more programming courses to make myself more marketable for technical jobs. If I were to earn a certificate through the local university extension program, does anyone have any advice on what languages are most marketable?

Thanks for the tip on Unix based OSs... that seems to be very relevant for embeded systems, correct?
Logged
EHO
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: How do I actually view the UQM source code?
« Reply #10 on: December 30, 2011, 07:31:18 am »

On another note, Dev C++ is gonna take you a lot of work for it to compile UQM.
I suggest Visual Studio or MinGW/MSyS since there are a sort of "how to" files inside the source archive that tells you what you need for both.
They are titled, "INSTALL.mingw" & "INSTALL.msvc" respectively. Just open them up in Notepad or Wordpad or whatever kind of text editor you use.

I had found a tutorial about using Dev C++ with SDL but it seems to be for a version from a good ways back. Dev C++ was what I had used in my C++ course so I was hoping that might work. I think you're right though, thanks for the advice! Smiley
Logged
EHO
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: How do I actually view the UQM source code?
« Reply #11 on: December 30, 2011, 07:49:46 am »


Back on topic, that download sure sounds like it's corrupted. It should contain a directory looking more or less like this:

http://sc2.svn.sourceforge.net/viewvc/sc2/trunk/sc2/

Wow, that looks more useful. Is that all of the files and content then? Now I'm getting more confused!
Logged
onpon4
Enlightened
*****
Offline Offline

Gender: Male
Posts: 709


Sharing is good.


View Profile WWW
Re: How do I actually view the UQM source code?
« Reply #12 on: December 30, 2011, 03:51:44 pm »

I am pretty novice however I'm actually strongest with C++ having taken a beginning course in it. I've used Python a bit but really prefer C++ having had that class.

C is a different language than C++ with completely different programming techniques. UQM is in C, not C++.

I'm in the process of having to reinvent my career (yet again!). I'm looking to take some more programming courses to make myself more marketable for technical jobs. If I were to earn a certificate through the local university extension program, does anyone have any advice on what languages are most marketable?

"Marketable" does not compute.

OK, more serious: if you're going to be a programmer, you need to understand that learning never ends. No one language is "most marketable". What's important is that you know programming and can easily learn more languages, not that you know specific languages.

A bit more importantly, do make sure you're doing this because you like programming, not because you need money. General programming jobs pay a lot, sure, but they're also a lot of work. Hearing this talk of marketability gives me the impression that you either don't fully understand or don't fully appreciate this.
Logged

oldlaptop
*Smell* controller
****
Offline Offline

Posts: 337



View Profile
Re: How do I actually view the UQM source code?
« Reply #13 on: December 30, 2011, 10:23:12 pm »

Wow, that looks more useful. Is that all of the files and content then? Now I'm getting more confused!

That is the up-to-date bleeding edge development code, may have lots of bugs and otherwise be broken. Linked there just to provide an idea of what the tarball is supposed to look like.
Logged

Play Supermelee online in #uqm-arena!
Netmelee Improvement Mod
JHGuitarFreak
Enlightened
*****
Offline Offline

Posts: 1374



View Profile WWW
Re: How do I actually view the UQM source code?
« Reply #14 on: December 31, 2011, 06:17:32 am »

I'm going to be installing Visual C++ Express 2010 soon and if there is any success with it I'll go ahead and write down a step by step guide for you and the rest of our fellow Windows brethren.

Before I just Virtual Box'ed WinXP and ran Visual Basic 6.0.
Logged

The artist once again known as Kohr-Ah Death 213.

Get your MegaMod HERE
Pages: [1] 2 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!