The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2022, 02:27:17 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)
| | |-+  graphic specifications
« previous next »
Pages: [1] Print
Author Topic: graphic specifications  (Read 3756 times)
Twurckle
Zebranky food
*
Offline Offline

Posts: 6



View Profile
graphic specifications
« on: February 24, 2008, 11:06:34 am »

I was thinking about creating some art for the game (new planet surface creatures) as a resource for modders and was wondering about the graphic format etc.

I assume the game can only handle 256 colors?
I could not find information on the graphic format used by the game. can I save them as animated gifs? if so what color palette should I use, I assume I somehow have to use the same colors as the game itself?


Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: graphic specifications
« Reply #1 on: February 24, 2008, 01:48:32 pm »

I assume the game can only handle 256 colors?
Some of the 3DO graphics have higher colour depth and UQM generally uses whichever of the PC or 3DO graphics has higher quality (and in some cases where they are different, both are available). In order to allow this, UQM supports up to 24-bit colour.

Quote
I could not find information on the graphic format used by the game. can I save them as animated gifs? if so what color palette should I use, I assume I somehow have to use the same colors as the game itself?
It's all in the doc directory of the source tree. For example, doc/devel/aniformat explains the animation format (sprites, dialogue animations, and so on); basically it's a bunch of PNGs and a text file that lists the PNG files and their position on screen relative to the position of the object the images represent. For example, the Roto-Dendron is in content/ipanims/lifea.ani.

There seems to be a lot of hard-coding of animation lengths, so you probably want to stick to 4 frames. Look at src/sc2code/planets/lander.c for how the life forms' behaviour is defined.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Michael Martin
Core Team
*Smell* controller
*****
Offline Offline

Posts: 387



View Profile
Re: graphic specifications
« Reply #2 on: February 24, 2008, 01:58:43 pm »

And Novus beats me to the punch, and even links all the same files I was going to.

That said, looking through lander.c it looks like everything is being done with IncFrameIndex, which will cycle through animation frames regardless of how many there are.  It should be safe to use any number of frames.  Test it before going nuts, though, of course.
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: graphic specifications
« Reply #3 on: February 24, 2008, 05:11:29 pm »

There's some stuff later on in object_animation that looks like it could be trouble:

Code:
246: frame_index = GetFrameIndex (pPrim->Object.Stamp.frame) + 1;
...
310: else if (!(frame_index & 3) && ElementPtr->hit_points)
If I'm reading this right, frame_index rolls through 1, 2, 3 and 4 for a 4-frame animation, so you need at least 4 frames before the condition on line 310 is true, i.e. a life-form with less frames won't move properly.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Twurckle
Zebranky food
*
Offline Offline

Posts: 6



View Profile
Re: graphic specifications
« Reply #4 on: February 24, 2008, 06:50:31 pm »

Thanks for the replies, it's good to hear that the game does accept images with higher color depth.
I have no coding experience whatsoever, but I've been toying with the idea of learning to program for a while.
I don't expect to submit any usefull code soon, but i'd at least like to better understand how it works, and learn to read code.
What would be a good place to start?
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: graphic specifications
« Reply #5 on: February 25, 2008, 07:36:56 pm »

There's some stuff later on in object_animation that looks like it could be trouble:

Code:
246: frame_index = GetFrameIndex (pPrim->Object.Stamp.frame) + 1;
...
310: else if (!(frame_index & 3) && ElementPtr->hit_points)
If I'm reading this right, frame_index rolls through 1, 2, 3 and 4 for a 4-frame animation, so you need at least 4 frames before the condition on line 310 is true, i.e. a life-form with less frames won't move properly.
Yep, I tried it out on the lunar bulldozers. If they have less than 4 frames, they freeze.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
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!