Login
User Name:

Password:



Register
Forgot your password?
 Just a few issues.
Yesterday, 10:13 pm
By Kayle
Compile Error & Overflows
Sep 5, 2010, 8:03 pm
By Daygon
Would anyone be willing
Sep 5, 2010, 9:33 am
By Remcon
Playing a MUD through Lan?
Aug 30, 2010, 11:04 am
By Raine
LoP1.39 Questions/Issues/Anomalies + Suggestions?
Aug 19, 2010, 4:24 pm
By Remcon
LOP 1.39r1
Author: Remcon
Submitted by: Remcon
Yaeger areas
Author: Yaeger
Submitted by: Cyberthrope
The City of Anon
Author: Yaeger
Submitted by: Cyberthrope
The Walls of Anon - Smaug
Author: Yaeger
Submitted by: Cyberthrope
LOP 1.39
Author: Remcon
Submitted by: Remcon
CommonCrawl, Yahoo!

Members: 0
Guests: 1
Stats
Files
Topics
Posts
Members
Newest Member
375
3,323
16,514
561
Aurin
Affiliates
Smaug Building Institute Arthmoor
» SmaugMuds.org » Codebases » SmaugFUSS » Max number of affected_by_typ...
Forum Rules | Mark all | Recent Posts

Max number of affected_by_types
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2, 3 next >>
Post is unread #1 May 29, 2009, 2:37 pm
Go to the bottom of the page Go to the top of the page


Trevlyn13
Apprentice
GroupMembers
Posts63
JoinedNov 30, 2007

Is there a maximum number of affected_by_types you can have, specifically in smaugfuss? .........................
-= DB =-
Nova, an original Science Fiction MUD based on SmaugFUSS
       
Post is unread #2 May 29, 2009, 2:43 pm
Go to the bottom of the page Go to the top of the page
Remcon
Wizard
GroupLoP Team
Posts1,325
JoinedJul 26, 2005

if it is an EXT_BV (which I think the one you mean, is) it's limit is 128 unless you change your EXT_BV to make it handle more :) .........................
Remcon
Lands of Pabulum
       
Post is unread #3 May 29, 2009, 3:28 pm
Go to the bottom of the page Go to the top of the page


Samson
Scaly but Handsome
GroupAdministrators
Posts3,434
JoinedJan 1, 2002
WWW

Heh. One of these days we should surprise people with an update to std::bitset but keep the existing macros - unlimited bitvectors without completely messing up the codebase :) .........................
PDNS-Admin | Sandbox | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
       
Post is unread #4 May 29, 2009, 3:32 pm
Go to the bottom of the page Go to the top of the page
Remcon
Wizard
GroupLoP Team
Posts1,325
JoinedJul 26, 2005

That sounds like a good one to do man :) Can't wait to see that one lol :) .........................
Remcon
Lands of Pabulum
       
Post is unread #5 May 29, 2009, 4:13 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

I'd second that vote behind Remcon's first, especially if you could figure out how to get it to still compile under gcc rather than g++... :tongue:

Actually, if I could ever get around to catching up enough with the stuff I feel is more important so I could get around to making my cde compile cleanly under g++ then I'd still consider this a worthwhile idea even the way you intended.

I suppose it'd get classified as a improvement rather than a bug fix, but it could still be a FUSS thing as much as hotboot and some of our other past improvements. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #6 May 29, 2009, 4:28 pm
Go to the bottom of the page Go to the top of the page


Samson
Scaly but Handsome
GroupAdministrators
Posts3,434
JoinedJan 1, 2002
WWW

std::bitset is part of the C++ STL, so no dice on getting that to work with gcc. .........................
PDNS-Admin | Sandbox | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
       
Post is unread #7 May 30, 2009, 8:27 am
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

Bah, it was worth asking.. like I said, I still think it'd be a good idea, just means that I've got to get around to making my own codebase be able to compile cleanly under g++ sooner. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #8 May 30, 2009, 1:18 pm
Go to the bottom of the page Go to the top of the page


David Haley
Sorcerer
GroupMembers
Posts902
JoinedJan 29, 2007
WWW

