The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
September 29, 2022, 12:43:48 pm
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Help with programming...
« previous next »
Pages: [1] Print
Author Topic: Help with programming...  (Read 1415 times)
Mormont
*Smell* controller
****
Offline Offline

Posts: 253


I love YaBB 1G - SP1!


View Profile
Help with programming...
« on: October 29, 2003, 01:07:37 am »

I'm trying to create an sc1-esque strategy mode to add into UQM. However, I recently downloaded the source and it's a nightmare. I can't even figure out the graphics libraries! Could one of the sourceforgers give me some help on how to do stuff with the game engine, such as graphics, input, and sound?

I don't know C per se, but I do know c++. Would it still work properly if I did it in c++, so long as I used structs instead of classes?
« Last Edit: October 29, 2003, 05:20:01 am by JWJ » Logged
Michael Martin
Core Team
*Smell* controller
*****
Offline Offline

Posts: 387



View Profile
Re: Help with programming...
« Reply #1 on: October 29, 2003, 08:33:57 am »

Look at the doc/devel directory.  Note that the graphics libraries, in particular, are frightening because there are at least five layers:  The gfxlib level, which is what the program uses for static graphics; the "DisplayQueue" level, which was originally there, the "TFB_Prim" level, which is a modified version of stuff that was originally there, the "TFB_Image/TFB_Canvas/TFB_Screen" level, which is my work (and is the glue between the backend and the game's renderer) and the DrawCommandQueue layer, which actually deals with SDL.

So there are a lot of emulation and abstraction layers, most of which are *probably* redundant, but it works, and we inherited, and so it goes.

Full extensions at that level are going to involve reverse engineering most of the main code.  We're *explicitly* not doing this for the most part; we're just trying to get the backends working sufficiently, and then (for the most part) everything falls into place.  Refactoring the main game code is something that we're doing very slowly and very carefully when we do it at all.

C++ extends the C core in several significant ways, some of which are in C99 (which we aren't really using), some of which are in C89.  Sort of beyond the scope of this post, but you should be able to find guides online.
Logged
Mormont
*Smell* controller
****
Offline Offline

Posts: 253


I love YaBB 1G - SP1!


View Profile
Re: Help with programming...
« Reply #2 on: October 30, 2003, 02:41:16 am »

Quote
Full extensions at that level are going to involve reverse engineering most of the main code.  We're *explicitly* not doing this for the most part; we're just trying to get the backends working sufficiently, and then (for the most part) everything falls into place.  Refactoring the main game code is something that we're doing very slowly and very carefully when we do it at all.

So are you saying that the the extension I'm making isn't really feasible? If so, will it be possible in a future version?
Logged
Michael Martin
Core Team
*Smell* controller
*****
Offline Offline

Posts: 387



View Profile
Re: Help with programming...
« Reply #3 on: October 30, 2003, 03:17:44 am »

I'm saying that our focus has been more on writing compability layers than on comprehending the original source in all its glory.  So we aren't really that qualified to make feasibility judgements.

If you try to take it on anyway, your first step will probably have to be working out the structure of the code.  Most of the developers have a vague idea of how the code is structured, but it's nothing that you shouldn't be able to eventually deduce yourself.  The "real program" is the stuff in sc2code, sc2code/planets, sc2code/ships and friends, and sc2code/comm and friends.  Stuff in libs/ is basically backend stuff.

We usually only mess around in sc2code to change calls to a unified backend or to fix bugs in the game proper, so it's not really our forte.

I'm not necessarily saying it's not feasible; I am saying that if you want to try, you're mostly on your own (and pay attention to the "invisible changes" we make to the API, since they may end up breaking your code.)
Logged
Pages: [1] 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!