• 0

    posted a message on Modify Max Vital Over Time

    You could use a Modify Player effect to modify the catalog for the unit but that would affect all instances of that unit.

    Last I checked it was much worse to modify data than it was to use buffs due to a resource leak. Each time data is modified it made a duplicate of that data leaving the previous copy in memory, unused. Thanks to efficient algorithms it did not slow the game down but it did mean exiting the game could take several minutes due to some inefficiency with freeing the extra allocated copies. Additionally if several million such modifications were made it is possible some clients may crash due to out of memory errors.

     

    I recommend looking at how Rexar does this for his one trait in Heroes of the Storm. He might use a method compatible with Heroes of the Storm. I suspect it was done with stacking buffs.

    Posted in: Data
  • 0

    posted a message on trigger for build time

    Try using the catalog actions to modify the build ability for the specific player. There are also catalog functions to read values if you want the modification to be dynamic, eg 50% as opposed to a constant.

    Posted in: Triggers
  • 0.960446719404374

    posted a message on Square root function 524287 limit bypass? [Solved]

    You still might want to check individual sub parts such as the q^2 in case of overflow. In such a case you could clamp them to max value instead of the output of the entire thing becoming garbage.

    Posted in: Triggers
  • 0.96040987424313

    posted a message on Square root function 524287 limit bypass? [Solved]

    Would it not be possible to scale down the formula? Currently it uses some pretty large numbers.

     

    For example 440 * population * quantity supplied. So if one was to supply 1,000 people with 1,000 units you are looking at 440,000,000 which is well past the range of the SC2 fixed point. However if one were to define population in thousands of people and supply in thousands of units then one gets 440 * 1 * 1 which is 440, well within the range of the fixed point type. Obviously the constants would need to be changed depending how they were derived. If the constants end up growing then this is counter productive so not a viable solution.

     

    One could try rounding parts of if into integers (range of -2,147,483,648 to 2,147,483,647). However I doubt the game comes with integer square root so one would have to implement one themselves. Wikipedia has a few articles explaining. https://en.wikipedia.org/wiki/Methods_of_computing_square_roots

     

    Otherwise you will need some kind of custom number type with custom maths functions to process the intermediate value.

    Posted in: Triggers
  • 0.96037296037296

    posted a message on Square root function 524287 limit bypass? [Solved]

    One might have to write a custom floating point or multi word fixed point library to solve such an equation. Such libraries are often used for micro controllers and other cheap/simple processors where larger or more complex dedicated maths instructions are missing. I suggest using a search engine to look for such code, there appears to be tons on GitHub with heavy reference to Wikipedia which might be adaptable to Galaxy.

     

    What is it for? Maybe there are other solutions that achieve similar results without requiring large intermediate values. For example an iterative algorithm that approximates towards it within reasonable time and complexity.

     

     

    Posted in: Triggers
  • 0

    posted a message on Making Cooldown system without using "Periodic Event" and "Repeat Forever".

    Periodic events alone will not cause lag. One must either be using far too many of them (inefficient) or something else is the cause.

    Posted in: Triggers
  • 0

    posted a message on Making triangle region

    Is it possible to modify natives script now, like events?

    As far as I am aware it is not possible to modify natives like it is not possible to modify events as they are hard coded into the SC2 game engine.

    Posted in: Triggers
  • 0

    posted a message on AI melee don't start with all races

    I do not think the melee AI system was designed to cope with dynamically switching races.

     

    If setting the race and then turning on Melee AI does not work, you will need to use custom AI. This custom AI can use the melee AI logic (extract from the CASC system), however which functions it runs are dynamically resolved from race rather than a hard coded sequence for a specific race.

    Posted in: Triggers
  • 0.962722852512156

    posted a message on A number of questions about Trigger related issues

    3. Understanding what is a model and is not

    Any file ending with .dds is a texture. Any file ending with .m3 is a model. I think models reference textures at a specific file path within the StarCraft II file system. The hard coded texture paths can be swapped out with an arbitrary texture to some extent.

    5. How does one find the string for this highlighted action?

    UI editor allows one to browse the XML of the UI elements. The string is created based on what various XML elements are named.

    6. What does this do?

    Sets a global reference named "1testname" to the actor which executes the message. Another message can use this global reference to interact with that actor from another actor. Since the reference is global only 1 actor can be assigned to it at a time, however this is still useful if one only needs a reference to the actor immediately, eg for accompanying actor to connect to it. I think various targeting UI from WoL such as Raynor's Penetrating Rounds used global references. I also recall the heal beams from medic/medivac also using it.

    7. Talking Portraits(Lips)

    I think one needs to attach the appropriate lip sync file to the voice over that one orders the portrait to play. I am not familiar with how to load lip sync files to a portrait without a voice over, but possible they are animation extension files. Alarak and Zagara likely do not support lip sync (they have no human like mouth) so instead they use generic talking animations similar to how Warcraft III worked.

    Posted in: Triggers
  • 0.962236390387445

    posted a message on Not able to spawn unit : Error: Parameter ouf bounds in 'sUnitCreate' ...

    ...owner by 'any' = it's seem to make me the number of active player (and it doesn't give me any error)

    Any is not a valid parameter to make a unit with. A unit must be owned and any is not a valid owner.

     

    Parameter ouf bounds in 'sUnitCreate' (Value: 16, min: 0, max: 15) (this is what I don't know how to solve it)

    Player 16 is not a valid value for the player. I am guessing it is failing to find a unit so you are getting the owner of null and hence it returns an invalid player number.

    Posted in: Triggers
  • 0.96440489432703

    posted a message on [Net Neutrality] Asking the real question here.

    Why would they want to do such thing?

    Because half the reason a lot of people cannot play HotS in the USA is because of so many people streaming that it is overloading some internet nodes causing them to drop packets. Under current regulations all packets have to be dropped and delayed equally, even if that packet is 1 of several megabytes worth per second used for a 4k HD stream that no one would care is dropped, or is a few kilobytes per second of game command packets that is extremely latency critical and dropping it will cause the player to experience lag due to retransmission. Technically under the new regulations internet companies could offer cheaper low priority bandwidth for streaming companies where latency is unimportant but quantity is while offering game servers more expensive high priority bandwidth where latency is extremely important but quantity is small.

     

    Sounds good and sensible right? Well the problem, and reason why the previous regulation existed to stop this, is human greed. Instead of offering sensible QoS levels at sensible prices targeting different practical applications. They will use QoS to blackmail content providers into having to buy the most expensive "premium" QoS level to even stand a chance of having their packets delivered. Once everyone is subscribing to this premium QoS and the internet starts to behave like it does currently due to too much data and too little infrastructure they will then introduce a new "ultra premium" QoS level that is above "premium" with a larger cost. The black mail cycle will repeat with normal premium customers not being able to reliably deliver content unless they subscribe to the new ultra premium service. During this cycle no one bothers to invest in new infrastructure as you can just charge infinitely more for existing infrastructure by inventing new "extra ultra premium" QoS levels for it to sell.

     

    Mostly when they want to sell you a service and there is a free alternative out there, without net neutrality they can just block all access to it to users using their internet. It also enables them selling limited internet where you can only access certain things, which might not be terrible on individual level (as you chose to pay less) but is a bad thing on a bigger scale.

    The average private internet consumer will probably not notice the change at all, even to their internet bill, as there is no real way or point to meter them. It is the content providers who will be paying for the QoS, and that QoS can apply both ways (so they can pay for priority incoming and outgoing traffic). This is why Facebook, Google, etc are all against it since they will be the ones having to pay.

     

    What the average private internet consumer will notice is that the QoS of the sites they visit and services they use will change, for better or worse. In the case of games, if the game company subscribes to a higher end QoS connection then their players might have a better play experience as connections that lagged before start to work with low ping. On the other hand if the game company goes with the cheapest QoS they can find the opposite can happen and where as before players could play with low ping suddenly the game becomes unplayable. This can only be made worse if huge bandwidth intensive content providers such as Netflix or Google use high end QoS to deliver their streaming services as although their streaming performance might improve slightly, it will totally trash peoples ability to play online games unless the companies use the same or better QoS in which case it becomes nothing better than it is now but costing more.

     

    This is why "net neutrality" is important. This is why most sensible countries enforce it.

    Posted in: General Chat
  • 0

    posted a message on Ordering workers to build structures via triggers.

    You send it a build order to the desired location. Note it will fail if the location is not suitable for the build order, such as the building cannot be placed there or enemies are in the way.

     

    Be aware that in GUI the action to send orders to units defaults with an order function for instant orders. One needs to change this order function from the tree view to the appropriate order function that can allow a building order.

     

    If the player is AI controlled one can enable the AI for it and then send AI build orders. These are not really recommended for cinematics as the AI might not produce consistent results with them, and can even ignore them entirely.

    Posted in: Triggers
  • 0

    posted a message on Forcing AI to Build a Base and Train Units

    Be aware that AI train/build/upgrade orders should be periodically re-issued. The AI might otherwise forget them after a long time. This is how the melee AI works, it periodically clears the order queue and repopulates it with new orders.

    Posted in: AI Development
  • 0

    posted a message on Text when specific player joins the game

    Each account has a unique player handle. All you do is string comparison that handle with hard coded player handle strings for the appropriate players.

     

    That said it is generally considered bad mapping practice to do this outside of map developer only debug features.

    Posted in: Triggers
  • 0

    posted a message on Triggers, probability system variable! Help!

    For a start SC2 uses Galaxy not Jass (the trigger language of WC3).

    Technically both StarCraft (original, 1) and Warcraft III use JASS.

     

    One way to implement this is to use a 2D array where one index is for spawn types and the other index is for player. The sum of all unit type indices for a single player equals 100. To determine what to spawn pick a random integer between 1 and 100 (100 different possibilities). Loop through each unit type index for the player and add its chance value to an accumulator. If that accumulator is greater than or equal to the random integer that was rolled then spawn the unit (or save it to a variable to be spawned outside the loop) and break out the loop.

     

    This works for integer probabilities and technically can even work for totals not equal to 100 as long as the appropriate random number range is used.

     

    A more scaleable implementation would use a binary search tree to resolve which result occurred for the random number generated however for your use case a linear search should be sufficient.

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