Project: Paper2D

Separate components (and therefore Actors) are not intrinsically batched together in Unreal (for 2D or for 3D), so each individual component equals one (or more, if there are multiple material sections) draw calls when visible, and one item that has to be considered for culling. As I said earlier, you can see where things are falling down with commands like “stat game” and “stat scenerendering”, which will give you a better idea of where time is going right now.

Tile map components already (as of 4.7) batch together linear runs from same sprite sheet texture into one draw call, but always breaking between layers, so if your tiles are all in same texture page, a tile map will only cost one draw call per layer.

I have some plans to allow other forms of batching for 2D components, hopefully for 4.8, but nothing is set in stone. Current thinking is a 2D equivalent of InstancedStaticMeshComponent, and possibly a layer-based global batcher, but there are a lot more hurdles there.

Cheers,

Here you go sir!

is now checked into main branch and will be part of 4.8: Allow Paper2D sprite to have more than 1 texture (compression issues) - Feedback & Requests - Epic Developer Community Forums

Cheers,

Hi,

concerns me a bit …

Ideally I would like to have my sprites batched together, put them on a big texture atlas, etc.

I would like to know more details about future batching system. Right now, almost every character in my game is composed of several PaperSpriteComponent (well, a specialization of class). Will regular PaperSpriteComponent support batching? or there will be another base class like PaperInstancedSpriteComponent?

Yours

Thanks, I was able to reproduce by using a bottom center pivot, should be a fairly easy fix.

Cheers,

There will almost certainly be another component (or an API/utility layer for a regular sprite component that allows building batches manually), and there may or may not be a generic batcher that you don’t have to opt in to (that’s what I meant by a layer-based global batcher).

Cheers,

an API/utility would be really cool !

You said that it might not be ready for 4.8… if so, could you guide me how to batch sprites together right now? i’m almost there since I have everything in texture atlas. I guess I could edit proxy scene component and add several “sprite components” geometries instead of just one

I’d hoping to get cleaner batch api and/or instanced component in 4.8, but am less certain about automatic batching. If you want to take a look now, look at UPaperSpriteComponent::SendRenderDynamicData_Concurrent. It builds a FSpriteDrawCallRecord and sends it to render thread. For multiple sprites that share a texture, material, and y plane, you can just keep appending Sprite->BakedRenderData to DrawCall.RenderVerts, but you’ll need to offset in XZ for each one obviously. At some point will probably change to actual vertex format (vec3 position, vec2 uv, color) so that sprites at different local y planes or colors can be batched as well.

You ought to be able to subclass UPaperSpriteComponent to have an array of UPaperSprite* pointers + local offsets and just override SendRenderDynamicData_Concurrent in order to batching going pretty quickly.

Cheers,

So if they are not in same y-plane, they can not be batched together?
is a pity because my characters are composed by several sprites, they move together and I need to put them in different y-planes to ensure right visualization!

They can still be batched together with differing y’s, it just requires subclassing proxy. limitation is in FSpriteDrawCallRecord, not actual render code.

Cheers,

My list of Paper2D issues that I really hope are fixed before 2.7 goes final:

Hi all,

I was hoping someone could give me a hand with how sockets work in Paper 2D.

One of things that our team wants to do is attach VFX to certain parts of character, i.e., attach an FX scarf to neck, FX hair to head, or glowing trails around ankles when they use an ability.

I did a test run by adding a “Neck” socket to each of frames of my run animation. first issue I noticed was that there was no easy way to rotate socket; I couldn’t put editor into rotate mode and had to do it by hand, which didn’t really seem to rotate position as much as add to number of triangles it had?

second problem I’m having is that I have no idea how to attach FX socket. Under sprite component in my blueprint, I have source flipbook specified to use flipbook that has sprites with their sockets defined. However, under “Sockets” category, I only see Parent Socket and no option for “Neck” socket.

I have a feeling that I’m missing a key part to how sockets work. I would greatly appreciate it if anyone could point me in right direction with .

