Jump to content
Double Fine Action Forums
Sign in to follow this  
DF Oliver

Programming Update 8: The Data Pipeline

Recommended Posts

I'm a little late to the party here but I would like to add another reason why PNG is not a good image format for textures: It doesn't store colour data for completely transparent texels. This means that if you try to magnify a PNG-based texture using a bilinear or higher order filter you will see colour bleeding artifacts (Usually white) where transparent and translucent/opaque texels meet.

Share this post


Link to post
Share on other sites
I'm a little late to the party here but I would like to add another reason why PNG is not a good image format for textures: It doesn't store colour data for completely transparent texels. This means that if you try to magnify a PNG-based texture using a bilinear or higher order filter you will see colour bleeding artifacts (Usually white) where transparent and translucent/opaque texels meet.

That is true only when alpha is premultiplied, no?

Share this post


Link to post
Share on other sites

Uhm, the gfx hardware doesn't deal with formats life PNG, TIFF or PSD, therefore it's part of the asset import/conversion/generation process providing the right data?

Share this post


Link to post
Share on other sites
That is true only when alpha is premultiplied, no?

I honestly can't remember how it works with different blending algorithms as I just gave up on PNG after I did my quick tests. I created a test image in both Photoshop and GIMP, exported it to PNG and tested the texels in my application and both images gave me (1, 1, 1, 0) for all fully transparent pixels. I was using libpng for reading the files, maybe other libraries give different results. My guess would be that non-premultiplied would result in bleeding to white while premultipled would result in bleeding to black (Or the other way around... Premultipled alpha has always confused me).

Uhm, the gfx hardware doesn't deal with formats life PNG, TIFF or PSD, therefore it's part of the asset import/conversion/generation process providing the right data?

That is correct. The hardware can only read either it's built-in compression formats or an uncompressed bitmap so the CPU has full control on how to interpret the file format before it's sent to the hardware. If the file format doesn't store information for some texels when you can use whatever algorithm you want to create the missing data. I guess if you really wanted to could do automatic calculation of transparent pixels when reading the file but that just increases the loading time and can be quite significant if you're loading a lot of files at once as you also need to calculate them for all mipmap levels.

Share this post


Link to post
Share on other sites

Actually there is a wide variety of formats (compressed as well as uncompressed) GPUs can deal with, more if you're targeting multiple platforms and mostly the data is preprocessed and stored in the needed formats already, so ..., dunno, i never had more serious issues with PNGs so far but i remember that many years ago, depending on certain tools, you could run into glitches with premultiplied alphas here and there.

Share this post


Link to post
Share on other sites

Great piece!

I wanted to ask: Will you make available the changes you make in MOAI?

For example, I would greatly like to use the PC host that MOAI does not support now.

Thanks!

Share this post


Link to post
Share on other sites
Great piece!

I wanted to ask: Will you make available the changes you make in MOAI?

For example, I would greatly like to use the PC host that MOAI does not support now.

Thanks!

We already submitted a lot of our changes back to Zipline. From what I understand they are trying to integrate it into the main line, which is somewhat tricky because our version of MOAI and the official release have diverged somewhat.

Just ask them on their forum how the integration is going... ;)

Share this post


Link to post
Share on other sites

I honestly can't remember how it works with different blending algorithms as I just gave up on PNG after I did my quick tests. I created a test image in both Photoshop and GIMP, exported it to PNG and tested the texels in my application and both images gave me (1, 1, 1, 0) for all fully transparent pixels. I was using libpng for reading the files, maybe other libraries give different results. My guess would be that non-premultiplied would result in bleeding to white while premultipled would result in bleeding to black (Or the other way around... Premultipled alpha has always confused me).

Yeah Photoshop has a terrible PNG exporter, which does nasty stuff like you described. Please note though that this isn't a limitation of the file format. The PNG compression is lossless (with the right settings) and you can work your way around the issues by writing your own Photoshop PNG exporter.

Share this post


Link to post
Share on other sites
Yeah Photoshop has a terrible PNG exporter, which does nasty stuff like you described. Please note though that this isn't a limitation of the file format. The PNG compression is lossless (with the right settings) and you can work your way around the issues by writing your own Photoshop PNG exporter.

That's useful to know. I'll try a custom exporter next time. :)

Maybe both Photoshop and GIMP remove the colour information in order to reduce the final filesize which is far more useful for most users.

Share this post


