Development:System Backgrounds

From VsWiki
Revision as of 17:14, 25 January 2008 by pyramid (talk | contribs) (Introduction)
Jump to: navigation, search

Introduction

This page summarizes concepts and approaches to creating space backgrounds compatible with Vega Strike.

Backgrounds in space are sphere mapped textures arranged in a cube-shaped sky box, so you will need to give us a set of six images.

Development Needs and Tasks

Space Backgrounds

Backgrounds in space are textures arranged in a cube-shaped sky box, like a cardboard paper that you can fold together to a box with the texture remaining on the inside of the box.

Texture Requirements

We require six images that make the six sides of the imaginary box: back, front, right, left, top, and bottom.

The texture graphics format currently recommended for the game space backgrounds is png format, but the files must be named bmp.

The image ratio horizontal:vertical must be 1:1 (assuming pixel ratio of the map is 1:1), since the texture is mapped to a cube with equal edge dimensions. Necessarily, in order for the surface not to appear distorted, your pixel ratio of the generated texture must be 1.0, i.e. a circle must show as a circle when viewing the texture in an image viewer.

The vertical and horizontal sizes should be a power of two (POT). Really, NPOT (non-power-of-two) textures are really, really, really troublesome. Don't use them. Just use POT. Love the POT. The POT is the mother, the POT is the father. Trust the POT.

That leaves few options:

  • 512x512
  • 1024x1024
  • 2048x2048
  • 4096x4096
  • 8192x8192

Keeping original high resolution image (e.g. 8192x4096 or 4096x2048) versions in stock helps maintaining quality and scalability as game development progresses or typical screen resolutions rise in the future with better hardware available to the players.

Committed textures are classified as:

  • DQ - Development Quality: textures with horizontal resolution of 512 or below and low degree of artistic quality
  • RQ - Release Quality: textures with horizontal resolution of 1024 or above and medium degree of artistic quality
  • CQ - Cinematographic Quality: textures with horizontal resolution of 2048 or above and high degree of artistic quality

Creating and Naming

You can use one of those tools described further down in tutorials. The following descriptions were tested with the settings used in the POV-Ray tutorial.

After creating your images you'll probably need to rename their suffixes to be compatible with Vega Strike format. This little map should help you get the orientation and namings right.

main.php?g2_view=core.DownloadItem&g2_itemId=7154&g2_serialNumber=2&ext=.png

If your texture core name is "blue2" you will have to produce the six images "blue2_1" through "blue2_6" with the correct orientation. Now take those suffixes (indexes) and rename them as follows: "blue2_1" to "blue2_back", "blue2_2" to "blue2_right", you are getting the hang of I guess. Continue until texture part 6. You may easily create a small script to do the job for you. Note: the underscore "_" separator is essential in your final textures.

At this point you may want to decide if your new texture should replace a low quality texture, i.e. become generically available for several systems, or if you want to make a system specific background. The first case is applicable at this stage of the development, where still many backgrounds present low artistic quality (DQ). Later, you may want to prepare specific system textures. At this stage the background core name should correspond to the system name. In the latter case (only) editing of the system file before submission will be required.

Now you should be ready to go to the next step of verifying your space background inside Vega Strike.

Including and Testing

First of all, copy your six texture files to the data4.x/textures/backgrounds directory.

The easiest way to test your new background is by trying it out in the test system. Edit the system configuration file "sectors/testsystems/planets.system" (yes, the same one you can use to test your planet textures) to change your texture at the beginning of the file

<system name="Sandbox" background="backgrounds/blue2"

Then run Vega Strike with the planet test mission:

./vegastrike test/planets.mission

Once you are happy with your texture, choose a system that you want to put it in. To generally (for all systems that are using it) replace e.g. the old "blue2" background you can search in data4.x directory using the command

