Results 1 to 20 of 20

Thread: Tiling

  1. #1

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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...
    To understand recursion, one must first understand the concept of recursion.

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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

  3. #3
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    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.
    Harry.

    "From one thing, know ten thousand things."

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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

  5. #5

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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?
    To understand recursion, one must first understand the concept of recursion.

  6. #6
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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

  7. #7

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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?
    To understand recursion, one must first understand the concept of recursion.

  8. #8

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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.
    To understand recursion, one must first understand the concept of recursion.

  9. #9
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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,...)

  10. #10

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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 ;)
    To understand recursion, one must first understand the concept of recursion.

  11. #11
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    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
    Designer/Programmer of the Comtech Operating System(CTOS)

  12. #12
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    *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

  13. #13
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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!!!
    Sanity is a full time job

    Puh das war harter Stoff!

  14. #14
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181

    Question

    One little question:
    are frames bad to the memory? what can I use as container instead?
    Sanity is a full time job

    Puh das war harter Stoff!

  15. #15
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    I use 2 lines instead.. well, not as container, but as frames

  16. #16

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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..
    To understand recursion, one must first understand the concept of recursion.

  17. #17
    New Member
    Join Date
    Oct 2000
    Posts
    5

    >:D

    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

  18. #18
    Member
    Join Date
    Jun 2000
    Location
    UK
    Posts
    49
    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.
    Dave.

  19. #19

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185
    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
    To understand recursion, one must first understand the concept of recursion.

  20. #20
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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
    Sanity is a full time job

    Puh das war harter Stoff!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width