Base backgrounds?

Thinking about improving the Artwork in Vega Strike, or making your own Mod? Submit your question and ideas in this forum.

Moderator: pyramid

Post Reply
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Base backgrounds?

Post by crouton »

I've looked through the VS Wiki on how to do (new) base backgrounds; unfortunately, that's a topic that has yet to be covered. A little research here on the forums has dug up: 1024x1024 or larger (same dimensions?) and .PNG preferred. What I'd like to have explained is how the image is arranged on the screen. For instance (I'm using the WCU/Priv mod here) the "sprites/bases/pleasure/Jolson_LandingBay.spr" file is the default Landing Bay image handler for agricultural and pleasure planets. The information within is arranged thusly:

Code: Select all

bases/pleasure/Jolson_LandingBay.png 0
3.104 2.4832
0 0
What does each number represent? Currently, if I replace the current 512x256 .png file with a 1024x1024 .png file, the image is distorted. Would I need to change the '3.104 2.4832' to be '1 1'? Is the first 0 alpha blending?

This would be very useful (once the discussion has concluded) in the Wiki.
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

That would be the sprite file format. You can find the description for that in the Wiki under HowTo edit HUDs. http://vegastrike.sourceforge.net/wiki/HowTo:Edit_HUDs

After that, you will need to create the appropriate python scripts to be placed in the bases directory. I'm not sure what the process is to add them to the game though.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

Let's just assume that I want to replace what is already present, rather than create new bases. The Wiki entry on HUDs and '.spr' files states the following:

Code: Select all

imagename alphaname
scaleX scaleY
positionX positionY
In my previous example, alphaname=0, scaleX=3.104, scaleY=2.4832, and positionX=positionY=0. This means that the image is being scaled on the X-axis more than 'doublesize' (2=doublesize) and Y-axis is a hair more than 'doublesize'. With both positionX and positionY being 0, the image is drawn beginning from the center of the screen. Looking at the old 512x256 file, the image is not centered. The image itself is only 320x200 from the upper left corner, with the extra space being transparent.

So, let's assume that all base backgrounds in the future will be 1024x1024 or some constrained multiple thereof (2048x2048, etc) and that such images will be full (containing no blank area). If we can determine the numbers now, all future backgrounds can follow the same formula and avoid the dilemma I'm currently facing. ;)

[edit] After playing with some numbers, I've almost gotten it to take up the whole screen. But it looks absolutely horrid - like the engine is downsampling the resolution to 320x200 anyways. Am I missing some crucial step, or is this a genuine impediment to having gorgeous high-resolution backgrounds?
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

Hmm... It looks like the base SPR format is slightly different. Instead of an alphaname field, there is a boolean (which is True in VS bases and 0 in Privateer bases) also there is a comma between the two position fields. I'm not entirely sure, but if the scale fields are handled like the others, it is not a size multiplier to the image, but rather the size that the image is scaled to (2 2 being fullscreen) I've never edited the bases, but if the hotspot locations change, you will need to edit the appropriate .py file.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

Image

That's the 1024x1024 .PNG file, using scaleX=scaleY=2 (fullscreen, supposedly) and positionX=positionY=0. The weird artifacting is the wave animation. I really think that the engine is constraining the resolution.
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

Can a VegaStrike developer help me out here? Is there a better way to accomplish high-res base backgrounds?
tiny paintings
Bounty Hunter
Bounty Hunter
Posts: 214
Joined: Mon Jun 27, 2005 7:35 pm
Location: Stockholm, Sweden
Contact:

Post by tiny paintings »

Did you take a peek at the backgrounds in vega strike?
They are rather high in resolution if I'm not mistaken... I'd do it but I'm not anywhere near a vega strike installation atm.
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

Try:

Code: Select all

bases/industrial/landing_sunset.png true
1.94 1.94
0 0
Dan.a
"Computers are useless. They can only give you answers."
-- Pablo Picasso
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

One thing that might be up with the png is maybe the colour palatte.....you need to have full 32bit colour png files for Vs to work with them properly

Dan.a
"Computers are useless. They can only give you answers."
-- Pablo Picasso
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

Dan: I tried your suggestions, and the image is still wackily offcenter. On the 32bit tip - the image was created with Photoshop and I was running in 32-bit Windowed mode. Viewed outside of the game engine, the gradiants are nowhere as striped as in the screenshot. Should the PNG files be interlaced or some other option I might have missed?
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

Okay, send me the image and I will see if I can work it out (to my sourceforge address ... dandandaman@...)