grep -R "blue2.png" sectors/*

In case you are creating a system specific texture, adapt the system background description directly.

This should give you a list of sectors using that texture. Now you can copy and edit a save file to be located in exactly that system (view instructions here) you'd like to evaluate.

Finally, please verify that the texture meets the basic requirements. In summary:

  • Format: bmp
  • Image Ratio (horizontal:vertical): 1:1
  • Size: following the POT rule (power-of-two)
  • Resolution: min 1024x1024
  • Seamless: horizontally and vertically
  • Quality: RQ or CQ

If all test are satisfactory, you can proceed with the community review (vetting) and submission.

Selection and Vetting

Some Thoughts

While many textures are still with the DQ (development quality) status, it is important to quickly raise the quality of all textures to release status and beyond. In this stage, following the selection (or vetting) process might not be of the highest importance (assuming your work has 'some' artistic quality). However, when replacing visually appealing textures or raising the overall quality to CQ (cinematographic) it is of advantage to share your decisions with the whole community. This is exactly the purpose of the selection and vetting process.

Enthusiasm, the strong motivation to contribute his own work, see it published in a release, and be part of the community, often brings the danger along of falling into the pitfall and wanting to contribute and replace too many textures at the same time. Take it slowly. Since the ultimate goal is to have an individual background for each system, the more advanced (in quality and visual appeal) the textures become, the more important it becomes to create a very distinct and personal look to the particular texture and system.

Ultimately, through availability of abundant imagery, we can get an idea of the visual marvels that space offers to us. Anyhow, here are some considerations that might inspire you to create an individual, unique, and personal texture:

  • If you want to replace a background, analyze the essence of the existing texture in color, structure, spatial division, and try to come up with something similar (in essence, not appearance)
  • Inspire yourself by other works of art (paintings, computer generated art, astronomical sites, science-fiction movies), real images (NASA, Hubble, ...)

And of course, push your tools to their limits.

Once you have chosen a replacement candidate and have one or more proposals...

The Process

If you are not sure that your texture meets the basic requirements, then please open a forum topic posting your textures. Here's a summary of requirements:

  • Format: dds (maybe in png or jpg clothes)
  • Image Ratio (horizontal:vertical): 1:1
  • Size: following the POT rule (power-of-two)
  • Resolution: min 1024x1024
  • Seamless: horizontally and vertically
  • Quality: RQ or CQ

If a texture that you have created meets the texture requirements, then:

  • Open a poll for a reasonable period of time (e.g. 2 weeks) and describe:
    • which texture(s) you'd like to replace
    • display your candidates
    • briefly describe briefly the method of creation and tools used
    • If you'd like to replace more than one texture, describe how you would assign the favorites of the poll to the individual textures
  • After a set period of time
    • announce the winners
    • and call the poll closed
  • Then
    • Submit the textures to svn (in case you have commit rights attributed), or
    • through the forum ask a developer with write access to submit them (e.g. the maintainer of this page, pyramid).


Submission

AKA: Committing to SVN.

You will be required to submit:

  • Six bmp image files (with the correct orientation and naming)
  • A system file if you have created a system specific texture

In addition you may also submit:

  • the source code or project file used to create the textures
  • a credits text file stating you as the creator of that work, plus any additional info you may want to supply (real name, experience, thoughts on the image, license type (CC, or GPL))

If you have write access to svn then submit the textures after going through the community selection process. Otherwise, please call, through a forum topic or private message, a developer with write access to submit them.

As of September 2007, svn has two directories for texture data:

  • \masters\textures that holds the original textures and also source files that were used to create the textures (if you are willing to share them so that larger resolutions may be produced in the future if required)
  • \data4.x\textures that holds the textures used in game.

Tutorials

HDR Shop

[Source: PhpWiki from September 28, 2003 10:49 | Author: Spiner]

Once you have your image done load it into HDRShop and choose Image/Panorama/Panoramic transformations.

Under your source image(left side of menu) there will be a format option(should say mirrorball) choose mirrorball closeup. now on the right side (destination image, keep new image) under format choose Cubic Environment vertical cross.

You should now have a cross with only half the image in it.(saves anything but will call it "image 1")

Now to the second part.

Go to your original image and press "V", that will turn the image 180. Now go to the panorama transformations again. Choose Mirrorball closeup under source image, and cubical map under destination image. Now before you transform the image go to "3D Rotation" and choose arbitrary rotation. and choose settings. Under X axis change it to 180. leave Y and Z 0.

Ok now we have the rest of the cross. save it.(this will be called image 2)

Now go to image/calculate; under image a choose your first image(Image A) and for image b choose the second image (image b); leave c and d alone.

This will calculate the image and put it together to have one seamless image.

Note that this also makes your image double so try to change image b before you transform it.

[2003 | Author: hurleybird]

And another way i found out how to make cube maps is this...

If you have a texture which can be tiled then you can use longitude/latitude to cubic environment (note, you want to add stars AFTER this is done, not before) then you can get some really nice effects.

POV-Ray

POV-Ray (Persistence of Vision Raytracer) is a high-quality, totally free tool for creating stunning three-dimensional graphics. It is available in official versions for Windows, Mac OS/Mac OS X and i86 Linux. The source code is available for those wanting to do their own ports. With its unique scripting approach and through a large base of available texture, pigment, and material functions there are almost unlimited possibilities to creating any kind of graphics.

A sequence of textures can be exported by using spherical camera setting:

     #declare skybox_part = mod(frame_number-1,6); //range [0-5] 
     #declare camera_texture_Vegastrike = 1; //1=true 0=false
     camera { location <0,0,0> angle 90 right <1,0,0> up <0,1,0>
        // turn the cam based on the current frame [0-5]
        #switch (skybox_part)
           #range (0,3) // first 4 frames: turn from left to right
              rotate (90*skybox_part)*y
           #break
           #case (4) // frame 5: look at the sky
              #if (camera_texture_Vegastrike) rotate -90*x rotate 90*y
              #else rotate -90*x #end
           #break
           #case (5) // farme 6: look at the ground
              rotate 90*x
           #break
        #end // End of conditional part
     }
  #end //camera 6

References

Software, Tools, Tutorials