maxhamner |
Posted - Nov 04 2004 : 11:11:29 AM Working on a project and thought I'd post this for feedback...
I'm writing a 2D tile based RPG in visual basic, using DX7. The shell of the engine is there, and the editor is comming along nicely (the editor will allow editing of map, items, npcs, coversations, triggers, etc.
Although a 2d tile system, I have 5 layers of tiles, overlayed and offset (and of coruse smooth scrolling), to get a psuedo-isometric view. The games supports all common resolutions (640x480, 800x600, 1024x768, 1280x1024, and 1600x1200), allowing you to see a larger area of the map if you have the hardware to support it.
I'm currently getting about 60FPS at 1024x768 x 32biit on a P500 with an ATI RADEON 7500 (slows to about 40fps when there is a lot of water on the screen as all water tiles animate). I use an integer per tile - allowing for huge diversity in tiles, although I'm creating it around two sets of 2048 tiles (one for ground (level 0), one for buildings/trees/objects(level 1-4)), which does not include items. (yes, I'm using vblank on page flip). My roomates computer (1.7G? Radeon 9xxx?) gets about 110 FPS at 1024x768..
Here are a few screen shots (frame rate a little low, I have a zillion things open on the desktop and ran it from the IDE to grab these), your character passes 'under' things like trees and wood structures, but buildings (which are multi-floored) will hide the levels 'above' you so you can see yourself when inside.
Seems like decent performance to me, any comments?
Image Insert:
Image Insert:
Image Insert:
|
Zarneth |
Posted - Nov 08 2004 : 11:07:07 PM quote: About the ATI vs nVidea: It really doesn't matter.
*laughs* don't mind me. I have a tendancvy to do the complete opposit to everyone else. And with the fx/r9000 series everyone was all going for the raedons. So naturally I had to support Nvidia. Not to mention how god damn fathefull my old gforce 2mx was while I struggled to save up for a new card.
Same reason why I'm so obsessed with VB, besides being damn easy to use and gettig a bit of a sting when I was forced to do a java corse, everyone else seems to be agaisnt VB. :(
You have a point with the powersupply. That $35AU case was listed to have a 300w. We only intended it for an old server we were setting up. Didnt' even know what it looked like. thoguh it was a nice supprise to find a 450w in there instead. Generic power supplies arn't really all that bad as long as you unplug your pc when there's a lightning storm. Though you gotta be carefull not to short 'em out. First night moving into a new house, 2am in the morning, everyone else was assleep and I decided to rearrange my case lights. Only took one brief touch and my power supply was dead..... So now I've got a decient qualty power supply with 4 power out thingies on the back. >:) |
Sr. Guapo |
Posted - Nov 08 2004 : 10:48:49 PM I realize a case can be had for around $20 (hell, you don't even need a case ), but you definately want a reliable PSU, which can cost around $50 (though I guess it may be less for only a 300 Watt or so...).
About the ATI vs nVidea: It really doesn't matter. I suggested the 9600 because it was cheap and still fairly competant in todays games, that and I don't know too much about midrange nVideas . For brand new video cards, though, nVidea pwns (*Drool* dual 6600 GTs in SLI). |
Zarneth |
Posted - Nov 07 2004 : 11:58:44 PM quote: Splitting the map itself into smaller chunks would be trivial. However managing the chunks real-time in game, given that my goal is to give each and every NPC a full daily schedule with minor variations and possibly weekend variations begins to get complicated if the npc is supposed to show up from a part of the map that isn't loaded.
Assuming all collidable objects are on the same layer, keep that layer in a fully loaded seperate array. Then the others can be devided up. Then just background load the nearby sections ready for when you cross into them. It's more complicated. but if it works it'll definitly reduce the memory usage.
here's how I'd considder doing it. The layer with the collidable objects is of corse, seperate from the other layers and is alwayse fully loaded. then you have 9 arrays, each which can contain a section of the map, in a 3 by 3 grid. depending on how you do it you shouldn't need a section to be bigger than the what can fit on one screen (in the largest resolutino thoguh). it background loads/moves cashes the surrounging sections you're not currently on. Have it so the sides of the grid wrap around too. So you don't have to keep moving the section your'e on to the center of the grid. Dunno if that'll make any sense, or if it's the best way though. Alwayse helps to look at all the possibilitys thoguh.
quote: Why would you want a P4? I'd go for an AMD... They are cheaper than the Pentiums.
I definitly aggree with AMD. Much better choice. But a Radeon? I dont' care what anyone sais ATI is EVIL!!!! *huggles his overclocked gforce FX5700LE* And $75 gor a case/psu? you've got to be kidding me? My housemate picked one up the other day for $35.... and that's in australian dollars. Admittedly all the other cases here were expensive but but not all were that expensive. o.O |
Sr. Guapo |
Posted - Nov 07 2004 : 10:45:00 PM quote: Originally posted by Eric Coleman For me, upgrading the video card means upgrading the mother board and that means upgrading the case and the cpu. And possibly the memory as well, there are so many different kinds I have no idea if my current memory would work with newer pentium 4 processors. Don't they require that expensive "Rambus" ram?
Why would you want a P4? I'd go for an AMD... They are cheaper than the Pentiums. A mobo ($60), AMD CPU ($100), 512 MB DDR RAM ($100) , and a Radeon 9600 ($150) can be very affordable... Add a cheapo Case/PSU ($75), A new HD (if neccesary, $60), and CD burner ($25), and you have a pretty decent system (better than mine at least).
BTW - The RD Ram you speak of is worthless. It is the equivalent to a betamax player, it was all the buzz for about a week, then better technology came out and is now obsolete and more or less unsupported. Just go for a good ol' 512 MB stick of DDR 3200 (400 MHz), it is pretty darn cheap nowadays. |
Eric Coleman |
Posted - Nov 07 2004 : 8:25:33 PM My card is limited not only by memory but by processing power. 1600x1200 resoultion is nice, but my card just barely handles 640x480 for games :-)
I have a Compaq Deskpro, and I should really take a picture of the inside of the computer because it's just difficult to explain the video card, but it's in a special slot in the computer, and newer video cards simply won't fit in my PC. I used to have a voodoo3 but it died and I had to break off a small corner of the video card to make it fit in this computer.
For me, upgrading the video card means upgrading the mother board and that means upgrading the case and the cpu. And possibly the memory as well, there are so many different kinds I have no idea if my current memory would work with newer pentium 4 processors. Don't they require that expensive "Rambus" ram?
Overall my computer works fine, the only limitation is that I can't play modern games, but even if I had a better video card I probably still wouldn't be able to afford those games. |
Lachlan87 |
Posted - Nov 07 2004 : 6:03:49 PM Hmm. You could make your textures in 16bit and make it up to user preference what DX is initialized in. That should cut down on the video memory requirements.
Your reasons for not splitting up the map sound logical. Like you said keeping your system requirements that low is probably not that big of an issue. I think that keeping the Video ram requirements low is more important. I can see requiring a 32 meg card as being acceptable, but I think you would find requiring a 64MB card to be pretty limiting.
It seems like you have it thought out pretty well. It will be interesting to see how your game progresses.
|
maxhamner |
Posted - Nov 07 2004 : 5:23:41 PM BTW, I don't mind answering those kinds of questions, they are actually what I'm looking for!
Sometimes I have thought it out and have an answer. Sometimes I dismissed something that I should have thought about more... (i.e. I'm more thoroughly re-examining both my map handling and the bit depth now)... |
maxhamner |
Posted - Nov 07 2004 : 5:21:37 PM Well, lets see, I have 2048 ground tiles in a bitmapof 1024 x 2048 x 32bpp(4bytes) = 8megs, another bitmap the same size for the objects (buildings, trees, etc), plus images for the player, items (stuff you can pick up etc), npcs, the status area, map view, etc... and I used a per-layer prebuffer system for updating tiles to get the best refresh at full screen so that uses more memory.... moving any of that stuff from video RAM to system RAM has a terrible impact on the bitblt performance.
As mentioned I originally was going for 16bpp, but noticed that my on my fairly good ATI card DX7 fails to init on 16bpp in several modes.... odd, but troubling, so I decided to go to 32bpp.
Splitting the map itself into smaller chunks would be trivial. However managing the chunks real-time in game, given that my goal is to give each and every NPC a full daily schedule with minor variations and possibly weekend variations begins to get complicated if the npc is supposed to show up from a part of the map that isn't loaded.
Additionally I would only split the map up if I can 'cache' chunks as you move so the entire map remains completely seamless... (games where you hit a 'border' and have to wait for a load really irk me). So even if I keep the NPCs all loaded (even if their 'map chunk' isn't loaded) causes issues because they can't path-find to where they are going.... there were some additional issues as well and it added up to making me feel it wasn't worth it, especially after looking at the requirements of a lot of the higher end shareware/freeware games comming out now. WIth one big map I can have triggers that modify remote locations on the map, etc without convoluted cache processing...
And by one big map I basically mean 'per continent' - there will probably be 3 maps total, but the transition between continients (boat ride, whatever) will make a transitional pause more acceptable. |
Lachlan87 |
Posted - Nov 07 2004 : 2:09:40 PM Actually. . . His card could hold one fairly big texure with that much space:
32 bits * 1 600 * 1 200 = 7.32421875 megabytes.
I love google calculator. :)
BTW, why did you abort your attempts to split the map into smaller sections? It doesn't seem like it should be that hard to do. |
maxhamner |
Posted - Nov 07 2004 : 12:04:36 PM 8 megs? that's like, what? 1 bit per pixel at 320x200? LOL! J/k! (ducks)
If you had a super bad-ass computer with that 8 meg card in it, you might be able to play...
The direct draw surfaces will get bumped to system memory rather than the game not running (willl probably add a video mem check and advise the player)... so if your FSB and video interface are top of the line it might still be playable.. ;)
m
|
Zarneth |
Posted - Nov 07 2004 : 10:46:19 AM quote: I guess my crappy 8 MB ATI card wont' be able to play this game.
Dear god you poor thing. Please tell me you're only using that 8meg card becaues your top of the line 3d card reciently died? o.o
Admittedly though you can get some damn good dos games that'll work sweet on that thing. ;D |
Eric Coleman |
Posted - Nov 07 2004 : 07:35:01 AM I guess my crappy 8 MB ATI card wont' be able to play this game. And it looks so cool! |
maxhamner |
Posted - Nov 07 2004 : 01:56:38 AM Yeah, it it is actually 2048 x 2048 x 2 x !5! (there are 4 layers for buildings and trees, plus a layer for 'ground') giving 40 megs.
Level 4 of the map is virtually empty (roofs of tall buildings and tops of tall trees here and there), level 3 only slightly more so, etc. The current map compresses to a few hundred K in winzip without turning on the 'maximize compression' mode.
But having 2048 current tiles, with the ability to add more if needed allows me to make the map so it isn't "blocky" (if you load a different size bitmap as the tile 'source' image in my editor it will automatically resize the arrays with the tile attributes so adding tiles, even a single row, is beyond trivial).
Graphics could probably be dropped from 32bpp to 16bpp, but my video card (an ATI Radeon 7500) won't even initialize directX7 in 16bpp in several video modes. I can drop the color count in the images for distribution without loss of quality and let DX upconvert them at load so they distribute smaller, but the video RAM requirement will be 'up there'
Actually given the size of the game and number of graphics it's going to require a decent computer anyway... My guess is 400/500 Mhz or better, probably 60 -70 megs of RAM, and a decent video card with 32 (64?) megs of RAM. That's extrapolating for the stuff that isn't in yet...
definately not a 'small' game, which means the quality, character development, and 'value' will have to be kept very high. |
Zarneth |
Posted - Nov 07 2004 : 01:32:24 AM 40 megs for the map? Are you sure that's right? Hrmm. 2048x2048x4x2 IS a bit over 33megs. :\ Rather a shame that. Though I guess that's not too bad with the ammount of ram in this day and age, but if you wanted to run it on older computers you'd run into trouble. :( |
maxhamner |
Posted - Nov 07 2004 : 12:06:41 AM This map will be the main map with several towns. A second map will probably contain a large and small island. A third map will be used for dungeons. Each map is 2048x2048x4 levels. They compress very well, but uncompressed a single map requires 40 megs of hard drive space because I use two bytes per tile. I aborted an initial design to break the each maps into 'sub-sections'.
Well, I actually had thought about it after your suggestions, and making the water flow into the channels wouldn't be hard because unlike a flood fill the channels are very limited (i.e. once you fill a tile you move to it's neighbors and you are done with the original tile so you don't have to use a stack to backtrack to the last branch - just allow for X simultaneous 'flows') . Having water 'fade' or 'soak into the gorund' is even easier because the change would be simultaneous across all tiles of the same type, and could be handled at refresh.
I agree on the idea that little details seem to add a LOT to a game. I pondered how I could work it into the game - like having to find a part to fix the sluece gate - but never came up with anything I liked, so thought it would make a good 'fun' detail if I didn't waste time on it. I don't want to burden the game down with too many little things that grow big because there is already so much complexity involved for stuff like the NPC's each having a 'life'....still, you have me considering it.
It will basically be real time combat - with quests that involve puzzles... probably figuring out the order of things in combinations with clues and riddles... still up in the air as it will be affected by how well I am able to impliment the full schedule/life details for NPCs.
Working on a new vb DirectX sound 'manager' module tonight that handles all the multiple sound loading (priorities for determining which buffers are over-written on loads, lockable buffers, easy to impliment callbacks) and makes it transparent to support multiple formats (bit rates, samples sizes, etc). When I get it working I'll post the code for anyone that wants it. |
|
|