How do we go about getting sprites to work in rocket?
Im looking into producing a uni project in rocket on the side for my self, but its a full 2D game, does rocket offer any easy way to use sprites with collision etc?
Or could we get in a future build something where we can use sprite sheets, like game maker ( i know game maker is simplistic but it works) it would really help to not have to do tricks to create these types of games, but still offer the full power of the engine for 3d effects and lighting. maybe even making it possible to create games like paper mario or the recent rayman games with ease.
While we are striving to make Rocket the best toolset available for all games, it is currently a 3D toolset. Dave has a good idea about how you could use the 3d tools available in Rocket to create 2D functionality.
Using an engine like UE4 for 2D games, is like using a sledge hammer to hammer a nail for a picture frame. While it can be done, there are other tools far better suited for it, now with that said, I’ve been working on a 2D example in rocket and you can make some really amazing effects with all UE4 right now.
Here’s what you do, First make a character in an art app with each part of the character on a separate layer.
Export each layer as its own image.
Switch to your 3D app, Make a bunch of flat rectangles to hold the exported images or you can even make flat custom geometry -[just make sure you have only triangles because you can get some weird shadowing sometimes also uv map the custom geometry and rectangles!]- to hold the images of the character.
These rectangles or custom geometries are going to be the hit-boxes
Next create a bone structure of your character that has movement bound in only 2 axis. -[You might want still 3 dimensions anyway for layering the characters body parts ]- Attach the Image’d Geometry to the Bones and then Create Animations, Export to fbx using the wiki options into Rocket. Use the Side Scrolling example Swap the example character for the one you made and bam you have all the 2D tools you will ever need.
-Also-
The geometry will cast shadows. Hit Boxes depend on geometry. Custom geometry works best imo. GPU Particles look and play with a 2D system like the one above are absolutely gorgeous. Instead of using flat geometry, try using like "shell/dome like " shapes to add some depth. Fps is amazing in a system like this.
What I have tried so far in UE4 and Unity using Dave.Voyles and I’s faking it method this works just as well as Unity’s 2D out of the box stuff in my honest opinion. While there are some cool features in Unity to help 2D I didn’t see anything that you can do in Unity that you can’t do in UE4. I think this is more of a workflow issue.
Also in regards to the sprite sheets you can also do this too, you use a large texture with a bunch of images and you uv map it to the appropriate geometry in the 3d app.
Alternatively, you could do a 2.5d game (this is what I’m doing at the moment) and prevent the characters from turning left and right. ie - they can only run to the left side of the screen, or right, but cannot rotate.
There are two ways of doing this:
Create a blocking environment within Rocket, which prevents the character from moving off of a plane. (Not recommended)
In the player controller, prevent rotation. This is what I do, and it works well.
The 3D models can just be a boxes where your material with the texture (sprite sheets) are applied. From there, it’s just a question of manipulating the uv coordinates to create the animation.
This is a question from the beta version of the engine. We are marking this answered for tracking purposes. If you are experiencing an issue similar to this please post a new question.