Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > Advanced MUD Concepts
Click here to Register

Reply
 
Thread Tools
Old 07-16-2002, 10:30 PM   #21
 
Posts: n/a
Quote:
Originally Posted by (wedsaz @ July 11 2002,05:54 am)
I wrote this beast from scratch, so you can pretty much throw legacy code out the window.

There is no such thing as a 'room' in this system. I just keep a list of creatures, objects, etc. Each object or creature has an x, y and z variable with a number in it. Any time you move, look, or perform any kind of action where it's relevant, it goes through the list and picks out the ones whose coordinates are within the right range. The closest thing to a 'room' is when you happen to be within the radius of a tent, but you could be in a corner or in the center, etc.
Could you elaborate on your user interface?
How do you handle facing?  Or player motion?  
Can players be set in motion towards some landmark?
  Reply With Quote
Old 07-17-2002, 12:40 AM   #22
wedsaz
New Member
 
Join Date: Jul 2002
Posts: 15
wedsaz is on a distinguished road
Quote:
Originally Posted by
Could you elaborate on your user interface?
.
Still working on that. Mostly it's just an ugly list of what's around you, in what direction and how far. If you see a bunch of trees you can call it a forest (same as in RL), but the engine just sees a bunch of trees.
.
"some distance to the north, a white rabbit sits."
.
Quote:
Originally Posted by
How do you handle facing?
.
I don't worry about it. If it's right behind you, you can swing at it. It wouldn't be that complicated to add, but it would just be tedious for everyone and I don't think it makes much difference. Realism should only be pursued so long as it adds to the game, rather than substract from it.
.
Quote:
Originally Posted by
How do you handle player motion?
.
From the player's perspective, it's the usual orthogonal and diagonal movement commands. From my perspective I change their X/Y coordinates, lower their breath and movement points (a staff and some footwear reduce movement cost), and call up the look command. Also if any nearby creatures are targetting or tracking that creature, they will be notified of the movement. Simple.
.
Quote:
Originally Posted by
Can players be set in motion towards some landmark?
.
Not yet. For now, movement is done one step at a time. I do plan on doing that eventually though, since walking north a hundred tiles involves a lot of Ns and enters.
wedsaz is offline   Reply With Quote
Old 07-17-2002, 05:38 AM   #23
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
Quote:
Originally Posted by
wedsaz wrote:
I don't worry about [facing]. If it's right behind you, you can swing at it. It wouldn't be that complicated to add, but it would just be tedious for everyone and I don't think it makes much difference. Realism should only be pursued so long as it adds to the game, rather than substract from it.
You could calculate their facing though, depending on what direction they're moving. You could then work out whether or not they can see the person creeping towards then.

I think it's fair enough to say that the "look" command shows everything (you could even describe the character turning around and viewing their surroundings), but I think it could add a lot to have a more limited arc of vision for other times. If someone is running up behind me I'd rather see "You hear footsteps approaching you from behind" and have to type "look", then automatically see them as if I had eyes in the back of my head.

I'd also like the opportunity to perform Tenchu-style assassinations by creeping up behind my opponent. Quite difficult to do that if they can see me

Quote:
Originally Posted by
For now, movement is done one step at a time. I do plan on doing that eventually though, since walking north a hundred tiles involves a lot of Ns and enters.
The approach I've currently got working is that each creature has a desired destination, which is either a fixed coordinate location, or another "thing". Typing "north" sets your desired location as 1 coordinate location ahead of your current desired location (so you can stack them). You can also type "north X", where X is the number of positions you'd like to move. This means the interface shouldn't be too difficult for those who are used to the standard compass-movement system.

I have literally only got this working in the last couple of days though, so there's still a lot more work to do on it. I've got the "speed" half done (walk, jog, run, etc), and am also considering "stacking" targets. For example if you're targetting Bob and he climbs into a car, you should start chasing the car instead. If he drives the car into a garage, you should start running towards the garage - once you get there, you should then approach the car, or Bob (if he's got out).