You don't need to use C++ to have a sane bitset implementation. C++ makes it easier, but it's not as if the SMAUG bitsets (even extended bitsets) are the epitome of good design in C. .........................
David Haley
Head Coder, Legends of the Darkstone
BabbleMUD Project
http://david.the-haleys.org
       
Post is unread #9 May 31, 2009, 2:22 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

I've taken classes in cobol, fortran, pascal, and for microsoft/comptia certifications, and possibly a few others in the past, but I'm mostly self-taught in C. Should I ask what the best solution would be then? I thought Samson's idea sounded great, but that it'd mean making my code be able to compile under g++, which isn't the same thing as saying that I'm going to convert my full codebase to C++ either, btw. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #10 May 31, 2009, 2:38 pm
Go to the bottom of the page Go to the top of the page


Samson
Scaly but Handsome
GroupAdministrators
Posts3,434
JoinedJan 1, 2002
WWW

The best solution would be to replace the internal macros with std::bitset usage instead of the EXT_BV stuff. That could also be extended to the standard BV macros as well and in keeping things just to that the rest of the codebase would just chug along as though nothing happened. Except in cases where converting the bits is going to piss things off, like the affect_data structures. .........................
PDNS-Admin | Sandbox | Arthmoor MUD Hosting Services | The Truth About Medievia: A Saga of Code Theft.

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
       
Post is unread #11 May 31, 2009, 3:36 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

Not knowing any C++ really, I can't argue that point, but I really meant within the confines of C since David seemed to be implying that there was a better way to handle affects and such than with bitsets. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #12 May 31, 2009, 6:48 pm
Go to the bottom of the page Go to the top of the page


David Haley
Sorcerer
GroupMembers
Posts902
JoinedJan 29, 2007
WWW

Well, no. I was just saying that you can get a lot of the benefits while staying in C-land. Going to C++ is a far superior solution in many respects. The only disadvantage really is that it requires learning something new, which takes some time. .........................
David Haley
Head Coder, Legends of the Darkstone
BabbleMUD Project
http://david.the-haleys.org
       
Post is unread #13 May 31, 2009, 10:52 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

Oh, I thought you were saying that there was a way to improve things like this while still within the confines of C, otherwise I'm already resolved to the eventuality of trying to learn enough about C++ to be able to at least make my code compile under g++ instead of gcc so that I can begin to incorporate things like std::bitset as a replacement for EXT_BV, but in the meanwhile I'll continue to make do with what I've got. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #14 Jun 1, 2009, 6:28 am
Go to the bottom of the page Go to the top of the page


David Haley
Sorcerer
GroupMembers
Posts902
JoinedJan 29, 2007
WWW

Err... yes... you can improve things like this without leaving C. :wink:
I said:

I was just saying that you can get a lot of the benefits while staying in C-land.


You won't get all the benefits, but you can sure improve an awful lot over the current situation. It's very possible to have OOP in C, it's just not as nice.

To illustrate,
obj->method()
can be written as
method(obj)
which can be implemented as a plain old C function.

Basically, make a proper interface to the bitvectors, encapsulate the array of bits, and then the interface functions can do all the nice things you would want them to do, including e.g. automatically growing the bitvector, or allocating more than 32 or 128 or whatever. .........................
David Haley
Head Coder, Legends of the Darkstone
BabbleMUD Project
http://david.the-haleys.org
       
Post is unread #15 Jun 1, 2009, 12:40 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

DavidHaley said:

Well, no.

DavidHaley said:

Err... yes...

Geez David, make up your mind already, will ya'? :wink:

DavidHaley said:

Basically, make a proper interface to the bitvectors, encapsulate the array of bits, and then the interface functions can do all the nice things you would want them to do, including e.g. automatically growing the bitvector, or allocating more than 32 or 128 or whatever.

Um, okay, you've lost me. Allow me to reiterate:

Conner said:

I've taken classes in cobol, fortran, pascal, and for microsoft/comptia certifications, and possibly a few others in the past, but I'm mostly self-taught in C.


Conner said:

Not knowing any C++ really

Can you explain any of that to someone who hasn't taken formal classes in programming within the last two decades and who isn't working professionally as a programmer... like me? .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #16 Jun 1, 2009, 1:01 pm   Last edited Jun 1, 2009, 2:11 pm by David Haley
Go to the bottom of the page Go to the top of the page


