Infinite scrolling help... again!

For questions about using Classic.

Post » Sun Apr 26, 2009 12:33 pm

Hello,

I've just recently revisited a game that I had some help on a while ago.

We originally got infinite scrolling going thanks to the help of linkman2004 in this post
[url:2g629vc8]http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=2357&p=18426#p18426[/url:2g629vc8]

I've recreated the game, with a slightly different way of controlling the car.

But when I added the infinite scrolling code again, something went wrong.

The wheels disappear now, and don't return. I can't figure out why at all.

The cap is here: [url:2g629vc8]http://www.mukpuddy.com/timtests/Mukbuggy_remake1.cap[/url:2g629vc8]

To see the scrolling, just press down to drive backwards off the edge of the screen.

Any help is much appreciated. Keep in mind though, I am still very much a noob when it comes to this type of thing, and may just be mildly retarded :)

Thanks
B
10
S
4
G
5
Posts: 136
Reputation: 2,977

Post » Sun Apr 26, 2009 3:01 pm

I think it's an object picking problem. I fixed it by offloading the object creation to a function. Here's the modified CAP showing the changes:

Modified Infinite Scrolling

EDIT: Just incase you've already downloaded this, you'll want to download it again. I accidentally messed something up in the first one.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Apr 26, 2009 7:59 pm

Wow, thanks again dude.
Very much appreciated.

I've never used functions before, I'll have to look into how they work for future reference.

Any clues on how to get rid of the flashing?

It's not a huge deal, but it would be cool to have it as smooth as possible.

If this ever actually turns into a playable game, you'll be credited as the guy who keeps saving it from "I don't know how to program" limbo :)

Thanks again
B
10
S
4
G
5
Posts: 136
Reputation: 2,977

Post » Sun Apr 26, 2009 8:12 pm

No prob', man. :)

The flashing I can't seem to fix entirely, but I've found that if you uncheck the "Center view on me" attribute for the car, and instead place an always event after the rest of your events where you scroll to the car manually, only the car will flash. I don't understand why this is, but it's less distracting than the whole screen flashing.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Apr 26, 2009 8:40 pm

Squeemish, you should seriously consider cutting that track up into smaller tiles. With a sprite that large you're allocating space in VRAM for a 4096x4096 texture. It's taking up way too much space, especially since you're only using the top portion of it... most of that image is wasted space.

Sure, it runs fine now, but when you start adding more graphics to your game you're going to choke your graphics card to death. Some people probably won't even be able to run your game, or they'll experience crashing due to running out of VRAM.

My advice would be to make smaller pieces of track that you can fit together like tiles. Not only will that save a crapload of VRAM, but it'll make things easier if you want to make new levels as well, since you can build new tracks out of the same pieces. It might take some work getting your custom collision masks just right so they line up, but it'll be worth it in the long run.

Oh, and make sure your tiles are a power of 2 square, and I wouldn't go any higher than, say, a 256x256 sized tile for a game like this.

Anyway, good luck with your game :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Apr 26, 2009 8:44 pm

Hi Deadeye,

I actually had it all made out of tiles at one point, and someone suggested making it one big one. Can't remember why now.

So I still have all the tiles, I'll swap them round.

Thanks for your help.

And also, thanks again for the help linkman, that works a lot better.
B
10
S
4
G
5
Posts: 136
Reputation: 2,977

Post » Sun Apr 26, 2009 8:50 pm

I wish I knew who that person was, so I could smack them (jk :D)

But really, making such large graphics is generally a bad idea. If you can create the illusion of huge backgrounds by using instances of smaller sprites, then that's the way to go. Making gigantic sprites is wasteful and unnecessary (especially for something like a repeating level design like you have).

And in case anyone's wondering, no it's not a Construct issue, it a graphics card issue. It's a designer-not-being-smart-about-video-memory-and-performance issue :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Apr 29, 2009 6:27 am

the reason was probably to avoid seams :P
(no, wasn't me)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests