Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Panning...
#21
But why dont you make a true pixel scrolling engine with the map already stored in a big buffer? Would be much faster...and easier.
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#22
Juh? Let me see if I get you right... Say I wanted to make an area that was 2500 X 2500 tiles, each tile being 27*27 pixels, I would make an arrya that was (2500 * 27 = 67500) 67500 X 67500, and just used that? Then keep track of the location of the player in a 2500 X 2500 array? Interesting idea. Is that what you meant?
ou're damed if you, well, let's just say your screwed not matter what you do.
Reply
#23
Umm...I dunno if you have lots of time on your hands, but 2500*2500 = 6 250 000. Thats over six million tiles you'll have to map Smile.

But no, you only store the tile index number, not the actual tiledata.
Code:
Dim Map(2499, 2499) As Integer

And to keep track of the player:

Code:
TilePlayerIsOn = Map(int(PlayerX / 27), int(PlayerY / 27))
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#24
Well, the screen is 23 by 17 tiles, so that's about 100 screens by 100 screens. It's big, but keep in mind that it has to store the world map in that buffer, so I think it's reasonable. Now, if I don't store the actual tiles in a buffer, they are just too slow to draw, so I'm back at square one. That said, can anyone get IMAGECREATE to work?
ou're damed if you, well, let's just say your screwed not matter what you do.
Reply
#25
PLEASE NOTE: If this isn't what you want, sorry, just ignore this post.

So you want to load it tile by tile and the player stays in the middle? just use numbers to represent the tiles in the map array and out them in a CASE like

Code:
SELECT CASE tiletoput

CASE 1

PUT (x * 27, y * 17), tile1

CASE 2

PUT (x * 17, y * 17), tile2

'and so on.

END SELECT

You would need to have the screen x size a multiple of 27 and the screen y size a multiple of 17 (you could rely on FB clipping the tile though)

When i get to my pc at home i'll whip up an example.

Wouldn't this look terribly jumpy though?

Umm, and pixel by pixel isn't slow to draw?
FB is more than fast enough to handle this.
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#26
FB is faster than QB, but it's too slow for what I'm doing. There are four gfx layers involved, per tile. And in order to achieve smooth paning, it would all have to be pre-loaded. I've tried what you've said, and it ain't gonna fly. Thanks though.

So, still, no one know how to use IMAGECREATE?

Thanks.
ou're damed if you, well, let's just say your screwed not matter what you do.
Reply
#27
Ok, it seems like that you cant go beyond 8191*8191.
Code:
'Set screen mode
screen 18, 32,, 1

'Make the pointer that points to the buffer in memory.
Dim Buffer As Any Ptr

'Create the buffer and fill it with bright red color.
'8191*8191 was the biggest I could get to on my computer without crashing...
Buffer = ImageCreate(8191, 8191, rgb(255, 0, 0))

'Place down the buffer at (0, 0)
put (0, 0), Buffer, Pset

sleep

'Destroy buffer
ImageDestroy Buffer

So it seems like you're stuck with two options:

1. Split the screens into smaller 8191*8191 buffers.

2. Make a true pixel by pixel scrolling engine.
I'm 100% sure this can be done fast enough, I could even make a pixel*pixel scrolling engine with 4 layers for you. Smile
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#28
Perhaps I'm stupid, but I got this far. I have FB 1.3 and this is what I get when I compile that code:

buff.bas(9) : error 71: Array not dimensioned, befr: '('

Buffer - ImageCreate(8191, 8191, rgb(255, 0, 0))

This is why I can't get IMAGECREATE to work. No matter what, this is what I get... unless I...

change: Buffer = ImageCreate(8191, 8191, rgb(255, 0, 0))
to: Buffer = ImageCreate(8191)

But, this, of cource, renders that line useless... So back to square one...

Sigh. Any ideas why?

Thanks.

So, a pixel scroller, how does that work?
ou're damed if you, well, let's just say your screwed not matter what you do.
Reply
#29
This is a shot in the dark, but I would try downloading 0.14 and see if that works...just to try.

A pixel scroller...well, first you would load the tiles, and just plot it down. I can make an example pixel*pixel scroller with multiple layers for you if you want.
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#30
I would love to see one that worked. Here's what I'm working with. There are different areas in the game. dungeons, towns, world map, ect. that each have their own tileset. So, for each place, there is a master tile file that hold all the tiles, and all the information reguarding the tiles. If it's an animated tile, is it passable, not passable, ect, as well as the actual tile pixel layout. Now, there are two basic types of tile in our game, underlay and overlay. Underlay is the groupd, overlay is everything on the ground. Now, say you wanted to have a burning candle stick. You would first put down a floor tile, then an overlay tile of a candlestick, then a second overlay tile that was animated of a burning small flame over all of that. Tiles are 27*27, screen is 640 X 480 with a bit loeft over on all four sides.

Good luck and thanks!
ou're damed if you, well, let's just say your screwed not matter what you do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)