Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Misc UMS questions
Misc UMS questions
Aug 31 2020, 4:20 am
By: Dauer  

Aug 31 2020, 4:20 am Dauer Post #1



Hello all,


I've got a bunch of questions regarding what most of you will find to be very basic but here goes.

- what sort of timescale do upgrades and tech operate on? I figured units/buildings work on per-frame basis, eg a command centre will build in 1800 ingame frames, so 75[?] seconds, but upgrades don't add up in my head

- what real-time/game-time rate/fraction do countdown timers operate on? is it a dynamic ratio or something following a specific formula? additionally, which formula does "elapsed scenario time" follow?

- once "defeated" via trigger or made rescuable through a script, can AI players be made active again, aka is it possible to reverse the effects of aforementioned scripts?

- what kind of non-scenario-specific build order, ie not through the use of "Brood Wars - Terran 6" etc, can be used to make an AI player adept but without having him spread all over the base and hog resource nodes?

- is it possible to dynamically adjust AI "difficulty" by running different behaviour based on something like their position on an invisible scoreboard? eg, there's a gap between score so, if possible, AI might stop its current script and switch to something more proactive, then perhaps slow down a bit once he starts hammering the player a bit too hard

- when a kamikaze [not sure if the s-word is allowed here] script is run, be it strategic or random, will AI account for things like custom unit HP/damage, specific unit presence, etc or does he not care too much about specifics?

- is it possible to "refill" mineral patches or geysers once they're partially mined without resorting to creating new ones after they got exhausted? I'm aware of the "set resources" trigger but I doubt it works like that

- what are the exact limits of "create unit with properties" trigger? is it limited to 64 uses per scenario, 64 units created in that manner, or 64 completely unique units created?

- is it a starcraft issue or a mapping tool issue where the latter report doodad states for installation traps as either "0" in chkdraft or "unknown state" in scmdraft?

- are AI "organisation" names hardcoded in the campaign or can they be reproduced by associating a specific race with specific colour, eg white terran will produce "alpha squadron" etc in the stats screen?


I know this is a tonne of questions but it's just a bunch of things I always wondered and couldn't reliably find definitive answers to.



None.

Aug 31 2020, 3:55 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

No worries, we're here to answer your questions, not to judge you. ;)

Quote from Dauer
- what real-time/game-time rate/fraction do countdown timers operate on? is it a dynamic ratio or something following a specific formula? additionally, which formula does "elapsed scenario time" follow?
Game time elapses approximately 1.5 times faster than real-time on fastest. With hyper triggers you have triggers checked every 84ms real-time while 2 in-game frames pass. That means 1 real-time second passes every 12 trigger loops (approx.). 1 in-game second passes every 8 trigger loops (exact). The Countdown timer and elapsed scenario time reference in-game time. The wait action references real-time.


Quote from Dauer
- once "defeated" via trigger or made rescuable through a script, can AI players be made active again, aka is it possible to reverse the effects of aforementioned scripts?
No.


Quote from Dauer
- is it possible to dynamically adjust AI "difficulty" by running different behaviour based on something like their position on an invisible scoreboard? eg, there's a gap between score so, if possible, AI might stop its current script and switch to something more proactive, then perhaps slow down a bit once he starts hammering the player a bit too hard
Sure. Condition: Kills score; Action: Run AI script. Make sure you don't run AI scrips every trigger loop or they will break.


Quote from Dauer
- when a kamikaze [not sure if the s-word is allowed here] script is run, be it strategic or random, will AI account for things like custom unit HP/damage, specific unit presence, etc or does he not care too much about specifics?
Dunno. You are allowed to mention suicide.


Quote from Dauer
- is it possible to "refill" mineral patches or geysers once they're partially mined without resorting to creating new ones after they got exhausted? I'm aware of the "set resources" trigger but I doubt it works like that
Yes. Action: Modify Unit Resource Amount. People have used this in RPGs in clever ways to display numbers, like prices for items or hero statistics. I would assume using EUDs it should be possible to even read the amount. (not trivial)


Quote from Dauer
- what are the exact limits of "create unit with properties" trigger? is it limited to 64 uses per scenario, 64 units created in that manner, or 64 completely unique units created?
There are 64 Create Units with Properties (CUWP) slots. So you can store 64 different sets of properties. They are not bound to units or unit types. If you create a Marine with 50% hp and then a ghost with 50% hp it will use just 1 slot. If you need more you need actions like set hp etc. to modify them after creation.


Quote from Dauer
- are AI "organisation" names hardcoded in the campaign or can they be reproduced by associating a specific race with specific colour, eg white terran will produce "alpha squadron" etc in the stats screen?
good question. I never paid attention and thought they were random.




