Project: Paper2D

Hey , just tried out Paper2D in 4.8 Preview 1 since Tilemaps got some love, and I immediately had a few things in mind to try out.
Fairly happy with how things work out (except a few quirks here and there that might be related to my setup, upper layers not blocking player in a top-down view for example), but I wanted to check first if you’re aware of any performance issues inside Tileset editor?
Over here it roughly takes a second from click to selecting/highlighting tile, and “Add Block” for collision has about same delay. It’s a 16x13 tile texture I grabbed off my old RPGMaker folder (256x256 px PNG) for testing, and I’m not sure what it will do if I put larger textures in there…
If is news to you guys, I can slap it onto AnswerHub with a small test project if you’d like.

There is a general slowness issue with details panel in tile set editor; even though tiles array is hidden except for one element, details panel checks every element every frame. However, given your numbers we’re only talking say 16x19 = 304 tiles or thereabouts, so I wouldn’t expect it to be too bad. Can you hit ` key and type stat slate, and take a screenshot of stats? You can also try closing details panel to see if that was issue (it can be brought back using Window menu).

Cheers,

What compression setting are your textures set to right now (it should say something like RGBA, DXT1, DXT5, BC5, etc… in texture editor)? Do they have alpha channels?

ETC1 is a miserable compression format that does not support alpha channels, so any RGBA textures, even if they ‘DXT5’ on PC, will get stored as full 32 bit textures when cooking for Android (ETC1). One common approach for Android is to split your sprites up into two separate ETC1 textures, one for RGB, and one for A. These two textures will use 4 bits per pixel each for a total of 1 byte/pixel versus 4 bytes/pixel. You can then use a material to route second texture read into alpha result of sprite.

Cheers,

Shaking effect?

Cheers,

actual texture is unimportant (you could overwrite sprite sheet with a solid white texture), just UPaperSprite .uassets that are misbehaving are what are needed for a repro (e.g., it would be fine to send just sprite .uassets that are bad, and tell us path where those assets sit as well as path and pixel size of where referenced texture should be; I can then just import a solid color texture at that location).

Note: If collision or render geometry is set to shrinkwrapped then obviously contents of texture does matter after all (but only alpha channel).

Cheers,

Hello .

is one of them

I am using TexturePacker for all my atlases.

Edit: Oh and i tried ETC2 format but nothing changed. Textures are still 10 times bigger than original ones.

format (top right) indicates texture is uncompressed. is controlled by texture group unless Compression Settings is overridden (which it is in your picture). defaults for imported sprite sheets are an editor preference (Paper2D - Import) in 4.8, but you can also change it per texture or for all your imported textures using Property Matrix to bulk edit them.

Cheers,

, man my apk is now 60% smaller. Happy to hear that we can set compression setting from project settings on 4.8.

I give you my thanks man :slight_smile:

@: Nevermind about repro, I was able to find an old test asset in one of my projects that has same issue and will try to get that fixed for 4.8p2. Note for future: It actually prints out log spam about what failed during load, don’t forget to check Output Log if things go wrong :slight_smile:

Cheers,

issue with losing geometry shapes when loading sprites in 4.8p1 has been fixed in /EpicGames/UnrealEngine/commit/96fe5943a574f7c145f4ccc480770367da3b2d96 which will be part of 4.8p2. It only affected assets saved with exactly Paper2D version 13 (4.7.4-4.7.6 or main branch 4.8 prior to geometry refactor). I had tested with older assets saved in 4.7.0 which worked after refactor even without struct redirect due to an unrelated bug in SerializeTaggedProperties :slight_smile:

Cheers,

Ok, so in general you already know about it.

Not quite, it’s 16x13 tiles, with one tile being 16x16 pixels (so its a little bit short of 256x256 in height; padded to get a pow2 size).

Nope, sorry. ` key doesn’t work for me, since I’m on a german QWERTZ layout (it doesn’t work in UT either). Even remapping it to something else like F12 in 4.8\Engine\Config\BaseInput.ini doesn’t work (but I think I’m simply editing wrong config here).
But closing Details panel does help a lot. And it seems that it might be a memory leak or something, since performance degrades over time with every click when Details panel is open.