David Haley
Sorcerer
GroupMembers
Posts902
JoinedJan 29, 2007
WWW

The problem with the way bitvectors are currently implemented is that they're manipulated through low-level routines that don't distinguish between the intent and the implementation. When you have a set of flags, you shouldn't have to worry about whether or not it's a simple array, an int, an EXT_BV, or whatever. The point is that you should only have to worry about the following high-level operations:
- Is bit X set?
- Set bit X
- Clear bit X

You would do something like this:

struct BitVector {
  char* bits;
  size_t numBytes;
};

BitVector* bv_new(size_t size);
void bv_delete(BitVector* bv);
bool bv_is_set(const BitVector* bv, int bit);
void bv_set_bit(BitVector* bv, int bit, bool value);


And now you no longer have to worry about any of the internal details, and everything "just works" once those (very simple) functions are written. Ideally, nobody except for the above four functions would ever touch the 'bits' field of BitVector objects. (C++ lets you enforce this restriction, which is one reason why it's better.)

Frankly I don't understand why the EXT_BV folks didn't do something like this in the first place, and instead just worsened the problem by doing the same thing, just with a few more bits.


(EDIT: added numBytes to structure definition) .........................
David Haley
Head Coder, Legends of the Darkstone
BabbleMUD Project
http://david.the-haleys.org
       
Post is unread #17 Jun 1, 2009, 1:33 pm
Go to the bottom of the page Go to the top of the page
Remcon
Wizard
GroupLoP Team
Posts1,325
JoinedJul 26, 2005

I considered doing something similar to this long ago but I thought it would be to much trouble lol. I have also tried once to switch over to C++ bitset, that one is annoying lol. I might give this way a shot sometime. .........................
Remcon
Lands of Pabulum
       
Post is unread #18 Jun 1, 2009, 3:08 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

Ok, you've got more than just my attention now, David. This sounds like a really good thing (and, yes, it makes sense to me now), but I don't quite fully follow how it'd be implimented, though if Remcon's considering giving it a try, maybe he'd share...

...and, Remcon, if you do, feel free to share your findings (as well as the four functions David mentioned, if you're willing) so the rest of us can benefit from it. Frankly, if it's that much of an improvement, maybe it's something that FUSS could/should impliment too, at least as an interim step between the current method and std::bitset. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Post is unread #19 Jun 1, 2009, 3:39 pm
Go to the bottom of the page Go to the top of the page


David Haley
Sorcerer
GroupMembers
Posts902
JoinedJan 29, 2007
WWW

I'll take a look at this sometime soon and see how hard it would be to start the conversion. I'm not sure how much sense it makes to do this in the main FUSS branch seeing that it's already g++-compliant (and so might as well use C++) but it should be pretty easy. But whatever happens with FUSS aside, I can provide the functions for you pretty quickly, I might have them already all written up at home somewhere. I'll see if I can find them. They weren't in the obvious spot, so I might have to do some digging. (It might be easier to just rewrite them from scratch...) .........................
David Haley
Head Coder, Legends of the Darkstone
BabbleMUD Project
http://david.the-haleys.org
       
Post is unread #20 Jun 1, 2009, 4:38 pm
Go to the bottom of the page Go to the top of the page


Conner
Sorcerer
GroupMembers
Posts833
JoinedMay 8, 2005
WWW ICQ AIM Yahoo MSN GT

Very cool, David, maybe if I can see the functions involved, I'll understand better how they'd have to be used to replace the existing ones. I'm kind of thinking, at this point, that what you're calling bv_is_set could just be installed as IS_SET and what you're calling bv_set_bit coud be installed as SET_BIT to minimize changes throughout the rest of the code. I'm not certain how you're bv_new & bv_delete compare directly to REMOVE_BIT & TOGGLE_BIT... but once I can see where you're going with it, perhaps things will become more clear to me. .........................
-=Conner=-

Administrator/Coder Primary SysOp
Land of Legends The Castle's Dungeon BBS

telnet://tcdbbs.zapto.org:4000 telnet://tcdbbs.zapto.org:23
       
Pages:<< prev 1, 2, 3 next >>

 
Contact Us