Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: SVG tilesets  (Read 6189 times)

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
SVG tilesets
« on: July 14, 2009, 07:53:40 pm »

To make the zooming feature in DF work better, it would be nice to have tilesets that work well at multiple sizes. However, that is not necessarily easy to arrange.

So, I'll make a deal with you.

If one of you create a (decent) tileset in SVG, I'll implement SVG reading in DF.

Alternately, if you create a bitmapped tileset with multiple resolutions, I'll arrange for that to be used as well; that would be 4x4, 8x8, 16x16, 32x32 at the least, preferably with 64x64. Yes, that humongous last one would be used when possible (which it usually is, on modern GPUs) in order to make the linear down-scaling when above 32x32 look better, which could happen with zooming. I can live without it, though. :P

(Oh, and you don't need those precise resolutions, just NxM, N*2xM*2, N*4xM*4 and so on; it's for mip-mapping. So 3x3, 6x6, 12x12 and so on are fine too. But at least four levels.)


FTR: Implementing SVG requires implementing the latter mechanism as well, but not the other around. So.. have fun. :)
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: SVG tilesets
« Reply #1 on: July 14, 2009, 08:14:28 pm »

As was pointed out, truetype works for this as well.

I can use that for a "tileset" too, but that requires a separate mechanism, which means this is a race now. Go for it! ^_^
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Ampersand

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #2 on: July 15, 2009, 04:44:30 am »

I love you, Baughn.
Logged
!!&!!

dibujante

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #3 on: July 15, 2009, 11:05:42 am »

Hey Baughn, will d14 handle tilesets at all differently or will I be able to just put SVG vector art in the same locations as the existing tiles, export an .svg and call it done?

edit: for the svg handling is it computationally faster to use complex shapes out of grouped polygons, single lines with multiple points or masks?

edit 2: when will you implement arbitrary tilesets that don't cause overlap between various objects and one tile and how would that be handled on the tileset designer's side?
« Last Edit: July 15, 2009, 11:11:01 am by dibujante »
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: SVG tilesets
« Reply #4 on: July 15, 2009, 01:26:28 pm »

d14 will not support svg. I can't really implement it before I have an svg tileset (or something, truetype could work) to work against.

So, the exact nature of the implementation will depend on what sort of tiles I get from you. However, I think it would be simpler to use one svg per tile; I could add a .tar.gz reader to pack them a bit. (Probably a good idea, since svg is a form of xml)

I'm not entirely sure how to deal with graphics sets, mind, mostly due to not having looked closely at it. I'll figure something out. :P

You shouldn't worry about the computational cost of tiles, as they'll be pre-rendered anyhow. OpenGL doesn't do svg ( ::) ), so I'll probably render them on demand, using mip-mapping and trilinear filtering to decrease the amount of texture memory required.

As for the overlap issue, that's not something I can deal with; you'll have to ask toady for that.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

dibujante

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #5 on: July 15, 2009, 01:50:52 pm »

Okay. I will get an SVG tileset to you soon, then. If it doesn't make it into d14 then maybe into d15. I will package each svg individually and name them according to the numerations used in the wiki.

edit: does the scaling technology you are talking about mean that tiles could become rather complex, with their more complex details only really distinguishable at different zooms? Or would that result in their smaller versions being artefacted to ugliness?
« Last Edit: July 15, 2009, 02:37:15 pm by dibujante »
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: SVG tilesets
« Reply #6 on: July 15, 2009, 02:55:32 pm »

They could be.

I'm pretty sure you can do that natively in SVG, but besides that, you don't have to use SVG; a tileset with pre-rendered tiles in the usual mip-mapping resolution factors will do. (See http://upload.wikimedia.org/wikipedia/commons/5/5c/MipMap_Example_STS101.jpg for what I mean)

If you just provide the result bitmaps, DF won't have as much flexibility in scaling but obviously the detail levels can differ. Still, SVG's nicer in many ways.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

dibujante

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #7 on: July 15, 2009, 03:07:22 pm »

Yeah, a series of bitmaps would provide the best-looking scaling, but it would restrict the zoom to discrete zoom levels and would take much more work >.< I'll stick to SVG and we'll see how it plays out in the real game.
Logged

LordZorintrhox

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #8 on: July 15, 2009, 03:31:47 pm »

I think it comes down to one question: do you want to merely know about the pimple on Urist's ass, or do you want to see it?
Logged
...but their muscles would also end up looking like someone wrapped pink steel bridge-cables around a fire hydrant and then shrink-wrapped it in a bearskin.

HEY, you should try my Dwarfletter tileset...it's pretty.
I make games, too

blah28722

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #9 on: July 16, 2009, 05:59:31 am »

I don't understand most of what's being said here.

But I know it implies something awesome.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: SVG tilesets
« Reply #10 on: July 16, 2009, 06:35:00 am »

^^ A soapmaker!!! ^^

Seriously, I would love to make all tilesets and even creature sets if it works, because I love good graphical readibility. Also an ability to have actual 32x32 tiles would be the best prize for me, I would really like to make detailed creature sprites.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

dibujante

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #11 on: July 16, 2009, 02:03:23 pm »

I'm about 25% done. I hope to hit 50% tonight and maybe clear 100% this weekend. I'm trying to keep them pretty high quality but some of them will be fairly crude (fuck dimple cups and their demand to be round and shaded).
Logged

Corona688

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #12 on: July 16, 2009, 03:58:13 pm »

Please don't make it truetype.  Editing fonts is a real pain.  Fonts can also do unexpected things -- glyphs are allowed to have variable sizes, and features projecting beyond the expected square boundaries.

Fonts also don't have color except whatever they're assigned by the program so far as I know.

SVG tileset sounds interesting as long as png/bmp will continue to be properly supported.
« Last Edit: July 16, 2009, 04:00:27 pm by Corona688 »
Logged
You never know when you might need a berserk dwarf to set loose somewhere.

G-Flex

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #13 on: July 16, 2009, 04:00:36 pm »

SVG, eh?

I'm not really sure how much of a fan I am of that.

I mean, I love the idea of vector graphics in distribution, but the spotty XML-based formatting is insanely inefficient for distribution, and at least in Firefox they tend to take their damn time rendering.

I'm also not sure how well rendering a complicated SVG graphic into, say, 8x8/16x16 tiles would work. It might end up looking sort of weird rendering something like a picture of a dwarf at such low resolutions.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

Corona688

  • Bay Watcher
    • View Profile
Re: SVG tilesets
« Reply #14 on: July 16, 2009, 04:09:30 pm »

I mean, I love the idea of vector graphics in distribution, but the spotty XML-based formatting is insanely inefficient for distribution
Its not that bad.  I can't imagine a DF tileset taking more than 100K to 200K.
Quote
and at least in Firefox they tend to take their damn time rendering.
They wouldn't need to be rendered more than once, after which they could be displayed as fast as any other bitmap.
Quote
I'm also not sure how well rendering a complicated SVG graphic into, say, 8x8/16x16 tiles would work.
That's a legitimate concern.  I'm not sure how one would draw a half-hatched square in SVG, you probably couldn't get the traditional ASCII one looking right at any resolution except the one you designed it for -- which kind of defeats the point of SVG.  SVG tilesets could end up having a very different kind of look.  It'd also be very easy to fuzz up the borders between tiles, unless maybe 25% extra blank space is left between all tiles.

As long as bitmap zooming like we have already continues to be supported I don't see the harm though.
« Last Edit: July 16, 2009, 04:13:24 pm by Corona688 »
Logged
You never know when you might need a berserk dwarf to set loose somewhere.
Pages: [1] 2