Aug 31 2020, 4:57 pm DarkenedFantasies Post #3

Roy's Secret Service

- Time cost of upgrades and tech is the same as units. 4000 = 166.666... seconds on fastest game speed.

- Countdown Timer and Elapsed Scenario Time follow the same timing; 1 second per 16 game frames. Meaning it will tick down slower or faster depending on game speed.

- The campaign scripts are the only ones that don't expand to new bases while also having active base management.

- Depending on what you mean: 1) AI behavior is not dynamic in any way that is not written in the AI script, and will not change behavior based on leaderboards/etc. 2) Running multiple AI scripts for a single computer player will have undesirable effects on the long run. Giving everything the CPU owns to another player and back is probably the cleanest way to "refresh" a computer player's AI script, but don't expect smooth transitions when doing so mid-game.

- Strategic Suicide behaves like a normal AI script attack wave, grouping all units that are not set to ignore the command together into a single attack wave. It requires the attack wave to be cleared for the script to be executed again for the same player, but attack_clear is not available as a script on its own. Random Suicide makes all units try to engage or move to the nearest enemy unit individually. They will go idle after losing/killing their target, and so the script can benefit from being run in a loop. Random's targeting will cause units without a weapon to target anything such as map revealers. There is nothing more specific to them as far as I currently know.

- I'm not seeing doodad states being listed as "unknown state" in ScmDraft 2. Do you have the latest version?

- Computer player names are identified by the player ID, so only Player 1 will appear as an "Elite Guard" Terran, regardless of player color.




Aug 31 2020, 9:15 pm IlyaSnopchenko Post #4

The Curious

AI Scripts can be written to adjust their behaviour - everything really including attack strength, delays - based on external stimuli such as death counters, player resources, enemy owning particular units, etc. Score can't be evaluated unless you convert it to deaths/crystals/gas, but then why not use those in the first place.

Faction names (tribe / brood / squadron) are set depending on race and player #. They can be edited in rez\network.tbl (1.16 and lower) or rez\network.json (1.23.2+), but these changes are modwide only, I believe.



Who am I, and why should I care?

Sep 1 2020, 2:53 am Dauer Post #5



Quote from NudeRaider
There are 64 Create Units with Properties (CUWP) slots. So you can store 64 different sets of properties. They are not bound to units or unit types. If you create a Marine with 50% hp and then a ghost with 50% hp it will use just 1 slot. If you need more you need actions like set hp etc. to modify them after creation.
So if I got this right, the different combinations of properties, like HP/MP/invincible/etc, are what take up slots, not different units themselves.

- Time cost of upgrades and tech is the same as units. 4000 = 166.666... seconds on fastest game speed.
I asked this because units like SCV build in 300 of something, in this case frames, but tech and upgrades follow a different pattern, eg stim packs take 80 of something and terran infantry armour take 266 of something, presumably seconds on normal game speed?

- I'm not seeing doodad states being listed as "unknown state" in ScmDraft 2. Do you have the latest version?
I should have clarified that they're listed as enabled/disabled/toggled in user-made maps opened with scmdraft, but in raw chk scenarios they're showing as either 0 or "unknown state". There are tonnes more issues with chk scenarios in general, like invalid newlines in comments leading to trigger preview displaying korean chars or one mission trigger displaying "use disruption web here" script as "brood wars - protoss 4" or whatever it was in that one protoss mission in BW.
Buuuut that's besides the point, and most likely nothing scmdraft can remedy.

Thank you all for the replies thus far, but let's move on to some other questions.

A while ago, I saw this thread http://www.staredit.net/topic/11825/ and downloaded azrael's map to have a look at the inner workings.
Somewhat roundabout to disable doodads one by one, give them to another player, then once again enable them one by one. Surely there is a better way, but based on what I've seen in various threads, different people have different views on how to get it done efficiently.
Personally I was thinking about creating them as doodads for a player who has no other units on the map and using "set alliance status" to make him pals with whoever is the main enemy to the human player.
Afterwards, if a human player walks over to a computer terminal that disables all the traps, the trap owner can be "defeated" through a trigger.
Ultimately, I'm not sure if this is an ideal solution and I'm certainly open to suggestions. Azrael's solution of enabling/disabling doodsds and cycling them between players as units won't produce floor decals if they're destroyed iirc, but not 100% sure on that one either.



None.

Sep 1 2020, 4:35 pm DarkenedFantasies Post #6

Roy's Secret Service