Because you can target a "thing", and everything in the world is a type of "thing", it means that you can walk towards anything you can see.

I'm still trying to decide how this should be combined with the combat, though. Combat consists of "targetting" someone (or something) then advancing, retreating, circling, punching, etc.
KaVir is offline   Reply With Quote
Old 07-18-2002, 08:52 PM   #24
Robbert
Member
 
Robbert's Avatar
 
Join Date: Apr 2002
Location: #### Paso, Tx
Posts: 89
Robbert is on a distinguished road
Send a message via ICQ to Robbert Send a message via AIM to Robbert
Quote:
Originally Posted by
You can also type "north X", where X is the number of positions you'd like to move. This means the interface shouldn't be too difficult for those who are used to the standard compass-movement system.
Add a 'head' command, allowing you to continue to move in a particular direction until you no longer can (or azimuth, such as head northeast or head 270 degrees).

Quote:
Originally Posted by
I have literally only got this working in the last couple of days though, so there's still a lot more work to do on it. I've got the "speed" half done (walk, jog, run, etc), and am also considering "stacking" targets. For example if you're targetting Bob and he climbs into a car, you should start chasing the car instead. If he drives the car into a garage, you should start running towards the garage - once you get there, you should then approach the car, or Bob (if he's got out).
I'd suggest, for intuitivity, that you have commands for the paces as well as a pace-setting command, so someone could do "run north" or "pace north" and then "run".

With our new engine, we are creating an analogous command interpreter - it will attempt to determine the command(s) you wish to do based on the construct of your sentence, rather than require you input your command in a specific format. One of the things this does is recognize the paces and change to them automatically. You may want to consider a similar approach, if you're not already.

Movement should be intricately linked with combat, in my opinion - all current paradigms restrict combat to the room or area in which it began, and this is not how it should be. Allow for the participants to set specifics about themselves (if the pressed, retreat or stand ground? If opponent retreats, do we press the advantage or hold back?), and then let combat meander as needed. If done properly, one could use objects and terrain in the area to ones advantage. I don't know if this is putting too much depth into it, but it would be great to fight in the dark and have your opponent trip over the caltrops you've strewn through the area.

With ranged combat, allow for misses to possibly strike others in the surrounding area. If someone passes through the trajectory of an object, perhaps it will hit them, or they will deflect it enough to where it misses its target.
Robbert is offline   Reply With Quote
Old 07-19-2002, 06:26 AM   #25
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
Quote:
Originally Posted by
Add a 'head' command, allowing you to continue to move in a particular direction until you no longer can (or azimuth, such as head northeast or head 270 degrees).
Good idea - thanks.

Quote:
Originally Posted by
I'd suggest, for intuitivity, that you have commands for the paces as well as a pace-setting command, so someone could do "run north" or "pace north" and then "run".
Well that's what I had been planning to do, but I've actually ended up doing it differently so as to combine it with the combat system. If you're familiar with the Glad2 combat system you'll know about the stacking of moves (and combo moves, etc) - well I've used the same approach for calculating speed. Your "feet" location allow you to move forwards, backwards, circle left/right, jump, duck or kick, and various combo moves allow for variations on that. If you move forward twice you'll start jogging, forward again and it becomes a run, a fourth time and you start sprinting.

This means that you can chase after someone and then do a flying kick when you reach them - or perhaps grapple them to the ground. There is no such thing as a "fighting" state - you just perform moves. You can throw punches and kicks at midair if you like (you can even practice your fighting techniques that way - sort of like performing katas). You can also target anything you like, so you could practice fighting against a dummy if you wanted to (or - my favourite - you could pick up your enemy and use them as a weapon to attack a nearby building )

I may add some commands like "run"/etc and just have them as aliases for feet actions. That should give me the best of both worlds.

Quote:
Originally Posted by
With our new engine, we are creating an analogous command interpreter - it will attempt to determine the command(s) you wish to do based on the construct of your sentence, rather than require you input your command in a specific format. One of the things this does is recognize the paces and change to them automatically. You may want to consider a similar approach, if you're not already.
Nice, although complicated to implement. I'll probably stick with simple commands for the time being though - people in a pure-PK mud don't tend to like verbose parsers so much.

