Using svg in tmw?

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
pclouds
Peon
Peon
Posts: 39
Joined: 26 Dec 2005, 11:37

Using svg in tmw?

Post by pclouds » 01 Jan 2006, 17:56

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.
User avatar
Pajarico
Warrior
Warrior
Posts: 592
Joined: 28 Feb 2005, 20:29
Contact:

Post by Pajarico » 01 Jan 2006, 19:29

But what are the advantages of using svg over bitmaps?
Lv.: Maggot
Please, read the FAQ before posting.
pclouds
Peon
Peon
Posts: 39
Joined: 26 Dec 2005, 11:37

Post by pclouds » 02 Jan 2006, 05:11

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.
User avatar
i
TMW Adviser
TMW Adviser
Posts: 1113
Joined: 07 Mar 2005, 18:29
Location: Poland
Contact:

Post by i » 02 Jan 2006, 09:06

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.
Retired chainsaw seller. CEO @ Advertising Agency N2P
pclouds
Peon
Peon
Posts: 39
Joined: 26 Dec 2005, 11:37

Post by pclouds » 02 Jan 2006, 11:34

I didn't mean to use it all the place. Use it where it fits :)
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 20:48
Location: Espoo, Finland

Post by Rotonen » 02 Jan 2006, 14:22

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.
This message used to be meaningful.
User avatar
Modanung
Knight
Knight
Posts: 1719
Joined: 20 May 2005, 16:51
Location: Groningen, The Netherlands
Contact:

Post by Modanung » 02 Jan 2006, 14:30

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.
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
User avatar
Bjørn
TMW Adviser
TMW Adviser
Posts: 1430
Joined: 09 Dec 2004, 19:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn » 02 Jan 2006, 18:40

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.
AndyG314
Peon
Peon
Posts: 13
Joined: 08 Oct 2005, 19:23

Post by AndyG314 » 14 Mar 2006, 01:06

SVG are only usuful if you are going to scale things on the fly, something I doubt that TWN will have a need for.
ziolive
Peon
Peon
Posts: 43
Joined: 01 Sep 2006, 13:21
Location: france

Post by ziolive » 07 Sep 2006, 17:07

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.
Ziolive
User avatar
Bjørn
TMW Adviser
TMW Adviser
Posts: 1430
Joined: 09 Dec 2004, 19:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn » 07 Sep 2006, 18:26

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.
User avatar
Modanung
Knight
Knight
Posts: 1719
Joined: 20 May 2005, 16:51
Location: Groningen, The Netherlands
Contact:

Post by Modanung » 07 Sep 2006, 18:37

Isn't it possible to render svg in different levels of detail? Like NURBS?
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
ziolive
Peon
Peon
Posts: 43
Joined: 01 Sep 2006, 13:21
Location: france

Post by ziolive » 08 Sep 2006, 08:44

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... :(
Ziolive
User avatar
Modanung
Knight
Knight
Posts: 1719
Joined: 20 May 2005, 16:51
Location: Groningen, The Netherlands
Contact:

Post by Modanung » 09 Sep 2006, 12:38

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.
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
Post Reply