PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Max Surface Size

Hi,

Its probably staring me right in the face:

What is the maximum size surface that I can create?

Will it be compatible across all devices that gapidraw supports?

What is the delay that I get at the moment with a surface that is 1200 by 960 on application start (jpg format)?

I want to use a large surface of say 6 screens by 4 screens to be a background image that I will just blit the required viewport from as opposed to writing some form of tiling mechanism, and then blit my other surfaces on top. Is this an accepted way to do things or is tiling the prefered method? Why?

What sort of speed hit would I expect. ( the background image will be a jpeg with no more then 256 colours)?


TIA

(PPCstudio if you read this and I'm sure you will then I hope that you're going to be covering tiling etc in your book :) )
One of the parts of my current game required a scrolling landscape. Rather than tiling, I decided to make one big 1000x60 surface, with the first 240 and last 240 identical. Then I just move my source rect across that, when I'm currently displaying RECT(760, 0, 1000, 60), I then go back to RECT(0, 0, 240, 60) for a seemless wrap. This works out rather well.

As for performance, I'm getting a steady 40 FPS on my Casio E-125 doing this. Incidentally, I then have a number of sprites over this, and all of this is blitted to a 400x400 surface, which is then in turn blitted (a 200x200 portion of it) to the screen.

My point is, I'm probably doing a lot more blits than you would be, even granted that your source surface would be bigger than mine, and my Casio has no problems keeping up. When I unbound the framerate, it goes up to between 50-60 and maxes out there, so it's not too shabby.

I'll let those who know more than me speak to the advantages and disadvantages, but my conclusion would be that the method you suggest shouldn't be a performance problem, assuming you don't have massive amounts of action going on over it.
Hmm, you guys like very large surfaces ;) . I was wondering how GapiDraw handels this in Direct X. When I was using Direct X 5 I know that it was not possible to create surfaces larger than the current screen resolution.
What is the maximum size surface that I can create?


Max size should be based on device memory, unless there is an internal limit set by GapiDraw.

Using large surfaces won't cause a speed issue since all you'll be doing as adjusting the RECT coordinates forming the viewport into the surface.

Is this an accepted way to do things or is tiling the prefered method?


It's a perfectly acceptable way of handling a non-repetitive image. By non-repetitive, I mean that if you were to 'rip' the image into tiles, the difference between the combined sizes of the unique tiles and the original surface is negligable. Suppose you had an image of outer space with alot of black area, then tiling would be much more efficient because alot of the image (the black areas) could be reconstructed using a single black tile.

Using a large image wrapped into a cylinder is a common way of creating a parallax background for 1pp viewpoint racing games. If I remember correctly, StarCraft used a huge image to help create the illusion that the terrain was 3D, and used 3D models moving over a heightfield to make that illusion even stronger.

StarFury: Yes, there will be coverage of tiling techniques - standard rectangular (ala Warlords), axonometric, isometric, hex and heightfield axonometric (ala the RaptureEngine).
And here I was, thinking I was being all clever doing a cylindrical wrap! :)

I've never actually heard it put that way, it just seemed to make sense to do it that way.

