x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Very efficient scrolling background needed [mobile]

Hello guys,

I'm currently trying to make an appealing, scrolling background with stars and some unique things like planets/space stations/something like that for my (space-themed) mobile game. It is 2D, as I want to target lower end devices as well (at least as low as possible), but I've encountered a somewhat big problem now:

I need a background and for now I just used a star-sprite that I placed in the world. If the player however moves a little bit, he will obviously see, that the texture ends at some point, so I'm looking for a solution to fake an "open-world" (the levels are not intended to be endless, just big enough to avoid obvious repetition at least). I have some ideas, however, I have no idea, which one would be the least performance-hungry (and still good-looking), maybe you can give me some ideas here ? :)

Idea 1: Skybox: Simple, but I guess this will be really bad performance-wise? As far as I know that's just a really big sphere (and therefore a lot of vertices?), pretty straight forward, but I guess it's not really good for mobile games? :/

Idea 2: Background sprite with UV-Map depending on the camera position that moves with the player (I did implement this, however, it is highly repetitive ... )

Idea 3: Dynamic texture: Paper sprite component behind the player pawn, that updates its texture with background data (could generate dynamically). I guess this is the most dynamic solution, however it will probably take a lot of computation ... ? (Lots of memcopys etc.)

Idea 1 & 2 wouldn't even allow for "special" landmarks like space stations f.e., I'd have to use independent actors for that, too, I guess? :(

Maybe you can give me feedback what the best solution would be here? :)

Thanks in advance!

Regards, Nano

EDIT: Small sidenote: I don't use any lights in my scene, only unlit materials (if that matters?)

Product Version: Not Selected
Tags:
more ▼

asked Mar 08 '15 at 10:41 PM in Using UE4

avatar image

Nanoxin
311 37 39 44

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi,

Why not using a Panner and set it to scroll horizentally in material editor. This way you can make an input parameter for making dynamic texture as well

more ▼

answered Mar 13 '15 at 11:14 AM

avatar image

plangton
367 17 20 31

avatar image Nanoxin Mar 13 '15 at 12:09 PM

Hey, thanks for your idea! :) However, with a panner (didn't know that one before, I calculated that stuff myself and created an UV map, but whatever) I'd have an endlessly repeating texture, right? If I switched the texture (at runtime) there would be a hard visual break, or am I wrong? Thank you for your help, have a nice day :)

avatar image plangton Mar 13 '15 at 12:32 PM

in theory you are not suppose to have a visual break. because it is a simple dynamic texture update. however it has an issue and it is that the whole texture updates together. Take a look at the side scroller sample. with that you can move your background horizontally or moving your camera horizontally. in a simple term it sets the camera to orthographic mode ( you can find it under the camera settings. if it is not fixing your issue. tell me and I can create an example for you

avatar image Nanoxin Mar 13 '15 at 03:56 PM

I'm currently looking at the Sidescroller samples (2D and 3D), however none of these use materials with panners (or maybe I don't see them?), they just have backgroundsprites / skyspheres, as far as I can see :( Could you be a little bit more specific where I can find such an example? :)

Would your theory also work with a free movement in x and z-axis direction? (not only horizontally)

Thank you again for your help!

avatar image Nanoxin Mar 13 '15 at 03:58 PM

Another thing: I'm currently implementing a 3x3 tiled background (3x3 sprite-actors) that cover a bit more than the whole screen and whenever the player moves to the right f.e., the left 3 tiles get moved to the right part. (Maybe with updated textures ...?) (Same for the left/up/down movement) This is somewhat working for now, however I'm not sure, if your suggestion is faster than this?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

A panner create a coordination in 2d space . It can get a shouted for a x and y coordination of a 2d space and generate the needed coordination. You just need to simply connect it's output to a texture 2d. For your issue I think the best case is to use layers of texture. E.g one in back ground that use a panner to rotate and the other sides is transparent and I'd mapped on the background and you can create random starts dynamically on it. I used the dynamic material with kinect2 and was updating the material 30fps by camera output. They're wasn't any problem but it is always depends on the machines that the app is supposed to run on. Although this is not a complicated calculation in my idea. The third solution I suggest is that use a background and then create your starts using sprites

more ▼

answered Mar 13 '15 at 04:32 PM

avatar image

plangton
367 17 20 31

avatar image plangton Mar 13 '15 at 04:33 PM

A panner create a coordination in 2d space . It can get a shouted for a x and y coordination of a 2d space and generate the needed coordination. You just need to simply connect it's output to a texture 2d. For your issue I think the best case is to use layers of texture. E.g one in back ground that use a panner to rotate and the other sides is transparent and I'd mapped on the background and you can create random starts dynamically on it. I used the dynamic material with kinect2 and was updating the material 30fps by camera output. They're wasn't any problem but it is always depends on the machines that the app is supposed to run on. Although this is not a complicated calculation in my idea. The third solution I suggest is that use a background and then create your starts using sprites . I will make a sample of how to use a panner soon

avatar image Nanoxin Mar 13 '15 at 05:11 PM

Okay, an example would be really nice, I theoretically get the idea, however not so much the dynamic part (I understand the panner, I guess), like how I could create variation in the used sprites dynamically... Thank you again :)

avatar image ThatGuyMiniB Apr 21 '15 at 10:45 PM

Have you guys figured this out yet?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question