Forum posts

Posted 1 year ago2023-01-23 03:09:37 UTC
in Would this work? Post #347246
Hah! I figured everyone would want 1080p at least these days. I used to do the same. It's far easier than figuring it out by hand.

I suppose you would cut the background on a grid laid out in Photoshop/GIMP. If I recall correctly there are a few old templates floating about that have different resolutions marked out in a grid already that you can use as an overlay, but this is still needlessly tedious work in my opinion.

As I banged my head against the wall trying to remember and explain this stupid process I decided to see if I could figure out a nifty way to do this all automatically for any resolution.

So I did it!
magic!magic!
You'd just drag the background you want onto the .exe or specify its path in a cmd window. I tested with a few different resolutions (including yours) and it all gets perfectly cut up & converted into whatever amount of .tga's are needed, placed in a resource/background folder. It also of course writes to BackgroundLayout.txt and then you'll have a GoldSrc background ready for use!

I haven't tested on any other computers and still have to tidy a few things up if I were to release this fully. But if my madness somehow produces something that truly works, I imagine this is all you'll need to convert backgrounds in the future. Hurray!?!
Posted 1 year ago2023-01-20 02:46:50 UTC
in Would this work? Post #347238
Sorry, I was under the impression you already had your image sizes sorted out. There isn't a catch all solution as far as I know. It entirely depends on your chosen resolution. If it was 1999, you'd be working with all 256x256 images easily. Widescreen is a bit more complicated.

I believe the max size for each TGA remains 256x256 and you can otherwise have most of your modern widescreen background be covered in those, but it won't completely fit without some oddly sized pieces. For example, at 1920x1080 like above, you can get away with most images being 256x256, while the remainder must be lesser seen multiples like 128x256 or 128x56. It doesn't actually matter as long as it fits together at the end.

Let's revisit the above for more clarification.

resource/background/1920_1080_0_0.tga scaled 0 0

This first piece is sized 256x256, and is placed at coordinates 0,0.
Instead of starting the coordinates at your typical X/Y in the middle, it actually starts from the top left of the screen.

resource/background/1920_1080_0_1.tga scaled 256 0

Therefore the next piece, also 256x256, is placed 256 units over to the right of the previous.

So starting from the top left (0,0) it goes left to right, row by row.

It's very confusing and a very hacky way to overcome a menu system that just doesn't natively care about widescreen. I have looked through a few widescreen backgrounds in my mod folder and they're all done differently. You could make every TGA 24x24 and have hundreds of entries on the BackgroundLayouts.txt and as long as the coordinates all match, it would probably work.

I also looked through my GoldSrc tools and the only background generators I found only work with earlier resolutions up to x1024. There really should be an updated one to streamline such a mundane and under documented task.
Posted 1 year ago2023-01-19 08:15:43 UTC
in Would this work? Post #347236
Sure thing. I have a custom widescreen background for most of my GoldSrc games and they generally have their BackgroundLayout.txt like:

resolution 1920 1080

resource/background/1920_1080_0_0.tga scaled 0 0
resource/background/1920_1080_0_1.tga scaled 256 0
resource/background/1920_1080_0_2.tga scaled 512 0
resource/background/1920_1080_0_3.tga scaled 768 0
resource/background/1920_1080_0_4.tga scaled 1024 0
resource/background/1920_1080_0_5.tga scaled 1280 0
resource/background/1920_1080_0_6.tga scaled 1536 0
resource/background/1920_1080_0_7.tga scaled 1792 0

resource/background/1920_1080_1_0.tga scaled 0 256
resource/background/1920_1080_1_1.tga scaled 256 256
resource/background/1920_1080_1_2.tga scaled 512 256
resource/background/1920_1080_1_3.tga scaled 768 256
resource/background/1920_1080_1_4.tga scaled 1024 256
resource/background/1920_1080_1_5.tga scaled 1280 256
resource/background/1920_1080_1_6.tga scaled 1536 256
resource/background/1920_1080_1_7.tga scaled 1792 256

resource/background/1920_1080_2_0.tga scaled 0 512
resource/background/1920_1080_2_1.tga scaled 256 512
resource/background/1920_1080_2_2.tga scaled 512 512
resource/background/1920_1080_2_3.tga scaled 768 512
resource/background/1920_1080_2_4.tga scaled 1024 512
resource/background/1920_1080_2_5.tga scaled 1280 512
resource/background/1920_1080_2_6.tga scaled 1536 512
resource/background/1920_1080_2_7.tga scaled 1792 512

resource/background/1920_1080_3_0.tga scaled 0 768
resource/background/1920_1080_3_1.tga scaled 256 768
resource/background/1920_1080_3_2.tga scaled 512 768
resource/background/1920_1080_3_3.tga scaled 768 768
resource/background/1920_1080_3_4.tga scaled 1024 768
resource/background/1920_1080_3_5.tga scaled 1280 768
resource/background/1920_1080_3_6.tga scaled 1536 768
resource/background/1920_1080_3_7.tga scaled 1792 768

resource/background/1920_1080_4_0.tga scaled 0 1024
resource/background/1920_1080_4_1.tga scaled 256 1024
resource/background/1920_1080_4_2.tga scaled 512 1024
resource/background/1920_1080_4_3.tga scaled 768 1024
resource/background/1920_1080_4_4.tga scaled 1024 1024
resource/background/1920_1080_4_5.tga scaled 1280 1024
resource/background/1920_1080_4_6.tga scaled 1536 1024
resource/background/1920_1080_4_7.tga scaled 1792 1024


I thought there was or would be an application by now that will export the images and the BackgroundLayouts.txt for whichever resolution you wanted :confused:
Posted 1 year ago2022-12-17 09:04:20 UTC
in Ok, here goes: question, why is a LEAK bad? Post #347175
As far as I know, the smallest possible leak into the void will cause a fullbright map, A.K.A. a fast trip to Uglyville. Given this as the popular understanding, it's usually considered a major fault for a leak to be inside a map.

On deeper thought, I can't really fathom the possible benefits of a leak despite the proper lighting compiling occurring.

So either we have different definitions of leaks or what you've said is honestly new to me. But even then I still can't see a benefit. If a leak somehow compiles lighting without causing fullbright, what possible effect could it have, one way or the other?
Starting your maps off with a sloppy giant square skybox isn't the worst but if you become too comfortable with it you can:
  • accidentally start mapping around new leaks that you will not know are there until you start optimizing the skybox placement.
  • have needlessly increased compile times.
  • misjudge lighting until you make a "correct" skybox.
Not to mention the crapshoot guessing Hammer does when pointing to possible leak locations.

It's a blunt answer but as previously mentioned the best way to prevent leaks is to make sure you seal your brushwork at every possible placement.

If the map is intended to be outdoor for the most part, I would say it's completely practical to cover your map in a quick skybox to prototype and such. But always consider the time it would take to create the skybox more properly on the fly, rather than having to convert a giant skybox into smaller efficient ones later, especially with possible leaks to deal with in the process.