-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plClient Resources #51
Conversation
Great work! Much more thorough than what I did, and I like the completely automated building of resources from SVG too. First bunch of comments, besides what I already mentioned by e-mail:
I do like the automated building. I just think it should be optional for those who don’t wish to change the resources. I agree it’s not a strong barrier (building libpng was harder than installing PyGTK…) By the way, I haven’t tried what happens when you don’t have Python installed. Can we assume Python to be such an essential development tool that everyone has it (on Windows, where it isn’t part of the operating system)?
I agree that putting generated files under version control isn’t usually a good practice, but there are exceptions (e.g. including configure scripts so that not everyone has to have autoconf to generate them), and I think this is one of them. I would either check in a complete resource.dat, or make it available for download separately somewhere, maybe as part of the cwe-prefix package. The build script could then even try to copy it from there if the prerequisites for rebuilding it aren’t installed. |
|
Those who use the GoW cwe-prefix package (unless it has changed since I got it) only have the libraries, but not the interpreter executable. |
I think I fixed the backwards spin at one point and forgot to commit that change. I know I remember noticing it. As I recall, I just flipped the sign as you say. I used Hobo for the font because it's what Cyan was using on the Linking text as well as other places in the game (there are a few dialogs that use it, I believe). I'm not particularly fond of it myself, but I decided (as with much of the code here) to stay as close as possible to existing assets for consistency's sake while making it easy for us to continue to enhance them later. Unfortunately due to the nature of fonts and rendering them as SVG, I converted it to curves so that those building wouldn't need the font to create the resources. Using that simple SVG however, it should be trivial to create new layers for those strings using a better font if desired. I'm not sure if Collegiate is the best fit for Uru, personally, but I don't have especially strong opinions about it either way. I used Python for the scripts as it was something I felt could be assumed to be available cross-platform, unlike my original bash script I was using, especially in an environment where we will be building Uru itself which uses Python fairly heavily. If the scripts fail or Python is unavailable it should return an error. If there's a better way to deal with this through CMake, I wasn't able to find one, but I'm still learning to use it. I'd rather have the resource.dat built as a separate target altogether, as it's not really a dependency (or dependent upon) the client or any of its libraries. I'm just not sure how best to organize that here. |
Consistency with existing assets is exactly why I would argue for keeping the font on the element that’s used (Collegiate on “Updating”) rather than on the one that’s not used (Hobo on “Linking”)… (aside from my personal aesthetic preferences) Using Python is fine with me, by the way, I’m a Python fan too. Having resource.dat as a separate build target rather than a dependency of plClient or anything is probably fine. What would be nice to have CMake deal with is that Cursor_Base.svg is a dependency of cursor_open.png and cursor_open.png is a dependency of resource.dat. As far as I understand the current CMakeLists.txt, at least the latter is currently not codified. But I’m unfamiliar with CMake too, and I don’t consider this particularly important. |
Ah, I see what you mean now about Collegiate. I didn't recognize that one when I was making those (and never could figure out why Linking and Updating were two different fonts). It's a good point; I'll commit a new Loading_Text_rasterfont.svg with the proper font for that as soon as I can. |
Looks like there are different Collegiates… here’s the right one that also matches dat/Collegiate-*.p2f (open Collegiate-28.p2f as a 30 pixel wide raw 8-bit-per-pixel grayscale image to compare): http://new.myfonts.com/fonts/k-type/collegiate/?testdrive=text%3DUPDATING |
Yeah, I eventually realized that after spending a couple of hours hunting when I should have been asleep (which I suspect was the problem). There was discussion last night about replacing these text plates entirely with a plDynamicTextMap instead, which would simplify this particular resource question greatly. |
That could be an option. I have no idea if it would be easier though. And maybe some future non-Uru games would like to display something fancier than simple text. Also, Collegiate-28.p2f only seems to have the Latin-1 character set, not Windows-1252, so there’s no bullet character (•) – these would be lost. One thing I have wondered in a similar regard is if the linking book animation should be rendered in real-time rather than as an image sequence – with two statically textured plates, one of which rotates. (That’s how I always imagined it to work anyway before I saw the image resources.) Rotating a plate shouldn’t be too hard. But we’re probably getting off-topic here. Let’s integrate the resource system without too many other changes first, and think about those later. |
Yeah, looking at the available character set in the bitmap fonts led me down a "What would it take for Uru to support actual font files...?" which would be better left for a different changeset entirely. |
…nt paletted images.
Add support for external resource Cursors. Add support for external resource Progress Linking Book. Add support for external resource Voice Chat indicators.
Cyan's resources were loaded into the array in reverse order, requiring the images to appear count-clockwise. This is no longer the case, as the array is now built in frame order.
This branch incorporates an automatic script to create the resource.dat file necessary to run plClient, which includes replacement art for the cursors, the loading book spinner, the Updating/Loading text splashes, and the Speaker/Microphone voice chat enabled/disabled icons.
All art assets are SVGs, rendered by a cross-platform python2.7 script (Windows users will need PyGTK for cairo and rsvg) to PNGs, optionally optimized by pngcrush (currently a size difference around 50kB), and then packed by another python script into a resource.dat file in the format used by Myst5 and HexIsle.
The resultant resource.dat file will need to be copied from the Plasma/Sources/Plasma/Apps/plClient/external directory to the location of the plClient or UruExplorer executable.