![]() |
#1 | |
Knight
Join Date: Apr 2007
Posts: 726
![]() |
Will we get rid of the 32 bit flag variables?
Here is another old rant of mine (from the same post as the one about indentation). Any news? I know it's not so essential for V, because it does not expand (so much), but since V is a base for variants...
Quote:
|
|
![]() |
![]() |
![]() |
#2 | |
Hellband maintainer
Join Date: Jul 2007
Location: New York, the Big Apple
Age: 46
Posts: 367
Donated: $120
![]() |
Quote:
![]() I would say the number 1 issues for V are to have mouse-code and big screen for all platforms and small screen for portable devices and makefiles for RISC OS and makefiles that make nice OSX applications and makefiles that can create .deb files etc. But that's me of course ![]() Cheers, T.
__________________
* Are you ready for something else ? Hellband 0.8.8 is out! * |
|
![]() |
![]() |
![]() |
#3 |
Knight
Join Date: Apr 2007
Posts: 590
![]() |
"Edit: ... I guess linked lists would be much more efficient and understandable, but bit vectors will induce the least code changes (in particular, no problems with serialization)."
In this particular application, linked lists are automatically bloated. (Generally, any of the one-datum one-node data structures are automatically bloated and should be avoided whenever either RAM efficiency or memory manager efficiency dominates other considerations. For V, it's RAM efficiency.) Also: C vs. C++ makes a huge difference. Efficient bitvectors with the high-level flags proposed in the Google-indexed thread are much easier to do in C++. |
![]() |
![]() |
![]() |
#4 | ||||
Knight
Join Date: Apr 2007
Posts: 726
![]() |
Quote:
![]() Quote:
Quote:
If the optional properties were integers instead of booleans, the lists would be unbeatable. But there are still only a few such properties, e.g. monster mana that many monsters just don't have. Quote:
|
||||
![]() |
![]() |
![]() |
#5 | |
Hellband maintainer
Join Date: Jul 2007
Location: New York, the Big Apple
Age: 46
Posts: 367
Donated: $120
![]() |
Quote:
Cheers, T.
__________________
* Are you ready for something else ? Hellband 0.8.8 is out! * |
|
![]() |
![]() |
![]() |
#6 |
Knight
Join Date: Apr 2007
Posts: 726
![]() |
Well, everybody knows, primitive evil variants are easy to expand. ;P
Seriously, it may be easier with no 4GAI and no extended (pseudo-)ID logic. Or perhaps you are just a boy-genius with a nice IDE or 'grep' mastery. Or perhaps you are a variant maintainer, which means you keep the whole code in your head all time time, anyway. ![]() Last edited by Bandobras; December 21, 2007 at 17:27. |
![]() |
![]() |
![]() |
#7 | ||
Knight
Join Date: Apr 2007
Posts: 590
![]() |
Quote:
Quote:
Code:
grep -n -F ____ > Test.txt |
||
![]() |
![]() |
![]() |
#8 |
Knight
Join Date: Apr 2007
Posts: 726
![]() |
Well,
Code:
grep -n -F "&f4" * > Test.txt Code:
/* Extract the flags */ object_flags(o_ptr, &f1, &f2, &f3, &f4); |
![]() |
![]() |
![]() |
#9 | |
Knight
Join Date: Apr 2007
Posts: 590
![]() |
Quote:
With a linked list, the RAM cost per node includes * at least one pointer to the next node [one for a singly-linked list] * memory manager overhead for the node itself. I suspect the typical minimum is 8 bytes on a 32-bit pointer system with a traditional *NIX tree-indexed free memory heap and no automatic debugging checks. My reimplementation for Windows costs 16 bytes in overhead. Using a C external library doesn't change any of this. And I don't see how a C external library can get you the efficient AND/OR testing of bitwise conditions. Within C: * Yes, tracking which flag goes with which bitmap bucket is a pain. * The simplest way to handle that as a bitmap ** convert the bitmap flag holders to an array of uint32_t ** provide an alternate set of macros that doesn't have the TR mess, just the logical names ** tests then become (bitmap[FLAG/32] & (1<<(FLAG%32))), which a competent optimizing compiler should handle as efficiently as the current code. Compile-time detecting when logical AND/OR tests can be merged is a bit trickier; we may have to retain the TR macros to support this transparently. The Boost preprocessor library wipes out at 256, which isn't really enough for all variants. |
|
![]() |
![]() |
![]() |
#10 | |
Knight
Join Date: Apr 2007
Posts: 590
![]() |
Quote:
|
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|