Quote:
Originally Posted by
With ranged combat, allow for misses to possibly strike others in the surrounding area. If someone passes through the trajectory of an object, perhaps it will hit them, or they will deflect it enough to where it misses its target.
I'm not sure if I'll bother calculating the trajectory (once again it's nice, but it's also a lot of effort for something you wouldn't really see). However a "miss" will certainly have a chance of hitting someone else - if you fail your attack roll, the missile will land somewhere else (just how close to the target depends on how badly you missed). So yes, you could fire at one target, miss, and hit something else instead ("Sorry - are you okay? I only meant to shoot your hat off!")
KaVir is offline   Reply With Quote
Old 07-23-2002, 02:25 PM   #26
mhc
Member
 
Join Date: May 2002
Location: Linköping, Sweden
Posts: 31
mhc is on a distinguished road
It would appear that the question 'Can MUDs implement range/distance?' has been answered, and the answer is 'Yes'.

In order to find out what items are 'near' you in the coordinate system, you would in the most simple case have to compute the distance to every other object you have. This then becomes an O(n*n) algorithm, which does not scale well. A common trick in simulations is to use a cell structure:

You partition your simulation into cells, and keeps lists of what is in each cell. When checking distances, you only check the neighbour cells and their content. The cell size is determined by the interaction range, which in this case would be the visibility range.

Another popular method is to use lists at each object of near neighbours. For most objects, which do not move, the lists will be static, and you'll be doing little work updating the lists.

Yet another method, popular in raytracing, is to use an oct-tree. Run that in google.com
mhc is offline   Reply With Quote
Old 07-23-2002, 03:06 PM   #27
Robbert
Member
 
Robbert's Avatar
 
Join Date: Apr 2002
Location: #### Paso, Tx
Posts: 89
Robbert is on a distinguished road
Send a message via ICQ to Robbert Send a message via AIM to Robbert
Additionally, if you track locations of *thing relative to other *things in the area, little work is necessary to extrapolate the information for the player(s) - work recursively based on the closest thing to them, and continue until they can no longer see based on other things in the area.

(Edit) - This works for sound as well as sight, and the theory is the same. Working from a known reference otuward makes much more sense, in terms of intensity, than taking a mass of things and checking each one to see if it is visible/audible to the character. And it allows for neat additions such as poor eyesight or hearing, and their reverse. (/edit)

Our system of location is based upon inheritance; you can be literally be in a forest and see the trees, or move to a particular copse/meadow/field that has been created within it. This allows for the world creators to give as much or as little detail as necessary. So a City could be visible from the forest, but the individual buildings of it need not be apparent until one is outside a gate of that city, or within it itself.
Robbert is offline   Reply With Quote
Old 07-24-2002, 04:25 AM   #28
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
Quote:
Originally Posted by
In order to find out what items are 'near' you in the coordinate system, you would in the most simple case have to compute the distance to every other object you have. This then becomes an O(n*n) algorithm, which does not scale well.
Surely the simple case would be to determine what distance is considered "near" and list all items that space, which is O(n).

Kas.
Kastagaar is offline   Reply With Quote
Old 07-24-2002, 09:26 AM   #29
mhc
Member
 
Join Date: May 2002
Location: Linköping, Sweden
Posts: 31
mhc is on a distinguished road
Quote:
Originally Posted by
Surely the simple case would be to determine what distance is considered "near" and list all items that space, which is O(n).
Only of you only have one player.
mhc is offline   Reply With Quote
Old 07-24-2002, 09:55 AM   #30
Loriel
Member
 
Join Date: May 2002
Posts: 49
Loriel is on a distinguished road
Quote:
Originally Posted by
In order to find out what items are 'near' you in the coordinate system, you would in the most simple case have to compute the distance to every other object you have. This then becomes an O(n*n) algorithm, which does not scale well.
Quote:
Originally Posted by
Surely the simple case would be to determine what distance is considered "near" and list all items that space, which is O (n).
Quote:
Originally Posted by
Only of you only have one player.
If the problem is 'finding items near a specified player', I believe it is O(n) where n is number of items.

If the problem is 'finding items near each player' I believe it is O(p*n), where p is number of players and n is number of items.
In that sense, it might be roughly O(n*n) where n is number of players.

Finding players near each player would be O(n*n), where n is number of players.
Loriel is offline   Reply With Quote
Old 07-25-2002, 01:27 PM   #31
Robbert
Member
 
Robbert's Avatar
 
Join Date: Apr 2002
Location: #### Paso, Tx
Posts: 89
Robbert is on a distinguished road
Send a message via ICQ to Robbert Send a message via AIM to Robbert
Quote:
Originally Posted by
Finding players near each player would be O(n*n), where n is number of players
Why would you need to find players near each player? This is inefficient and unnecessary. Take your known point of origin, Player_A, and extrapolate from that location outward N points, to find OBJ's and PLAyers in the range shown. Allow for mediation of this value to account for extra large objects (the further out you get, the larger the object must be to be 'seen&#39, and limit the function based upon the weather/race/eyesight/time of day/etc.

In some cases, such as finding if others are nearby as well, you could take the data culled from above and sift through it again, placing relationships between the player and the objects/other players:

Frank is here, standing near the large oak tree. Wilhelmina and Ruprecht can be seen beyond him, almost at the edge of the copse. Far on the horizon, the towering mountain, Spinterfang, can be seen dominating the horizon. In your peripheral vision you can make out a type of building to the right, and the forest continues to the left.

The above is an example of an intricate dynamically built location description, taking all the data from the extrapolation (Fred, Wilhelmina, Ruprecht, a building, Splinterfang Mountain, and a Large Oak Tree) and placing it into a (well?) written sentence.

At no time does it become O(n*n), because we are not concerned where -everything- is in relationship to everything else, only to our known focii, the character. There's no need to find Fred's distance from the tree, or Wilhelmina, because it is implicit in their relative location to the viewer.
Robbert is offline   Reply With Quote
Old 07-25-2002, 02:52 PM   #32
Loriel
Member
 
Join Date: May 2002
Posts: 49
Loriel is on a distinguished road
Quote:
Originally Posted by
Finding players near each player would be O(n*n), where n is number of players
Quote:
Originally Posted by
Why would you need to find players near each player?
I think I failed to make my point clear - I was supporting your (Robbert's) proposition that the basic algorithm would be O(n), before further improvements.

The only circumstance I can see where the O(n*n) would apply is the one I quote above, finding number of players near each player.

You could look at one 'game loop' in this context, where you might need to construct n 'player views', each of O(n) approx, so the complete game loop computation is O(n*n), though even in this case I think O(n*p) is a better value.

As you said, there are various improvements that would reduce this in practice.
For example, if we have found when constructing Frank's view that Frank is near Ruprecht, we know when constructing Ruprecht's view that Ruprecht is near Frank and don't need to calculate it again .
Similarly if Frank is near Ruprecht, and Ruprecht is near Wilhelmina, we know that Wilhelmina is at least 'fairly near' to Frank, though we may need to refine that.
Loriel is offline   Reply With Quote
Old 07-29-2002, 01:32 PM   #33
Alexei
New Member
 
Join Date: Jun 2002
Posts: 20
Alexei is on a distinguished road
TopMudSites.

Last edited by Alexei : 11-17-2014 at 09:25 AM.
Alexei is offline   Reply With Quote
Old 08-04-2002, 06:40 PM   #34
Raghar
New Member
 
Join Date: Aug 2002
Posts: 1
Raghar is on a distinguished road
Hello boys I'm doing some very hard and complex simulation and I found this topic very interesting. Basicaly I simplified seeking of targets to something like 3D room and I wanna know if there is better and FASTER way to do this. I do probably have two problems big list for seeking and considering of what data I would need.
Could you post some links?

It's strange I do RPG Strategy Simulation and I found lots of interesting problems here, and not on the graphical/ game servers. Probably becose I have similar problems like muds but for different reasons. At least most of them are different.
Raghar is offline   Reply With Quote
Old 06-27-2012, 03:34 PM   #35
Hersir
New Member
 
Join Date: Jan 2009
Posts: 11
Hersir is on a distinguished road
Re: Can MUDs implement range/distance?

This game is a recent browser/C# remake of a MUD that had a coordinate system/text map, and a sandbox style (players make everything) back before anything else did in the 90s.

Thorns of War
Hersir is offline   Reply With Quote
Old 06-27-2012, 06:57 PM   #36
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?

You necro'd a 10-year-old discussion thread so that you could post a random promotion, on a board that explicitly asks you not to post promotions?

And no, your game was not the first to implement those features.
KaVir is offline   Reply With Quote
Old 06-28-2012, 11:54 PM   #37
Ghostcat
Member
 
Join Date: Mar 2010
Home MUD: Unwritten Legends
Posts: 135
Ghostcat is on a distinguished road
Re: Can MUDs implement range/distance?

Quote:
Originally Posted by KaVir View Post
You necro'd a 10-year-old discussion thread so that you could post a random promotion, on a board that explicitly asks you not to post promotions?

And no, your game was not the first to implement those features.
At least he necro'd an interesting thread.
Ghostcat is offline   Reply With Quote
Old 06-29-2012, 04:09 PM   #38
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: Can MUDs implement range/distance?

Ok, so a few thoughts on this.

Firstly, godwars2 does this. Go look at it for a good example which is running still.

Secondly, there's a harder, but less processor intensive way of finding near objects. I forget what this is called--I'm not smart enough to have come up with it--and a lot of 3d engines use it:

The world is a quadrant forming the first node of a tree.
Divide the world into some number of quadrants--9 works well--and make them the next set of nodes in the tree.
Keep dividing until you get to the desired resolution.

To find an object in the same area as a player, you simply walk up the tree to the desired resolution and get the list from that. You can do that by finding all leaf nodes below the desired resolutional node (new term!), or you can sacrifice memory and store each object in all nodes containing it...so, the world node gets all objects.

If someone can remember what this is called, it'd be a help--I'm bad at explaining it.

Also, you can divide up the world into "regions" or "maps" or what-have-you, making the two lists in the o(p*n) algorithm smaller--p is the limit in each map and n the number of objects in that map. Should help anyway.
camlorn is offline   Reply With Quote
Old 06-29-2012, 09:59 PM   #39
Ide
Senior Member
 
Join Date: Feb 2006
Location: Seattle
Posts: 361
Ide will become famous soon enoughIde will become famous soon enough
Re: Can MUDs implement range/distance?

I'm guessing quad trees camlorn, but I think there use is more typically for representing very large worlds than line of sight calculations.
Ide is offline   Reply With Quote
Old 06-30-2012, 07:07 PM   #40
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: Can MUDs implement range/distance?

Heh, well, it doesn't much matter. I didn't realize this topic spanned two pages and was replying to the old part from however long ago. Only just now realized that this was necroed for a random promotion and that I wasn't reading the latest post.

Oopse.

I think oct-trees are what I was talking about--might also be called quad-trees, I really don't know.
camlorn is offline   Reply With Quote
Reply


Thread Tools


Can MUDs implement range/distance? - Similar Threads
Thread Thread Starter Forum Replies Last Post
Old muds makila Tavern of the Blue Hand 13 06-08-2012 05:13 AM
Looking for RP MUDs Almondine War Advertising for Players 13 10-22-2005 02:07 PM
how to implement a class? UnKnOwN1205 MUD Coding 2 01-03-2005 07:09 PM
Top 20 muds Cayn Tavern of the Blue Hand 141 08-25-2004 12:30 PM
Any Muds? Asalyt Advertising for Players 6 03-10-2004 09:10 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 07:12 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014