with 4.8 i am having random artifacts all over my tilemap. In general i see tiles disappear in my viewport whenever i change zoom level and sometimes if i deselect little eye in one of my layers and reactivate it they don’t show up at all or a small percentage of them re appears.

Here we see my tiles layer as it should be. And here we have same layer activated but it only shows a fraction of my tiles.

Now for even weirder part.It seems that Unreal adds artifacts to an existing tile from a completely different sprite. Here we see a green line(from my grass) that nests inside my dark rock tileset.

tile isolated.

If i zoom in artifact is gone.

Needless to say that my sprite does not have artifact and nothing like was happening before 4.8 . It seems that system adds random artifacts all over place. My tilemap was imported as a from texture packer and yes dark tile neighbors next to green one and that makes me speculate that has something to do with padding. Did you change anything that could affect coordinates of each sprite regarding original texture?

Dropbox - Error ( above pictures)

Vector 2D Interpolation Nodes Are Live in 4.7

Dear Paper2D Community,

I wanted to let you know that I submitted two nodes to Epic for you all that got accepted in 4.7!

You can now do Vector 2D Interp To in blueprints!

means you can programmatically generate your own smooth 2d animations / smoothly transition between 2D values without being constrained to an alpha transition value that you have to track and increment!


**Example Usage**

![Vector2DInterp2.jpg|1011x773](upload://66xgbwmZyvLGgCa7Yht2m3MhoGh.jpeg)

Why Is Great?

You can now continuously interpolate Vector 2D values toward a chosen goal, even if there are other influences upon current value, such as manual user-input or other game conditions!

Interp To does not use an alpha value to transition, it uses World Delta Time, which means you can create smooth-looking game mechanics where multiple sections of your 2D game code are effecting final position / values.

And you can control speed of interpolation!


**Full Explanation and My Other 4.7 BP Offerings Here:**

**From Me For You in 4.7**
https://forums.unrealengine.com/showthread.php?49459-From-Me-For-You-in-4-6-and-4-5-PlayerId-Get-Focal-location-and-others&p=230566&viewfull=1#post230566




PS: You can see my original  Pull Request here:

/EpicGames/UnrealEngine/pull/730
(must be signed into  to visit  link)

aah , ty so much! is ! but until they fix reimporting sprites, my paper2d project is pretty much on standstill.

Hello.

First i want to say thanks for .

On my first project, i am trying to get one way collisions. People say you can add a trigger volume to enable/disable collisions.

I am new at UE4 and i want to know how you add a trigger volume to a Paper2D sprite?

Thanks in advance.

rotation issue (and scaling) was fixed in /EpicGames/UnrealEngine/commit/b9bed03bd68969fe33b2951eee2c97508c33c9b8 and will be part of 4.8. You can still type it into details panel manually to work around it, as you figured out.

RE: attachment, if you drag another component onto flipbook component in Blueprint editor, it will attach it by default. Now select child component and go to details panel. There is a Parent Socket property, and when you click on magnifying glass it should show a list of available sockets on parent component you can attach child to. seems to be working fine for me in 4.8, and I don’t know of any reason why it’d be broken in earlier versions but I can check.

Cheers,

You can define collision for sprite in Sprite Editor (Paper 2D Sprite Collision in Unreal Engine | Unreal Engine 5.3 Documentation). There are a couple of different approaches to do jump-thru platforms. Haruna has one posted here:
Project: Paper2D - C++ - Epic Developer Community Forums and I replied to someone trying to do it elsewhere suggesting a custom collision channel, but I can’t find post ATM. I will keep looking.

Cheers,

I haven’t seen any issues like you’re describing with tiles sometimes disappearing; if you’ve got a repro case let me know.

RE: green line, it’s possible that tile maps need a 0.5 pixel offset in tile UV coordinate generation or something like that to prevent rounding issues. I’ll take a look.

Cheers,

I’ve asked Dinesh to have a look at terrain splines issues. RE: texture packer issue, would it be possible to upload an example with some .uassets and texture packer project?

Cheers,