Path: chuka.playstation.co.uk!news From: "John \( QuietBloke \)" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Daft Question [long] Date: Wed, 22 Aug 2001 23:54:59 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 52 Message-ID: <9m1d9c$b2i7@www.netyaroze-europe.com> References: <9loc6a$p3k2@www.netyaroze-europe.com> <9loeu8$p3k3@www.netyaroze-europe.com> <01c1297e$8cb6e8a0$LocalHost@pal-s-omnibook> <9lrqqf$3j63@www.netyaroze-europe.com> <01c129ca$a5a6f700$d81fe4d5@pal-s-omnibook> NNTP-Posting-Host: host213-122-114-236.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Hi Pal, Sorry for the slow response... I havent had time to implement your code yet. I took a look at what your doing and it looks like a good solution. Its not actually what I had planned on trying but your method will probably be a little quicker. The only change I am going to have to do is that as I am trying to find the angle between a bug and its target ( whatever it may be ) the distance may be quite large.. ie the bug on the left of the screen and the target on the right. I dont fancy having a table of 320x320 so what I am going to have to do is check whether both my x and y fit within the table.. Im not really THAT bothered about the accuracy so a small table of 33x33 will do me fine and Im going to keep right shifting both x and y until they both fit. In fact as I know the table needs a values -15 thru 15 ie 4 bits ( and a sign) and I know my value wont exceed 9 bits I might just do it with multiple if tests.. so if bit 8 is set shift right by 5 elseif bit 7 set shift 4 etc. Of course Id need to store, remove and restore the sign while I do this. Anyone any idea what will be faster ?.. using lots of if's or just a loop checking if either x or y value & 0xffe0 true then shift both right by 1 ? I guess it kind of depends on how the R3000 works. I know it has a 4K cache so a loop would be good but what about the actual instruction execution ?.. does it pipline instructions ?.. if so does it cache the last n number of JMP's and try to predict ? or just clear out the pipeline and start from scratch ?. sheesh.. I really have no idea. Is any of this relavent ?.. or am I talking complete twadlle.. I dunno. And what about the famous D cache that Ive never made use of ?.. If Im gonna access the table a LOT would it be prudent to try and squeeze it into there ?.. if not.. then what exactly should I be using it for ? Of course a simple game like mine probably wont mind about this sort of small inefficiencies but it may be needed if I decided I wanted all my bugs to follow each other or the player and I end up with 30-40 bugs calculating new directions each frame. My head hurts now ! LOL Does anyone else have a better idea on how I would solve my problem ?.. does anyone have any idea what Im been pratlling on about ?.. has anyone even read this far ? So many questions... it just goes to show how little I know. Ahh well.. its keeps me off the streets I guess .. come to think of it... it also keeps me awake far too often too. Cheers John ( QuietBloke )