01-24-2003, 09:32 AM | #1 |
Member
Join Date: Apr 2002
Location: Chicago, Illinois
Posts: 152
|
The coding forum, sans the couple of questions that pop up on something, is pretty slow of late, so I'll throw out a question for all the coders out there...
What is your greatest code innovation that you've added to the code you run and/or the mudding community (if you've published it? Is it something behind the scnene to make things run faster, or something the players all can use and rave about because it's cool and unique? No posting of things like a class, I'm looking for specific single instances of things... Terl |
01-24-2003, 02:23 PM | #2 |
Senior Member
|
I've to the public domain =). The potential users of my codebases aren't your average mud coder though, as most sections of the code are overengineered and the entire system requires a thorough knowledge of C++ and related programming principles to understand. Its primary goal (aside from my own entertainment ;)) is to be of use to those that wish to see how certain code designs play out in a working implementation. So it's only really of any utility to people concerned with these design issues, i.e. those that are writing codebases themselves.
Certain ideas I've been working on through the codebase are template systems for modifying the format and content of strings in the game, generic database layers, inheritance-driven client/server architecture, dynamic loading of compiled code, a one-type system for objects (not different types for things like inanimates, mobs, pcs, areas, etc.), traditional and spacial area systems, and little things here and there to increase maintainability and robustness =). |
01-24-2003, 04:36 PM | #3 |
New Member
|
In coding for a privately-run Shadowrun MUD, I finally finished my greatest work about a year ago. A simple perception code that checks against intelligence (using the Shadowrun system) whenever you look at someone. It uses the "conceal" numbers from the books, and remembers what you can and cannot see (on a given individual) for an in-game day.
E.g. when a not-too-sharp person types 'look troll', they get: The trolls description is here. The troll is using: <worn on body>A pleated, armored jacket <worn on legs>A pair of leather pants <worn on feet>A pair of army boots This works even if the troll has hidden items under his jacket (the conceal code again). Someone with better luck on their perception roll might see: The trolls description is here. The troll is using: <worn on body>A pleated, armored jacket <hidden>An Ares Predator II <hidden>A hold-out pistol <worn on legs>A pair of leather pants <hidden>A NarcojectTM pistol <worn on feet>A pair of army boots <hidden>Many NarcojectTM darts Thought it was pretty nifty... only took me about 2 weeks to work the bugs out, heh. |
01-28-2003, 08:54 PM | #4 |
Member
|
Hey there,
My last thread showed a little bit of what I was doing, and I've now finished my "biggest accomplishment" to date... It's a restructuring of OLC that should make builders much happier. Based on Ivan's OLC, it takes out the ability for immortals to add areas and assigns that to the implementor only, and then uses "segments", or logical segmenting of area files, to keep track of what zone is which. This on the surface seems pretty pointless, but the added bonuses continue to pop up. Segments don't have predefined numbers of vnums to be used with them, so the builder can create anything they want and never have to worry about vnum holes (unused vnums within an area); the code takes care of looking up the last vnum used in the area, and the room/obj/mob is automatically assigned a number which correllates to the segment being added to. Not only that, but in a one-area MUD with logical segmenting of the vnums, you can reset anything anywhere, so there's no more need to copy over the values of that cool sword or beefy ogre you saw in someone else's area; just reset it, and go. I'm continuing to pursue this restructuring, looking for ways to make it better, and I'll be releasing my code base as a whole in probably 6 months give or take, and I'll be happy to give out a patch to the mud community at that point. -Visko |
01-28-2003, 09:48 PM | #5 |
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
|
I coded a datastructure which is released to the public domain.
A spheretree is a version of an using spheres instead of rectangles. A spheretree is a data structure used for handling spatial data. For example, storing objects in a 3D coordinate system. R-tree's are especially suited for dynamic insertion/deletion as well as for point data. And R-Tree's are well suited for MUD's in general if the MUD uses any type of "real" spatial representation (such as a 2d/3d coordinate system or grided room system). I encourage any MUD wanting a roomless system to take a look! |
01-29-2003, 12:28 AM | #6 |
Member
Join Date: Nov 2002
Posts: 66
|
Just out of curiosity, why did you make a "spheretree" system? I can't think of a reason not to use R-trees because you need to use the rectilinear bounding box of the given polygon in order to do the initial culling efficiently. With a sphere-based system, you need to calculate a vector normal for every single test, which, I would think, would bog you down considerably.
|
01-29-2003, 01:01 AM | #7 |
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
|
Because spheres are more simple than rectangles. You can give a rectangle a bouding sphere and cull off of that vice the bounding box.
I'm not sure what you mean. Which normal are you refering to? |
01-29-2003, 01:48 AM | #8 |
Member
Join Date: Nov 2002
Posts: 66
|
|
01-29-2003, 02:19 AM | #9 |
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
|
Determining if a point intersects a sphere requires only one check.
[code] bool Sphere;;Intersects(const Vector& point) { float flSqrDist = SqrDistance(_vecCenter, point); return (flSqrDist < (_flRad*_flRad)); }[/quote] With SqrDistance returning the squared distance from the sphere's center to the point in question. And _flRad is the sphere's radius. No square roots and only 1 check versus 6 for a rectangle. Spheres are computationally cheaper than rectangles in almost any use. NOTE: In case people are thinking this is about graphics, it's not. This is all very applicable to text MUDs. |
01-29-2003, 02:38 AM | #10 |
Member
Join Date: Nov 2002
Posts: 66
|
Yes, but you're forgetting what SqrDistance() does. It does n subtractions, n multiplications, and finally n-1 additions, as opposed to simply 2n comparisons, where n is the dimensionality of the given space.
|
01-29-2003, 08:13 AM | #11 |
New Member
Join Date: Jan 2003
Posts: 5
|
|
02-22-2003, 09:22 PM | #12 |
New Member
Join Date: Feb 2003
Posts: 29
|
|
02-23-2003, 07:32 PM | #13 |
New Member
|
I think some of my greatist innovations for my old mud was when i got sorta semi-annoyed at players and became a sadisitic coder..
So i started to make things like stds and breaking of bones, which impared movement as well as abilitiy to do skills and such. yea.. |
02-26-2003, 07:58 PM | #14 |
Member
Join Date: Feb 2003
Location: Bay Area, CA, USA
Posts: 39
|
I'm the author of the for DGD. So that's probably my greatest contribution to MUDding. Within that, probably the UNQ save/load system including DTDs. It's kinda like XML, but different.
|
Your "greatest" code innovation... - Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
um..how do I code? | Asalyt | MUD Coding | 12 | 05-26-2004 05:03 AM |
Where do you value progressive innovation most? | Burr | Tavern of the Blue Hand | 14 | 05-09-2003 10:38 PM |
Avathar = Greatest Mud | KnightFall | Tavern of the Blue Hand | 2 | 07-08-2002 05:04 PM |
Avathar = Greatest Mud | KnightFall | Advertising for Players | 0 | 07-08-2002 01:43 PM |
I would like to code! | Zellius | Advertising for Staff | 1 | 07-03-2002 08:59 AM |
|
|