Project: Paper2D

GetReferencedContentObjects is only used for Ctrl+E and Ctrl+B features in editor to sync to or edit asset(s) associated with selected actors in level (and an actor being a Blueprint always trumps that to interact with BP asset instead). It has no bearing on compilation process of a Blueprint.

tile map component getting lost in placed Blueprints is certainly not desired however, it looks like there is an open bug on BP team about issues with tile map components + BPs in standalone or packaged games (UE-16978).

Cheers,

  1. Oops, it looks like is not exposed right now ( properties on both maps and layers are read-only for Blueprints / protected in C++). As a work around, assuming you don’t need varying thicknesses at runtime, you could create a ‘template’ asset with layers set up at your desired thicknesses, and then call MakeTileMapEditable on component, which will duplicate asset into an editable instance that you could then further modify programmatically. I’ll throw in a feature request to expose them in future.

  2. Are you working from C++ or Blueprints? Working from C++, you can call RecreatePhysicsState to force collision to update. I’m actually a bit surprised that isn’t happening inside SetCell if tile has collision, I’ll bug that. If working from BPs, you can call ResizeMap to force physics state to be recreated (just pass in current width/height, it’ll still rebuild but won’t affect map itself).

  3. Yeah, all of normal primitive component methods should work as expected. You can change collision channel or enable/disable collision entirely if desired (SetCollisionEnabled).

Cheers,

(1) You can turn on Show Grid in show menu, which can be quite helpful when adjusting pivot and it draws origin lines in a different color, giving you a point of reference, but being able to choose a guide sprite is a good idea!

(2) A tile map component can either be ‘instanced’ (uniquely owning tile map) or reference an asset (that may be used in many places). Any instanced tile maps are already editable in level editor. You can also convert back and forth between them using buttons on details panel for a selected tile map actor / component.

(3) You can accomplish same thing using a material instance assuming all of frames are contained in one texture. Instead of using sprite texture sampler in your material, use a regular texture parameter. For each different character, create a material instance that points to texture for that character, and now you can ‘skin’ your characters by applying different materials to flipbook component.

(4) is already possible in Source Region edit mode. Create one sprite from texture, then open it and go to Edit Source Region mode. Here you can Ctrl+Drag or double-click to create additional sprites from same texture. All of sprites that share texture will also appear in mini-content browser in corner of screen, and you can switch between editing them using that or by clicking on them in viewport. Also allowing behavior in extraction dialog would be nice, but most of functionality is tied in with other aspects of sprite editor, so it’d be a decent amount of work to hoist it out and reuse it there.

Cheers,

thanks for quick reply!

i converted tile map to an instance and it can be edited exactly how i wanted it to. i didn’t notice that option because it wasn’t mentioned in documentation, and “convert to instance” sounds like it is for improving performance. so problem solved :slight_smile:

i thought about using a material instance to change texture, but i never tried it, because i assumed sprite texture sampler was doing something magic behind scenes, and i thought switching it to a regular texture parameter might break it somehow, so its good to know thats an option. are there any downsides to using a regular texture parameter instead of a sprite texture sampler? if they are interchangeable, it makes me wonder why sprite texture samplers exist.

that source region edit mode solves many of those problems, but if i paint 20 new sprites onto a sprite sheet that i have already extracted sprites from, i would have to use “create sprite” 20 times, and move rectangles into place. maybe there could be a button in sprite editor that allows me to add new sprites by dragging out a rectangle, so i can quickly add many new sprites to a sheet. it could use an automatic naming convention, kinda like extraction dialog, but since it would be a tool inside sprite editor, instead of extraction dialog, it might be easier to add change.

thanks again for these features!

sprite texture node is actually just a regular texture sampler with a special name under hood (and starting in 4.8 slot index as well), but there is code in render side to automatically set that sampler to point to asset referenced texture without having to create a material instance or dynamic material instance.

Open a sprite that you had already created in that sprite sheet, and use Ctrl+LMB+Drag in source region edit mode. It will create a new sprite to cover rectangle area you dragged. You can also just double-click on center of each sprite to create a new asset, if all of pixels are connected together (or double-click on largest area, then drag borders to include outliers).

Cheers,

wow, so i guess all of those problems have been solved, i just didn’t know about hidden hotkeys because its not in documentation yet. sweet!

since you solved all of those problems, i guess ill just make a few more feature requests:

  1. maybe you could add a list of collision boxes to each animation frame, so user could set up hitboxes for a fighting game.

  2. maybe you could add a pallette editor to sprites. i know it can probably be done with a gradient mapped material, but maybe there could be a more user friendly built in solution for editing values as a list of colors. would be handy for old school game effects, like color cycling animations for waterfalls, blinking lights, or fading to black with a limited palette. when an NES game faded to black, or flashed lightning, it would change palette in a way that might be nostalgic for 8 bit gamers.

  3. maybe it could be set up to use one of those palette colors as transparency, which might help texture compression on mobile platforms, so you can avoid alpha channels and separate mask textures, putting all info on a single opaque png.

