PDA

View Full Version : Any demand for a "tile picker"?


ekolis
February 23, 2010, 21:23
I had this thought while I was making a "beehive" tile for submission to Dungeon Crawl Stone Soup...

What if there were a simple Javascript-in-an-HTML-page app where you point it at a bitmap (say, by putting the HTML page in the same folder as the bitmap, or vice versa, then typing the name of the bitmap into a text box on the HTML page), and you tell it the size of the tiles in the bitmap, and then when you click on a tile, it copies the tile number into the clipboard for pasting into your text files where you're defining monsters or features or whatever, so you don't have to count tiles manually?

Is there any demand for such an app? Or does one exist already? ;) I could see it being useful not only for DCSS and Angband, but also for any other game or whatever that uses tilesets... say, Space Empires 5 or something :D

RogerN
February 23, 2010, 21:39
I use such an application for the variant I'm perpetually working on. I find it to be indispensable, as there are thousands of potential tiles in the larger sets. I use the application to assign names to tiles, and the names are stored in a tile definition file. The tile names are then referenced by the feature, monster, and item definitions. This way I can reassign the tile for "Granite Wall" and everything which depends on that tile automatically points to the right tile (i.e. outer wall, inner wall, extra wall, secret door, permanent walls, etc...).

In other words... I think it's a good idea. Unfortunately my tool wouldn't work for Vanilla's data formats.

Nick
February 23, 2010, 21:47
Yes. When I did tiles for FA, picking them all by hand took a Long Time.

buzzkill
February 23, 2010, 23:41
Oh yes. Being able to assign a name(s) would just be gravy.

ekolis
February 23, 2010, 23:45
Well, here ya go... a tile picker! :D
Let me know if you need any additional features for it to work properly with Angband, or if there are any bugs...

buzzkill
February 24, 2010, 02:30
Last tile selected is "NaN" or "NaN,NaN" regardless of chosen options.
It was able to open the vanilla 32x32.bmp (which I copied to my desktop) no problem, but I couldn't open any other .png or .bmp (that happen to litter my desktop).
Windows Vista, IE 8.0.6.

ekolis
February 24, 2010, 17:08
Oops! Forgot to test in IE! :P

Here's v2, then - also fixed another bug, this one with the zero based indexing mode being always treated as on when in X,Y mode!

Not sure what's wrong regarding those other images, though... what kind of error do you get? Or maybe you could send me one of the images that doesn't work?

buzzkill
February 25, 2010, 02:37
Here's v2, then - also fixed another bug, this one with the zero based indexing mode being always treated as on when in X,Y mode!

Working!!! I'm presuming this will be used primarily for Angband and it's variants so here are a few suggestions that would make this script more useful for this purpose.

1. an option to specify the upper-left value, such as 80,80.
2. an option for hexadecimal counting and output, 0x80,0x80
3. an option to select the chosen separator, or just default to a colon
4. an option for both X,Y and Y,X or simply default to Y,X

5. IMO what would really make it ideal. A split screen, prf and bmp. Click on prf entry, click on bmp image, and the value is automatically entered.

Not sure what's wrong regarding those other images, though... what kind of error do you get? Or maybe you could send me one of the images that doesn't work?

bmp attached. I apologize for the nit-picking in advance.

ekolis
February 25, 2010, 15:04
Knights.bmp works for me; the only thing I can think of is that maybe since the background of the image was white, you couldn't see the selection reticule and thus never even tried to click? I could make the reticule a different style, if you'd like...

As for features, here goes...
1. Not sure why you'd want to specify the upper-left value apart from zero and one, but OK, can do :)
2. Hexadecimal should be possible, too :)
3. Choosing a separator? Sure :)
4. Y,X mode? OK :)
5. prf mode? Hmm, that might be a bit tricky... I was intending this to be a bit more generic - I was also thinking of Crawl and Space Empires 5... not sure if Javascript can write to files, either... but if it can, perhaps I could have a generic "text file" area on the right into which you load a text file; you'd have to position the cursor exactly where you want the indexes to be copied, since it would have no idea of where they're "supposed" to go for any particular game... Would also be cool though if you hightligt a number in the file, if it could do a reverse lookup and select the image, too! :)

