System Advanced Indexing & Data Storage

tooltiperror

Super Moderator
Reaction score
231
It's logical, in a way. I don't think modules are even what they sound like. Modules should be like 'oh yeah, you implement in blah blah blah' but they came out more like special textmacroes. What right now is a 'module' should be some sort of struct textmacro and then we should get real modules that initialize in a better order.
 

muzzel

New Member
Reaction score
1
Im not sure whether its a new feature in AutoIndex or you just forgot to implement this in AIDS to provide compatibility, but AIDS does not have the functions:
Code:
function IsUnitIndexed takes unit u returns boolean
function OnUnitIndexed takes IndexFunc func returns nothing
function OnUnitDeindexed takes IndexFunc func returns nothing

Can you tell me a simple painless way to write those functions? (I did not want to read through the whole AIDS code, im sry). Propably you even might want to upload a newer version of AIDS which contains these functions, I'd appreciate that.
thx
 

Bribe

vJass errors are legion
Reaction score
67
1. That function doesn't exist, but can be replicated as:
Code:
function IsUnitIndexed takes unit u returns boolean
    return GetIndexUnit(GetUnitId(u)) == u
endfunction
2. AIDS_RegisterOnEnter
3. AIDS_RegisterOnDeallocate
 

muzzel

New Member
Reaction score
1
The first one is not the Problem, but anyway its easier with
Code:
function IsUnitIndexed takes unit u returns boolean
    returnGetUnitId(u) != 0
endfunction
But the other two:
Code:
function OnUnitIndexed takes IndexFunc func returns nothing
function OnUnitDeindexed takes IndexFunc func returns nothing
take a function interface as argument:
Code:
function interface IndexFunc takes unit returns nothing

The AIDS functions OnEnter and OnDeallocate Bribe posted just register triggerconditions. I cant see any simple way to register those function interfaces as trigger conditions and use GetTriggerUnit() as argument.

I know it would be easier just to use the AIDS functions, but im using a system that requires those AutoIndex functions and I do not want to change that one.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Unfortunately, those functions in AutoIndex actually came out well after AutoIndex support was added to AIDS. AIDS uses the AIDS struct paradigm instead (the functions mentioned by Bribe are not actually.. documented, ie. not supposed to be used). The simple solution is to write an AIDS struct which supports the OnUnitIndexed and OnUnitDeindexed functions. Not particularly hard, but I haven't the time right now. Perhaps after the 12th of Jan I will have some more, else you or somebody else can try, I'm happy to review it if someone posts a nice shot at it.
 

tooltiperror

Super Moderator
Reaction score
231
Can you make it no need to use UserData()?

Very old quote, but still relevant.

I need AIDS to use stuff like Status and Damage, but the map I am editing is someone else's original work (ofc I have permission to modify it) but they use Point value everywhere. It'd be too much of a mess to try to fix it.
 

muzzel

New Member
Reaction score
1
You could just replace all UserData calls with Hashtable Lookups.

Code:
SetUnitUserData(u, i) -> SaveInteger(myHash, GetHandleId(u), 0, i)
GetUnitUserData(u) -> LoadInteger(myHash, GetHandleId(u), 0)
But this is like 70% slower.
 

tooltiperror

Super Moderator
Reaction score
231
You could just replace all UserData calls with Hashtable Lookups.

Code:
SetUnitUserData(u, i) -> SaveInteger(myHash, GetHandleId(u), 0, i)
GetUnitUserData(u) -> LoadInteger(myHash, GetHandleId(u), 0)
But this is like 70% slower.

I guess I'll have to do that.

Thanks.

EDIT: Untested, but if anyone wants it, here it is.
 

vuongkkk

New Member
Reaction score
1
Damn YOU! This system is sooo goooddddddd ! + rep. :thup:
A small question:
What the hell are your brain made by :p Just kidding :-j
 

vuongkkk

New Member
Reaction score
1
What happen if i makes 2 different struct for only one unit ? Or I should make a struct has all method.

I need speedddd !!!! more and more
 

Bribe

vJass errors are legion
Reaction score
67
One unit will never have more than one struct. What are you worried about?
 

tooltiperror

Super Moderator
Reaction score
231
Wrong, Bribe.

JASS:
struct AIDSone extends array
	//! runtextmacro AIDS()
endstruct

struct AIDStwo extends array
	//! runtextmacro AIDS()
endstruct
 

vuongkkk

New Member
Reaction score
1
yep , i know it can be. But i dont know which way is faster?

JASS:
struct AIDSone extends array
	//! runtextmacro AIDS()

        method A takes nothing returns nothing
        endmethod
endstruct

struct AIDStwo extends array
	//! runtextmacro AIDS()

        method B takes nothing returns nothing
        endmethod
endstruct


OR this

JASS:
struct AIDSonlyOne extends array
	//! runtextmacro AIDS()

        method A takes nothing returns nothing
        endmethod

        method B takes nothing returns nothing
        endmethod
endstruct


Because my English is NOT good so i must have a example :p

In the fact, my map has more than one AIDS struct for each unit (each struct for a spell)
 

SerraAvenger

Cuz I can
Reaction score
234
I don't see any difference in speed? There should be only one struct id assigned to any unit at any time. One version loads faster and consumes less memory. And that's it.

My advice: Take whichever is more logical in that situation.

EDIT: Just to make sure you understand, the difference in loading time will probably be around 0.02 seconds or something.
 

Jesus4Lyf

Good Idea™
Reaction score
397
In theory, merging may make units entering/leaving the map unsubstantially faster.
You can typecast between the structs, so there isn't going to be a speed difference in using them, if you do so. :)

I mean, depends on your use? lol
One version loads faster and consumes less memory. And that's it.
I thought that as well, until I remembered that AIDS_onCreate methods will still fire for each unit as it enters the map.
My advice: Take whichever is more logical in that situation.
/Agree. :thup:
 

SanKakU

Member
Reaction score
21
surprised the system still gets attention. haven't seen a spell i can't live without that uses it...and it's overkill to do this crazy coding for every unit...u never dream of doing this crap on trees so why the special treatment for units?

best reason to use it would be it lets you use the damage system...can't you make a version that focuses solely on that?

we have multuple flavors of timerutils why not for aids like an aids that only supports the usage of damage system and does nothing else for example would be kinda nice...? or is it not so much different from current aids? or did someone already make a system or two like what i described?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
It isn't doing much. Indexers are pretty light unless you are going to mass-spawn units. The thing they do is allow you to convert a unit's user data to a unique integer that is usable for arrays. (i.e. 0-8191 [and they also have some extra features, like controlling what happens on index/deindex... etc.]) Tbh, if you really don't care about speed and simplicity, just use hashtables. However, it can become annoying to manually get the kind of control that indexers have. :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top