is encouraging! Digging in UE source is daunting, so it’s good to know that you are willing to offer guidance. Is there any existing documentation of Paper2D code architecture? I recently contributed a very very minor feature and was thrilled to get it merged into 4.17. I would love to do more and would feel more prepared to if I better understood how it all works.
Hey, I’m doing some work on a fork of engine to add a feature that my game needs. I wanted to bounce my idea around to see if I should make my implementation generic enough to be merged, or if I should just burn through it for myself.
goal is to make an efficient solution (processing and workflow-wise) for per-frame hitboxes in Paper2D using traces. Combined with existing per-frame sprite collision, would give people a streamlined hitbox/hurtbox system. is for any game that has attacking object, (fist, sword, whatever), as a part of sprite art instead of as a socket object. There are tons of posts that show desire for , but I wanted to check first before I put effort into making sure my changes don’t add much cruft for people who don’t want to use it.
I’ll be adding another array of FSpriteGeometryShape next to current “Shapes” array in FSpriteGeometryCollection. new array will be for non-colliding shapes–basically just position data that can be drawn by a user in sprite editor like current sprite collision shapes and accessed in normal game programming from FlipbookComponent. new array won’t be passed through to PhysX collision box calls like Shapes is, so it should be an efficient way to handle position data. I’ll be adding in UI and attaching to right hooks to make it same process as adding sprite collision.
Here’s kicker: PaperCharacter Tick function will have logic to check if there’s any shapes in NonCollidingShapes array. If there is, it will run traces using each shape’s position data. There will also be a new function pointer or delegate in PaperCharacter for you to attach your trace logic to.
For people that don’t want to use it, only dead weight would be an empty array in FSpriteGeometryCollection, and an added check on every PaperCharacter Tick call to see if new array has anything in it.
For people that do want it, their workflow would just be to draw boxes on each sprite and specify in PaperCharacter a collision channel and a function to pass any HitResults to.
Thoughts? Valuable to eventually PR, or too specific?
At moment it seems really specific but if you create general use all case for kinda system where it’s efficiently used across board for anything you’d like to do in paper2d then I don’t see why not. Always helps to have instead of want.
Doesn’t sound like there’s much interest, so I just made changes specific for my own game, but here’s finished result. Sorry for bad quality, you might have to fullscreen to see box trace debugs on character’s foot at end.
poYswiuqop0
Next, I’m going to look into adding a button that’ll let me copy boxes from one sprite to another. Then I’ll be done with my Paper2D changes, and can get back to game programming.
Luckily, it ended up being pretty simple. Here’s a demo of collision/trace box copying between sprites in editor.
l_3qQ88OK3Y
I put some thoughts about it in video description.
Now I just gotta put these features through their bug test paces, then I’ll be able to make a rocket build with a really nice sprite workflow. ^^
Hey archduke_ i’m very glad that you managed to modify paper2d for your specific needs… good work there!
We just have to keep filling void little by little… right now i have found that sprite editor is very lacking, specially when dealing with sprite atlases… importing from them is pure pain and suffering if they are not rectangles or you have a sprite that’s small and fits inside geometry box of another sprite.
I also found several bugs with polygon tool, specially 2nd point… it’s always flipped for me… so i’ll end up fixing that on some fork of engine eventually.
I also dislike fact that we (or maybe i just didn’t figure how) cannot configure different collision shapes to have different trace and object responses per box/polygon on a single sprite.
Finally i think we really need a importer for our “Extract Sprites” section (haven’t found one…)
Is anyone interested on that? maybe i’ll create a fork and fix those issues and upload them when they’re ready
Though… if they do exist or people don’t really use them… i’ll wait or deal with them for our project
I looked around at since I’m pretty familiar with Sprite code right now. setup is as such:
shapes are stored in an array of FSpriteGeometryShape, which itself is in a FSpriteGeometryCollection that is a member of PaperSprite. GeometryShapes just hold information for shape itself (position, size, etc), and eventually get turned into physics engine box shapes and attached to BodySetup (another member of PaperSprite).
I haven’t fully tracked down collision response path, but I know it’s part of BodySetup ( tooltip on Collision Presets menu item is from BodyInstanceCustomization).
As a quick sanity check, I looked at ShapeComponents (e.g. CapsuleComponent). They all have their own BodySetups. Making some assumptions, it looks like BodySetup is what allows you to specify your own responses, which leaves us with no way to do it per-shape unless we go for a more heavyweight option (give each shape it’s own BodySetup).
As far as solutions go, I have some ideas for ways to hack it together. Nothing that would be general enough to merge though. Tough problem. Would be good to get confirmation that my poking around is correct, though.
That should be an easy fix, math for shapes in sprite editor is wonky in places. I fixed some bugs with position/size during shape creation that I’ll eventually PR.
yeah… i’m thinking about that too… i would very much like better support for body setup… will take a look eventually though
Hello
Since news about Paragon being shut down, and since Unreal Engine 4 is being used by more and more developers to create 2d games, is there any chance that paper2d will be under development again?
I would be very happy if You could take a moment to answer question
Best Regards
AM
A small message to renew all interest we have in Paper2D…
[USER=“2289”][/USER] Any news on Paper2D development?
No particular news, fully supported part of engine but not under active development. I accepted some pull requests for Paper2D bug fixes and features for 4.20 and will do same for 4.21.
Cheers,
Thanks for info!
Just for sake of understanding… which features would people think are lacking on 2d? Personally i would just focus on importing of sprites that could be made a little easier, specifically for extremelly packed/rotated atlases… but i’m pretty sure i have heard people saying that SVG support for rendering would be pretty …
That’s basically my biggest problem with paper2d now, that added with ability to maybe use multiple physics bodies on a single sprite…
Change shape of character’s collision to a box.
https://www…com/GkiF65WnwSI
That’s difficult to do with character movement component as is… due to it requiring a capsule component (coming from ACharacter)
There should be a workaround to that though, like adding a child box component on top of capsule collider
Other thing would be simply creating a APawn with a PaperFlipbook Component and write PawnMovementComponent to use a box collider instead of a capsule one… there could obviously be issues with angles and a solution like that could be way too convoluted for our own good
Wasn’t sure of best place to ask . Firstly, havent used paper2d in a long time and it has so many nice features, it is !
Now my question, if I import a 32x32 pixel sprite, should i build game around that? ie Character collision scaled down to match, or should I scale up sprite rendering?
Is there a pro/con to either way ?
Hey, I’ve been working with paper2D for almost a year, and I haven’t have a whole lot of problems I couldn’t overcome but tilesets… When using tilemaps for mobile development, they’ve been pretty harsh on performance due to overdraw. hasn’t been an issue with sprites because you can set render geometry, and even moreso, you can use opaque materials to keep shader complexity in green, no matter how many layers of sprites are drawn over one another.
Here’s a shader complexity comparison is es2 preview mode. tilemap is two layers and sits in red, I have 9 grouped sprite components stacked at 9 unit spacings on y, which sits in green. If I add another layer to tilemap it puts it in pink. At 4 layers, it’s at max. A simple two layer tilemap drops my game’s performance from a steady 60fps to around 20fps.
TL:DR It would be amazing to have render geometry added to tile editor to get better performance/less overdraw.
Hello, I also want to do exactly - to set DrawTwoSided to 0 by default, so that my sprites are not rendered from back. I have not been able to figure out how to do that yet, though. Just like user, I can’t seem to affect through an ini file, but I honestly don’t understand how I’m supposed to set defaults for console variables through ini files anyway - docs are very vague on that.
How should I actually do ?
I figured it out. I added to DefaultEngine.ini:
[SystemSettings]
r.Paper2D.DrawTwoSided=0