More options for tile-size besides 16, 32, 64?
Moderator: Moderator
More options for tile-size besides 16, 32, 64?
Are there any plans to have (or interest in having) more tile sizes besides 16x16, 32x32, and 64x64? I like having choices, and I appreciate that these choices were probably the easiest to do. I would just like to have more choices, because sometimes different levels would be best with different tile sizes, but there is too much difference between the choices we have.
Perhaps the choices could be
16, 23, 32, 45, 64
or
16, 20, 25, 32, 40, 51, 64
or
16, 19, 23, 27, 32, 38, 45, 54, 64
or self-defined.
Supposing one could satisfactorily scale the tile images (and there are sufficient interpolation and filtering techniques out there to do this, imho), how difficult would this be to add? If I'm willing to help do this, would anybody be willing to help me, because I'm still really, really new this code...
Perhaps the choices could be
16, 23, 32, 45, 64
or
16, 20, 25, 32, 40, 51, 64
or
16, 19, 23, 27, 32, 38, 45, 54, 64
or self-defined.
Supposing one could satisfactorily scale the tile images (and there are sufficient interpolation and filtering techniques out there to do this, imho), how difficult would this be to add? If I'm willing to help do this, would anybody be willing to help me, because I'm still really, really new this code...
Re: More options for tile-size besides 16, 32, 64?
I would personally love a tile size between 32 and 64, as the 64x64 size cuts off too much vertical visual space, making it a bit dangerous to play on (especially with the current display bug on the minimap). The 32x32 on the other hand feels like a waste of the beautiful tiles!
Re: More options for tile-size besides 16, 32, 64?
Yeah, a 48 x 48 size would be really nice.
Re: More options for tile-size besides 16, 32, 64?
Sweet, so I'm not the only one who would like this!
After a bit of hackery and cheating (*ahem*), I took a couple of screenshots using size 45x45 tiles. This would be my preferred option if it were available!
The screenshots are attached (in multiple messages) for your enjoyment
(p.s. it would be great if somebody else could link to an unzipped image--I can't do it and you have my permission)
After a bit of hackery and cheating (*ahem*), I took a couple of screenshots using size 45x45 tiles. This would be my preferred option if it were available!
The screenshots are attached (in multiple messages) for your enjoyment

(p.s. it would be great if somebody else could link to an unzipped image--I can't do it and you have my permission)
- Attachments
-
- screenshot1-003.zip
- (256 KiB) Downloaded 251 times
-
- screenshot1-002.zip
- (256 KiB) Downloaded 173 times
-
- screenshot1-001.zip
- (256 KiB) Downloaded 181 times
Re: More options for tile-size besides 16, 32, 64?
the rest of screenshot1 (why did I make it so large...?)
- Attachments
-
- screenshot1-005.zip
- (142.49 KiB) Downloaded 178 times
-
- screenshot1-004.zip
- (256 KiB) Downloaded 184 times
Re: More options for tile-size besides 16, 32, 64?
Screenshot2: Scintillating Cave. 1-3 out of 6.
- Attachments
-
- screenshot2-003.zip
- (256 KiB) Downloaded 207 times
-
- screenshot2-002.zip
- (256 KiB) Downloaded 199 times
-
- screenshot2-001.zip
- (256 KiB) Downloaded 198 times
Re: More options for tile-size besides 16, 32, 64?
The rest of screenshot 2. So, what does everyone think?
- Attachments
-
- screenshot2-006.zip
- (229.47 KiB) Downloaded 170 times
-
- screenshot2-005.zip
- (256 KiB) Downloaded 163 times
-
- screenshot2-004.zip
- (256 KiB) Downloaded 186 times
Re: More options for tile-size besides 16, 32, 64?
Send a patch to darkgod?
Re: More options for tile-size besides 16, 32, 64?
Oh my, I just joined a week ago, I don't know if I'm ready to take that step yetCanderel wrote:Send a patch to darkgod?

At the moment, however, these changes aren't patch-ready. First, I changed the tile images to the desired size outside of tome4 using a combination of filters from ImageMagick on the command line. Multiple filters are necessary to make the resized images look good for a wide range of sizes (the exact particulars of which may still need tweaked). ImageMagick has a very reasonable C API (and a very reasonable license), so it would be straightforward to apply the filters in ToME if darkgod is okay with it. The filters are pretty fast if you only need to apply them when an image is first loaded.
The second issue is that there are still a few minor kinks to be worked out (which isn't surprising considering I superficially hacked the change into the code). For example, the boxes around NPCs are screwed up (too small), and the highlighting graphics of the look command are screwed up (also too small). Oh, and I haven't even tried ASCII graphic mode yet. Everything else seemed to work fine, though, so it might not take much work to get this up and going.
Another consideration is to how to best provide options for changing tile size. A list could be provided (as is currently done) with several options, but I might prefer to have a prompt with a min of 16, max of 64, and default of 32.
Below are samples of 23x23 sized tiles, which seems to make the map much larger than 32x32 and a good deal more practical than 16x16:
Re: More options for tile-size besides 16, 32, 64?
Now that I figured out that you can inline images (d'oh!), here are samples of 45x45 size tiles. It's easier to see the NPC box weirdness, but aside from that I think these tiles look pretty good (with due credit to the graphics designers!):
Re: More options for tile-size besides 16, 32, 64?
Personally I think the graphics card or even cpu could do it on the fly. It's small HxW images and it's store in memory once. Resizing must already be available if it can do shockbolt tiles (64x64) at 32x32, so it should be arbitrary to change to change it to just support any size. (that's what I thought you did)
But that "it should be arbitrary" is a famous uninformed comment...
But that "it should be arbitrary" is a famous uninformed comment...
Re: More options for tile-size besides 16, 32, 64?
Yes all that is required is inform the tile engine of the new size, the resizing is done by opengl itself on the fly
I'll probably add something like that
I'll probably add something like that
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: More options for tile-size besides 16, 32, 64?
That's what I first tried--just giving a new size--but it cropped the tile images instead of scaling them. And, well, I haven't been able to make heads or tales of the opengl code yet. Anyway, you'll probably want to at least use a Lanczos 2 interpolation method or what have you to keep the graphics sharp.
Re: More options for tile-size besides 16, 32, 64?
Hum, how did you do it then ?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: More options for tile-size besides 16, 32, 64?
using svn2847...
I peeked, poked, and played with the code a bit more, and I am able to resize the tile images within ToME without the images getting cropped. The only modification needed is to set 'map->tex_tile_w[dw-1]' (and for dh) equal to one in 'src/map.c:map_new'. These are only used in DO_QUAD. Amazingly, the comments in the code actually said 'tex_tile_w' was chosen for scaled images in powers of two. Although setting 'tex_tile_w[i-1] = 1' works for image tiles, it doesn't work for ASCII tiles, but ASCII tiles worked well before the change...
The path highlights used in targeting are shrunken when using non-standard tile sizes (example image below). The path highlights are self.sr, self.sb, and self.sg defined in 'engines/default/engine/Target.lua'. I don't claim to understand this one, but my guess is the issue occurs in 'toScreen(...)' (actually 'sdl_texture_toscreen(...)' in 'src/core_lua.c'). When it binds the texture while using smaller tile sizes (for example, 'self.sr' could be 45x45), artifacts appear in the texture like noise or skeleton legs and arms. If I set the targeting highlights to 64x64 when created, they look fine. This would probably be an easy fix (like clearing or resizing the texture buffer) if you actually knew what the hell was going on
.
Oh, and of course I set the tile size in 'game/modules/tome/class/Game.lua:setupDisplayMode'
This is unrelated, but it looks like there is a minor type in line 302 of src/map.c:map_objects_toscreenshould probably be
Here's an example 45x45 tile sizes with the 'tex_tile_w[i-1] = 1' hack. Notice the ASCII '@' misalignment and the small "look" highlights. I doubt it would take much work to iron out the kinks...
I peeked, poked, and played with the code a bit more, and I am able to resize the tile images within ToME without the images getting cropped. The only modification needed is to set 'map->tex_tile_w[dw-1]' (and for dh) equal to one in 'src/map.c:map_new'. These are only used in DO_QUAD. Amazingly, the comments in the code actually said 'tex_tile_w' was chosen for scaled images in powers of two. Although setting 'tex_tile_w[i-1] = 1' works for image tiles, it doesn't work for ASCII tiles, but ASCII tiles worked well before the change...
The path highlights used in targeting are shrunken when using non-standard tile sizes (example image below). The path highlights are self.sr, self.sb, and self.sg defined in 'engines/default/engine/Target.lua'. I don't claim to understand this one, but my guess is the issue occurs in 'toScreen(...)' (actually 'sdl_texture_toscreen(...)' in 'src/core_lua.c'). When it binds the texture while using smaller tile sizes (for example, 'self.sr' could be 45x45), artifacts appear in the texture like noise or skeleton legs and arms. If I set the targeting highlights to 64x64 when created, they look fine. This would probably be an easy fix (like clearing or resizing the texture buffer) if you actually knew what the hell was going on

Oh, and of course I set the tile size in 'game/modules/tome/class/Game.lua:setupDisplayMode'
This is unrelated, but it looks like there is a minor type in line 302 of src/map.c:map_objects_toscreen
Code: Select all
vertices[0] = dx; vertices[1] = dy; vertices[3] = dz;
Code: Select all
vertices[0] = dx; vertices[1] = dy; vertices[2] = dz;