Path: chuka.playstation.co.uk!news From: Andrew Partington Newsgroups: scee.yaroze.freetalk.english Subject: Re: negative scrolling on homebrew map routine - need help!! Date: Mon, 19 Mar 2001 17:22:24 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 76 Message-ID: <3AB6404F.65C9AF1C@harbinger.com> References: <3AAF7BB2.B427AED3@harbinger.com> <98o38v$ij81@www.netyaroze-europe.com> <98p3qp$rms2@www.netyaroze-europe.com> <98t840$6f5@www.netyaroze-europe.com> <99057g$3ok7@www.netyaroze-europe.com> NNTP-Posting-Host: manuk72.harbinger.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en Hi all! Firstly, thanks to all for the help you guys have given me! I *think* i've got it scrolling smoothly in all directions now, will post the latest build for everyone to look at when I get home... For those interested, the fix turned out to be (as indicated by Jon and Martin): offsetX = background->scrollX / background->blockSizeX; while(offsetX < 0) //Had to change the if to a while to cope with when things went massively negative! { offsetX += background->backgroundSizeX; } offset %= background->backgroundSizeX; [similar for Y offset] However, (using a GsBG map for the nebula graphics, and with my foreground map being drawn with 32*32 16-bit/pixel blocks to fit in the texture cache) the value returned by VSync(0) seems a bit high - it almost uses all the time available when there is a screen full of blocks to be displayed (and especially when being zoomed/rotated - VSync hovers between around 60 - >200 depending on where you are in the map). I have moved as many of the multiplications and divisions outside the map drawing routine as I can, and I am using optimisation level 4 (using CodeWarrior BTW), but although it has helped a little, there doesn't seem to be as much speed increase as I thought. (I am currently drawing around 264 blocks in total). A maximum VSync of around 90-100 seems reasonably acceptable for this sort of thing though, after all we have all seen things on PSOne that would probably take more time than drawing around 300 sprites and still run at 50FPS (well, smoothly at least) - then again, those guys are better coders than me :) I am thinking about moving to a VSyncCallback, that will probably give me a bit more time to play with, but i'm not convinced that'll give me the speed increase that I am after (I want to put in some Defender-style pixelshatter routines and have potentially loads of them on the screen at once). I don't really want to drop my screen resolution either (currently 320*256). Surprisingly, eliminating the mod (to test the speed difference) didn't seem to have much effect either (apart from things were then allowed to go out of range)! [surprising, because I was sure that was one reason why it was slow - a divide per block would be needed to get the remainder :( ]. Can anyone else suggest anything I might be able to do? (most sprites are now 32*32 for faster texture cache lookups, most are 8bpp but some are 16bpp) Derek da Silva wrote: > > I think it looks pretty flash. > > Yep - nice demo. So, what's the game going to be about? Hehe, cheers! The nebula background was from GIMP by the way (not some strange bloke in a leather suit and mask, but the quality Linux/UNIX image manipulation tool!) - everything else was by me... Well, I have a concept of sorts brewing - a kind of a cross between Defender, Solar Jetman on the NES and Super Metroid... I've not got a story together yet (just a few elements lurking in my mind), but I want it to be fairly action-packed (with a VSync of around 200? Hah!!) with a bit of exploration/puzzle solving thrown in for good measure. I want to be able to pick stuff up with the ship (more Solar Jetman/Thrust influences), and have the character swing about on a grappling hook (Super Castlevania IV/Metroid influences!) for certain bits of the game... nothing really original so far! Thanks everyone - hopefully I can turn this collection of routines into something like a game!! Andy