Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Large Bitmaps and Scrolling Backgrounds

Author
Message
Ninjazz
16
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 31st Jul 2008 07:06
Hey, I've been looking through every post in every forum I can that's related to scrolling backgrounds, and unfortunately none of them seem to provide me with the info I seek.

I'm working on a top-down shooter, vertical scrolling, (a la 1943) Anyways, I've seen mention of tile based systems and such, but I really want to know if there's a way of using a single, (very) large image for the background and then scrolling it, or do I literally have to break it down into chunks with the get image command?

Also, I've noticed that DBPro must have some sort of limit to the get image command's size? Any time I put it above a certain value it errors out about illegal values. (Even if the get image size is fine, but it's trying to grab a portion of a large bitmap) Can anybody give me an idea what to do here?
This blasted background problem has been single-handedly holding me up.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Jul 2008 12:45
Grant Clark (Geecee3) made a sideways scroller tutorial for the newsletter many months ago, possibly a couple of years ago. The principal should be the same. Look through the newsletter archive.

There is also a 2D game kit - http://darkbasicpro.thegamecreators.com/?f=2dplugin

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 31st Jul 2008 15:27
If you're working with 3D you could make a giant plain and use the SCROLL OBJECT TEXTURE command.

But still, you should probably try the tutorial BatVink was talking about. I haven't seen it but it could be useful.

Ninjazz
16
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 1st Aug 2008 05:29
Looked through all the archives, failed to see the tutorial by grant clark. I saw a couple of other tutorials related to scrolling, and looked at all of them, but again they all deal with repeating elements in the background, I want a continuos, unique background from an image, not a tile set.

I did experiment around some more, and so far the only thing that's even come CLOSE to working is making a plain and scrolling object textures, but I really don't want to have to mess with that as I'd have to start moving the 3d camera around to set it up right.
I also have tried breaking my image up into chunks, (as best I know how) using the get image command and making smaller sprites out of my bitmap, with the idea to replace the top sprites as the player get's farther up the level, but I'm stuck with the same problem... DBPro doesn't like to grab images past certain point.
For example my background bitmap I'm using is 1600x1800. If I try to
get image 1,0,1649,799,1799
I get an error telling me it can't get the image due to an illegal area. I'm figuring this is simply because it's out of DBPro's capabilities to load that large of an image. (although it didn't complain when I used this same bitmap to texture a plain and scroll it.
Am I doomed to the realm of 3d here? Sadly scrolling a background seems like such a simple concept(and gaming staple), I'd have thought there would be a command for it
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 1st Aug 2008 06:37 Edited at: 1st Aug 2008 06:39
I think DBP can grab any size of an image (bigger = slower however). But it can only grab within the limits of the current bitmap.

If you have not changed the bitmap, and your screen resolution is smaller than 1600x1800, those values will be out of bounds as the bitmap size = screen width() x screen height(). You can create a second bitmap and grab the image from there however.

This works:


But not this:
Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 1st Aug 2008 17:54
Wouldn't the 0(for selecting the left side of the area) in the get image command be an illegal area?
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Aug 2008 20:26
Quote: "Wouldn't the 0(for selecting the left side of the area) in the get image command be an illegal area? "

I haven't had any problems with it.

Ninjazz
16
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 2nd Aug 2008 07:15 Edited at: 2nd Aug 2008 09:52
@Ian G: Thanks, looks like you were right on the money. If I go even one pixel over my screen size it gives me the error.

@Nano: Same with Sixty Squares, I've never had problems with it.

I've more or less given up on the bg at this point, and went with my last resort, making the plain and scrolling the texture on it. It looks alright after some tinkering... Is there a way to switch to Isometric view rather than the perspective one? I'm not a big fan of the distortion caused in my background by the perspective, and I'm very very noobish when it comes to the 3d stuff. (Hence my trying to avoid using this method.)

EDIT: Excuse me, not Isometric, I mean more straight-on without the distortion. Would the camera FOV do this alright? I just want the perspective gone.
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 5th Aug 2008 04:56
Ya, I just used the values he used, didn't bother to change them.

Login to post a reply

Server time is: 2024-11-24 22:59:25
Your offset time is: 2024-11-24 22:59:25