Alright, I think that is enough serious/sophisticated bedak to begin with, let’s get down to business! My name is Leonidas and I am an avid CoH1 and CoH2 player and follower of the franchise; I have put many hours into both games (I have only played CoH1 non-Steam, however, – just a note) and, of course, just as many into the World Builder (abbrev. as WB from this point on) – for the original CoH at least, and I intend to put even more into the WB for CoH2.
COH2 WORLD BUILDER
The World Builder executable file
is located in the Company of Heroes 2 game installation root folder in your Steam directory:
C:\Program Files\Steam\SteamApps\common\Company of Heroes 2
C:\Program Files (x86)\Steam\SteamApps\common\Company of Heroes 2
- For those who have a custom Steam Library folder in which Company of Heroes 2 has been installed, they may find it in that folder. Specifically, they may find it in:
[CUSTOM LIBRARY DIRECTORY]\SteamApps\common\Company of Heroes 2
Once you have located the
it to launch the
Company of Heroes 2 World Builder
and proceed with map creation and map design/editing.
The Company of Heroes 2 World Builder has arrived. OORAH!
2.000+ views as of 23:00, December 9th 2022! Thank you all and I hope you keep reading! ~Leonidas
Function Manual Pt. 01
UI Element (Number/Icon/Name)
Creates a new
Creates a new
Opens a Windows Explorer instance to
select and load
Saves current scenario (map).
The usual cut option. (e.g. cut text and store in clipboard)
The usual copy option. (e.g. copy text and store in clipboard)
The usual paste option. (e.g. paste text stored in clipboard)
Select map objects (click
to select a
click and drag
hold shift key and drag
on the right pane, and right click anywhere on the map to place the object. (object controls apply)
Render Marker Prox.
Select, place, or edit
SCAR and Action
markers. (object controls apply)
Edit the map terrain height. (in
additive, subtractive, set value or smoothing
Impass Map Editor
map of your scenario. (left-click
and hold to paint impassable terrain,
and hold to remove impassability)
Texture Tile Painting Editor
Select texture maps
with which to
the terrain of your scenario. (select a texture map from the pane on the right, set a layer slot for it and right-click and hold on the map to paint your texture)
Select texture maps
in your scenario (as if they were objects). (select a texture map from the pane on the right and right click anywhere on your map to place it) –
object controls apply
“texture”, “object” and “deform”
Place water in your scenario. (set water depth in the right pane, and right-click on
terrain to place water renderer/spawner)
NIS Animation Tool
Create NIS (i.e. in-game) animations/cinematics.
Measures virtual distance between objects.
Creates back-ups/copies of a selection of any type of map object(s) (splines, splats, squads, entities, etc.) to use in (i.e. import to) other scenarios, or for mass-redesign of a map.
Paint grass in your scenario. (select painting mode, type for kind of grass, height for changing the grass blade height, select grass type or configure grass settings, and left-click and hold to paint grass, or right-click/left-click to perform set action for the grass height)
Places ice in winter scenarios.
Used for setting
(i.e. paths), that can be used in SCAR scripts to program a squad’s (or squads’) movement.
Territory Mapping Tool
Configures territory sectors of your scenario.
Interactivity Stage Editor
(i.e. custom map boundaries), primarily for use with SCAR scripting in mission scenarios (as seen in the CoH2 campaign).
View Error Messages
Displays program error log for troubleshooting of your scenario.
Move to the location of the previous error.
Move to the location of the next error.
Memory Dump Tool
Memory dump debugging tool for developers.
Memory Statistics Tool
Displays memory usage statistics for use in optimization of memory performance of your scenario.
Function Manual Pt. 02
Continuation of the Function Manual table in Pt. 01.
References and explanations:
The most frequently used method for copying any objects in W.B. is by holding down the “c” key, lef-clicking the object (or group of selected objects) we wish to copy, dragging in a different location in W.B. and by releasing the mouse button: The copies of that object (or objects) are placed in that location.
you have an
object selected, you may:
Left-click, hold and drag
objects – Release the left mouse button to exit this mode.
Hold “Shift” key, left-click and hold,
drag to the left
to rotate the object in that direction – Release the “Shift” key to exit this mode.
Hold the “H” key on your keyboard,
pan your mouse up
the object, or pan it
the object – Release the “H” key to exit this kecenderungan.
More info. on SCAR markers found in “Scenario Creation Pt. 02” section of this guide, under the “Basic level SCAR coding” feature. – More info. on Action Markers found in the “Level Design” section of this guide.
More info. on terrain impassability and movement/Blong/shot blocking found in the “Level Design” section of this guide.
More info. on texture tile painting found in the “Level Design” section of this guide.
More info. on texture splat placement found in the “Level Design” section of this guide.
More info. on the spline placement tool found in the “Level Design” section of this guide.
Little is known by the author as far as NIS animation is concerned. Though the author
attempt to research the NIS animations included in the Campaign and Theater of War missions for pertaining information, it is kindly requested that anyone who has any knowledge regarding the matter share it with the community. Once reasonable information has been gathered for the tool, it will probably be published under the “Scenario Creation” section of this guide.
More info. regarding virtual distance measurement found in the “Level Design” section of this guide.
More info. on stamps found in the “Level Design” section of this guide.
More info. on grass editing found in the “Level Design” section of this guide.
More info. on winter battlefield design found in the “Level Design” section of this guide.
More info. on waypoint placement and use found in the “Scenario Creation” section of this guide.
More info. on territory mapping found in the “Level Design” section of this guide.
Basic info. on interactivity stages found in the “Level Design” section of this guide. – Advanced info. on interactivity stages found in the “Scenario Creation” section of this guide.
(requires more research)
Level Design Pt. 01
Map designing involves a lot of work. The trick is to start out tough, then as you gain more experience and learn new stuff you will be able to do more impressive work, getting ever closer to the most perfect rendering of your ideas.
So, if we wanted to translate the overall creative process into a list of steps, the first one would be:
Really. If you ever want to get a map designed the way you initially wanted, I would
advise you to make quick (very low detail) sketches of your maps, preferrably by pencil and paper (or even MS Paint, if wanna be
sloppy), and keep those sketches on your desk or under your keyboard while designing at all times.
Really – it helps that much.
- Komisi: Try to work out your own set of global symbols to use on your sketch to help you out: e.g. a blown-out, large, circled “S” for strategic points or a similarly drawn “M” for munition points and an “F” for fuel points – anything that suits your style best.
Once you’ve sketched your map out a couple of times and you’ve decided which design you like best, then it’s time to go digital.
Now, I will be honest with you. As far as basic map settings are concerned, OnkelSam from CoH2.org has devoted a lot of effort in creating quality tutorial videos for the subject.
Click here to view them first
and we’ll continue from where he leaves off in the video. This is for saving some resources for this guide to progress in content, so we can advance further into map making. If I have more time in the future, I might write about these basic map settings by myself. As of now, please consider the option above, as the most viable one to date.
Create your map, set it’s size and playable area, mark its boundaries for your convenience, set teams, place starting positions, shared starting position territory, map entry points (and optionally bunker markers), and assign the last 3 (and the bunker markers, should they exist) to the teams/players they belong to. Place the 4 territory points, and then define the territory sectors using the “Calculate Voronoi” function of the Territory tool.
Once you’ve reached the point that the above images illustrate, we are ready to move on to one last technical detail and start placing objects, splats, painting texture tiles, and much, much more. So what we have to do to make our map in terms of basic gameplay functional, is to define the
interactivity stage of 50.
That is the interactivity stage from which units are called in, i.e. that is where the
object should normally be placed, for the unit off map call-ins (=call-in commander abilities) to work properly.
To do this, we are going to use the
Interactivity Stage Penyunting
). Let us get started: First,
the tool by clicking on its icon in the W.B. taskbar
(see image below). Then set the
50. Make sure it is
50, as that is very important. After that,
right-click, hold and drag
outside of the grid lines you set in your map, to
that interactivity stage. See example image:
Here is a comparison (from top to bottom) of a
plain map overlay,
territory sector map overlay
interactivity stage 50 map overlay:
- Tip: To
an interactivity stage that is already painted on the map and paint it somewhere else too,
on the distrik painted with the interactivity stage that you want to sample. Then you can paint normally by
clicking and holding the left mouse button.
Once you’ve completed these steps, we are ready to get down to the exciting part of map designing.
In this section we will be covering basic object placement. First things first, before we get down to what an object is (although quite obvious) we must find out how to place (or “spawn”) one. To place an object, you must first select the
tool. That opens up a new panel on the right side of the W.B.
- Explanation: Every tool uses the panel on the right side of the W.B. application window, to display its settings and configurable options, which can be modified by the user to suit their current needs. Its layout changes automatically, based on which tool is selected.
In the panel that opens when you select the
tool, there are many options to choose from. Right now, you need to scroll down and find the “Objects” rollout.
You should see three
expandable/collapsible tree lists, which can be
collapsed, as in the image below:
The lists are “ebps”, “sbps” and “visuals”. The first are
entity blueprints, which are mostly world/nature/NPC objects (squads or entities). The second are
squad blueprints, which are playable/controllable squads. The last one is mainly used for NIS animations
[more information required]. We are first going to place a World-owned building, as an example.
Since we are going for a world-owned object, we expand the “ebps” tree as such: ebps > environment > art_ambient > buildings > eastern_rural > log_wooden_2x3x1_cottage_01
its entry in the list (it will be highlighted mencicil placed in the map), and
anywhere on the map to place the object. Follow the steps in the image for a better explanation:
And now, add in a bit of
rotation. To rotate and object,
it to select it, then
left-click and drag from right to left or from left to right
the selected object. See the following image:
You can also
change the object’s height, i.e. elevate or lower it. To change an object’s height,
on the object you want to elevate/lower
to select it,
while holding down the H key on your keyboard, left-click and drag up/down to elevate/lower (respectively) the selected object.
See the following example image for details:
[CONTINUE TO PT. 2]
Level Design Pt. 02
[CONTINUATION OF PT. 01]
Another very important function of the World Builder, is
objects to uneven surfaces (uneven terrain), such as hills, slopes, etc. When an object is positioned in sloped terrain, it usually seems to float above the surface, which is aesthetically unappealing for the map. Such an example can be seen below:
[TO BE CONTINUED]
Scenario Creation Pt. 01
INTRODUCTION TO SCAR CODING
Relic) is a very powerful, and at the same time very understandable
scripting language, based on a modified version of the LUA programming language . It can be used to implement additional gameplay functionality to your maps (e.g. a classic “King of the Hill” multiplayer/co-op mission) or a full-blown, compelling single-player scenario or series of scenarios – a campaign (think CoH2, or even CoH1, single-player campaigns). Just imagine recreating the Battle of Stalingrad – your own version, with your own protagonis units, or a more historically accurate one.
SCAR, being based on LUA, does present identical, or
similar, syntax and structure.
Once again, both SCAR and LUA are very easy to comprehend, fun to use and slightly challenging, yet quite tempting, to master. That simply would mean that using SCAR in Company of Heroes 2 makes the whole scenario creation process
interesting and very, very exciting. Note that very limited basic knowledge of programming and programming languages is needed (hence the ease), as the basics will be covered within this section of the guide.
The next subsection will cover the application types/categories required for SCAR scripting (as well as
applications of each type preferred by the author), sources for SCAR (/LUA) functions and information, i.e. where and how to get it, and some miscellaneous notes and information.
RESOURCES AND TOOLS
SCAR is a scripting language, which would mean that a SCAR script is comprised of numerous lines of code.
In order to manage those lines of code (=text), we need a versatile and powerful “text editor”. Now, for a mulai, we
work with MS Notepad; however, as pointed out earlier in this guide (specifically in “Design Introduction”), we need to start out tough and organized, in bestelan to effectively produce high quality work. A far more dynamic text pengedit and counterpart to MS Notepad (and the tool preferred by the author) is the free, open-source “Notepad++“.
These are the download locations for the application:
- Official Notepad++ Downloads Webpage
(RECOMMENDED – download installer for easier and faster setup)
- PortableApps.com Notepad++ Portable
(ADVANCED USERS ONLY – portable – can run on any PC whilst preserving settings and has the same functionality, but is more difficult to install and run for less experienced PC users)
Once you’ve downloaded and installed the application, you’re ready to do a little bit of configuring. This is how Notepad++ looks like:
(click image to enlarge)
Now we are going to make
small, but very important and helpful modification to the settings. Simply click Language > L > LUA. That configures Notepad++ to recognize LUA syntax and structure characteristics and transform the text layout accordingly. See image les:
(click image to enlarge)
Now check out a little comparison of the text editor with the setting
(left image) and
(click images to enlarge)
Once we’ve configured those settings, we are ready to begin SCAR coding.
Coding complex and captivating scenarios is not always a matter of being a coding expert. It usually comes down to how well you understand the basic, fundamental commands and functions of the programming language. If you know the basics (and some more advanced stuff here and there, i.e. some uang sogok and tricks) then you can easily build upon that knowledge and accomplish even more goals in your code.
Theoretically, there are probably tens (or even hundreds) of pre-programmed SCAR functions, for example:
Util_CreateSquads(). However, very few of them are commonly used. That does not mean, though, that the rest are useless. Usually they serve a very specific purpose, or are technically a combination of different functions into one, to facilitate the coding of a specific operation to be performed.
- All (or most of) these SCAR/LUA functions can be found in this official SCAR documentation file (coh_scardoc.zip) hosted by the author
– click File > Download to download it, then extract it and open the
file with any web browser to view the function list (or, alternatively, view it online in this SCAR documentation page
hosted by the Europe in Ruins mod ).
- All of this information can be extracted from the CoH2 game archives (.sga files) using tools and tutorials hosted in the CoH2 Arsenal sub-forum of the Relicnews Forums.
(Note: The above SCAR documentation files already contain references to the source
files from which the functions where extracted, which are listed under each function’s description.)
- It is a good thing to know that there is actually a way to study Relic’s own SCAR files (and maps) for the ToW and the single-player campaigns by extracting the .sga packages that contain the according files, and opening the .scar files with any text penyunting and the .sgb map files with the World Builder (you may read numerous tutorials on how to do that in the CoH2 Arsenal sub-forum of the Relicnews Forums
backup any files you are trying to modify or read/extract information from, because you can never know whether the integrity of those files is manipulated in the process or not. Otherwise you run the risk of encountering stability problems or problems with integrity checks from the game (in titipan to fix those problems, you’ll have to verify the CoH2 game files through Steam).
). It is recommended, however, that you
IMPORTANT: Lastly, the format of SCAR code in this guide, i.e. how it will be presented/displayed. Complete parts of code will be presented as such:
function mytestfunction1() –Code is placed here end
However, whenever a small extract of code, e.g. a simple command or function, is presented, it will be so
in italic type. For instance:
Alright, closing up with this subsection of the guide, we have the miscellaneous stuff. I would like to point out that any tools used in this guide are only the recommended/preferred/tested-and-working ones. If you have a text editor or any other program that you like using and would also like to use in this case, there will be no objection. If you, however, encounter any problems regarding how the application handles SCAR code, that
be an obstruction to your work.
Should you encounter any such problems with SCAR coding, map editing, or modding of the game in general, it is suggested that you should ask for help in the comments of this guide, if your query is simple enough, or in the CoH2 Arsenal sub-forum of the Relicnews Forums
[CONTINUE TO PT. 02]
Scenario Creation Pt. 02
[CONTINUATION OF PT. 01]
BASIC LEVEL SCAR CODING
— SCAR script and World Builder integration
In order for a scenario to be fully functional, there must be something that the code can use to execute its commands in the right place and the right time, somewhere in the map (i.e. the “playing field”). Something that
SCAR scripts with parts of the map the scenario is using. The means for accomplishing this is referred to as “SCAR markers” (not to be confused with the “Action Markers” that are used for visual FX elements, e.g. a fire or smoke rising from debris – more details in the
section). They are WB objects/elements that can be placed anywhere on the map, and they are
rendered in the scenario (i.e. they are invisible) when they are loaded into the game, and by themselves as map elements do
affect gameplay at all. They only represent
on the map (i.e. they represent XYZ coordinates for a specific, unique location) which essentially tells the code where the actions it is programmed to execute should take place.
I would recommend creating your own set of generic SCAR marker names, preferrably short, and very descriptive. Examples would contain
s_forestnorth1, where “s” stands for “spawn”, and the part on the right of the underscore would represent the map-specific location, along with additional information, which should be helpful for you in your scripting, without having to switch back and forth from the text editor to the WB. The number “1” is used just in case there are other markers with the same name. To place a SCAR marker in your map, simply use the
Render Marker Prox. tool, and select SCAR markers in the right pane. The ones we will be using for now will be the three
markers. For now, you may select the
marker, and right click anywhere in your scenario to place one. Then double click its name to change it to
s_pathfield1. Explanation image:
— Function structure and basic functions
It is time to start with our very first SCAR function (advanced coders: notice the LUA-similar syntax):
function OnGameSetup() player1 = World_GetPlayerAt(1) player2 = World_GetPlayerAt(2) end
This is what we call a “function”. Functions in SCAR always menginjak with
function, followed by a space, and the name of the function – in this case
(PLEASE NOTE the two parentheses “()” are
and must always be there) – and must end with
part tells the game that we want to create a new function. The
is the name of the function, which is
for every function, and is associated with what each function does. The
part tells the game that the function is complete, and that only the code between the beginning and the end of the function is to be executed.
Specifically for this example:
(case sensitive!) is a very basic and special function; it is ran automatically upon loading the map/scenario, and it
be present in
SCAR scripts for their proper functioning. This is where we place all the commands that configure basic settings for the players of the map/scenario, such as: 1. The name of each player (human or AI) 2. The choice of army (e.g. Soviet, German – or even custom armies for mods) It also provides the capability for coders to run desired commands at the start of the map (we will get to that later on).
Now then, the
player1 = World_GetPlayerAt(1)
for player 1 (and
player2 = World_GetPlayerAt(2)
for player 2, and so on for any other player) are
for EVERY map. Simply put, they tell the game that player 1 and 2, for example,
exist, and we wish to
include them in the map.
They tell the game the location of those players in the map, as defined in the WB.
The actual function that’s important is
World_GetPlayerAt(Ufuk), where Cakrawala is an integer, starting from 1. We place it in a
(player = …), i.e. a custom name for it, so we can
to it more easily, without having to type it all oper again.
change any settings for the incaran player. If we wish to change
settings for a player, we do the following:
function OnGameSetup() player1 = World_GetPlayerAt(1) player2 = World_GetPlayerAt(2) player2name = Player_GetDisplayName(1) Setup_Player(player2, player2name, “german”, 2) –We can also use
player2, to directly define the map location. end
In this example we keep all the settings for player one, stating only his position in our scenario. Now for the second player, we use the
function. The first argument we use defines
we want to change the settings for. The second defines the player name (in this case we use a function, stored in a variable, that retrieves the current name of the player, so that they have their in-game username). The third defines the player race, and is either
for Soviets, or
including quotes(!). The last defines the player’s team. (in this case player one is on team one
in W.B., and we set player two to team two). You will see more complex examples as we move on to create some basic missions, however, if you wish,
you can view
them, and open them with MS Notepad or Notepad++).
Do not worry, however; all this trouble just for the basic function that will always be pretty much be the same. It is only this function (as well as one more) that are all the trouble for SCAR scripting. The rest are much more enjoyable, and it is where you will truly experience the true capabilites of SCAR.
— Final explanations
We managed to create our very first function. Now, if we were to place it in a SCAR file for our maps to use, we would notice an error upon execution. That is because, our
SCAR script is not functional yet.
We are missing one
important command. At the very berangkat of
SCAR file, we have to place the
command. This command is extremely important, as it tells the game to import the complete code library from Relic, which contains all commands and game functions, and instructions on how they should run. Note that it is possible to set it up at the beginning of every SCAR file we make (or even import one of our own), but it is preferred to use the one provided by Relic, mainly because it is
global, meaning it will work for
copy of the game.
If your SCAR file is missing this single command, it will simply titinada work.
[CONTINUE TO PT. 03]
Scenario Creation Pt. 03
CONTINUATION OF PT. 02
— First working example
After this introduction to SCAR coding, we are able to put together our first working SCAR script:
import(“ScarUtil.scar”) function OnGameSetup() –Player locations player1 = World_GetPlayerAt(1) player2 = World_GetPlayerAt(2) –Player setup (only player two, we keep the player 1 settings unchanged, except for race) –Jujur races are:
and they must always be put in quotation marks when they are used as arguments in our commands, e.g.
“soviet”, because they are considered text strings Setup_SetPlayerRace(player1, “soviet”) Setup_Player(player2, “German Waffen SS”, “german”, 2) end
Finally, note the lines that begin with double dashes ” — “. The double dashes denote
comment lines, which do not affect the code at all, and are only used for directions or to make notes, for the developers. Generally, in a large script, it is recommended to place explanations before every command, to avoid confusion.
[TO BE CONTINUED]
- Design Introduction
- Object Placement
- Heightmap Editing
- Texture Placement
- Territory Mapping
- Exporting the map/scenario
- Balancing and player feedback analysis
- In Progress
- Not started yet
- Titinada started yet
- Titinada started yet
- Not started yet
- Titinada started yet
- Titinada started yet
- Introduction to SCAR coding
- Resources and tools
- Basic level SCAR coding
- Intermediate level SCAR coding
- Advanced level SCAR coding
- Troubleshooting and bug-squashing
- In Progress
- Titinada started yet
- Not started yet
- Titinada started yet
To-Do tasks will be added after reasonable completion ratio has been achieved for the aforementioned upcoming features, and new suggestions have been made or new content ideas have been conceived.