Link to post
Share on other sites
Maybe both Photoshop and GIMP remove the colour information in order to reduce the final filesize which is far more useful for most users.
The build of GIMP I have (2.8.not_sure) has an option to remove colour from fully transparent pixels. I don't remember setting it to on so that must be default, it appears on the png export window (during the export). I assume photoshop also has the option somewhere.

Share this post


Link to post
Share on other sites

I was quite late with the updates and read this one just now, so... sorry if this topic was buried or something. I'm sure it's a noob question and maybe you answered in the first post and I didn't understand, but why save the files in png format if they are going to be converted anyway?

Share this post


Link to post
Share on other sites

The original Photoshop files normally remain in the project folders as they contain all the additional information like all the different layers, masks, texts, effects and so on. From those you export to a lossless, easy to deal with, widely common pixel format like PNG or TIFF which you then can use as the basis for generating all the needed formats from. You don't use the Photoshop files directly because they tend to be bigger, they are more complicate and more versions are floating around. All you want is an easy and widely supported RGBA format instead, like PNG offers, from where on you can start batch conversion. But depending on your project and the engine you use this can differ, like for instance some engines deal with PSDs directly, with all the pros and cons.

Share this post


Link to post
Share on other sites

More than a bit late but I'd like to add my appreciation of this great update. Very interesting details, and hope to see more along this line!

Eye-opening how deep down the stack Broken Age is being implemented, right down to the metal. Is that a limitation of the available game frameworks like Moai at the moment? Or that the envelope is being really pushed here?

Share this post


Link to post
Share on other sites

I'm impressed by someone recognising where I got my forum name from!

I read and watch stuff from a wide range of timezones.

Share this post


Link to post
Share on other sites

Sorry for going off topic, but yes I still happily read the World of Tiers series. I have the Phantasia editions of some of the books. Author with a wonderful universe sized imagination.

Share this post


Link to post
Share on other sites

Eye-opening how deep down the stack Broken Age is being implemented, right down to the metal. Is that a limitation of the available game frameworks like Moai at the moment? Or that the envelope is being really pushed here?

It's not a limitation of Moai necessarily, but obviously we want to give you guys the best experience possible and that is true for the story, puzzles, art and of course tech. In addition to that we promised to make the game available on many non-desktop platforms. Since most of the mobile platforms are still not as powerful as a average gaming PC we have to make sure that we get the most out of the underlying hardware. Using the best data representation is one of the major aspects to achieve this goal.

Edit: Typos

Share this post


Link to post
Share on other sites

Thanks for the reply DF, that you're aiming high and sharing with us these behind the scenes details. While I envy you working on "Broken Age" I don't envy you trying to get the game to perform across so many platforms which will be moving targets.

Share this post


Link to post
Share on other sites
uhhh, this game will work for WIN XP right? :)

We should be able to support WinXP, unless we run into a road blocker of course.

Share this post


Link to post
Share on other sites
Thanks for the reply DF, that you're aiming high and sharing with us these behind the scenes details. While I envy you working on "Broken Age" I don't envy you trying to get the game to perform across so many platforms which will be moving targets.

It's actually kinda fun... :)

Share this post


Link to post
Share on other sites

Hi Oliver,

a) would you mind sharing your thoughts (pro's / con's) on using the Unity Engine instead of Moai, besides the vendor lock-in. For e.g. the people making the "Realm", (http://www.kickstarter.com/projects/995134339/the-realm-game?ref=category) have a brief overview of how the setup their classic point and click adventure game in Unity (by using 2D camera) and it seems quite efficient.

b) I know it is too early to tell, but is there any possibility that besides 2HB tools, that you also release moia components / tools specific for adventure games (Dialogue Tree system, Scene editors, Navigation, etc)?

many thanks,

you are the best

Share this post


Link to post
Share on other sites

a) would you mind sharing your thoughts (pro's / con's) on using the Unity Engine instead of Moai, besides the vendor lock-in. For e.g. the people making the "Realm", (http://www.kickstarter.com/projects/995134339/the-realm-game?ref=category) have a brief overview of how the setup their classic point and click adventure game in Unity (by using 2D camera) and it seems quite efficient.

I don't have much experience with Unity myself, so I can't say much about it. From what I can tell though their approach seems to be quite similar to ours, although their art style is obviously quite different.

It always has been my opinion that the tech doesn't matter as much as some people might say. Get a bunch of talented people to work with limitations and they will still produce amazing results. In fact I had to give the artists quite a few limitations compared to some of the past projects, but they still blow me away all the time with creative ways to make things look amazing.

From a purely analytically perspective Unity is probably better for non-programmers whereas Moai is great for people with programming experience. I say that mostly because Unity has a great tool environment, but it's somewhat fixed in how it wants to get things done. Moai on the other side has no tools but also doesn't impose a workflow on you.

So pick whatever you are most comfortable with and create some cool prototypes! :)

