More options for tile-size besides 16, 32, 64?

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Post Reply
Message
Author
tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

More options for tile-size besides 16, 32, 64?

#1 Post by tiger_eye »

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...

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: More options for tile-size besides 16, 32, 64?

#2 Post by Grey »

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!
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: More options for tile-size besides 16, 32, 64?

#3 Post by edge2054 »

Yeah, a 48 x 48 size would be really nice.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#4 Post by tiger_eye »

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)
Attachments
screenshot1-003.zip
(256 KiB) Downloaded 252 times
screenshot1-002.zip
(256 KiB) Downloaded 174 times
screenshot1-001.zip
(256 KiB) Downloaded 181 times

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#5 Post by tiger_eye »

the rest of screenshot1 (why did I make it so large...?)
Attachments
screenshot1-005.zip
(142.49 KiB) Downloaded 179 times
screenshot1-004.zip
(256 KiB) Downloaded 185 times

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#6 Post by tiger_eye »

Screenshot2: Scintillating Cave. 1-3 out of 6.
Attachments
screenshot2-003.zip
(256 KiB) Downloaded 208 times
screenshot2-002.zip
(256 KiB) Downloaded 200 times
screenshot2-001.zip
(256 KiB) Downloaded 198 times

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#7 Post by tiger_eye »

The rest of screenshot 2. So, what does everyone think?
Attachments
screenshot2-006.zip
(229.47 KiB) Downloaded 171 times
screenshot2-005.zip
(256 KiB) Downloaded 164 times
screenshot2-004.zip
(256 KiB) Downloaded 187 times

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: More options for tile-size besides 16, 32, 64?

#8 Post by Canderel »

Send a patch to darkgod?

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#9 Post by tiger_eye »

Canderel wrote:Send a patch to darkgod?
Oh my, I just joined a week ago, I don't know if I'm ready to take that step yet :P . Seriously, though, how would I go about sending 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:
ruins_23x23.png
ruins_23x23.png (247.5 KiB) Viewed 3940 times
scint_caves_23x23.png
scint_caves_23x23.png (250.85 KiB) Viewed 3940 times

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#10 Post by tiger_eye »

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!):
ruins_45x45.png
ruins_45x45.png (229.85 KiB) Viewed 3934 times
scint_caves_45x45.png
scint_caves_45x45.png (254.21 KiB) Viewed 3934 times

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: More options for tile-size besides 16, 32, 64?

#11 Post by Canderel »

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...

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: More options for tile-size besides 16, 32, 64?

#12 Post by darkgod »

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
[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 ;)

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#13 Post by tiger_eye »

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.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: More options for tile-size besides 16, 32, 64?

#14 Post by darkgod »

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 ;)

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: More options for tile-size besides 16, 32, 64?

#15 Post by tiger_eye »

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_toscreen

Code: Select all

vertices[0] = dx; vertices[1] = dy; vertices[3] = dz;
should probably be

Code: Select all

vertices[0] = dx; vertices[1] = dy; vertices[2] = dz;
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...
cut1.png
cut1.png (222.26 KiB) Viewed 3862 times

Post Reply