Questions about tile graphics and other stuff
I want to write an RPG although I am fairly new to graphics programming. (I''ve been programming for a long time but I could never get graphics with Turbo C++. I just downloaded djgpp and allegro. I also used to use graphics in BASIC.) I want to use tile-based graphics, although I''d like to know of any alternatives. I was going to use isometric tiles, but I would like some advice as to whether this is a good idea or not.
What is the best way to store a map? I am planning on using an array of linked lists (or a linked list of linked lists, although I generally mess that up.) I want to be able to use tiles of different sizes. (So my trees will be larger than my character(s))
What resolution/tile size would work best? (I''d like to make this program as cross-platform as possible) No windows-specific stuff, so it is basically a DOS game. Can I run a program compiled in djgpp on other systems (such as Linux?)
Any help or advice would be appreciated. Thank you for reading.
hometown.aol.com/forneiq/index.htm -I might have information on my site about this project after it gets off the ground.
Several billion trillion tons of superhot exploding hydrogen nuclei rose slowly above the horizon and managed to look small, cold and slightly damp.-The Hitchhiker's Guide to the Galaxy by Douglas Adams
Regarding your cross-platform question: You can''t run a DJGPP compiled program on other systems (except with a DOS emulator, I suppose), but you can take your DJGPP+Allegro code to Linux (and other platforms that Allegro supports), and compile it just fine without having to change a single line of code. Allegro is super-ultra-portable.
Martee
Magnum Games
The Demon - from Realm of Arcanum
Martee
Magnum Games
The Demon - from Realm of Arcanum
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
That''s exactly what I wanted to know regarding that question.
Thank you
Thank you
Several billion trillion tons of superhot exploding hydrogen nuclei rose slowly above the horizon and managed to look small, cold and slightly damp.-The Hitchhiker's Guide to the Galaxy by Douglas Adams
For tile-based games I think 640x480x16 works well. As for storing map files, the question is too general. It totally depends on your implementation of the maps, i.e. how many layers do they have? Are items saved on the maps or elsewhere? Do maps have scripts linked to them? etc. Even if it were a specific question, I don''t know how I''d answer it... just take all the relevant information and shove it in a file!
-Ironblayde
Aeon Software
-Ironblayde
Aeon Software
"Your superior intellect is no match for our puny weapons!"
Basically, what I need to know is:
How to get tile graphics from my map to the video memory?
Especially how to make tiles scroll.
Wouldn''t it be too slow to copy all the tiles to the screen every frame, even with page-flipping?
I thought maybe I should copy all the tiles to a single bitmap and then copy that to the screen to scroll. Would that be any faster?
How to get tile graphics from my map to the video memory?
Especially how to make tiles scroll.
Wouldn''t it be too slow to copy all the tiles to the screen every frame, even with page-flipping?
I thought maybe I should copy all the tiles to a single bitmap and then copy that to the screen to scroll. Would that be any faster?
Several billion trillion tons of superhot exploding hydrogen nuclei rose slowly above the horizon and managed to look small, cold and slightly damp.-The Hitchhiker's Guide to the Galaxy by Douglas Adams
It depends on your video card weather drawing all the tiles to screen each frame is to slow, I have a voodoo3 card and it has 16megs of video ram, and for my game, i reblit everything every frame and even at 1280x1024x16bit color, it still gets 75 fps, which is the refresh rate of my monitor, and I probably could get an even faster fps if had a better monitor.
But the same game running on an old computer with only a 1meg or 2meg video card gets only around 7 fps. But no one now a days has such a crappy computer, the standard is pretty much 8 megs of video ram and everyone usually has a 3D card too, so doing a tile blit for every tile every frame can be fine today.
Possibility
But the same game running on an old computer with only a 1meg or 2meg video card gets only around 7 fps. But no one now a days has such a crappy computer, the standard is pretty much 8 megs of video ram and everyone usually has a 3D card too, so doing a tile blit for every tile every frame can be fine today.
Possibility
Like I said before it is important for this to run on as many platforms as possible, even older computers. I''m not trying to impress anyone with my graphics, I just need to get the tiles on the screen fast enough to look good.
How many pages will SVGA support in 800x600?
What if I only need 256 colors (thats the plan)?
How do I tell the SVGA I''m only using 256 colors (in Allegro)?
How in the world do 3D games redraw every pixel every frame?
After all, I can play Doom without an accelerator.
???
I don''t know, maybe I''m going about this all wrong.
How many pages will SVGA support in 800x600?
What if I only need 256 colors (thats the plan)?
How do I tell the SVGA I''m only using 256 colors (in Allegro)?
How in the world do 3D games redraw every pixel every frame?
After all, I can play Doom without an accelerator.
???
I don''t know, maybe I''m going about this all wrong.
Several billion trillion tons of superhot exploding hydrogen nuclei rose slowly above the horizon and managed to look small, cold and slightly damp.-The Hitchhiker's Guide to the Galaxy by Douglas Adams
October 04, 2000 08:10 PM
I''m making a side scroller for the game boy.
Its very simple to make a good side scrolling map,
it''ll be a little more difficult to scroll in all directions
but not too bad.
The game boy has a resolution of 160x144, and tiles are 8x8.
I recommend using a power of 2 for tile width. It makes it easy
to get from an x,y position to tile number by using just shifts (this is important on the GameBoy, probably not so on a computer because it actually has divide instructions).
Anyways I have an array of tile numbers. The video memory can hold 32x32 tiles, and the screen has 20x18 tiles. So if I scroll 8 pixels to the right I load in the next column of 18 tiles. (This is loaded into the next column off the screen, so the screen is always correct.) And thats it. Just need to keep a pointer into the array, and what x position the screen is at to know where in video memory to write column numbers to. (In the game boy, you only need to change tile numbers because each tile has a number that points to tile data that it should draw. On a computer you''ll actually have to write the tile data into the correct spot in vram?)
Its very simple to make a good side scrolling map,
it''ll be a little more difficult to scroll in all directions
but not too bad.
The game boy has a resolution of 160x144, and tiles are 8x8.
I recommend using a power of 2 for tile width. It makes it easy
to get from an x,y position to tile number by using just shifts (this is important on the GameBoy, probably not so on a computer because it actually has divide instructions).
Anyways I have an array of tile numbers. The video memory can hold 32x32 tiles, and the screen has 20x18 tiles. So if I scroll 8 pixels to the right I load in the next column of 18 tiles. (This is loaded into the next column off the screen, so the screen is always correct.) And thats it. Just need to keep a pointer into the array, and what x position the screen is at to know where in video memory to write column numbers to. (In the game boy, you only need to change tile numbers because each tile has a number that points to tile data that it should draw. On a computer you''ll actually have to write the tile data into the correct spot in vram?)
If you''re writing your game for DOS, then it would probably be a good idea to save a copy of your background in memory, and copy the required section to vram each frame. This is what I did for a couple of my DOS games. And yes, you do need to rearrange objects and redraw everything each frame (unless you use dirty rectangles, but that seems to be becoming obsolete...). In fact, I think you''ll find that your computer is more than capable of redrawing your entire screen each frame, if you use Allegro or DirectX. I wouldn''t worry about the game speed if you use either of these APIs; it''ll be as fast as you need. And if it''s not, then take out a few things
If you want to see how many pages your video card can handle, take 800 x 600 = 480000 bytes per page (for 256 cols), so on a 1 MB video card you can have 2 pages. But I wouldn''t use page flipping; a linear frame buffer is much, much faster. And on a side note, Doom is not a 3D game. Neither is Duke3D, as the name suggests. They''re both fake - sometimes called 2.5D
Oh, and hi Martee Good luck for Arcanum!
-----------
C++ is the language of the not-so-ancients.
Learn to speak it well.
BeamMeUp
If you want to see how many pages your video card can handle, take 800 x 600 = 480000 bytes per page (for 256 cols), so on a 1 MB video card you can have 2 pages. But I wouldn''t use page flipping; a linear frame buffer is much, much faster. And on a side note, Doom is not a 3D game. Neither is Duke3D, as the name suggests. They''re both fake - sometimes called 2.5D
Oh, and hi Martee Good luck for Arcanum!
-----------
C++ is the language of the not-so-ancients.
Learn to speak it well.
BeamMeUp
-----------C++ is the language of the not-so-ancients.Learn to speak it well.BeamMeUp
Thanks BeamMeUp.
I''m starting to get a really good idea of how this is going to work. (Very different from my original plan, but that''s a good thing, right? It means I''m learning.) Okay, so I take my background tiles and I copy them into one large background bitmap. Then, when I want to scroll, I just copy the appropriate section of that bitmap onto the screen. Then, I can draw all the other sprites over it with layers, etc.
I created a little test program for myself, but it had major flicker problems. To fix the flicker, I put page-flipping back in. It still has some flicker, but it is less obvious.
BeamMeUp, you say not to use page-flipping. How do I control flicker then?
I can assume that everyone has 1MB SVGA, right? (I''m serious about this cross-platform thing)
I''m starting to get a really good idea of how this is going to work. (Very different from my original plan, but that''s a good thing, right? It means I''m learning.) Okay, so I take my background tiles and I copy them into one large background bitmap. Then, when I want to scroll, I just copy the appropriate section of that bitmap onto the screen. Then, I can draw all the other sprites over it with layers, etc.
I created a little test program for myself, but it had major flicker problems. To fix the flicker, I put page-flipping back in. It still has some flicker, but it is less obvious.
BeamMeUp, you say not to use page-flipping. How do I control flicker then?
I can assume that everyone has 1MB SVGA, right? (I''m serious about this cross-platform thing)
Several billion trillion tons of superhot exploding hydrogen nuclei rose slowly above the horizon and managed to look small, cold and slightly damp.-The Hitchhiker's Guide to the Galaxy by Douglas Adams
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement