Main Menu

News:

LINKS: Website | Steam | Wiki

Web-based REX viewer

Started by Phssthpok, June 06, 2015, 06:26:18 AM

Previous topic - Next topic

Phssthpok

I'm working on a web-based REX viewer. It's still pretty rough, but it gets the right tiles in the right location with the right foreground color. Give it a try:

http://jjclark1982.github.io/rex-viewer/

Kyzrati

Wow, and I thought you were busy enough doing cool things with the wiki :P

This is pretty neat... what might it be used for? Any plans? I dropped some stuff in and can see that it's missing the background color implementation, but other than that it works nicely so far.
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Phssthpok

#2
I thought it might be useful for importing item screenshots to the wiki. Are you ok with that in terms of copyright? It's easy to limit to items that other people have already spoiled.

I had done some similar work for Dwarf Fortress tilesets (http://jjclark1982.github.io/df-tileset-previewer/), so this was mostly a matter of parsing the binary format. But at this point I might as well get backgrounds working too.

Kyzrati

Nice DF tileset previewer!

I hadn't yet made the connection that this could be related to your wiki endeavor. I do need to put a proper copyright message up on the wiki, but yeah eventually images and art can/should all be there, anyway. I'm okay with that and expected it to happen at some point.
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Phssthpok

I think I have colors painting properly now. Is it correct to treat the final color as a linear interpolation between the bg color and the fg color, determined by the brightness of the font pixel?

It still doesn't handle font files with over 256 chars, so it's hard to find a good grayscale font to inspect visually.

Kyzrati

Background colors are simply painted in each cell, and foreground pixels are painted over that using the grayscale value (0-255) of each font pixel to set the alpha transparency at that point.

Unless I've misunderstood what you're asking here...
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Phssthpok

Yeah, that sounds equivalent to the linear interpolation I'm using:

bgColor + (fontColor / 255) * (fgColor - bgColor)

ironpotato

Man I was just going to make something to view the game files but it looks like yours already works for it :P So much for that.

Good job on this though, very well done. I was considering making the viewer in javascript myself xD

Kyzrati

You guys are really good at spoiling yourselves =p
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Phssthpok

Yeah, this will view Cogmind art files.

But I'm not sure how to handle Cogmind font files, which are not laid out in normal ASCII order. I hard-coded some mappings for obvious things like letters and punctuation, but there are still a lot of unreachable or duplicate tiles.