Page 1 of 1

Using svg in tmw?

Posted: 01 Jan 2006, 16:56
by pclouds
I just checked that we can use librsvg with sdl. Additional dependencies are librsvg, cairo (i'm using librsvg-cvs, but recent librsvg should already have this dependency), glib and gdk-pixbuf, pango. gdk-pixbuf is part of gtk+ but we can split it out and include it in tmw source to prevent such a huge dependency. libgsf and libcroco are optional deps.
I think using svg would ease the graphics development. And i expect we could have some fancy dialog box with svg. Also Cairo would provide a good drawing functions for simple graphics. SVG rendering is of course slower than png. We should pregenerate png/sdl buffer from svg in init phase. Other non performance critical images like dialog, svg could be used directly.
What do you think?
If anyone interested in, i will post the test code of mine.

Posted: 01 Jan 2006, 18:29
by Pajarico
But what are the advantages of using svg over bitmaps?

Posted: 02 Jan 2006, 04:11
by pclouds
I'm not an artist. I say what i think. Drawing in vector format is easier than plotting pixel by pixel. You may draw a big image then scale down and do some post modifications. Maintaining big images is imho easier than small ones. Creating svg is not hard these days. We have inkscape and others to make good images.
Suppose one day you want maggot a little bigger. Just scale it appropriately and change some pixels if needed. If you use bitmaps you have to draw it from scratch again.
SVG has some features such as gradient, which make images more appeal.
Other one i have mentioned in the previous post is using svg in dialog boxes. You may use svg to draw fancy dialog boxes and it fit better than traditional dialog boxes in games. Not sure about it because i haven't had much experience with guichan.
The last one comes from a dependency of librsvg: cairo. Cairo is a good 2d graphics library. With cairo you may have anti-aliased drawings, compositing translucent images ... In short, you have more power to draw simple images.

Posted: 02 Jan 2006, 08:06
by i
pclouds, with all respect. I do like SVG format, it is my fav. format, but i cant see it in TMW. why? because we want make a rpg game in style of old nes/snes 2d rpg's. We dont want make another "flash" game. IMO vector graphic cant be use in all places as substitute of raster.
Any place when we can use SVG is imo inventory - icons, larger previews, etc.

Posted: 02 Jan 2006, 10:34
by pclouds
I didn't mean to use it all the place. Use it where it fits :)

Posted: 02 Jan 2006, 13:22
by Rotonen
Well yeah, we should use modern technology where it's applicable. (Obviously.)

Icons and stuff like that could be vector based, it would make sense after all.

Posted: 02 Jan 2006, 13:30
by Modanung
Particle sprites maybe? They are one of the things you'd like to be scalable.

I think though that pixel-art has a certain feel to it. SVG would change the style. Keeping the HUD and the rest of the game seperate in style isn't weird at all. But having SVG tree in the middle of the rest of the pixeled game would look strange.

Posted: 02 Jan 2006, 17:40
by Bjørn
I want to point to a recent icon set posted by Adarius:

Image

You can't create a crisp look like that in SVG I think, and especially not if you plan to use the SVG at different sizes. You lose pixel level accuracy.

For GUI, it could very well fit. Although still, I don't really see the advantage over bitmapped graphics. It's fine to use Inkscape to create the graphics, but for the game I think it's better to export it as a bitmap.

Finally for monsters, sure it's nice if you can use the monsters at different sizes. But as with the icons, this will mean a rather big change in style. It's not necessarily going to look bad, but it will certainly not look nice together with other, bitmapped, graphics.

Posted: 14 Mar 2006, 00:06
by AndyG314
SVG are only usuful if you are going to scale things on the fly, something I doubt that TWN will have a need for.

Posted: 07 Sep 2006, 16:07
by ziolive
A friend have done a game with svg graphics :
- first step, you scale the window, the game resize the svg graphic and convert it in png, and you play with these graphics, all is ok.
- second step, he try to use CAIRO for playing directly in SVG. After one or two month he decide it's impossible, CAIRO can't do that, it's lagging a lot !

And it's a very very good developper, i trust him.

And SVG with many many graphics like in this game is more heavy than bitmaps.

Posted: 07 Sep 2006, 17:26
by Bjørn
Hmm, well a good example of a game which extensively uses SVG is Frets on Fire. But it uses an as of yet not really common library (Amanith) with a weird build process, and it needs OpenGL.

Anyway I stand by what I had already pointed out a long time ago above.

Posted: 07 Sep 2006, 17:37
by Modanung
Isn't it possible to render svg in different levels of detail? Like NURBS?

Posted: 08 Sep 2006, 07:44
by ziolive
Maybe if you draw your picture for each level of detail :(

They have this problem for using SVG icons in desktop environment and actually they perfer do 3 levels for each icon.

Personnaly i would prefer manaworld used SVG cause :
- we should do same object or monster in different scale,
- create quickly new picture with the old
- change easily each color etc...
but it would be very difficult to unified the graphism. Many person uses vectoriel but not many does good graphism... :(

Posted: 09 Sep 2006, 11:38
by Modanung
Reasons not to do it:
- I don't think we have any experienced SVG artists on the team.
- The style of SVG is in no way what we're striving for.
- People would need better systems to play TMW.