View Single Post
Old 07-04-2012, 09:59 AM   #45
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: Can MUDs implement range/distance?

Since we've opened this conversation again:

Firstly, swampdog, I so wish wayfar1444 was more blind-friendly--I'd come offer to do it, but I just started coding over on cotn, and probably wouldn't have the time.

KaVir, the square of a negative is always a positive; the addition of two positives is always positive; the Pythagorean theorem can never result in the square root of a negative number--at least, not if done correctly.

As for the abstraction of arrows/bullets. No mud is going to have an update time fast enough for the player to notice whether or not you're faking the math; in most cases, even with such an update time, it's not going to show. Much easier to fake it. Given a coordinate and a vector, it's easy enough to determine if someone/something is in a certain range and on that heading:

given coordinate (x,y), and vector (xh, yh), we've got enough to draw an imaginary right triangle, so you can do all sorts of useful things. I can show the math, but it's probably way easier to get it off wikipedia; I've never done it in coding, so mine might be slightly wrong. In short, though, you've got an angle for player output and a slope, and:
y=mx+b. If you have m and some point, the point is on the line if that equasion works for that point. There you go, faked arrow trajectory.

And just an idea I've been toying with: empire mud clone. All the cities etc are rooms, in fact all the locales are, but when you go into combat, you go to a separate battlefield with your party and the enemies--think console rpgs here--with targettable features at the four edges, such as bridges, that let you exit, hazards, and of corse targettable enemies. Basically, godwars2 and empire mud. My point being, there's no reason you can't mix both; exploration, at least in my opinion, is much more engaging when you have all the complex text-adventure-like things rooms allow, and combat is more engaging when you cclone KaVir. Heh, I'm not too sure why no one has yet.
camlorn is offline   Reply With Quote