Download

Project: Paper2D

I haven’t got any experience with any of these libraries, but did look around last month for some with a thought of creating a SVG Slate widget, and about the only two I found that looked interesting were the Nanosvg one, and libsvgtiny. However I don’t think either of those libraries support the full SVG format.

Hi Michael,

Thanks for adding vector graphics support to the Paper2D wishlist. I can certainly imagine the cache issues you described when dynamically scaling sprites. I’m glad you see some merit in using vector graphics to save storage and perhaps in creating sprites at various resolutions on load.

I looked around for SVG libraries as well and only found this Google Code Archive - Long-term storage for Google Code Project Hosting. so far. I also read that WebKit supports importing SVG files and converting to an intermediate format before rasterization, not sure if something like that could be used. The NanoSVG library looks really interesting. I’ll keep looking for SVG related stuff.

The main reason I like the SVG format, is that so many authoring tools support it as an export option or can edit them directly. Exporting SVG files directly into UE4 would save lots of time converting to other pixel based formats, especially if you have to go back and modify the original vector graphics at some point, or have to create layers for articulated characters. Anyway, I’m excited about the possibilities! :slight_smile:

Jason Wilhelm

I thought of another interesting feature idea that could be added to Paper2D’s Wishlist. It entails, being able to make color adjustments to sprite instances in a scene, such as modifying the hue, saturation, value, color balance or levels of a selected color range. This would allow the developer to vary the color of trees or foliage in a jungle scene for example, without having to load in many assets to create color variety.

I saw a game developer build their own custom shader to achieve this effect and minimize the number of assets they end up creating for the game. It also went a long way in letting them color grade their game esthetic or match various graphic elements together right in the editor. Anyway, it just seemed like a brilliant solution to a common problem.

Cheers,

Jason Wilhelm

Hi Jason,

That should already be possible. Sprites have a per-instance color that is passed down to the material as the vertex color. The default sprite materials multiply the texture by the color, but you can also implement and apply custom materials that use it for other things (e.g., as a mask or lookup coordinates into another texture).

Much longer term it might be possible to extend the editor vertex painting to work on sprite instances and add tessellation options to the sprite editor, allowing you to do even more interesting variation without a lot of texture data.

Cheers,
Michael Noland

Here is some info I found on SVG loading and rendering using librsvg:

Ok I was wondering if something like that could be done already! Sounds cool!

Librsvg is LGPL. One other thing I found last night was Antigrain (Anti-Grain Geometry -), which switched from 3 clause BSD to GPL at 2.5, but it looked like there is a fork of 2.4 still being maintained.

Cheers,
Michael Noland

I’m still wrapping my head around the various Licensing systems. I noticed that Librsvg uses two sub-libraries, livxml for parsing the XML with a MIT license and Cairo for rendering the SVG to a block of memory with a dual license of LGPL and MPL.

Is the Mozilla MPL licensing too restrictive as well?

The Antigrain engine looks interesting! :wink:

Jason W.

I would like to also register my interest in getting Spine working with Paper2D when you get to the stage of adding skeletal sprite support, I’m currently using it on two of my XNA/MonoGame projects and it’s fantastic. It’s an amazing little program, very low cost for indies and hands down beats programs like Maya for creating 2D skeletal artwork.

I am also using Spine and have found it very usuful and powerful. I was hoping it will get support. I would imagine the developers would help as they have implemented most of their runtimes.

Hey Michael,

I’ve appreciated the time you’ve spent on the live streams explaining many technical details of the engine and also the features to come. I can’t wait to see an episode featuring your work on Paper2D and UMG! Anyway, just wanted to thank you for all the hard work your putting in to make this a truly great platform for everyone!

All at Epic, thank you immensely for realising the possible ramifications of lightweight, performant 2D rendering with Blueprints. It could well change the way the world views the creation of interactivity and provide the ultimate easy entry point to Unreal Engine and programming.

Dream/

Is it possible to make UE4 build a games that contain only Paper2D, 2D physics and Blueprints/C++? So that’s it’s as lightweight as possible, and loads to devices super fast, builds rapidly, etc.

I’d happily suffer a tonne of feature loss to gain that kind of development and loading speed.

If it was then possible to have a version of Unreal Engine that only did 2D, and was consequently much lighter as a result of the 3D having been stripped from it… that’d be extra awesome.

