Please stick to the "terran fights invading zerg" concept instead of "play god and shoot random dudes"... Part from that i suggest a coop mode, where 1 player has to protect the convoy from above, another one is manning the cannon on the convoy itself and maybe a third one which operates an anti air cannon to defend (though i dont know if there are skybox textures at all to make it look good)
- Registered User
Member for 8 years, 8 months, and 5 days
Last active Fri, May, 27 2011 19:34:26
- 0 Followers
- 27 Total Posts
- 0 Thanks
Feb 9, 2011Posted in: Data
Its far easier:
- Create a buff (behavior) on your unit, that periodically casts a Search Area Effect
- Set the Search Area Arc to the sight angle (180° maybe). Be sure to set Impact Location and Launch Location to Caster Unit/Point, otherwise it would always assume your unit has a 0° facing. The Effect you apply to the found unit is up to you...
Dec 1, 2010Posted in: Project Workplace
- put all your items in a list where the list index corresponds to the spawn location
- iterate n times where n is the list count
- Generate random number A from [0, n[
- Generate random number B from [0, n[
- Swap List[A] with List[B]
Nov 12, 2010Posted in: Triggers
I'm just curious, how is the anti camping zone designed? Just like a general "no-go" zone, where you get squashed after a certain time? Or do you want to prevent players from staying in the same spot all the time? A problem with your anti-camp design could be: Player A enters zone->timer started. Timer running out in 3..2..1..Player B enters zone...0. Player B caught for being in the wrong place at the wrong time.
For general anti camp stuff you could work with the "Unit Becomes Idle" Triggers. For example set a marker of the units current zone/point in an idle candidates list and use a global timer to check periodically, whether your idle candidates left the zone/moved at least X from the initial point. Or just start a trigger when unit becomes idle, and set a position variable locally. Wait for X seconds and check again.
Nov 2, 2010Posted in: Tutorials
In this tutorial, I am going to show you how to create a Starcraft 2 texture for a custom tileset.
- Starcraft 2 (orly)
- Gimp 2.6 (or later)
- Gimp Plugin to handle DirectDraw Surface files (*.dds)
- Gimp-Normalmap, CrazyBump or any other tool to generate Normal maps
The SC2 Engine uses Deferred Rendering, that means instead of rendering an object one time for each light in your map, an object is rendered only once. To get the correct light result for more than 1 light, light information for each pixel are stored in the RGB channels of its texture, thats the base-map - the texture file (how much of a red/green/blue light would this pixel reflect).
With the base-map, we can make out terrain look colorful, but it still would look a bit flat. Bricks have cracks and other details...they are not even. To get more details into a simple texture, the Starcraft 2 Engine uses some kind of Bump Mapping. That means, on top of our base-map we project another texture, that contains information of the height of each pixel. Thats handy, but if we would rotate our map (or adjust time of day values to change the light) the lightning on a bump mapped surface would always bounce in the same direction. To get a nice lightning effect for each aspect, we need information for each axis we move (x,y,z). Thats what Normal Maps are for. Each RGB channel is a height map of our texture, where R=x-axis, G=y-axis, B=z-axis. If we would move in our scenery along the x-axis, the R channel of the normal map tells the engine how to adjust light reflection. Edges will have brighter values and reflect more light whereas cracks would be dark and start reflecting only at an extreme angle or not at all. SC2 Normal maps also have an alpha channel, that works as some kind of default bump map.
- Prepare your texture file (tiling it, contrast etc.)
- Create a standard normal map of your texture (use Crazybump, Gimp-Normalmap or even the Photoshop plugin, whatever you are comfortable with)
- Prepare your Gimp if you want to follow this tutorial (install gimp-dds) or have a snickers if you just want to know basics
- I'll use these:
Creating the Base Map
- Take a tiled texture of your choice (I am not going deeper into tiling textures; some say you don't even need a seemingless one). Almost all Terrain Tiles are 512x512, changing the size of a terrain texture will result in a scaled texture ingame, so stick at this size or go higher.
- Open it with Gimp.
- Remove the alpha channel, if it exists. (Right Click on the Layer->Remove Alpha Channel)
- The RGB channels should be fine; you may adjust brightness values, but if you can clearly see it, they are ok
- Now we apply a new Alpha Channel to our texture.
- Setting it to 255 (white) will result in nothing but white glimmering space. :) The texture will be drawn but is completely overloaded with light, since it will not let light through and reflect everything. A value of 0 (black) will do a plain texture as your RGB channel reflects nothing and doesn't change at all.
- Basics: Red Channel describes where red light will be reflected, so that our texture appears to be red. Same for the other channels. The Alpha channel determines, how much of light is reflected in general, see it as a sun glass for your texture. The darker a channel (or a pixel/area in this channel) the less light will be reflected there.
- If you have a generally very dark texture (reeaaaallly dark) your alpha channel could almost be gray...If you want a texture, that reflects light extremely (slime, organic bleeding stuff), your alpha channel can be gray. However, for most textures you want an alpha channel that is between 1 and 25, that means almost fully transparent.
- Alpha Channel Gimp:
- Select "Colors"->"Levels", change the channel dropdown box to Alpha. What you see there is a histogram, describing how much pixels are of each color in the grayscale. We want every pixel there in a range from 1 to 40 (try it out what suits you best).
- Leave the first slider as it is (Did you touch it? select the whole spectrum from 0 to 255 with 1,00 as the gamma value). You want to adjust the "Output Levels" slider: Drag the right pointer to about 40 or just enter it in the textbox on the right, then hit OK.
- This is what the final histogram could look like:
- Now the image is gone...in the world of wysiwyg. It's still there, but almost transparent.
- Save your file as a *.dds; use BC3 / DXT5 compression and check "Generate mipmaps" (Use these settings for all SC2 DDS files).
Creating the Normal Map
- Load your standard normal map into Gimp.
- Remove the alpha channel, if it exists. (Right Click on the Layer->Remove Alpha Channel)
- This is where the fun starts: We have to set up all channels to fit into the Blizzard Normal map scheme. Remember what we said about how the RGB channels are assigned to the axis? R=x, G=y, B=z. Selecting only the red layer you should see all dimples from top to down; all from left to right with only the green layer selected. And blue? Why does it display both? If we move along the Z axis, all the edges are relevant. But guess what: We dont need them. R and G combined does almost the same.
- The Alpha Layer of the blizzard normal map acts as the bump map from above, so we have to combine R and G and copy it to the alpha channel:
- Unselect any selection you have ("Select"->"None")
- Right Click the Red Channel -> "Channel to Selection"
- Right Click the Green Channel -> "Add Channel to Selection"
- Right Click on the empty space below -> "Add Channel" -> Opacity 100%, Check "Initialize from Selection"
- Unselect any selection you have ("Select"->"None"), depending on your image, these selections really slow down Gimp...
- Now we have an additional channel, representing x and y movement reflections. Later more on that
- Right now I'm unsure, some people say we need a red-scale normal map, for me a grayscale worked fine.
- To convert the image into a grayscale we do the following:
- Select the Layer
- Right Click on it ->"Colors"->"Components"->"Channel Mixer", check "Monochrome", don't click OK
- Now you have to choose from which channel you want to take the colors; Select the Green Value (100%).
- You can also check Red and Green and do 50% for both. This setting does not change the color of our map itself, it just changes how the lightning on our texture changes when we move through the map. Since the SC2 point of origin is the bottom left of your map, we move in the x or y so both of them or a combined value is ok.
- Now the Normal map is almost complete.
- Setting up the old R channel (the one thats still hanging around) as Alpha:
- Right Click on the layer -> Add Layer Mask, select "Channel" and choose this channel
- Remove the R channel: Channels -> Right Click on it -> "Delete Channel"
- Select the Layer -> Right Click on it -> "Apply Layer Mask"
- That should be it; Save the file as *.dds just like the base-map
- Thats what I did with the channels:
Importing / Data
- Read Alcoholix Tutorial
- You can find sample screenshots and the generated *.dds files in the attachments.
- Do not test your textures in the Terrain Editor, it has bugs and odd results due to re-uploading etc., test it directly in Starcraft.
- Use different light settings to see, how your texture reacts
- Don't just fill the ground only with your texture, use other and paint around to see the blending
- You can set up a lightning that changes fast: In the Data editor create a new lightning or use an existing one and set "Time Per Game Loop to something like 00:10:00. Don't forget to give this lightning settings for more than 1 Time of Day. :)
- you can use Ousnius Free Camera Mode to look from different angles while testing your texture
- Don't worry if you can't see the picture of your texture, the preview in the galaxy editor doesn't deal properly with the alpha channels, too.
- Don't eat yellow snow
- My texture shines almost pure white at different angles: Lower the base-map alpha
- My texture is still too dark/bright: Adjust the brightness/contrast of the alpha channel of the normal map
- My texture does not show up in the Terrain editor although i put it in the data editor: Close the Terrain Editor. Open the Terrain Editor ;)
- My texture does not blend at all/Terrain Editor Crashes when I try to paint it: Check the *.dds Format settings when you saved your file. Check if they all have an alpha channel. Don't forget to re-import them.
Feel free to comment, add additional infos or report my errors. Right now I'm too tired, but I still want to figure out, how the minimap color works and there is still some formatting / additional screenshots to do.
Oct 11, 2010Posted in: Project Workplace
Need something blueish!
Fading Realm (2)
Still some balancing issues to fix, mainly plateau sizes...
Quote from Sixen: Go
You have 10 days to complete this contest. End of the submissions: Friday, October 19th - Midnight PDT (Los Angeles) [Thursday, October 20th - 9 AM GMT (Paris)] A public vote will be held after the end of the submissions to decide who wins. Reward
I might be wrong, but Friday is not October 19th, that would either be Tuesday 19th or Friday 15th
Edit II: Final...Fixed balancing, still not (and not meant to be) 100% symmetrical. Added destructible rocks to the middle ramps. Uploaded on EU Servers, have fun. :)
Jul 6, 2010Naim2k10 posted a message on Need help with: Specific unit enters region - Do actionsPosted in: Miscellaneous Development
Jul 2, 2010Posted in: Miscellaneous Development
The problem is: EventUnit() is the unit that enters the circle around your Mengsk Statue, not the statue itself.
I changed your map: 3 Arrays: Flags/CapturePoints, Regions, Structures to be converted as UnitGroup array; All have the same length. If you have an index, you know exactly which unit to change. Note: The Index directly correlates in these arrays; Region 1, the capture point in Region 1, and the UnitGroup of Structures have index 0 in their array, and so on
To get this index i wrote a function that loops through all CapturePoints and returns the closest one.
UnitGetNearestFlagIndex Options: Function Return Type: Integer Parameters flag = No Unit <Unit> Grammar Text: UnitGetNearestFlagIndex(flag) Hint Text: (None) Custom Script Code Local Variables retVal = 0 <Integer> loop_end = (numRegions - 1) <Integer> i = 0 <Integer> Actions General - For each integer i from 1 to loop_end with increment 1, do (Actions) Actions General - If (Conditions) then do (Actions) else do (Actions) If (Distance between (Position of flag) and (Position of flags[i])) <= (Distance between (Position of flag) and (Position of flags[retVal])) Then Variable - Set retVal = i Else General - Return retVal
ps: The parameter "flag" is misleading, its not the flag, its the event unit...that one which enters the region
Jun 29, 2010Posted in: Miscellaneous Development
A first step for a stand-alone conversion software would be a detailed specification of the input format (MDL/MDX) and the output format (M3). All links i found were deleted or moved.
Maybe i find the time to dig into it
Edit: Just in case it will be moved again, I attached Magos' MDX Format Specification; http://home.magosx.com/index.php?topic=6.0
Jun 28, 2010Posted in: Miscellaneous Development
Sorry for the wall of text, i miss some kind of spoiler tag Maybe you can use some of these scripts:
ZRegionGetOwner Options: Function Return Type: int Parameters region = null <region> Grammar Text: (~region~) Hint Text: (None) Custom Script Code Local Variables Actions Return((UnitGetOwner((ZRegionGetTower(region)))))
ZRegionGetTower Options: Function Return Type: unit Parameters region = null <region> Grammar Text: (~region~) Hint Text: (None) Custom Script Code Local Variables Actions Return((UnitGroupUnit((UnitGroup(ZSectorTowerType, c_playerAny, region, (No Value), 0)), 1)))
RegionFromIDWrap Options: Function Return Type: region Parameters id = 0 <int> Grammar Text: RegionFromIDWrap(~id~) Hint Text: (None) Custom Script Code Local Variables Actions Return(RegionFromId(lp_id))
- Note: This function iterates through all regions of the entire map; will be faster if you store all regions in an array; however, this would require the map makers who use your code to change exactly this array...
ZRegionFromUnit Options: Function Return Type: region Parameters unit = null <unit> Grammar Text: (~unit~) Hint Text: (None) Custom Script Code Local Variables unit_loop = null <unit> unit_group = (UnitGroupEmpty()) <unitgroup> region = null <region> i = 0 <int> Actions ForEachInteger(i, 1, 50, 1) actions SetVariable(region, (RegionFromIDWrap(i))) SetVariable(unit_group, (UnitGroup((UnitGetType(unit)), c_playerAny, region, (No Value), 0))) ForEachUnitInGroup(unit_loop, unit_group) actions IfThenElse() if Comparison((UnitGetType(unit_loop)), ==, (UnitGetType(unit))) Comparison((UnitGetPosition(unit_loop)), ==, (UnitGetPosition(unit))) then Return(region) else Return((RegionEntireMap()))
ZRegionPlayerIsOwner Options: Condition Return Type: bool Parameters region = null <region> player = 0 <int> Grammar Text: ZRegionPlayerIsOwner(~region~, ~player~) Hint Text: (None) Custom Script Code Local Variables Actions IfThenElse() if Comparison((ZRegionGetOwner(region)), ==, player) then Return(true) else Return(false)
ZPlayerHasMostUnitsInSector Options: Condition Return Type: bool Parameters = 0 <int> = null <region> Grammar Text: ZPlayerHasMostUnitsInSector(~~, ~~) Hint Text: (None) Custom Script Code Local Variables unit_count_enemy = 0 <int> units = (UnitGroup(null, (No Value), (No Value), (No Value), 0)) <unitgroup> unit_count = (UnitGroupCount(units, c_unitCountAlive)) <int> i = 0 <int> Actions ForEachInteger(i, 1, 15, 1) actions IfThenElse() if Comparison(i, !=, (No Value)) then SetVariable(unit_count_enemy, (ArithmeticInt(unit_count_enemy, +, (UnitGroupCount((UnitGroup(null, i, (No Value), Required: Visible; Excluded: Structure, Missile, Uncommandable, Buried, Cloaked, Dead, Hidden, 0)), c_unitCountAlive))))) else IfThenElse() if Comparison(unit_count_enemy, <, unit_count) then Return(true) else Return(false)
TowerTriggers Events TriggerAddEventUnitRangePoint(null, (UnitGetPosition(Sensor Tower [35.50, 14.50])), 2.0, true) TriggerAddEventUnitRangePoint(null, (UnitGetPosition(Sensor Tower [46.50, 27.50])), 2.0, true) TriggerAddEventUnitRangePoint(null, (UnitGetPosition(Sensor Tower [24.50, 14.50])), 2.0, true) TriggerAddEventUnitRangePoint(null, (UnitGetPosition(Sensor Tower [12.50, 28.50])), 2.0, true) Local Variables unit = (EventUnit()) <unit> region = (ZRegionFromUnit(unit)) <region> color = (ConvertPlayerColorToColor((PlayerGetColorIndex((EventPlayer()), false)))) <color> Conditions Comparison((UnitGetOwner((EventUnit()))), !=, 0) Not() cond ZRegionPlayerIsOwner(region, (UnitGetOwner(unit))) ZPlayerHasMostUnitsInSector(, ) Actions ZRegionBorders(region) ZRegionToOwner(region, unit)
I even have a mechanism for sniping and capturing vehicles, but thats far from perfect... :>
Another issue: I used a bunch of UnitGroup Actions, but these are really slow, you might encounter performance issues depending on how many triggers use them.
Jun 13, 2010Posted in: Project Workplace
dont make a square map... What you get:
- More space;
- Use map space more effective
- May be easier to implement since units either move in one direction or teleport; no corners to evaluate
- Separates you from the board game
just my suggestion :)
Jun 12, 2010Posted in: Project Workplace
Currently the best AI would be Behemoth with its micro extended to the other races and Mimics macro, copying build orders and always "learning".
Oh and I'd like to point out, that a fair fight against Behemoth isn't even possible at this stage, since it has view over the entire map.
- To post a comment, please login or register a new account.