Click to See Complete Forum and Search --> : Tiling
DarkMoose
Oct 4th, 2000, 06:03 PM
Hihi everyone. I'm working hard on my tilesets (hard because it's very difficult to draw stuff with close to 0% artistic ability ;P ) Anywayz, I've seen some different tiling methods but I know which one I'm going with. I wanna have a text file with a big block of numbers, each number representing a different tile, like this:
1,1,8,6
0,1,1,3
0,1,1,1
5,1,1,1
Then I need to read just a certain area of that file depending on where the player is located on the map. Like, if there is 4 tiles on the screen at one time and the player is on the bottom left, it would read the 0,5,1, and 1 and BitBlt the proper tiles. This seems like an easy enough method. I'm not sure of how to use Input methods for this thou, cuz I don't know how to make it Input from the spot you want it to...
Fox
Oct 5th, 2000, 12:09 AM
Why not loading the whole map and just draw the visible parts? I didn't yet try to load only partially from files, but as long as your map isn't that big you won't need it :)
HarryW
Oct 5th, 2000, 12:34 AM
Maybe it would be easiest to load the whole thing into a two dimensional array of bytes or integers? I have heard about using one dimensional arrays I think, but I'm not sure why.
Fox
Oct 5th, 2000, 12:48 AM
I use them... well, you can resize them at runtime ;) Ie. in my mario game.. if you suddenly need a bigger map... but well, doesn't really matter.. there are ways to do the same with 2D arrays, I just like the 1D more.. probably coz the screen matrix is also 1D ;)
DarkMoose
Oct 5th, 2000, 02:44 PM
Oooooooh a 2D array, that will work. Good idea, harry, thanx. And as for loading the whole map first - Fox yer saying I can load like, the whole town/castle/area/wutever into my backbuffer and that won't really slow down the program so long as it's not like, the whole game map or something rediculously huge?
Fox
Oct 5th, 2000, 03:13 PM
Exactly.
You'll have a buffer (DC) for each picture as I think, well, once you loaded the tiles your map can be as big as you want without slowing down the computer... (execpting 10000000x100000 or something ;))
Maybe many tiles may fill-up the graphics memory, but you can still use system memory which is fast enough for 2D-games... don't think about this problem until you don't have it ;)
DarkMoose
Oct 5th, 2000, 03:16 PM
I've been keeping my graphics on pictureboxes on another form. Should I switch to DC's and just load the pics from outside of the program?
DarkMoose
Oct 5th, 2000, 03:22 PM
BTW, FOX you forgot STARCRAFT on your Games You Must Have list!! If you weren't so dang smart, I'd kill you right now!! ;) You DO have Secret of Mana thou, wooohoo ;D SoM > Chrono Trigger.
Fox
Oct 6th, 2000, 12:08 AM
Mhm.. don't like Starcraft that much ;)
To your method to store the graphics: DONT USE PICTUREBOXES!!! Look at my website coding->graphical, there's a nice demo how to load a picture directly into the memory... Don't waste your memory with VB-controls! (Timers, Pictures, Images, Frames,...)
DarkMoose
Oct 6th, 2000, 01:58 PM
D'oh! i was afraid you'd say that. storing graphics is confusing/annoying ;) Well I guess i'll get started on all that DC stuff.
What!?!? You can't hate Starcraft!! That's like...ILLEGAL or something...well it SHOULD be ;)
Warmaster199
Oct 6th, 2000, 02:31 PM
I sort of find StarCrap boring too. I'd much rather play a more graphical/interesting game like Earth 2150, Tiberian Sun, or Age of Empires - Rise of Rome(Don't like Age 2 that much, don't know why).
Or what I like even more than playing these games is actually making them :)
Fox
Oct 7th, 2000, 01:23 PM
*hehe*
erm, I said that I don't like it, not that I hate it! Big difference!
However, played it 2 times with friends... it's funny but I like other games better ;)
/\/\isanThr0p
Oct 7th, 2000, 10:15 PM
Hi everybody.
Like always in the last time I give my opinion on the stuff, even if you don't want to have it, cause I'm saing the same again and again. (just like fox)
Pictureboxes are evil. Why do you need all those stuff in your memory? But DC loading sux, because of the code you need! JUST USE DX!!!!!!!!!!!!!!!!!!!!!! It is easier in loading and managing surfaces!
By the way, I always use 2D arrays for my tilegames! And most time I used even byte arrays. 256 tiles are enough for me! (I can change the tilesets, but 256 is the highest number of different tiles at once)
HOW CAN SOMEONE NOT LOVE STARCRAFT. IT'S ONE OF THE BEST PIECES OF PROGRAMMING I HAVE EVER SEEN! LOOK AT THE GRAPHICS OF CC3. IT NEEDS 300Mhz TO WORK, WHILE STARCRAFT WORKS FLUENTLY(hope it's the rigth word) ON MY OLD P75!!!
/\/\isanThr0p
Oct 8th, 2000, 03:28 AM
One little question:
are frames bad to the memory? what can I use as container instead?
Fox
Oct 8th, 2000, 11:14 AM
I use 2 lines instead.. well, not as container, but as frames ;)
DarkMoose
Oct 8th, 2000, 11:20 AM
I have a question about the DC stuff - do I have to create a new DC for every image? or is there a way to store them all on the same one..
N2k
Oct 9th, 2000, 03:04 PM
muahahahah nuttin, I found joo! ;D
Starcraft > All
Too many people don't like Starcraft because they never win :( have you even played on bnet!?
muahahah
dangerousdave
Oct 9th, 2000, 05:46 PM
You can just create one big DC and blit one big bitmap of all the images to that, then take selections off've that big DC to put onto the screen or whatever. Quite easy as well, as long as you have a method of storing the locations of each image within the large bitmap.
I agree with whoever said use DirectX. It is better, but I spose you gotta learn to walk first. Setting up DX is more difficult than Windows API graphics functions but once it is running it is easy to implement.
DarkMoose
Oct 9th, 2000, 07:59 PM
Ya, exactly. I don't wanna get involved with DirectX stuff yet for just that reason. I don't even know what the heck it is. I'll get into it later thou.
N2k go away befoure you annoy everyone on the forum ;)
/\/\isanThr0p
Oct 9th, 2000, 09:32 PM
Don't get to the problem of redoing everything, just because you were to lazy the first time.
just go to http://www.ur.co.nz
look at the voidman tutorial. It is so easy and you can just copy the declaration stuff and than use the power of DX as easy as BitBlt
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.