|
|||||||
This is a discussion on "Your "greatest" code innovation..." in the Top Mud Sites MUD Coding forum : 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... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#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 |
|
|
|
|
|
#2 |
|
Senior Member
|
I've released a couple of codebases 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 =). |
|
|
|
|
|
#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. |
|
|
|
|
|
#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 |
|
|
|
|
|
#5 |
|
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
![]() |
I coded a spheretree datastructure which is released to the public domain.
A spheretree is a version of an R-Tree 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! |
|
|
|
|
|
#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.
|
|
|
|
|
|
#7 | ||
|
Member
Join Date: Apr 2002
Location: Seattle
Posts: 32
![]() |
Quote:
Quote:
|
||
|
|
|
|
|
#8 |
|
Member
Join Date: Nov 2002
Posts: 66
![]() |
Ughh... that's what happens when you're coding 3d transformations while posting
Spheres are conceptually more simple, but calculating whether or not a point falls within a polygon is computationally simpler for a rectilinear shape than for a sphere. Using a rectilinear bounding box, you need to make, at most, 2n comparisons, where n = the dimensionality of the space you're working with. With a sphere, you need to find the root of the sum of n squares, plus a numerical comparison. |
|
|
|
|
|
#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. |
|
|
|
|
|
#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.
|
|
|
|
|
|
#11 |
|
New Member
Join Date: Jan 2003
Posts: 5
![]() |
Hmm...the greatest...
Haven't achieved much of anything noteworthy, but a couple things I'm sort of proud of (all made in/for Circle 3): * Online chess (between players, NOT against computer! * Turn based combat with "combat grids" in which people fight * Modified variant of "pets" that you can desc, name and control remotely and snoop, for IC purposes such as having servants that can take part in conversations elsewhere, run errands, etc * Horse races with semi-graphical progress "bars" and betting system * XML saving system /F |
|
|
|
|
|
#12 |
|
New Member
Join Date: Feb 2003
Posts: 29
![]() |
Innovation is such a strong word.
I'm working on a from-scratch codebase designed around screen-control via the ncurses library. Working here is meant to mean, 'a week into', so I cannot say that's my greatest innovation in the past tense. I wasn't the first to do it, but I'm very proud of my work with modern weapons. Guns, with ammo that ran out and had unique properties, explosives, land-mines, and tanks. I don't know how to qualify 'great' but one very useful bit of code I wrote was the Static Reset Loader, a run-length encoded object survival system whereby objects in clan vaults, designated by room flags, would be written to file periodically by a fork()'d process and loaded on boot. I wrote a signal handler for SIG_SEGV so that the game never actually crashed cold, but would hotboot on fatal error. Given the quality of my code at the time, that was very useful. Well, that's all that springs to mind. Interesting thread, by the way Xanes -=- Lone Coder WinterMUTE |
|
|
|
|
|
#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.. |
|
|
|
|
|
#14 |
|
Member
Join Date: Feb 2003
Location: Bay Area, CA, USA
Posts: 39
![]() |
I'm the author of the Phantasmal MUDLib 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.
|
|
|
|
![]() |
| Thread Tools | |
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 |
|
|