Using svg in tmw?

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
pclouds
Peon
Peon
Posts: 39
Joined: 26 Dec 2005, 10:37

Using svg in tmw?

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

Post by Pajarico »

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, 10:37

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

Post 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.
pclouds
Peon
Peon
Posts: 39
Joined: 26 Dec 2005, 10:37

Post by pclouds »

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, 19:48
Location: Bern, Switzerland

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

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

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

Post 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.
ziolive
Peon
Peon
Posts: 43
Joined: 01 Sep 2006, 12:21
Location: france

Post 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.
Ziolive
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

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

Post by Modanung »

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, 12:21
Location: france

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

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