Using svg in tmw?
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.
Using svg in tmw?
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.
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.
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.
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.
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.
Any place when we can use SVG is imo inventory - icons, larger previews, etc.
- Modanung
- Grand Knight
- Posts: 1719
- Joined: 20 May 2005, 15:51
- Location: Groningen, The Netherlands
- Contact:
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.
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
- Bjørn
- Manasource
- Posts: 1438
- Joined: 09 Dec 2004, 18:50
- Location: North Rhine-Westphalia, Germany
- Contact:
I want to point to a recent icon set posted by Adarius:
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.
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.
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.
- 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
- Bjørn
- Manasource
- Posts: 1438
- Joined: 09 Dec 2004, 18:50
- Location: North Rhine-Westphalia, Germany
- Contact:
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.
Anyway I stand by what I had already pointed out a long time ago above.
- Modanung
- Grand Knight
- Posts: 1719
- Joined: 20 May 2005, 15:51
- Location: Groningen, The Netherlands
- Contact:
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
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...
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
- Modanung
- Grand Knight
- Posts: 1719
- Joined: 20 May 2005, 15:51
- Location: Groningen, The Netherlands
- Contact:
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.
- 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