/End of Dream.

We’ll certainly do a stream on Paper2D some time in the next few months.

In order for workflow to be as seamless as possible (e.g., knowledge of how to work in 3D translates smoothly to 2D, working with the same scene components, traces, and queries as you’re used to) and to allow hybrid 2D/3D games, you won’t be able to jettison the rest of the engine as a whole. However, it should be possible to compile out PhysX and a number of other pieces of middleware to significantly reduce the size of the runtime binaries. I’ll give that a shot when I get a chance, but I’m aiming for all of the Box2D work to be independent, so you can pick 2D physics only, 3D physics only, or both (though individual components will only exist in either the 2D physics scene or 3D physics scene).

Cheers,
Michael Noland

I’m quite interested in this and have not found a real “answer” from the roadmap for Paper2D:
What is planned in terms of 2D animation? As some mentioned it would be nice to see 2D skeletal animation and especially just things like placing sprites at different positions in frames, having tweening and such things… maybe also Spriter (a 2D animation tool that has a free version) support.

Anyway, just hoping this will become something highly useable with a good animation system that can do more than flipping between images :slight_smile: (and preferably doesn’t require paid third-party software to use)

Hi Pinkishu,

Currently we’re only planning on improved flipbook animation support in the short term. There are backlogged cards on the roadmap for in-editor hierarchical 2D animation, but any kind of in-editor skeletal keyframing will probably wait until Sequencer (a new track editor for UE4) is further along.

Cheers,
Michael Noland

Hi Michael,

I’ve been working with Paper 2D for a few days now, and ran into an issue that I wanted to ask about. In my level I’ve created two sprite actors and used the sprite editor to crop portions of a single PNG so that one sprite becomes the body of a character and the second becomes the eye. After adding the finished sprites to the scene, I want to make the Eye sprite the child of the Body sprite, so I try to parent them together in the scene outliner, or in the component editor. But in both cases, the sprites will not parent together, even if they appear to be parented in the hierarchy. Shouldn’t sprites behave the same way as meshes in the scene when you translate the parent, the child should translate as well.

Am I missing something, or am I describing a current bug?

Thanks for your help!

Jason W.

Is anything expected to break in future releases with projects made in 4.2? If I create bunch of sprites and a flipbook, will that still work in 4.3? Will there be at some point be in editor tools for auto creating sprites from an atlas or possibly importing from a third party tool like texture packer.

From 4.3 on, everything should be forwards compatible. For Paper2D content created before 4.3, most things should work, but some stuff will get lost when you upgrade (specifically sprite material overrides, which I modified before adding a custom version number to the plugin). I’ll probably also be renaming the classes before 4.3 ships; there will be class redirectors in place so BPs will seamlessly update, but C++ authors referencing the types will need to update their code to refer to the new classes (instructions will be in the upgrade notes).

There are a number of image slicing improvements coming in 4.3, including a source region edit mode to quickly a draw rectangle around a region and an ‘Extract Sprites’ context menu option for textures that automatically identifies discrete regions in an image and creates sprites for them. We’ll be continuing to improve the sprite editing tools.

We also support importing a spritesheet that was exported from Flash CS6 (json descriptor + png textures). I’d like to add support for other tools as well, if you can point me to example data from texture packer it probably wouldn’t be too difficult to add importing for (although if you’d like to copy the PaperJsonImporter module example and submit it as a pull request, that’d be even better ^_^).

Cheers,
Michael Noland

Hi Jason,

Parenting with sprite components should work exactly like any other component, however I just tried to put together a test case and I can repro the issue you’re seeing. I’ll let you know when I have a fix.

Cheers,
Michael Noland

Heya,

I’ve fixed the issue that caused problems when a sprite is a parent component with attached children (doesn’t matter what the child is).

Paper2D: Fix bug in UPaperRenderComponent::GetSocketTransform that would cause components attached to a sprite to behave as if they weren’t attached
https://github.com/EpicGames/UnrealEngine/commit/3277c32486201425af1b390a4a59bfd839f5206e

If you aren’t building from source, you should be able to work around it for now by using a dummy scene component as the real parent, with the visual sprite ‘parent’ being attached to that as well. It should also work fine as-is if you attach to a socket defined in the parent sprite (the issue was only for the ‘none’ socket where it was returning Identity instead of ComponentToWorld)

Cheers,
Michael Noland