Adventure Game Studio

AGS Development => Editor Development => Topic started by: FanOfHumor on Mon 04/04/2022 15:53:57

Title: (feature request) import SVG as sprite.
Post by: FanOfHumor on Mon 04/04/2022 15:53:57
I don't know anything about how SVG works so I have no idea whether it's plausible or not to import SVG images as sprites into AGS.Ive been learning to make svg recently and I thought"I wonder what it would be like if AGS could import SVG?I'm guessing it would be smooth for even small resolutions.". Would it? Is this possible or just wishful thinking?
Title: Re: (feature request) import SVG as sprite.
Post by: Crimson Wizard on Mon 04/04/2022 17:03:01
There's a difference between importing SVG as bitmaps and using SVG directly. First can be done with some other tool which converts SVG to bmp or png. Second would require writing whole new functionality for AGS engine that would support vector graphics, as right now engine works only with raster (pixel) graphics.
Title: Re: (feature request) import SVG as sprite.
Post by: FanOfHumor on Mon 04/04/2022 18:19:09
That's what I figured.
Title: Re: (feature request) import SVG as sprite.
Post by: eri0o on Mon 04/04/2022 18:24:07
Tbh, engine wise I thought about making a plugin at some point but all C or C++ libraries I found for SVG were absolutely terrible to work with. Many dependencies, huge codebase, no good way to deal with animation or standard tween of things so you endup with a fancy static bitmap and a big hard to build plugin.

During my experiments though I did found a library that works alrightsh for Lottie format, still it's all rasterized (e.g.: sprites), but this actually enable to make something that would then factory DynamicSprites. I imagine performance could be terrible or not depending on how it would be used by final user of the thing. Problem is Lottie has no decent open source animation tool and also apparently very few people are aware it exists.

In the end I thought that vectors are just too different from how graphics card actually works and I notice most games that employ vector-like graphics use a work pipeline (from the artist perspective) built on 3D concepts, so tools that work with this in mind are more readily available - you can see these tools in many high resolution visual novels.

Example of such tools: https://forums.tigsource.com/index.php?topic=72433.0
Title: Re: (feature request) import SVG as sprite.
Post by: FanOfHumor on Mon 04/04/2022 18:42:28
Alright then.Do whatever you see fit.
Title: Re: (feature request) import SVG as sprite.
Post by: eri0o on Mon 04/04/2022 19:11:48
The Lottie library I mentioned: https://github.com/samsung/rlottie

The code itself is MIT licensed, if the person can do with less Lottie features then you can even roll it back for some old versions of it that were a bit lighter on dependencies - but as far as I remember nothing has a too restrictive license.