b) I know it is too early to tell, but is there any possibility that besides 2HB tools, that you also release moia components / tools specific for adventure games (Dialogue Tree system, Scene editors, Navigation, etc)?

Good question! We are still talking about that and unfortunately there are no news at this point. The crux of the problem is that we are making a game (surprise, surprise) first and tech second. That means that we are cutting corners quite often in terms of polishing the tech. People here are veteran game developers and can quite happily life with tools that are a bit rough around the edges. Whether or not the tech is good/clean enough to release later on has to be seen.

In addition to that we are very often using 3rd party libraries for which we own licenses and since we obviously we can't release those it isn't quite clear how some of the tech can be shipped.

I hope that answers your question at least to a certain degree. :)

Share this post


Link to post
Share on other sites

I add these lines...

Unity primary is a 3d engine, you need to grok 3d at least on a basic level. If you want to make a 2d game it needs some work on top of that. Alternatively you can utalise some third party extensions (the more cooks, the more hassle might be involved) or if you're more looking into the future wait until 2d engine support will arrive. Generally Unity comes with all the pros and cons a closed proprietary software comes with, unless you're able to afford the source code licence. It easily gets you to a certain point but it can be more cumbersome if you need to do something specific and workaround certain shortcomings & issues.

Unity is quite powerful and offers a number of features. It offers a nice balance as a working mule but being an allrounder and a general purpose engine it's also not the best performing 3d nor 2d solution you can sometimes get and comes with a certain amount of overhead. The cross platform support is a big plus if you can afford the needed platforms. Depending on your project the editor can be great but don't be misleaded, you need to code in Unity too. It might be easier in the beginning but getting serious will get your hands dirty as well. For a 3d adventure many aspects are covered already (animation system, pathfinding, fmod licence, ...).

The wide extension and support can make Unity the game dev entry tool these days, also offering a perspective that you're familiar with a more commonly used tool afterwards but if you have no idea what to do (no game dev/programming/etc. experience) and just want to make an adventure, i would give one of the more specialised adventure tools a try instead first. Unity is a good choice if you want to get familiar with game dev generally, more as Indie comes for free. Saying so, if you groked one tool/programming language properly, it's mostly easy to learn another one as well. So, you can do things either right or wrong in a number of ways.

Depending on the project the technology can make a huge difference and you always should try to choose the right tool for the right job but as Oliver suggested already you might encounter shortcomings in other fields instead which are more art and game design related or due to your ability to adapt to certain issues.

Share this post


Link to post
Share on other sites

Thanks a lot for the updates, Oliver! It's all very helpful and insightful.

Is there any chance you could share some snippets of actual game code? Sometimes it helps me a lot to see the actual implementation, or even just what a professional programmer's code looks like at a glance.

Share this post


Link to post
Share on other sites

Hoogabooga! Rise, thread, rise from the dead!

I get why you want the processed form for loading, and I get why you do it ahead of time for mobile platforms, but is there any particular reason to do it for PCs before shipping, rather than on install or even on first load of a given texture? I know back when 16-bit color was the norm and there were different ways of representing colors within that, some games did that, (the first one that comes to mind is Creatures) and it was *really* nice for mods and addons because you didn't have to ship a zillion copies of every texture. Admittedly, adventure games don't tend to see as many mods ;)

Share this post


Link to post
Share on other sites
Hoogabooga! Rise, thread, rise from the dead!

I get why you want the processed form for loading, and I get why you do it ahead of time for mobile platforms, but is there any particular reason to do it for PCs before shipping, rather than on install or even on first load of a given texture? I know back when 16-bit color was the norm and there were different ways of representing colors within that, some games did that, (the first one that comes to mind is Creatures) and it was *really* nice for mods and addons because you didn't have to ship a zillion copies of every texture. Admittedly, adventure games don't tend to see as many mods ;)

Good question! Since adventure games don't require mods we chose to minimize load times and doing as much work as possible ahead of time definitely helps with that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...