4 ms·
I think bitmaps are often used in 2d games for level definition or various other sorts of mapping (height, for 2.5d games, et c.)
by handrous 5y ago
I think bitmaps are often used in 2d games for level definition or various other sorts of mapping (height, for 2.5d games, et c.)
- WorldMaker 5y agoBitmap is the easiest image file format in the world to read/write and the easiest and sometimes fastest to shoot over to any video device in the history of computing. Almost every game making tutorial going back to the 80s has "how to read/write" bitmaps usually in it somewhere. Even 3D games will sometimes use them in a lot of odd places because it was faster/easier/took fewer cycles to include an uncompressed or simple run-length encoded bitmap than to try to store a smarter image format and need time to decompress it. (Though yes modern GPUs often support image decompression directly for certain texture file formats and that's shifted a lot.)
- pcwalton 5y agoTGA is easier because the rows go top-to-bottom, you don't have the RIFF header, and you don't have to pad each row to 4 bytes. I still copy and paste a little TGA encoder into my graphics code when I need to dump something out for debugging.
- Isthatablackgsd 5y agoThat's why some games have uncompressed audio files which made the game size ballooned up. If the game have so much audio on, it would be best to use uncompressed audio as CPU don't have to spend extra resources to decode bunch of audio files at the same time when the games is asking for it.
- WorldMaker 5y agoThis is a small pet peeve of mine. Even though PCs have mostly lost dedicated "sound cards" they still have dedicated hardware for sound decompression in their SoC packages. The big reason I think games often think they need so much uncompressed audio has not as much to do with hardware support as much as it is that games and general consumers "forked" on different compression paths in audio. Most consumer audio is MP3 and has been for decades, while most game audio went to patent unencumbered formats like Ogg Vorbis. Everyone has MP3 hardware decoding and almost no one has Ogg Vorbis in hardware. Even with the MP3 patents expired I think game companies just forget it exists as a well-supported lowest common denominator format with a wealth of hardware support. Sure, MP3 is a lossy compression format, but the specific losses in MP3 would hardly matter in most game soundscapes (and also Ogg Vorbis is similarly lossy, though "better" in double blind studies of single audio files). (Some of that I think is also political/contractual in the way that using MP3 would give some additional types of PC players "free soundtracks" while using other compression formats is a bit of security through obscurity and raises the bar slightly for PC players that don't, for instance, know what Ogg Vorbis even is.)
- duskwuff 5y ago> ... they still have dedicated hardware for sound decompression in their SoC packages Do they? Even if they do, it's typically useless for an application like a game, because the game will need to filter and/or mix that audio in ways that the hardware probably can't handle on its own. (Sure, maybe your hardware can decode one MP3 at a time, but can it decode two dozen MP3s at once, apply a bunch of environmental filters to them, and mix them down to a single stereo output? Probably not.)
- Isthatablackgsd 5y agoEven though CPU have hardware support for decoding, there are factors that can affect how much the computer handles it. The games have to deal with multiple layers of audios at the same time. So imagine one sound file have the dialogue for that specific scene, other sound file have the ambient music to compliment the surrounding, other file have sound effects, etc. So the games have to handle maybe 10 audio files at the same time which can put the strain on the CPU since it need to handle the decoding for compressed format. When that occurs, it eats up the CPU resources when it should be allocated for other stuff. Also don't forget some game have 5.1, 7.1, Dolby variants, etc which can be taxing on the CPU if it have to process multiple compressed audio at the same time.
- ElectricalUnion 5y ago> dedicated hardware for sound decompression Do they? Most of "modern audio" is just software decoding/mixing to a pretty not-smart-Digital-to-Analog Converter. My educated guess is that most compressed audio formats are optimized for size, not for low latency recording/playback. Also one of the reasons why Opus is so good and is replacing lots of older formats.
- TylerGlaiel 5y agothe other reason game devs use ogg vorbis over mp3 is cause ogg vorbis supports gapless looping and mp3 doesn't
- somebodynew 5y ago> Bitmap is the easiest image file format in the world to read/write When making a quick hack like a toy ray tracer or Mandelbrot generator in C or C++, it's traditional to use .ppm [0] because it's trivial to write out pixel values in ASCII. [0] https://en.wikipedia.org/wiki/Netpbm#File_formats https://en.wikipedia.org/wiki/Netpbm#File_formats
- Const-me 5y ago> modern GPUs often support image decompression directly for certain texture file formats That works great for compressed textures like DDS or ASTC. Unfortunately, the hardware decoders for proper codecs like jpeg or h.264 typically come with APIs prohibitively complicated to use, unless the app is a video player and needs to consume these APIs anyway, despite the complexity.