• 0

    posted a message on Triggers that access a global variable (an array of 400 by 400 reals) malfunctioning during multiplayer only

    Forget about limits - there are no limits on anything that would be exclusive to online games. 400x400 array of scalar type like fixed (aka real) is nothing. Whether you actually need this array to achieve what you need is another thing, but let's not focus on this.

     

    I am assuming that global variables are only running in one spot (host? battlenet? Who handles trigger execution logic?

    It seems like you just don't get how SC2 works. It's based on so called deterministic synchrous game engine.. I'd recommend you to read this [1] to get better understanding.


    To answer your question in short - everyone.. that is every client/player connected to the game. Not the battlenet server though. When your friend drops a nuke, he has to process the action on the same terms as you do (over the wire there are transmitted only inputs/commands from each client). Thus both of you use the same global variables to get the same result.
    Perhaps this is what you've missed, when implementing triggers (I didn't try to analyze them).

     

    [1] https://blog.forrestthewoods.com/synchronous-rts-engines-and-a-tale-of-desyncs-9d8c3e48b2be

     

    and that triggers are not multi-threaded (i.e., an infinite loop will freeze the game; the game allows as many CPU cycles to finish trigger loops as those loops require, it does not save pause long loops and resume them later).

    There is multi-threading.. but no the one you'd expect - threads cannot run in parallel. And executions happen in cycles. I'll just link the wiki again, because it explains it better than I would be able to:

    https://en.wikipedia.org/wiki/Cooperative_multitasking

    In case of SC2 context switch can be initiated by Wait function. When supplied with 0.0 it guarantees the thread will be resumed in next game frame.
    And yes, there's a limit of actions VM can perform during one frame. I don't recall exact limit, but you can indeed freeze the game for few secs, before timeout occurs.

    Another thing that makes this hard is the lack of any debugger (that I know of).

    There's one.. kinda obscure, but does the job. In testmode you can open it by typing "TrigDebug". Also it requires game to be in windowed mode. If you want to have it at start of the game then head over to editor preferences -> test document.

    Is there any way at all to open some kind of debug message window DURING MULTIPLAYER and see if the map is generating errors?

    You can setup TriggerDebugMessage to save to log file. Log file will be written anytime you play the game or watch the replay.

    But, you can also relaunch SC2 with "-development" flag, that will enable test mode for replays. Including access to debugger.
    If you launch SC2 from Battle.net client, then in its options there's somewhere a field to type additional cli params. For testing purposes that would be "-development -windowed -trigdebug".

     

    When testing offline it's also good too add additional dummy players, that have the control shared to you. And simulate what would happen in actual online game.

    Posted in: Triggers
  • 0

    posted a message on Cannot build ultralisk in custom map..WTF......

    Yes, multiplayer and campaign dependencies don't play well together. If you want to use them together, you'll have to resolve such issues on your own.

     

    Multiplayer dependency is automatically injected to maps set as melee (and that's the root cause of your problem). Add VoidMulti dependency at the end of your current list, and Editor will reflect what's actually happening in game.

     

    Posted in: General Chat
  • 0

    posted a message on Starcraft 2 - Square Root Function Behaviour

    Are you familiar with the difference between floating point and fixed point number?
    SC2 doesn't use FPU, and the fixed type is the way around it, which comes at the cost of low precision.

     

    Fixed type consists of 32 bits:

    ---------------------------------------------------
    -- 1 sign | 19 integer part | 12 fractional part --
    ---------------------------------------------------

    I won't tell you how the internal implementation of this function looks like, as I don't really know myself. But there are certainly couple of methods it could've been done. 

    SquareRoot(10.5) ==> 3.2402

    The result was trimmed to 4 decimal places, but in reality it is exactly equal to .240234375 (result of 984/4096).
    The next possible value would be .240478515625 (result of 985/4096). What is above the expected result of sqrt, thus it returned the closest possible that was equal - rounded down.

     

    The fractional part of 10.5 is represented as 2048/4096. Now if you iterate over next possible values:

     

    2049/4096 = 0.500244140625 | sqrt(10.500244140625) = 3.2404080207012513 (nope)
    2050/4096 = 0.50048828125 | sqrt(10.50048828125) = 3.240445691760626 (nope)
    2051/4096 = 0.500732421875 | sqrt(10.500732421875) = 3.240483362382069 (got it!)

    So yeah, that's as far as explanation goes.

     

    btw. You can increase the verbosity of FixedToText when it comes to decimal places - it just defaults to 4 at most.

    Posted in: General Chat
  • 0

    posted a message on Please recovery link

    Ah damn, you're right. I thought numbering in attachments have been preserved, but nopeee.. anyway this is correct URL:

     

    https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
    before:

    http://www.sc2mapster.com/media/attachments/15/252/Screenshot2011-04-17_09_16_21.jpg

    (I have no clue where these 2 numbers come from)

     

    This is how I found it:
    site:sc2mapster.com "Screenshot2011-04-17_09_16_21.jpg" -"15/252/Screenshot2011-04-17_09_16_21.jpg"

    (in Google)
    then in source code of the first result search for:
    class="multi-file-upload-file-image comment-attachment-image" alt="Screenshot2011-04-17_09_16_21.jpg"
    The preceeding src attr of img element will be correct URL. But I'm unsure if this method would work for in all cases. I think it's worth to note anyway.

     

    (btw. this would have been easier if media.forgecdn.net was indexed by Google, but it isn't sadly).

    Posted in: General Chat
  • 0

    posted a message on GAx3 Trigger Source Code? Dependency Problems

    Yeah, this file was mostly stripped from newlines.. and whitespaces in general. I don't know why he did that.

    Anyway, I guess you don't really need to modify it, since you can just re-link the dependency that's still up on bnet, right? If no, I could fix the file for you (in the past I wrote some scripts for cases like this).

     

    btw. If you wanna work with Galaxy code I recommend this : https://marketplace.visualstudio.com/items?itemName=talv.sc2galaxy :p

    Although the feature which you would need right new - that is pretty print/format code is not yet finished.

     

    Posted in: General Chat
  • 0

    posted a message on Please recovery link

    That's different thing. Attachments (which were bound to posts) have been restored. All of them I believe.

    However attachment URLs have changed, and links manually embedded in the posts haven't been updated. But if you correct them by hand they'll work.

     

    With the exception of the ones that are orphaned - when original post to which the attachment was bound have been removed (or attachment was manually taken down). In such case these files haven't been moved to the new CDN.

     

    The example of it can be attachment in the signature of DrSuperEvil (which is trimmed btw.) - full signature can be seen in WaybackMachine:
    https://web.archive.org/web/20160612001107/http://www.sc2mapster.com:80/profiles/DrSuperEvil/

     

    That's the URL:
    http://www.sc2mapster.com/media/attachments/15/252/Screenshot2011-04-17_09_16_21.jpg

    It uses old pattern. Now attachments are stored in CDN, corrected link would look like that:
    https://media.forgecdn.net/attachments/15/252/Screenshot2011-04-17_09_16_21.jpg

    Unfortunately it doesn't work because of the reason I've mentioned above. It was an orphan. The post/project to which it was bound have been removed before site was migrated.

     

    When it comes to links in general, then yes. They didn't bother fixing them. But it's fairly easy to do that manually using search engines when there's such need. As example take the link in DrSuperEvil signature:
    http://www.sc2mapster.com/forums/resources/tutorials/20772-data-actor-events-message-texture-select-by-id

    Now cut the part after ID, that's: "data-actor-events-message-texture-select-by-id"

    Then build following query for the Google engine:
    site:sc2mapster.com inurl:data-actor-events-message-texture-select-by-id
    That would be:
    https://www.google.com/search?&q=site:sc2mapster.com inurl:data-actor-events-message-texture-select-by-id

     

    It works in most of the cases. If however title of the thread was changed, then other methods must be used.


    This is how I've fixed links in the Tutorials section of the Wiki btw.
    https://sc2mapster.gamepedia.com/index.php?title=Tutorials&curid=496&diff=13382&oldid=13381
    (using script that automated the process).

    Posted in: General Chat
  • 0

    posted a message on Please recovery link

    All attachments works now. Silent update from Curse... not actually sure if intentional, haha. Perhaps it's "side effect" of their migration to AWS.

    https://www.curseforge.com/news/3113-site-maintenance-underway

    Posted in: General Chat
  • 0

    posted a message on GAx3 Trigger Source Code? Dependency Problems

    Yep, you did miss an include statement:

     

    // Custom Script: Custom Script
    //--------------------------------------------------------------------------------------------------
    include "TriggerLibs/GAx3"

     

    There's another Galaxy file, where all the functions are actually declared.

    It's because author coded it all by hand, and in Triggers there are just metadata definitions of these functions - pretty much like you've said. So they can be accessed from the GUI. But actual function declarations are in this custom file.

    Posted in: General Chat
  • 0

    posted a message on Galaxy IDE as Visual Studio Code extension

    In general whitespaces are ignored in languages where they are not used for indicating beginning and start of the block  (such as Python etc.). Galaxy mostly follow C syntax, thus you could even do things like:

     

    int lv_I;
    if (true)
    {
    lv_I+= 1;
    }
    else
    // a
    if
    (
    true
    )
    {
    lv_I
    +=
    1;
    }

    And it should work (it does in current version of SC2). But you might be right - I never tested how it did behave in the past.

     

    Reporting bugs here is completely fine too. But I just respond to it slower, since I don't visit the site so often anymore.

    Posted in: Galaxy Scripting
  • 0

    posted a message on GAx3 Trigger Source Code? Dependency Problems
    Triggers file defines all the elements which are present in Triggers component of the Editor, and as such it is file exclusive to the editor, it is ignored by the game if present - the process of generating Galaxy code is done by editor.

    And now more specifically to your problem - *GAx3.SC2Mod* can be downloaded here: https://www.sc2mapster.com/projects/gax3-starcraft-ii-editor-enchant

    What you probably did, thus I'm kind of confused why you're saying it has no *.galaxy file included. Perhaps you were looking in root directory for MapScript.galaxy? In case of libraries the file is put into Base.SC2Data subdirectory, i.e. Base.SC2Data/LibGAx3.galaxy.

    Keep in mind that the version of GAx3 linked above is very old and likely not up to date.

    But most importantly, GAx3 is still up on Battle.net:
     
    There are some copies, but always look for the one from the author itself - Renee.
    It was even updated this month, what indicates any bugs introduced by recent SC2 patches were addressed.
    You probably just need to link it again into your map.
    Posted in: General Chat
  • 0

    posted a message on Galaxy IDE as Visual Studio Code extension

    Thanks for reporting these, but if you've account on Github it would be probably better to report it there - I get the notification and such.

    https://github.com/Talv/plaxtony/issues

     

    As for the second one, if you move things around, you'll get:

     

    if (true)
    {
    lv_I+= 1;
    }
    else if (true) // removed new line :)
    {
    lv_I+= 1;
    }

     What is valid code :) Unless SC2 Galaxy parser complains about something like that? O.o

    Posted in: Galaxy Scripting
  • 0

    posted a message on Time for another Is The Arcade Dead? thread!

    Hah, this kinda remainds me of all these Reddit posts "is it too late to get into starcraft" which are popping every other month since years.

    https://www.reddit.com/r/starcraft/search?q=is it too late&restrict_sr=on&sort=relevance&t=all

     

    Maybe an API to track stats for my game and maybe being be able to do HTTP requests inside the game? Is that too much to ask?

    From security point of view, yes it is too much.

    SC2 has official API though, where you can fetch players game history and such. But it's all kind of limited, and rather specifically suited for Ladder tracking, not Arcade.

    Posted in: General Chat
  • 0

    posted a message on Importing .m3 to Blender error

    Without going highly technical you could think of this file as a map of M3 format. Which purpose is to describe how to turn the binary data behind it, to meaningfull a structure of nodes/elements. Where each node describes different part of the model. What in the end allows it to import/export data to modelling programs, as long as they follow the structure described.

     

    Even though this schema file is ambiguous, as in it could be used by other software, currently only m3addon does it.

     

    Due to complexity of the format, there's still a lot of quirks regarding it unkown/undocumented. Not to mention, it has been evolving through the years since the release (and still is). Each release has been versioned, and brought new features which affected how the binary data is distributed along it.

     

    There's simply no full coverage. The reason why certain models can't be imported, or are imported improperly is because model contains something, that hasn't been documented and included in the schema. Or there are bugs within the code translating already loaded data, into Blender environment.

     

    M3Addon actually attempts to load data in quite a strict mode. And often times, once it encounters something contrary to the schema, it will cease the process and output error.
    While other importers made for M3 have more speculative import process implemented I believe. And rather skip some unknown chunks of data, and attempt to load relevant sectors in usual manner. What always gives you something - even if incorrect. Other times, they crash hard :)

     

    Anyway, quite often import errors occuring in m3addon can be resolved by just filling missing gaps within the scheme file. Of course that requires some understanding of how is it all connected. Author of the plugin actually documented some of the common problems, and how can they be resolved.

     

    In this particular case, the problem was relatively easy to resolve - even with all things said above, my understanding of m3 format, modelling stuff, and general graphic rendering subjects is quite poor, really. Anyway, the cause of the error was a result of the strict behavior in method responsible of loading mesh vertices. There was one flag not covered by the schema file. And this flag turned out to to be relevant in this case, to get the model right.

    This was it: https://github.com/flo/m3addon/pull/38/commits/8f4ff44ee995dabeff83d41655627be02c3aaa42

     

    Unfortunately author doesn't actively work on the plugin anymore, and no one else competent stepped in to provide furher support for Blender. Partly because there is more focus given into 3ds Max, what's not suprising.

     

    Anyway, while my knowledge on this field is poor as I said, if you want badly some model imported into blender, and it results in error, I guess I could give it it a look.

     

    hmm.. for such a small question, I probably put up too long answer, haha

    Posted in: Artist Tavern
  • 0

    posted a message on Importing .m3 to Blender error

    The model in question stores vertices in a format currently unsupported by m3addon.

    However, I did investiagate it further and was able come up with a fix.

    Fix was sufficient to successfully to import and export back model to m3.

     

    Here is updated: structures.xml (schema file that plugin uses for a reference)

    You just have to replace it with the one currently exisiting in m3addon folder.

    (I'll later submit the patch to plugin maintainer.)

    Posted in: Artist Tavern
  • 0.962616822429907

    posted a message on Func Ref/Pointer Syntax
    void fn_prototype(int a);
    
    void some_function_that_must_match_above_signature(int param)
    {
    }
    
    void main()
    {
        funcref<fn_prototype> ref;
        ref = some_function_that_must_match_above_signature;
        ref(1);
    }

     

    Some further explanation about _ref thingies can be found here:
    https://www.sc2mapster.com/forums/development/galaxy-scripting/148197-passing-arrays-as-parameters

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