Quote from Dauer
I asked this because units like SCV build in 300 of something, in this case frames, but tech and upgrades follow a different pattern, eg stim packs take 80 of something and terran infantry armour take 266 of something, presumably seconds on normal game speed?
You're right, I haven't looked at the Upgrade/Tech settings tabs in a while. A frame in normal game speed is around 66.666...7 milliseconds, so 80 / 0.066666...7 = 1200 frames for stimpack. Wonder why it's not consistent with the units tab.

Quote from Dauer
Afterwards, if a human player walks over to a computer terminal that disables all the traps, the trap owner can be "defeated" through a trigger.
I think you can achieve the same result by giving the traps to player 12 to deactivate them.
Quote from Dauer
Azrael's solution of enabling/disabling doodsds and cycling them between players as units won't produce floor decals if they're destroyed iirc, but not 100% sure on that one either.
The reason for the "floor decals" is because when placing them as doodads, the terrain beneath them is replaced with different tiles that have the destroyed appearance, but it's simply hidden beneath the unit graphic until it's destroyed. You can manually place these tiles with "tileset indexed" mode.




Sep 2 2020, 2:10 am Dauer Post #7



You've got a point there. Using doodads and doodad state triggers might seem like the "proper" way but placing them as units and then switching between players saves a lot of hassle and doesn't need as many triggers, not to mention making actual sense.
In campaign missions, like BW's terran mission #7, the doodads are enabled for "all players", yet they can distinguish between friend and foe, since they only attack the invading zerg.
With the above in mind, I wonder how well one can make substructure traps work with their designated tiles, but I'll try experimenting with that myself.

Moving on, I had a quick look through SC zerg mission #9, the one where you steal a crystal, and noticed that the AI is a bit of a mess.
Firstly, 2 of the enemies use 2 AI scripts a piece. I was always convinced you should only use 1 script, maybe 2 if one of them is a simple mining base. Is the mission hardcoded to let them use 2 separate scripts per base or is a base defined by whether or not it has a nexus, resources and a bunch of factories under a single location?
Then, you've got the opponents themselves. The 3 comps are in separate forces, they have no alliance set and I don't think the human player is even set to be the enemy, yet they don't fight amongst themselves and only attack the player, so..what was blizzard smoking?

Moving on again because these posts are getting long-winded...

- what is the actual sprite limit per map? Scmdraft defaults to 250, but I've seen mentions of it being 500. Other than doodads and terrain[?], what will increase the count? What will happen if I try to go over the limit?
- can a nuke silo can be used to launch nukes directly across the map without a ghost, a'la superweapons in C&C games? I remember googling that ages ago but don't recall whether or not I found a solid answer
- let's say I want to spawn/place a dark swarm pretending to be a gas leak that will kill anything that comes inside via a kill trigger at location. Is placing it as a unit the best idea or can I use pure sprites? If latter, can the sprite itself be removed later on through a trigger? Will the dark swarm expire on its own? Should I assign it to player 12 like all swarms created normally ingame?



None.

Sep 2 2020, 2:32 am jjf28 Post #8

Cartography Artisan

I've organized a ton of basic timing information here: Trigger Cycles

