• 0

    posted a message on Catalog functions incredibly slow

    Thank you for taking the time to try and replicate my problem, I realy appreciate it!

    I won't be able to test this for a week or two but I'll try your code and I'll be interested to see if it experiences the same amount of lag or none at all. If none, I'll be curious about what the cause of lag is.

    Once I can test it I'll get back to you about where the discrepancy is coming from.

    Posted in: General Chat
  • 0

    posted a message on Catalog functions incredibly slow

    Methodology:

    I created a trigger such that when I ype "cats" (for catalogues) it does this:

    int i;
    ability abil;
    string s;

    set abil = factory train ability

    debug "starting"
    wait 1 second

    for i = 1 to 20
    {
            s = catalog field value get ability abil infoarray unit[4]
            debug s;
    }

    debug "finished"

    wait 10 seconds

    debug "starting"
    wait 1 second

    for i = 1 to 20
    {
            s = catalog field value get ability abil infoarray unit[3]
            debug s;
    }
    debug "finished"

    That would be the only trigger running. I used a wait 1 after declairing that it was about to start because the messages to screen do not happen instantly but are buffered. I would then select a worker and move him around the screen and count for how long the game freezes each time the loops are entered. unit 4 in the ability is a thor and unit 3 is empty so that is how I know it takes longer when the entry is empty. I then divide the total time spent when the game freezes by 20 to get the amount of time it takes for one call.

    I would run this trigger many times in a row to make sure the result was consistent and would not improve due to memory being loaded in.

    I ran this in "test document" which has a list of run time errors and warnings you can view. When doing a catalog lookup on an empty field it generates a warning so the discrepancy between empty and non empty fields might be due to generating that warning message and adding it to the list

    Posted in: General Chat
  • 0

    posted a message on Catalog functions incredibly slow
    Quote from ArcaneDurandel: Go

    User Types to store static data. Also, unless I'm terribly mistaken, there are natives that will determine the requirements to do anything. AI uses them as to know which buildings to build in order to produce a given unit.

    Also, I would test how fast a catalog lookup is the first time, and then subsequent times for the exact same query. If the later ones are faster, then the slow speed the first time is the result of loading the data into memory (on demand). This can be negated by preloading that unit (which will preload all data associated with it, ie, if you Preload a unit, it will preload its unit data, its weapon data, its actor, its model, abilities, etc.)

    Yeah. I can manually recreate the information that already exists in the data editor creating a second copy. But that is wasteful, error prone and a lot of work. I would just like to be able to reference the data which is already there.

    Makes no difference if it's the first or tenth time I look up the data in catalogues. In fact it often gets WORSE with time. I think that is because when you access an empty element in the array it adds it to the error log and the longer it gets the slower it goes.

    AI functions exist to tell you what unit is a prerequisite. For example you give it marine as an argument and it returns barracks. But not the reverse.

    I also need to look up details about unit weapons like damage types, attribute bonuses, etc and there are no functions for that either.

    All the info I want is in the data files but it seems as if the only way to access it would take 5 minutes worth of lag

    Posted in: General Chat
  • 0

    posted a message on Catalog functions incredibly slow

    Anyone else ever noticed that catalog functions are ridiculously slow? I was experiencing BIG lag spikes in the mod I'm making and managed to track it down to catalog operations. That's only in early game, if I ignored the problem and continued it would probably ramp up exponentially.

    For example I'm looking to find all the units that a certain train ability produces. Using the function "catalog field value get" the field for what units are made by this ability is an array so I give it the ability and a command index.

    For example the first 10 entries for units in the factories train ability =

    0 -
    1 - siege tank
    2 -
    3 -
    4 - thor
    5 - hellion
    6 -
    7 -
    8 -
    9 -
    10 -

    The only way to figure out which units this ability produces is to go through the array and look at each entry. If I ask it which unit is in slot 4 (thor) that operation takes about 0.1 seconds. However if I ask it about a slot with no unit in it then it takes about 0.3 seconds.

    These figures are from running the operation 20 times and dividing the total time by 20.

    0.1 and 0.3 seconds might not sound like much but added up these operations are HUGE! The factory has 30 entries mostly blank. (Widow mine is number 25). So that means to figure out what units a factory produces takes a whole 5 seconds! That's a completely unnacceptable amount of time for such a simple operation!

    That's only one of the catalog lookups I am doing. I was also trying to look up other stats for units on the fly using catalogs as well but how long it takes renders that option impossible.

    I thought of maybe creating arrays for all the information about unit types I'm going to need and populating it at map creation. The amount of time it takes to retrieve a variable from memory is negligable. But that leaves a MASSIVE lag spike at the start of the game.

    An alternative being maybe having the arrays but only populating them as I go. So each time I look up a stat for a unit it will check the variables in memory first, otherwise do a catalog lookup and put the info in the array for future use.

    (third option that I see is to manually add each of the entries)

    Anyone got any ideas how I can find this kind of data without the massive wait times?

    Posted in: General Chat
  • 0

    posted a message on Funky's Editor Wishlist

    A Scrolling dialog (list box doesn't work that well)

    Just simply giving us simple scroll wheel detection in the same way as all the other mouse events like pressing/clicking/releasing left/right mouse buttons would be great.

    Us map makers can take it from there.

    Letting us see all the "hidden" functions would be good too.

    Posted in: General Chat
  • 0

    posted a message on Why there is no website to backup SC2 arcade project with Paypal? $$

    You could always contact a map maker and ask if there is a way you could give them support for their map.

    I'm not sure there would be that many people willing to go out of their way to donate to make it worthwhile. I've never advertized or asked for money but I've had one person donate to paypal and I've had others ask me for my paypal account but then not give me anything. I guess when it came down to it they just didn't feel like giving their money away, which I can totally understand.

    A big enough project which rellies on funding would probably have their own kickstarter page up and be advertizing it already.

    Posted in: General Chat
  • 0

    posted a message on 16bit Game Engine?

    The other part you may have seen 65536 is in reals. IIRC The real data type uses the first 16 bits to represent the integer portion and the last 16 bits to represent the fraction. So reals are represented using 32 bits.

    Posted in: General Chat
  • 0

    posted a message on known unit count function does nothing

    OF COURSE!

    thanks heaps. Yeah, things like units seen and visibility flags only work for AI players. I should have thought of that but that is why it can be so useful to have a second set of eyes on a problem.

    There's just so many things which are broken I just assumed this one was in the same pile.

    Posted in: AI Development
  • 0

    posted a message on known unit count function does nothing

    Trying to get the "known unit count" function to work. Editor description says that it returns the number of units of type X the player has scouted.

    I created a brand new map from scratch. Nothing on it except starting locations and no triggers except one which runs this function. It only ever returns zero. Even if I'm looking directly at a unit of the specified type.

    is there a way to know what units have been scouted? If not, what would be the best way to do it? Periodically check a radius around every unit? Create a behavior in data which puts a dummy effect on all the nearby units and check how many units have the dummy effect?

    Thanks for any help you can give.

    Posted in: AI Development
  • 0

    posted a message on Disapearing towns

    Creating an AI and for some reason it is unable to keep track of towns.

    Town 1 is always the place where the player spawns. If I tell the AI to expand then it expands to the nearest location and sets town 2 to be the new expo. But after about 10-15 seconds it no longer recognizes it as a town. The expansion and buildings will still be there but it is no longer listed in the towns slot. My guess is there is an automatic, periodic trigger running every 30 seconds or so refreshing the AIs town slots to accomidate for when an expansion gets killed off.

    I can manually set the town up using the set town functions and again, the new location is listed in the town slots but just like before it only lasts like that for < 30seconds or so before the town slots are refreshed and the AI no longer considers that location to be a town.

    Does anyone know why it is considering these expansions as invalid? Anyone know how the town system keeps track of towns? Anyone know how I can turn it off? There is nothing I am doing between creating a new town and it not being registered anymore so it is the game which is doing it, not me.

    For the moment I will try and have a periodic trigger which runs every 1 second and refreshes the town list. But running a periodic trigger constantly to prevent another periodic trigger from undoing my work is a pretty lame solution, if it can even be called that.

    Thanks for any help or insight you may be able to provide.

    Posted in: AI Development
  • 0

    posted a message on Switch Player in Debug

    sharing control with them will often be preferable if that helps you.

    Swapping ownership of units can mess things up a bit. All orders are cancelled, building construction and unit training gets removed and IIRC resources are not returned to the players. Also some abilities which are in progress get messed up.

    Posted in: Triggers
  • 0

    posted a message on Remove unit without actor events

    "if you remove a unit from the game, it normally doesnt trigger the death response unless you have checked the flag for it (disabled by default). I guess you have another trigger running (maybe unit leaves region?) which creates the debris. please check your overview-editor, check all creation actions and look out for your debris. if you are able to exclude triggers as reason you have to check, again, the unit."

    Proof that this has nothing to do with me accidentally having other triggers running like unit leave region or something else which is creating the rocks.

    This is the terrain

    http://postimg.org/image/4bwzir90z/

    This is the only trigger

    http://postimg.org/image/fypew9kkh/

    "Perhaps something like a two triggers."

    While removing the rocks after removing the towers is a possibility it takes about 4 seconds for the rocks to appear and I would have to pause all game play for 4 seconds. This can potentially happen many times during a game and would be a major pain in the butt to players.

    Quantum

    Thanks again for your help mate. I didn't understand what you were saying the first time... actually I still don't understand. So much of this doesn't make any sense to me like why destroying the effect doesn't do anything without that validator, why does it even use persistent effects in the first place... but then, nothing to do with data ever makes any sense to me.

    Either way, it does exactly what I wanted. Thanks again for your help and your patience with me. :)

    Posted in: Triggers
  • 0

    posted a message on Remove unit without actor events

    well...

    This is going to sound strange but it no longer works. Seriously tried it again today and can't get it to work. I messed around a bit and took out some of the other stuff I did like removing behaviours and abilities but I can't figure out how I was doing it.

    There must be some kind of "magical" conmbination of which behaviour to remove when, how long you should pause between doing each step and which order you mess with the abilities...

    This is bullshit. Surely there is a straightforward method for completely removing a unit and all its effects from the game permanently. Right?

    Posted in: Triggers
  • 0

    posted a message on Remove unit without actor events

    Thanks Quantum,

    I had tried removing all efects from the area previously but had foolishly forgotten to put a break between removing the tower and running the remove effect trigger. I inserted a wait 0.5 seconds step and it fixed the problem.

    This is good enough for what I need it for, but obviously something is causing the effect to happen. Is it an actor event which creates the effect? If I could just remove it without having to include a wait command that would be ideal.

    Again, thanks.

    Turtles.

    Posted in: Triggers
  • 0

    posted a message on Remove unit without actor events

    yeah, I was doing the exact same thing a few months ago no problem. But it's only now that I'm seeing this problem. It might be a change in behaviour from some patch? I dunno.

    There are no "unit dies" triggers or anything like that running which might be interfering. I created a test where when I type the word "die" into chat it uses the "remove unit from game" trigger and does nothing else just to make sure it wasn't a problem in my code. The unit disapears and then a full 3 seconds later debris appears on the ground.

    It's late at night but tomorrow I'll create a demo map with nothing but a rock tower and a trigger that removes it as demonstration.

    Posted in: Triggers
  • To post a comment, please or register a new account.