View Single Post
Old 07-03-2012, 05:01 AM   #42
KaVir
Legend
 
KaVir's Avatar
 
Join Date: Apr 2002
Name: Richard
Home MUD: God Wars II
Posts: 2,052
KaVir will become famous soon enoughKaVir will become famous soon enough
Re: Can MUDs implement range/distance?

That's not the problem though. The problem is that most muds are room-based, and even if they laid their rooms out on a grid, those rooms would still represent abstract containers that restrict sight, movement and combat. You couldn't simply display everything within hundreds of rooms, the spam would be horrific - you'd need to make some fundamental design changes.

You'd also need to define the dimensions of each room, because a "room" could represent anything from a vast clearing in a forest to a tiny closet in a house. And to calculate the distances between two creatures or objects, you'd also need to track their position within each room.

You need to make sure you don't try to calculate the square root of a negative number. This is my solution:

I wouldn't bother tracking individual arrows. You'd need to update a lot more frequently to do that, increasing the load on the processor (particularly when you're tracking tens or even hundreds of thousands of objects) - and it make archery very annoying, because you'd never hit a moving target.
KaVir is offline   Reply With Quote