One of these days I really have to read some game programming articles and stop re-inventing the wheel.
Sorry DillRye I am a numpty and do not know anything about DX :(

Talking of max memory what is considered to much for a game? I know that this will be personal to a user but if a download appears too large will they be put off sampling the wares? The reason I ask is that my latest epic Teddies Revenge is achieving miniscual downloads/sales and I was wondering if it was down to the fact that 2Mb is too large. Can't be my game surely 8O

To be honest I hadn't thought about wrapping the screen but it will suit my current sketchy idea quite nicely.
So you could stack surfaces on top of each other to create a multilayered parallax display?
Yep, just leave some transparent regions as your layers go back in depth and you get a nice parallax effect.

About game size, I can tell you that people complain far more about how much memory is needed to run a game than storage space. Invasion: Trivia has sold next to nothing, and most of the complaints I hear about it is the memory it requires to run.

It's tough to judge what will sell well (at least for me), but 2M doesn't strike me as very much at all. I played Teddies Revenge, and I liked it, but that figure does feel a little high for what the game is. Even still, I don't suspect size is causing you any problems.
If I remember correctly, StarCraft used a huge image to help create the illusion that the terrain was 3D, and used 3D models moving over a heightfield to make that illusion even stronger


Starcraft was isometric tile based, everything was pre rendered and the charicters were sprites. Maybe you were thinking about myth?? Myth used a hieght map but the chars were also sprites...

As for the lack of sales thing, Im thinking people dont want to pay for simple clones when there is freeware. I too have programmed/released some simple clones, but it was more for the experience than anything.

People will pay for a fresh new game idea with kick ass gameplay/features. Heck, if you came up with something revolutionary, I believe they would go to extreme ends to make it work on thier device.

I did like "invasion trivia", I thought it was a very fresh take on trivia games,but I have enough school to deal with and dont want to quiz myself more than I have to :D .
Starcraft was isometric tile based, everything was pre rendered and the charicters were sprites. Maybe you were thinking about myth?? Myth used a hieght map but the chars were also sprites...


Definately not Myth as the terrain was full 3D (note the camera controls). I don't remember if the characters were sprites or not as its been a long time. I may have been thinking of Total Annihilation instead of StarCraft...

...and I was wondering if it was down to the fact that 2Mb is too large.


It really depends on the product. Typically a large ppc distribution is caused by either large amounts of data files, graphics or music (if stored as MP3 or WAV files). You can usually trim down your graphics by saving as 256 color images (just monitor the number of colors used when you dither them down). For music, you will likely want to go with MOD or IT format files - MP3 and WAV format files are simply too big if you have a decent selection of songs. Not much you can do with data files other than packing the data.
Ahh, yeh total annilation sounds right.

Myth used a height map to generate its 3d landscapes(new games like battlefield 1942 do this also), I thought thats what you were talking about.
Nope, what I was referring to was having the flat predrawn terrian and using the heightfield data to change the incline of the 3D units to make it look like they are actually climbing over hills and such. Its just a way of creating the illusion that you have a 3D terrain without actually having the overhead of the thousands upon thousands of polys needed to create one. =)
Dillrye: You should use the Invasion: Trivia question editor and study for your classes with it! I wonder how much better you'd do... :)
The actual game itself is small, it was the tune that upped the anti, didn't seem the same with out it somehow. Its in IMA ADPCM wav format so is quite compressed, still a goog meg though.

I hear what you're saying about something fresh, to be honest I thought that I had added enough of a twist to tempt people, still got a review coming soon :D Not looking to make mega bucks just enough to keep up with the hardware :wink:

I'm trying to do some sort of space epic, if you like, which started with invaders then teddies and each time as I learn to use gapidraw a bit better I up the expectation, hence the next part of the story "Rescue from Outpost X" will have bigger then screen action but with elements from lunar lander/rescue and defender. Hey I will even change to using timers to control the animation (something I learnt in the forum :D ) I know that I'm not totally original :( but these are the kind of games that I grew up with so that is what I draw on.
I thought I'd take a look at the graphics/sounds - managed to shave 400k off! Made the mistake of thinking that if I saved in .png then it would be nicely optimised. Converted as many sounds as possible to the IMA ADPCM format, lower quality but I don't think it detracts from the gameplay. Still know what do in future now.

Have changed Teddies Revenge to a Freeware release, like you say DillRye I can't really compete against freely available emulators and straight clones.
I would rather people are enjoying it then leaving it sitting idle :D Gotta be worth some good PR. Will have to work my damndest to make Outpost X good and hopefully original.
What are you using for sound? I love Hekkus myself, but I'm anxiously awaiting Thomas adding compressed WAV support of any sort (sure, I could do my own GZip, and I will for the current project if Hekkus doesn't support compression by then, but it's easier if I don't have to myself).
I use fmodce, free for non comercial use. I purchased a site wide shareware license for $250 when I first released Invaders. They do a commercial license as well.

Whats GZip?
Sorry, wrong term.. I meant zLib (which is as I recall at the heart of GZip, which is why I got confused). It's a freeware compression library, and it's been ported to WinCE. Works rather well, and it's about the only option for WAVs when your using Hekkus for the time being.
ah zlib I have come across, not used yet though.
zlib is the compression algorithm used inside of Zip files. Basically a zip file is just a bunch of gzipped files in one lump, with additional info like file path, date, time, attributes, etc.

Dan East