Project: Paper2D

random sphere is probably default pawn (ADefaultPawn::MeshComponent is a sphere), which may be visible there but not in editor viewport due to a different aspect ratio?

Cheers,

Ah great that makes sense, it’s only plug-in I’ve worked with. Can see it now I’ve added to IOSEngine.ini.
Cheers,
Doug

[Weekly 2D Status 6/30/2014]
Everything listed here will be in 4.3, but later updates will be about future releases as we have branched for 4.3 today. I’ve also taken a pass at updating 2D Trello roadmap to reflect completed work and changed priorities.

Enabled Paper2D by default in engine, so it will be usable in content-only games in 4.3

Editor and documentation work to properly message state of Paper2D in 4.3

  • Overall Paper2D in 4.3 is an Early access preview - While not considered production-ready, it is a step beyond ‘experimental’ and is being provided as a preview of things to come
  • Created placeholder editor intro tutorials, etc…
  • Sprites and Flipbooks are Early access
  • 2D collision/physics, terrain splines, atlasing groups, and tile maps are Experimental (hidden behind enable flags where possible)

Created 2D side scroller game template (BP and C++ variations)

Productization / usability polish pass

  • Added pixels per unreal unit scaling factor to sprites, with a per-project default setting
  • Visual pass on Sprite Editor
  • Completely revamped Flipbook Editor
  • Flipbook component improvements (play/pause, looping control, reverse, etc…)
  • Renamed Paper2D classes to better match their associated assets and parallel existing engine components

Posting here as well as editing at top of thread since I’m not sure if subscription notifications are sent out for edited posts.

SideScroller2D.png

Cheers,

Excellent work . Look forward to using it.

Wow, I didn’t expect so many mind-blowing features to come quickly, really work!

feature I want and I think it’s quite important for a 2D game is a box character controller. current capsule one is good for 3D game, but not so much for a traditional side-scroller. I don’t know if you guys have already implemented that.

Thanks!

Hi 3dgo,

You can try out bUseFlatBaseForFloorChecks on CharacterMovementComponent, which will make it behave more like a traditional 2D platformer character, with a flat bottom instead of a curved capsule bottom. However, can cause a little floating when going up inclines; you can choose tradeoff between better behavior on edge of a ledge versus inclines by setting to true or false.

It’s certainly something we’d like to continue improving. You kind of want hybrid behavior, using a box to determine support but capsule to determine grounding, maybe falling back to box when discrepancy is too high.

Cheers,

is shaping up real nice. Once 4.3 has been released, I plan to convert my Captain Comic prototype game to using Paper2D. Hopefully that will reduce some of graphical glitches I am seeing. Will there be any issues in deploying to HTML5 using Paper2D?

looks great, just out of curiosity, if anyone is using experimental Paper2d at moment will 4.3 totally break that?

I haven’t tried it out with HTML5 yet, but it works fine on iOS so I wouldn’t expect any major issues (as that tests both cooking and ES2 rendering path). Note: Box2D integration (experimental) only has checked in libs for Windows right now; I’m waiting until integration gets a little further along before I commit to rebuilding binaries for all different platforms each time I modify it, but you should be able to use PhysX with planar constraint on character without any issues (2D template we’re shipping in 4.3 is PhysX). Box2D source is included along with modifications I’ve had to make though, so you could recompile it if you really wanted to try it on HTML5 / etc…

I think it will wipe material asset reference or material override you’ve configured on a sprite or flipbook asset or associated component instances (resetting them to default sprite material), but otherwise it should work OK. From 4.3 on, they should be forwards-compatible, although I’m not promising that on terrain splines and tile maps yet.

classes also got renamed, but there are ActiveClassRedirects in place for existing content and deprecated typedefs mapping to new names for C++ users, so it should still compile/load fine (unless you include’ed a header directly instead of using *Classes.h, I didn’t place stub headers that include new one).

Cheers,

@

thanks for your work on Paper 2D, i’m checking every day, several time by day your commit on master branch, so thanks again for everything you’re currently done to allow us to use UE4 for a 2D Game production.
On another Topic, i need to ask you several questions, that i found anywhere answer :stuck_out_tongue:

1 - How are we supposed to do to ensure that Animation sprite are replicated ? i mean i have two character , currently everything is replicated correctly, except Animation, should we check replicated in Timeline animation or having a specific replicated variable who will handle those animation ?

2 - what is your current suggestion regarding collision, i’ve read all forums post related to 2D collision, so we don’t really know if we need to enable collision on sprite and disable collision on Mesh, if you have any idea i will like to heard you on topic.

Thanks

Had a play with recent preview build(30th June) which has latest and greatest paper2d stuff in it. very much enjoyed seeing 2d templates included. Regarding physics, at moment capsule is colliding with sprites and constrain to plain is enabled on capsule. Is way paper 2d will be going forward with physics? Not sure how box2d stuff is related. How is box2d utilized in regard to sprites and character movement component?

While writing up release notes today I realized that material property rename actually happened during 4.2 development, so there are probably no real content breaking changes from 4.2 to 4.3.

Cheers,

Nothing is currently set up to replicate; correct approach would probably be to replicate flipbook asset pointer, position, and a few state bits (bPlaying, etc…). I don’t think I’ll be able to get into 4.3 branch as we’re trying to reach RC0 soon, but I’ll make sure to take a look at it for 4.4. If you want to cheese something together before then, you can try (on authority only) copying GetPlaybackPosition() and GetFlipbook() each Tick into variables set to replicate on your Actor subclass.

