Thomas; -Just a quickie for now;

## Advertising

How are you working out which direction you'd like to have Mara travel in? I'm assuming you're deciding based on a degree and then working out a vector from that? How are you creating your vector from your angle? (this might be the issue) I.E. if you're supposed to be moving at 1 unit, then the proper vector length if you're moving at a 45 degree angle, should be something like 0.7174, 0.7174 or some such. :) It shouldn't be 1.0, 1.0. If it's not less than 1 on each axis, then you'll need to normalize your vector using the Pythagorus Theorem to get it to a length of 1 unit. Hope this makes sense and talk soon!… Smiles, Cara :) On Dec 9, 2010, at 3:00 PM, Thomas Ward wrote: Hi Cara, Hmmm...That makes sense. That also seams to be the problem. Mara's rate is 1 unit per frame and the walls are 1 unit thick. Now, if I walk at them head on I'll smack face first into the wall, door, whatever. If I take them at an angle say 15 degrees I'll walk right through them. On 12/9/10, Cara Quinn <caraqu...@draconisentertainment.com> wrote: > HI Thomas since you said that Mara passes through walls sometimes when > you're at just the right angle, I'm betting that: > > 1. your walls are very close to the same thickness to Mara's move rate. (the > distance she usually moves in a frame) > > 2. that it's easier or more likely that she will walk through a wall the > closer you get to walking at a 45 degree angle in regard to your X and Y > axes. > > If the above is true, then I think I know the solution, as in my last note > about normalizing and magnifying. > > If you want to post your code, I'd sure be up for taking a look at it, and I > can post mine here as well, if you'd like. -Perhaps peeps might like to see > this in practice so to speak?… > > -Just as a quick explanation in 2D, if you have a vector that's 5 units long > and goes straight along the X axis as in 5.0, 0.0 and you try to create a > vector five units long on a forty five degree angle simply by defining it as > 5.0, 5.0 you're actually making a vector which is longer than five units. > > I.E. since you're essentially mapping curves with a square coordinate > system, you're actually covering more distance on a diagonal then on one of > the axes. If you could turn your 5.0, 5.0 vector so it traveled straight > along your X axis, you'd find that it actually went well beyond 5.0, 0.0. > > If you think of squares on a piece of graph paper; if you draw a line along > the edge of a square, and then draw a line from one corner of the square to > the other, and then measure the line, you'd see that the corner to corner > line is longer than the other one. > > This is what's happening inside the computer. We're just working with graph > paper on a very large scale! :) so there are a couple of processes we can do > to properly measure the vector so that it's always the same length > regardless of which direction it's traveling in. Does this make sense? > > There's no need to calculate in advance of where any entity will be at any > given time. This is the work of the detection routine to let you know what > gets touched where, rather than you needing to try to guess it ahead of > time. Use small game units, and real rates of travel, realistically sized > entities and features, and the detection routines should work fine. > > Smiles, > > Cara :) --- Gamers mailing list __ Gamers@audyssey.org If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/gam...@audyssey.org. If you have any questions or concerns regarding the management of the list, please send E-mail to gamers-ow...@audyssey.org. --- Gamers mailing list __ Gamers@audyssey.org If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/gam...@audyssey.org. If you have any questions or concerns regarding the management of the list, please send E-mail to gamers-ow...@audyssey.org.