Recommended Posts

whitch one would be better for a game with some basic maps that you have to load that have fairly varying diffrences in each one
i have tried to make a tile map class at least 3 times now and have failed horribly (end up ripping my hair out) because there are alot of long and tedious arrays
then it hit me. it would be easyer to just make a map in the editor save it as a bitmap then underlay a black and white image for collision detection
or would it? i know the first part would be easyer (saving the bitmaps) but ive never worked with the second part (making a black\white underlay) and i just want to know whats involved
thanks alot [smile]

0

Share this post

Link to post

Share on other sites

The black/white underlay would essentially be another bitmap [although it would be a 1 bit map rather than 32 bits, or whatever color depth the actual map is]. So doing collision detection will involve parsing through the entire bitmap and as the scene changes you'll get to edit the bitmap directly to change what areas are "solid".

The long and the short of it is that you'll be dealing with lengthy arrays either way you handle it. Personally, I can't stand dealing with arrays after using an object oriented replacement like the STL's vector [though I use my own linked list class because I'm stubborn].

0

Share this post

Link to post

Share on other sites

Telastyn is right, I'm just I don't think like him, so I'll state it my way. XD

You basically have the same thing, either an array of black & white 1 bit pixels or an array of tiles with a bool variable(pass or not pass).~~However, a map like the one you're talking about is a popular way of creating maps(exp. single screen games). The advantage is a unique map for every scene. The disadvantage is that it maps will take a hell of a lot longer to create, since every scene will require a brand new giant image. A large map images will also take a lot more HD space than a tiled map, which is important if your game is going to be download-able.

Creating the underlay black & white image shouldn't be too difficult, since you can put it in a new layer and edit it until it covers everything that is inpassable.

0

Share this post

Link to post

Share on other sites

ok (sorry it took a while to get back to you guys i was asleep) any way from what i gathered hear they both need arrays (but it also seems one needs less. the black and white one needs a pixle array but a tile map needs a tile array and an array of images it also needs to flip through those tiles and draw them indavidualy). would it be possible to do somthing that uses more then one bit say 8 bit or would that hog too much memory per map? my thoughts are that black and white is fine but if i want to identify seprate surfaces like a green area for grass and a brown area for dirt, black would still be impassible and white would be under passable (you go under it), everything else would be normal but would have varying atributes based on the coulor.

it basicly returns the direction you cannto move and dierection is a simple typedef const so i could return ints instead i just find words better ;) as for the rest of the stuff Get_RGB gets the RGB values for the pixel entered at getpixel whitch takes an image and 2 cordaninths. the number i added to the initial top right of the image (R_Player) corrosponds to were the feet are located in the image.

dont know if any one cares but im proud of it (strange as it may sound) because ive been trying to get some kind of map collision set up and i finally did it thanks to every one who helped me figure this stuff out (especally the anonomus poster who helped my figure out how to get the RGB values of a single pixel within a bit amp)

Share this post

Link to post

Share on other sites

Ok, deleted a long post there cus it got too long winded. My first comment is to not use large bitmaps as a tilemap. A tilemap is not that difficult to handle and is much more flexible in the end. I have used both methods before and if I were to remake the one I used large bitmaps for (starfields for space invaders/galaga type game) I would use a randomly generated tilemap instead. I have the code for these somewhere on here... if you want to take a look, e-mail me and I will be more than happy to send them to you. They both use DirectDraw but I don't think that really matters as they were both more proof of concept tpye programs than anything else.

0

Share this post

Link to post

Share on other sites

Original post by raptorstrikeok (sorry it took a while to get back to you guys i was asleep) any way from what i gathered hear they both need arrays (but it also seems one needs less. the black and white one needs a pixle array but a tile map needs a tile array and an array of images it also needs to flip through those tiles and draw them indavidualy). would it be possible to do somthing that uses more then one bit say 8 bit or would that hog too much memory per map? my thoughts are that black and white is fine but if i want to identify seprate surfaces like a green area for grass and a brown area for dirt, black would still be impassible and white would be under passable (you go under it), everything else would be normal but would have varying atributes based on the coulor.

Yes, of course you could use more bits if you need more information. 1 byte per pixel, assuming 1600x1200 is... what? 2 megs?

Share this post

Link to post

Share on other sites

dang well this sucks i was glad to get a underlay map working and now i get all these people saying DOH! well ill have to decide if im switching i dont think that it would be THAT hard but this just seems more elgant and presise it is also easyer to add details without being confined to a set of tiles that are a set way, whatever though thanks alot for you guys imput [grin]

edit also i dont need EVERY pixel in the array. as you can see from the above mentioned code i just test a few pixels by my charictures feet

edit2: what do you think is the exceptable amount of memory required for an RPG?