2D side scroller sample is using only character capsule for collision, with no collision on Mesh or Flipbook Components. It’s using PhysX, and relying on plane constraint feature of CharacterMovementComponent to lock everything to a 2D plane.

For Flipbooks:
We don’t currently support any collision on flipbooks due to some concerns with animated size/shape of collision volumes. If sprite doesn’t dramatically change aspect ratio during animation, I don’t think 'll be a huge issue, but I’m interested in hearing from real world use cases. I can imagine it working a bit more like PhysicsAssets do for skeletal meshes in future, with a set of rigid bodies that are animated but don’t collide with each other, moving but not changing size, etc…

For Sprites:
You can define arbitrary collision shapes, and it will generate ‘fat’ 3D collison shapes from them by extruding by CollisionThickness. These work great for collision detection, although if you enable simulation it’s easy to knock them ‘out of plane’. Ori is looking at a simple ‘easy button’ way to set up PhysX constraints for arbitrary rigid bodies (not just Character) to lock them to a 2D plane, which should make PhysX more viable for a 2D game that includes simulation, not just collision detection.

Box2D integration is quite early still. Collision detection and simulation/response are mostly working, including all of great Unreal collision filtering and object/trace filtering channel stuff, so it could probably be used in a physics-based 2D game already. However, non- based queries, sweep tests, and overlap tests are not implemented yet. Without those features, things like CharacterMovementComponent and MoveComponent with bSweep=true won’t work correctly.

integration strategy I’ve been taking is to make it a first class citizen, where same techniques/knowledge you use in 3D scenes will directly apply to 2D scenes, so there’ll only be one Overlap event, not a separate 2D and 3D one, etc… For example, 3D raycasts are already implemented for Box2D and you can both trace ‘in-plane’ (gameplay traces within 2D ‘world’) or ‘perpendicular to plane’ (things like Touch input trace to determine object under your finger / mouse cursor). You’ll get a proper hit result location, normal, etc… back as well. will both make it integrate more cleanly with engine as a whole, as well as enable hybrid 2D/3D experiences to be built easily (although there are some tricky questions about authority if you want two domains to overlap at all during simulation; probably best approach will be to have a kinematic mirror body attached to a simulating body in opposite domain or avoid issue altogether).

I’ll be focusing on some more general mobile workflow issues for 4.4, so I don’t know if I’ll have time to advance Box2D integration further in near term. If you (or anyone else) are interested in having a look, there are a lot of //@TODO: BOX2D: comments in code and I’d love to look at pull requests :slight_smile:

Cheers,

Ok that explains it. I was thinking that sprites and paperanimatedrendercomponents would behave similarly but I can understand changing bounds being an issue.

would love to. still getting my head around engine code though. doesn’t help that i’m working 10+ days 6 days a week making fluid sims for my day job :slight_smile:

Yeah, you can type ‘show collision’ in PIE/gameplay, or use Show…Collision menu in viewport of level editor or sprite editor.

Cheers,

popping/disappearing is probably because you moved it too far and it crossed near clipping plane. camera boom on character is only 500 units long (TargetArmLength), you can just extend it to get more depth in Y to play with.

Cheers,

Upgrade notes specific to Paper2D from 4.2 to 4.3 preview:

  • Paper2D: Several C++ classes were renamed to better match engine standards

  • Existing content should upgrade with no changes, but C++ code will need to be updated to match new names:

  • Rename UPaperRenderComponent to UPaperSpriteComponent

  • Rename UPaperAnimatedRenderComponent to UPaperFlipbookComponent

  • Rename FPaperAnimatedRenderSceneProxy to FPaperFlipbookSceneProxy

  • Rename APaperRenderActor to APaperSpriteActor

  • Paper2D: Paper2D is now enabled by default so that content-only games can use it in cooked builds

  • Paper2D: Switch mobility setup for sprite components to match static mesh components; UPaperSpriteComponent now defaults to Moveable and APaperSpriteActor defaults to Static.

  • Paper2D: Refactored public interface of UPaperFlipbook (FramesPerSecond and KeyFrames must now be accessed via getters or a FScopedFlipbookMutator instance)

Cheers,

Will documentation be ready for 4.3?

I’m working on a quick start guide right now. I would say that ‘early access preview’ quality documentation will be ready by 4.3 release, but it might be in a forum post or wiki article rather than in main docs at launch (it’ll get to main docs soon after).

Cheers,

Hey ,

Thanks for your update about replication & Collision, we are currently working on replication, and we also prepare some tutorials about 2D Games, especially how set up a 8 Direction behavior and a Platformer Behavior, hope it will help everyone who want to use UE4 during a real 2D production !

i will update you soon on replication but i have another question, for you please! could you shortly explain, easy way in UE4 to play an animation trought flipbook but only once! i mean, let say i’ve an animation ‘jump’ who need to play until last frame and then stop and stay on last frame, is there any easy way to specify that an animation should not loop forever ? (maybe it’s already possible, in case i’m apologize) but i need to know if you plan , to allow to specify how a 2D animation should play

At moment we are using a timeline linked to all our flipbook (by way a suggestion, but when a user link a flipbook component to a timeline it should “by default”, set timeline lenght to animation playing time" (as you get number of frame, frame speed, and animation time)

Thanks again for new help :stuck_out_tongue: