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.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top