Dan.a
"Computers are useless. They can only give you answers."
-- Pablo Picasso
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

Image sent. Maybe I should be making a larger image than 1024x1024 and constraining the actual usable image to 1024x1024? e.g. as I stated earlier, the source 512x256 file is a 320x200 with transparency filling the rest.
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

Any update on this?
spiritplumber
Developer
Developer
Posts: 1831
Joined: Mon Mar 07, 2005 10:33 pm
Contact:

Post by spiritplumber »

Coordinate wise... what way would you rather it behave instead? I can see what I can do.
My Moral Code:
- The only sin is to treat people as if they were things.
- Rules were made for people, not the other way around.
- Don't deceive. Real life is complicated enough.
- If all else fails, smash stuff.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Try 0.97 0.97

Just from looking at the spr from the upgrades screen, which is a 512 x 512 png, its numbers go 1.94 1.94; so 0.97 is half that.
Looks like these numbers happen to be equal to 993.28 / texture dimension.
Well, 3.014 * 320 = 964.48 actually...
No idea why, just playing with numbers.
By the way, if you have smooth gradients looking striped, perhaps you need to enable dithering in the videocard driver.
MamiyaOtaru
Privateer
Posts: 729
Joined: Tue Jan 07, 2003 8:32 am

Post by MamiyaOtaru »

First off, the bases are not full screen due to the config file, not the sprite file. Change that first to have fullscreen bases. So, the explanation:

In the coordinate system, 0,0 is at the center not the top left. The coordinate system is cartesian, left to right is -1 to 1 x, top to bottom is 1 to -1 y.

Width 2 means the width of the screen (two halves, from -1 to 1) and height 2 means the height of the screen.

In your example, the image is meant to take up 3.104/2 screen widths and 2.4832/2 screen heights. This is because the actual used part of the image (320x200) is approx 512*(2/3.2) x 256*(2/2.5). 3.104 and 2.4832 stretch the image beyond fullscreen, so that the part of the image that actually has something in it (which is only 320x200) will take up fullscreen.

The next two numbers are where the image is centered. Often, those two numbers are actually stored elsewhere. In cockpits, they are stored in the .cpt file and only the dimensions are actually in the .spr file. Here, the X and Y coordinates for the center of the image are in /bases/*.py. Your example is in /bases/pleasure_land.py

Your example is therefore actually
3.104 2.4832 width and height
and
0.582 -0.2716 centerX and centerY

The center of the image is thus a little more than half the distance from the center of the screen to the right hand side of the screen. This serves to place the center of the area that has actual content at the center of the screen. The center is a bit more than a quarter of the way from the center to the bottom of the screen for the same reason.

If you use an image that fills up the whole bitmap, without empty space like the priv remake backgrounds, to go fullscreen you would use something like this
2 2 (2 half widths and half heights, from -1, -1 to 1, 1)
0 0 (centered in the center of the screen)

Oh, and pleasure_land.py is also where the animations are linked, if you'd like to remove them for a different background. The animations are the water and the building lights: Jolson_LandingBay_wtr and Jolson_LandingBay_blt respectively. Remove their lines.

*edit*
flipped a couple numerators and denominators in the explanation of PR background dimensions
Last edited by MamiyaOtaru on Fri Aug 05, 2005 12:07 am, edited 3 times in total.
CubOfJudahsLion
Confed Special Operative
Confed Special Operative
Posts: 286
Joined: Tue Dec 21, 2004 3:11 am
Location: Costa Pobre
Contact:

Post by CubOfJudahsLion »

Now that's informative (I'm still working on that gas giant background so I might have an use for this info.) Thanx bunches.
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

I replied to the email crouton, did you not get it?

Dan.a
"Computers are useless. They can only give you answers."
-- Pablo Picasso
crouton
Bounty Hunter
Bounty Hunter
Posts: 161
Joined: Wed Mar 23, 2005 11:03 pm

Post by crouton »

I did get one email, dan - I'll go check again.

Mamiya - thank you for the indepth explanation - I'll try to cut'n'paste this into the wiki for future reference. So rather than editing the .spr file I need to be editing the .py file. I'll give that a try and report back.
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

crouton wrote:I did get one email, dan - I'll go check again.
I wouldn't woryr...the essence was 'it is a config file variable', ask mamiya or hellcat for what changed in priv ;-)

Dan.a
"Computers are useless. They can only give you answers."
-- Pablo Picasso
Post Reply