Another feature I wanted to implement was a "memory", such that if you close the app, it would save off your last used options so you wouldn't have to set them from the defaults! (Or at least an INI file to set your OWN defaults!) Not sure if Javascript can read or write files though...

buzzkill
February 25, 2010, 15:37
Knights.bmp works for me; the only thing I can think of is that maybe since the background of the image was white, you couldn't see the selection reticule and thus never even tried to click? I could make the reticule a different style, if you'd like...
It's not a big deal. Is long as it work with 32x32.bmp's, all is good. Image of unviewable.bmp attached none the less.1. Not sure why you'd want to specify the upper-left value apart from zero and one, but OK, can do :)
Every variant I've ever tinkered with starts (upper-left) with 0x80:0x80.

3. Choosing a separator? Sure :)
4. Y,X mode? OK :)
Once again, the Angband prf format is two hex values (Y,X) separated by a colon. Just trying to minimize the manual editing.

5. prf mode? Hmm, that might be a bit tricky...
Yeah, I knew that this was a long shot. The script is still be incredibly useful without it.

Another feature I wanted to implement was a "memory", such that if you close the app, it would save off your last used options so you wouldn't have to set them from the defaults!

Good idea.

ekolis
February 25, 2010, 18:24
Try v3 :)

Hmm, this message was not at least 10 characters, so the forum rejected it, it was only 9, so here goes... lorem ipsum dolor factorum virumque spam spam eggs and spam all your base are belong to us behold my floating fortress the egg carrier insert your random quote here...

That enough characters? :)

buzzkill
February 26, 2010, 04:41
[applause] Awesome! This will save me a lot of work, and re-work. Thanks to yourself and Konijn_, creating a tile set is becoming almost tolerable.

What web browser and OS do you use? I'm still having (inconsequential) problems opening other .bmp's.

thapper
February 26, 2010, 10:38
Sweet! I gave it a try on the (delayed) commuter train this morning. I couldn't get it working in Firefox 3.6 (on a windows vista machine) but it ran like a charm in IE.

ekolis
February 26, 2010, 13:42
I'm using Google Chrome on Windows 7... sorry I didn't test on Firefox; I don't have Firefox installed at the moment. I could always install it though if necessary ;)

What kind of trouble are you having, thapper? Any particular error messages?

As for the "other BMP's" issue, I wonder... Space Empires has this strange requirement that bitmaps be saved in some sort of OS/2 format - most image editors apparently do so by default, but Photoshop doesn't... maybe that has something to do with it?

thapper
February 26, 2010, 15:23
The problem in Firefox is that nothing happens when I hit the "ready" button, no error message, nothing! I'll check and make sure that it's not my settings that are blocking something...

and don't worry about it, I have IE installed so I'll just run it there.

ekolis
February 26, 2010, 15:57
Heh, almost sounds like you have Javascript disabled or something... does anything happen when you type a filename into the options-file loader box and hit Load?

edit: Aha, just installed Firefox now, and it looks like it's being really pedantic about ID's of controls on the page... IE and Chrome will let me refer to controls without calling getElementById, but Firefox won't... grrrr! :( Guess I'll have to release another version soon...

buzzkill
February 27, 2010, 23:50
I'm using Google Chrome on Windows 7...

Well, after editing the 32x32.bmp (paint.net), I couldn't open it within the tile picker (IE8), so I installed Google Chrome which solved the problem, but I still don't know what the problem was.

BTW, I couldn't load the .ini files in IE8 either (TypeError:Access is denied).

buzzkill
September 19, 2010, 20:06
Still using the same version of Google Chrome as before (6.0.472.62)
Still using the same old WinVista 6002 SP2 (lastest updates auto-installed)
Java Version 6 Update 21 (build 1.6.0_21-b07)

In addition to the old problem of not being able to load an .ini file...

Now instead of copying the (hex) address to the clipboard when clicking on a tile, it copies the 32x32 bmp itself, the whole thing. The correct value DOES appear on the screen, but scrolling back to it to view/copy it is a pain.

andrewdoull
September 20, 2010, 03:54
Call me crazy, but is there any reason that you're not using the tile picker that already ships with Angband?

Andrew

[Edit: Knowledge menus, ~, choose an feature/object/flavor etc, 'v' for visual display mode. You can also 'c' copy and 'p' paste.]

[Edit 2: Checking the code, this may not yet be ported from Unangband].