Download

Project: Paper2D

Oh cool! Glad it was a simple fix! Thanks for looking into this issue so quickly and also suggesting a workaround since I have yet to try compiling engine updates.
I should be able to get something working now!

Thanks again for your help!

Jason W.

Hey ,are you still working alone?
I think Epic should send serveral people to work together to speed up the development of Paper 2D.
I can’t wait.

I second the above poster ^

I’ve built the latest preview build (from the 20th june). Although the source code has a lot of stuff in it, I don’t see to much in the editor. I did notice that you can click in the editor to auto create the region bounds and collision.

I guess you are still working on it michael. Are we expecting to see much in 4.3? Nice work though. cant wait for a lot of the tools to get in there.

Hi dokipen,

In addition to what you’ve found, there are a few other little editor things like being able to auto-split a spritesheet that has space between the images (right-click menu on the texture), but a lot of the focus for 4.3 is productization, improving what is already there and fixing bugs.

Before 4.3 branches I’ll be going thru clearly marking what isn’t ready for prime time as well (tile maps aren’t good to go), so it’s more obvious what is supported/stable and what isn’t. I’ve also spent a decent amount of time working on integrating 2D physics into Unreal, but it’s a WIP (collision detection/response and raycasts are implemented, but queries, sweeps, and overlaps will not be in 4.3, so it’ll also be ‘experimental’).

For 4.4 and beyond, we’ll push to productize more of the 2D support and do sprite editor improvements, documentation, templates, etc…

Cheers,
Michael Noland

Also, as a fun little diversion since James and Richard got generic spline editing support into the engine, I started working on a spline-based 2D terrain system. It probably won’t be out of experimental for 4.3 but the prototype is in there if you want to have a go with @latest.

Cheers,
Michael Noland

Wow I didn’t see that that there was a right click menu. The spline tool looks like it will be great. Cheers Michael.

It’s already possible to add a sprite/flipbook setup to a Character blueprint and use the in built movement mechanics. To simulate input, you would just call the events for the characters movement.

How do we get started with the spline terrain tools? Not sure where it is.

ok ive found the paper terrain class. just not sure of how to use it. I can drag an actor into the map and edit/create points on the spline. are we meant to create blueprints/c++ from the class? also, what kind of material do we add? ive tried to put a default sprite material into the slot but nothing will take.

You need to create a paper terrain material (New…Data Asset in the content browser, pick Terrain Material as the type). That will let you define rules for how the terrain should be textured, you’ll need at least one for anything to show up right now (haven’t created a default one yet). I’ve attached a photo of the material used for the photo above. At a minimum you need a single sprite to reference as a body segment, but the concept is as follows:

  • Break the terrain up into segments that fit a specific rule (e.g., slope is in a certain range)
  • For each segment, try to put a start and end cap sprite on it (if they are not null).
  • Fill the remainder distance of the segment with randomly picked body sprites (you can define more than one).

Right now the sprites being deformed to the curve are not automatically subdivided, so you may want to create some extra internal detail in the sprite editor so they more closely fit the curve. This probably won’t be necessary in the future (either the sprite editor or the terrain component will have a tessellate option to make it much easier). There are also some improvements to the general spline editing inbound that let you pick the type of segment for each control point on the spline (linear, auto, etc…), which are very useful in practice.

Note: Anything you make now with the 2d terrain component is not guaranteed to work in the future, I may break the data compatibility when finishing it.

Cheers,
Michael Noland

Animations

Michael,

If you want to do simple animations such as moving a sprite, scaling, fading, spinning, rotating, ect, what would be the best way? Will any of the tools for 3d animations work at all with Paper 2d sprites? (I haven’t looked into those tools yet, but I have seen notes about animation so I assume they are there) Or is right now rolling your own animations programatically the only way?

The terrain works quite nicely. How does collision with it work? Will there be paper collision components or is that functionality built into the paper render compoment? I see a code entry on github for paperCharacter. Will that be like the Character (ie a pawn but with movement component included)? Should we separate the current physics system to the 2d one?

Hey Michael is this only in the GIT HUB and not 4.2.1? At the moment I have been using paper2d and each piece of art work I have had to resize each sprite to fit it, this would be very handy.

This is in the latest preview release for 4.3. You can get the source code from here and build it yourself.

https://github.com/EpicGames/UnrealEngine/releases/tag/latest-preview

Yeah, the right-click option to find sprites separated by alpha=0 regions is going to be in 4.3, but we’re also planning on an interactive ‘slicing’ tool to make it a lot quicker to split things up in the sprite editor as well (creating additional sprites you can switch between using the browser in the corner), but that won’t be until 4.4 or later.

Cheers,
Michael Noland

There’s no collision support yet for the terrain splines (which is part of why it’s still experimental), but my current plan is to have an option per rule on whether it’ll create collision as well as some offset settings, and it’ll generate a collision strip that follows the spline segment. If all rules have collision and the spline is closed, then it’d generate a single solid collision object probably. Not 100% sure until I start playing around with it. I’m also considering using the source sprite collision geometry for the sprites that are getting stamped down, but that might end up being a bit unwieldy to define/tweak for simple splines.

Cheers,
Michael Noland

Animation is still pretty early. Right now you can only swap sprites in a flipbook, and play one of those back. However, sprites and flipbook players are regular components, so all of the general Unreal features work the same way on them as they do on 3D stuff. You can use matinee to keyframe things, a Timeline in a BP to rotate/scale/etc… things, or arbitrary math in a BP or C++ code. In the future, we may grow what can be done inside of the Flipbook editor, or create a different kind of animated sprite that has more skeletal anim-like features, but nothing is set in stone yet.

Cheers,
Michael Noland

Hi Michael,

Thanks for your work on this plug-in. I am however having an issue with displaying the sprite animation once deployed to iOS. I can see the flipbook in the viewport fine, and when I hit play in-editor I can see it, but it is nowhere to be seen on iOS.

Any ideas?

Link showing sprite animating in standalone game (and random sphere which exists nowhere in the project) http://pasteboard.co/18Dci85h.png

Thanks,
Doug

Hi Doug,

There are two common causes of problems in cooked games:

  1. There is a bug in the plugin editor that causes it to write to the Saved dir instead of the Config dir, which means that enabled plugins won’t take effect on cooked builds / other user’s machines if you use source control. This has already been fixed in 4.3, but for now you will have to manually copy the EnabledPlugins lines into your Config\DefaultEngine.ini.
  2. If you have a content only game (no C++ code), then the only runtime plugins that can be used are the ones that were enabled in BaseEngine.ini when UE4Game was initially compiled, as we statically link the enabled plugins into the monolithic executable, and linking only happens when you have C++ code. Since Paper2D is not enabled by default, it won’t work in cooked games in projects without C++ code. To work around (2), you’ll have to add C++ code to your project.

Currently the Paper2D plugin is slated to be enabled by default for 4.3, which will help with (2), although we’re still mulling how to handle this case in general, since platforms like iOS don’t support dynamic linked libraries.

Cheers,
Michael Noland