System PII - Perfect Item Indexing

Cohadar

master of fugue
JASS:
while (p != null){
    if (p.evaluate()){
       p.execute();
    }
    p = p.next;
}


So when you have one condition on trigger (that returns false) the difference from timer is 4 bytecode instructions.
So yeah they have exactly the same performance, since no performance difference can ever be noticed in any real usage situation.

We already had discussion of real-usage vs testing-only performance in KT2 thread, lets not repeat it here.

Let me be clear: I have no intention of changing any code in order to satisfy peoples silly ideas of optimization.

EDIT:
my bad, not bytecode instructions but machine assembler instructions since it is safe to assume that trigger invocation is written in C++ rather than in jass :p
 

Jesus4Lyf

Good Idea™
*Shrugs* I'm satisfied with that. Just wanted to know and be sure for my own systems. :)

Thanks for posting your findings.

Edit after thought:
JASS:
while (p != null){
    if (p.evaluate()){
       p.execute();
    }
    p = p.next;
}
Wait, what? Why would it execute after every condition? I thought it was more like:
JASS:
bool b = true
while (p != null){
    if (!p.evaluate()){
       b = false;
    }
    p = p.next;
}
if (b){
    t.execute();
}
 

Cohadar

master of fugue
Aye, I am making DDEA. It's not working! :mad:
Attaching is enough for destructables, they are never removed as far as I know.
(also they are mostly preplaced)

indexing as a concept makes sense only when you need to attach to something that might have MUI problems, and the only two handles of that type are unit and item (items are actually special kind of units)

@Jesus4Lyf
you are right. (obviously)
 

Cohadar

master of fugue
*bump*

Someone needs to approve this before it is forever lost in the depths of php.
 

Sevion

The DIY Ninja
Well, this is pretty much PUI for Items, and I always found PUI really handydandy when doing stuff with Units. And since my opinion carry so much weight, I approve of this system.
 
.. Cohadar do you know your PUI broke my system because it overwrote existing struct on the unit?

I might use this for the new CIS library if you make it a module and we call .destroy instead of .release.
Not to mention struct stack must be allowed too.

Why don't you use modules like AutoIndex? It seems nicer and better to implement.
 

Cohadar

master of fugue
.. Cohadar do you know your PUI broke my system because it overwrote existing struct on the unit?
Do you realize your system is broken because PUI is not?

I might use this for the new CIS library if you make it a module and we call .destroy instead of .release.
Not to mention struct stack must be allowed too.
Just don't call anything, it is a better way.
If it was possible I would forbit destroying of PUI structs manually, but vJass does not have that capability.

Struct stack??

Why don't you use modules like AutoIndex? It seems nicer and better to implement.
Because modules cannot be used for properties.

Autoindex does not work the same way as PUI, it gives index to anything and everything so it can avoid complex algorithms.
If it suits you better you should probably use Autoindex.
 
Because the textmacros are almost the same.
JASS:
  if .pii_data[pii] != 0 then
            call .destroy(.pii_data[pii])
        endif


Why would you want to destroy the struct if a struct is already active on the unit? What if I wanted multiple structs on a unit?

For example for a knockback system what if 3 knockbacks are active on a unit? It'll break the existing knockback on the unit before it's even finished.

>Because modules cannot be used for properties

Okay.
 

Jesus4Lyf

Good Idea™
Please. No one wants a knockback system for items. So would you go comment in the correct thread?

Edit: You know I'm not sure that PII is that useful? I think the system should have the ability to make structs for items when they enter the map, automatically (based on filters and stuff). Hmm.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • tom_mai78101 tom_mai78101:
    Hmm, do I need to start posting some of the Science and Technology news to this new section in the future?
  • tom_mai78101 tom_mai78101:
    Or do we need to move the news to their respective sections once the threads are old enough, read to be put into the News Archive?
  • The Helper The Helper:
    The 2nd thing
  • The Helper The Helper:
    I have been moving stuff from the current Headline news like a year old and stuff over when I see it in the logs or members online but mostly I have been moving stuff from the Archives
  • The Helper The Helper:
    It is possible to automate it so that instead of moving to Archive if it has the Science, technology or sci tech tag that it gets archived there instead. I am considering a new Weird News Tag
  • tom_mai78101 tom_mai78101:
    Please do. I'll try to tag the news appropriately when I get the chance.
  • The Helper The Helper:
    The new Discourse forum software we are moving to next does alot with the tags and also hashtags
  • The Helper The Helper:
    OK I found the source of your burrito post stuff it is from Reddit and possibly a facebook post too but definitely reddit
  • The Helper The Helper:
    Happy Monday!
  • The Helper The Helper:
    Happy Tuesday :)
  • Blackveiled Blackveiled:
    Happy Tuesday
  • The Helper The Helper:
    Blackveiled! What is up?
  • The Helper The Helper:
    I saw XXXConan on here the other day I dont know if you remember him
  • The Helper The Helper:
    blasts from the past
  • Blackveiled Blackveiled:
    I remember him, buncha old faces
  • jonas jonas:
    He's a software engineer at a hiring platform now I think
  • The Helper The Helper:
    I wanna know if his mom is still single LOL
  • tom_mai78101 tom_mai78101:
    I need context.
    +1
  • The Helper The Helper:
    Back in the day conan was a young one and his mom was single and I used to tease him that I was going to date his mom and be his daddy - yeah sounds bad now but it was funny at the time
  • The Helper The Helper:
    his mom is my age
  • The Helper The Helper:
    i know right it was pretty funny
  • thewrongvine thewrongvine:
    its pretty funny
    +1
  • tom_mai78101 tom_mai78101:
    Thanks for the context.
    +1
  • The Helper The Helper:
    Happy Hump Day!!!

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top