824d2f80539849085fd8e7b09c5135ca121e1908.jpeg

Tile Map pivot point seems to be positioned at first tile’s center. It is either in topleft point nor in center.
So need to substract 1/2 of Tile width and height to align well.

(1) We probably won’t be adding collision editing directly in flipbook editor any time soon, but in mean time you can add sockets to your frames and attach collision components to them in order to have multiple independent hit regions.

(2) sort of thing is best left up to user in a material . No modern GPUs support indexed textures, so it would just be getting emulated under hood as a dependent texture fetch anyways, and then you’d have no control over process versus being able to do arbitrary things in material (e.g., animating/shifting colors by pingponging Y coordinate of a 2D LUT, with X coming from ‘index’ texture). I’d also recommend checking out global material parameters, which you can set once and read in any material in your game.

(3) material is in control of opacity as well. You can chroma-key-test a texture for a value and use that as opacity mask result rather than having an alpha channel if you want, trading off shader instructions for memory (or do something like have two ETC1 textures, one for RGB and one for A on Android platforms).

Cheers,

is by design to make it easy to place things like actors in a tile cell, but there is a feature request filed for configurable tile map pivots (UE-13624).

Cheers,

I know it’s on trello list already, but just wanted to reiterate how useful an event track would be in flipbooks - right now there’s no great way to configure events/checks to occur on specific animation frames and it’s kind of behavior I have used a bunch in past systems. If there’s an alternate method that’s intended here, please let me know and I’ll try to do it that way!

Another flipbook request - in some animations we want to vary time of a frame slightly for stuff like anticipation frames. So we’d have most frames run for 0.05s, but occasionally we want frames to run for just a bit longer (e.g. 0.8333s) but not necessarily a clean multiple of base time. Being able to directly type in durations would be great.

One last thing for tilemaps that I’m currently working around but thought I’d mention it - I started with 3 layers (floor, walls, ceiling). I wanted floors to always be behind player, and ceiling to always be in front - is straightforward with existing system. But for walls I wanted player to be in front if he’s beneath them, and behind walls if he’s above them (where beneath and above are in terms of z-axis). I ended up solving by instead of doing one wall layer, breaking it out and doing each row of walls as a separate layer with a new depth, and modifying player y axis position based on current z position. It’d be nice instead to be able to just keep it all as a single layer and specify an amount of offset for each row.

Hi .

I’ve been working on a Android game on Unreal Engine 4 only using Paper2D components. results are very good and game is running. But “sometimes” i have an issue launching game.
is log i could catch in Android Monitor:

It’s weird because is not always happening. game launches and works like a charm, then you close and relaunch it again and then SOMETIMES game crashes and it seems like something random.

Would you please show me right path to follow? I don’t know where to start.

Thanks in advance

Hi AleCadavid,

For bugs like , best path is to open an AnswerHub ticket. I haven’t seen anything like personally, but I think it might be a known issue that we are investigating after talking with Android folks.

Cheers,

LinkerLoad.cpp issue was fixed in master branch today. You can get source fix from here:

/EpicGames/UnrealEngine/commit/fc3965d32ae392049084b773e73a4cc68e3677cc

Hi . Thanks for your answer.

I will open a new ticket then. I’ve not done it before because i read issue was fixed on UE4.8.1 but seems it’s still happening :frowning:

I have other weird glitch right now only on mobile devices.

Sometimes game randomly takes wrong info from wrong texture atlas or from right atlas but wrong position.

UPDATE 1: glitch only happens installing a compressed APK. Uncompressed APKs don’t have issue. I will try to open a new ticket for issue.

OMG Chris, thank you very much. Best news ever.

Hi AleCadavid,

Is glitch stable within a run (e.g., it’s not flickering or changing, but it’s like loaded asset is permanently corrupted)? If so, it’s probably being caused by same issue as linker load bug that Chris mentioned fix for, where data was being corrupted during load. If it happens in a header, then safety checks fire and it crashes, but if it happens inside middle of a texture load it might just look corrupted but otherwise run fine.

Cheers,

Hi . It’s stable within a run if it happens on a sprite but it’s flickering if happens on a flipbook, but never crashes.

As a heads up, it looks like fix for load corruption in Android packaged games will be a part of 4.8.2.

Cheers,

That’s great

Drag assets directly from Content Browser to Scene will not correct snap to 2D Layer