You should be able to edit them using Project Settings … Engine - Input … Console Keys.

Cheers,

Nope, sorry. Both “^” and “Zirkumflex” (which is apparently same character) are bound to console, but neither works in main Editor viewport (again, German OS with German QWERTZ layout). I also tried preselected “`” and a newly bound “ö” (o with dots above) - neither work. But I think thats something I should be putting on AnswerHub, rather than Paper2D thread - Edit: there we go.

Please do create an AnswerHub thread for that issue, it is expected to work.

Cheers,

4.8p2

4.8 Preview 2 is out now, please check it out if you are interested in trying some of new features out. will be one of last chances for feedback before 4.8 ships. Here is a non-exhaustive list of new Paper2D features in 4.8:

Tile Maps:

  • Programmatically working with Tile Map Components from Blueprints (both querying and building from scratch)*
  • Tile map color can now be controlled both per-layer and across entire tile map
  • Improved projection mode support: Staggered Isometric and Staggered Hexagonal are now supported
  • Support for rotated/flipped tiles
  • Various workflow/editing improvements (key binds for layer operations, drag-drop works as expected, existing painted tiles can be selected using Shift+LMB+Drag, etc…)
  • Improved support for importing from Tiled, more data is retained during import/conversion process
  • Collision geometry and custom metadata can now be specified on a per-tile basis in tile set editor ( metadata is limited to a single FName, but can be used as a key into a UDataTable asset with arbitrary additional data).
  • Note: There were a few BP exposure changes which just missed 4.8p2 cutoff but will still be in 4.8. In p2 you may need to use ResizeMap and AddLayer to programmatically create tile maps instead of being able to directly create one size you want.

Importing and sprite processing:

  • Configurable texture settings for both importing from a sprite sheet and ‘prepare for Paper2D usage’ context menu option (still called Configure for Retro sprites in 4.8p2 but renamed shortly afterwards)
  • Sprites can define additional textures, and materials can sample from those additional textures (and give slots descriptive names like NormalMap or Mask). improves workflow for sprites that have associated textures, removing need for a material instance per sprite.
  • Importing paired normal maps / Creating sprites from textures with paired normal maps (looks for an adjacent texture/atlas named _N or _Normal, configurable in settings)
  • When a normal map is detected, it automatically uses one of default lit materials instead of default unlit materials. Both are defined in ‘Paper2D - Import’ settings page.
  • Sprite extraction dialog - Lets you configure how sprites will be extracted from a texture. In addition to ‘automatic’ mode from 4.7, it also has a grid-based mode where you can pick width/height/grid size. You can also provide a custom naming scheme to use.
  • Sprite ‘shrinkwrap’ texture analysis mode is now conservative, so it will never cut into edge of a sprite

Sprites work in more places:

  • You can now use Paint editor mode (set to Textures, not Vertices) to paint onto a sprite in level editor.
  • You can use sprites as preview mesh in Material Editor

Misc. 2D editor workflow:

  • Toggle-able ‘snap to layer’ when dragging into level editor viewport; layer names, axis, and depth can be defined in project settings*
  • 2D combined gizmo, allows both rotation and translation in a single gizmo
  • To enable these options, go to 2D section of Project Settings…Editor and enable them.
  • Paper2D filter group in Content Browser
  • Note: There were several improvements to layer snapping which just missed 4.8p2 cutoff but will still be in 4.8, including a configurable key binding for ‘snap selection to layer’ and addition of some default layers.

Geometry/collision editing:

  • Various workflow/UX improvements to geometry editing in Sprite and Tile Set editors
  • Support for rotating geometry
  • Support for circles/spheres as collision geometry

Flipbooks / flipbook editor:

  • Added SetPlaybackPositionInFrames and GetPlaybackPositionInFrames to UPaperFlipbookComponent
  • Added display of sprite name in keyframe strips and when drag-dropping key frames
  • Added Ctrl+MouseWheel when over timeline to change time scale
  • Beefed up context menu options for key frames to make working with flipbooks easier
  • Sockets from key frames can now be viewed (but not edited) in Flipbook Editor

Bug fixes aren’t included in list, but there have been a number of those as well.

Cheers,

stuff! You have outdone yourself release! Cannot wait to try ‘GetPlaybackPositionInFrames’ . Do you think i could use that to trigger sfx (something like a sound notifier)? If works i can synchronize sfx and walk cycles so much easier! And it will become flipbook playback speed independent. I am heading to now.

Did you read by chance a post i wrote in feedback section regarding paper2d and cooked performance? Would you be kind enough to comment on that and maybe give us some insight on why is happening and what is causing it?

Thanks!

I would like to know how to jump onto a platform from under it in UE4? Is there a sprite option or can I change blueprint to change collision of a Box?

Hello littleclaude,

What you are can range between very simple and very complicated depending on how you want to implement it in your game. I will try to give you some pointers on where to start and hopefully you can pick up from there and expand it to better suit your needs.

As you have guessed (simplest method) way to go is to disable collision for tile you want player to be able to jump through. You create a bp that has that tile inside it and you add a box collision a little bigger than tile itself. then when player touches that collision box you disable bp’s collision and when he exits you re enable it.

Things to consider: make it only work when player is ascending (tip:get his velocity) to avoid funky situations.
Experiment with collision box size to make it feel more “natural”. And last but not least you need to create a safe zone so that bp will not re enable collisions as long as player is inside tile , otherwise he will get stuck.

I hope that above information can get you started. Good luck with your game!

You can use it to do things like , but you have to be careful and always check a time interval, never specific frames. For example, if you call GetPlaybackPositionInFrames on game frame 1 and it returns 5, and again on game frame 2, it might return 7. You would then check interval [5,7] for any events that need to occur, not just frame 7.

I haven’t seen your other thread, can you link it? I did just post some numbers for grouped sprites that are coming in 4.8 in thread though Rendering 5000 sprites in UE4 10x slower than Unity5? - Rendering - Epic Developer Community Forums if you want to take a look. same underlying changes also apply to tile maps in 4.8p3. They were already more efficient than loose sprites but still had a non-trivial per-frame RT cost, which is now gone.

[edit]Note: grouped sprite component changes missed preview 3 which was apparently cut Saturday morning…

Cheers,

Here are some additional features coming in 4.8 beyond what are listed in Project: Paper2D - C++ - Epic Developer Community Forums

Grouped sprite components

A grouped sprite component allows many instances of one or more sprite assets to be drawn together in a minimal number of batches (separate materials or textures will still split batches).

Working with groups is pretty simple:

  • You can build them programmatically in same way you might use a UInstancedStaticMeshComponent for 3D meshes, but they have fewer limitations (you can mix/match sprites and materials in one, it will generate additional draw calls as necessary)
  • You can convert selections in level editor into a grouped component using Merge button in details panel if all selected items are sprite actors, or right-click context menu if selection is mixed (it will leave non-sprite objects alone but delete sprite actors, replacing them with a merged actor).
  • You can split a sprite group back into separate actors if you need to move/reposition something, and can then re-merge them.
  • You can sort them based on rendering project settings TranslucencySortAxis, so that batches that contain translucent sprites render as expected.

Note: All sprites in a group will be drawn as one or a few draw calls ( mininum required given materials and textures). means that:

  • Culling will be done as a whole unit. Either all instances are drawn or none of instances are drawn. You probably don’t want to group sprites from opposite ends of map together.
  • Sorting will be done as a whole unit. If you have some translucent foreground sprites and some translucent background sprites, you probably don’t want to group them together. With sort button they’ll sort correctly relative to each other, but a translucent player in mid-ground can’t pass in between two of them, it’ll either draw in front of both or behind both. These kinds of sorting issues only apply to Translucent materials, Masked materials don’t have same issues but they only work for binary (0 or 1) opacity.

Tile maps

  • CPU performance improvements: Tile map components now generate a vertex buffer only in frames when they are dirtied and avoid most per-frame work, making them significantly faster.

Snap layers

  • Keyboard shortcuts to snap to current snap layer, select a different layer, or move selection (and active layer) up or down.

Cheers,