With game speed fastest...
1 tick = 42 ms (this may be higher when lagging - perhaps because it's the tick a trigger cycle runs on and there are some heavyweight operations)
1 game second = 84/125 real seconds

Quote
which formula does "elapsed scenario time" follow?

It's hard to give you a specific formula without knowing what you want the dependent variable to be (ticks, [trigger cycle type] trigger cycles, real seconds) so instead...:

As mentioned countdown timer and elapsed scenario time is based on game seconds, 1 game second = 16 ticks, regular trigger cycles occur every 31 ticks (without any waits/transmissions), the first trigger cycle occurs on tick 2, you can see the alignment of elapsed time to regular trigger cycles (for the first 10 trigger cycles) at the bottom of the spreadsheet.

Quote
what is the actual sprite limit per map? Scmdraft defaults to 250, but I've seen mentions of it being 500. Other than doodads and terrain[?], what will increase the count? What will happen if I try to go over the limit?

2500 or 5000 depending on whether your map is running with extended limits, this wiki http://www.staredit.net/wiki/index.php/Map_Limits was from 1.16.1, most are simply doubled for extended limits (they gave numbers in the patch notes somewhere), units all have at least one sprite, some have multiple; many weapon effects have sprites, there are "pure" sprites that you place on the map in editors; note that when you place a doodad in the editor it's actually placing some terrain and a sprite (if the doodad has a sprite), StarCraft doesn't care whether your editor thinks something is a doodad. If you hit the limit you may get CCMUs, firelag, and increased prospensity for desyncs.

Post has been edited 2 time(s), last time on Sep 2 2020, 8:20 am by jjf28.



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Sep 2 2020, 3:24 am Dauer Post #9



Thanks, even though this is a lot to process in one go. The question came from a simple observation that countdown timer seconds don't align particularly well with real time.
Also, when I asked about map limits, I meant mapping tools, not necessarily ingame limits. That's mainly so I know whether I can go crazy with decor without making the game explosm.
Also #2, I have an issue with your tool, but I'll post in your own thread instead.



None.

Sep 2 2020, 3:26 am DarkenedFantasies Post #10

Roy's Secret Service

Quote from Dauer
[...]but placing them as units and then switching between players saves a lot of hassle[...].
Keep in mind that placing doors and traps as doodads will still give them to the player you have selected, and the "Give Units" action will also work on them.
Quote from Dauer
In campaign missions, like BW's terran mission #7, the doodads are enabled for "all players", yet they can distinguish between friend and foe, since they only attack the invading zerg.
It's only a "lazy" way of doing it; the traps are owned by a specific player, so whether you enable them for "all players" or for "player #" it will do the same thing.

Quote from Dauer
Moving on, I had a quick look through SC zerg mission #9, the one where you steal a crystal, and noticed that the AI is a bit of a mess.
Firstly, 2 of the enemies use 2 AI scripts a piece. I was always convinced you should only use 1 script, maybe 2 if one of them is a simple mining base. Is the mission hardcoded to let them use 2 separate scripts per base or is a base defined by whether or not it has a nexus, resources and a bunch of factories under a single location?
One of the scripts of a specific computer player is a main town, while the others are area towns. Main towns are written to run at least 1 frame later than area towns, the latter of which take control of all units inside the associated locations in order to run them as towns separate from the main script. Running multiple main towns for a single cpu will cause some issues due to conflicts, as one script is requesting some stuff while the other is requesting other stuff in the same town. Since area towns take ownership of their own town (and generally have much fewer requests), they run fine alongside the main script.
Quote from Dauer
Then, you've got the opponents themselves. The 3 comps are in separate forces, they have no alliance set and I don't think the human player is even set to be the enemy, yet they don't fight amongst themselves and only attack the player, so..what was blizzard smoking?
Computer players are automatically allied to each other, and opponents to human players.

Quote from Dauer
- let's say I want to spawn/place a dark swarm pretending to be a gas leak that will kill anything that comes inside via a kill trigger at location. Is placing it as a unit the best idea or can I use pure sprites? If latter, can the sprite itself be removed later on through a trigger? Will the dark swarm expire on its own? Should I assign it to player 12 like all swarms created normally ingame?
Dark Swarms placed in the editor will never expire on their own. Placed as units, its collision box must not be over impassable terrain and not stacked with other dark swarms, but can be removed/killed through triggers. As pure sprites, they can be placed over impassable terrain or stacked but aren't affected by triggers.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:29 pm]
MTiger156 -- u
[06:58 am]
NudeRaider -- m.0.n.3.y
m.0.n.3.y shouted: Mini Game Party was featured on Artosis's channel recently! Pretty cool win for UMS: https://www.youtube.com/watch?v=gSydfyOfOpI
"xKrayZee sux"
[04:36 am]
m.0.n.3.y -- Vrael why do you say that?
[12:03 am]
Vrael -- thats awesome money, for you, but artosis is a giant turd of a human being
[10:12 pm]
RdeRenato -- a
[09:59 pm]
m.0.n.3.y -- Mini Game Party was featured on Artosis's channel recently! Pretty cool win for UMS: https://www.youtube.com/watch?v=gSydfyOfOpI
[2021-1-17. : 3:47 pm]
C(a)HeK -- greetings all, friends, can you check my new post? :) http://www.staredit.net/topic/18183/
[2021-1-17. : 3:17 pm]
IlyaSnopchenko -- Neiv
Neiv shouted: Depending on your situation you may be able to use 18/19/20/21 to select all players in a force?
thanks! Will use the force # instead most likely, if they're in the same one
[2021-1-17. : 2:26 pm]
Neiv -- Depending on your situation you may be able to use 18/19/20/21 to select all players in a force?
[2021-1-17. : 2:25 pm]
Neiv -- IlyaSnopchenko
IlyaSnopchenko shouted: Anyone knows whether current player (13) is counted among allied (15) when specifying targeting flags for idle_orders in AISE?
It is not counted; the dll seems to accept a combination of multiple players there like most other extended commands, but pyai doesn't seem to allow specifying them in targeting flags
Please log in to shout.


Members Online: jjf28, NudeRaider