Recently I was invited to assist in the development of a game that is based around CS:GO’s professional scene.
The game will consist of a team that the user creates out of professional players inside the CS:GO professional league, the game will be played out with AI when combating other teams; the AI’s strength will be based around the statistic of the player, and the team who wins will receive currency to upgrade and buy new players.
I created a tool that will help tremendously when creating a scenario for the AI to battle in, this includes path nodes, spawn locations and objective locations and a map.
Note: the map used in this demonstration is from Froosh
Source: https://steamcommunity.com/sharedfiles/filedetails/?id=157442340
As you can see there are rough nodes on where the teams spawn and the path the AI will be able to take.
Saving of the scenario leaves an asset like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML 1.1 | |
%TAG !u! tag:unity3d.com,2011: | |
— !u!114 &11400000 | |
MonoBehaviour: | |
m_ObjectHideFlags: 0 | |
m_PrefabParentObject: {fileID: 0} | |
m_PrefabInternal: {fileID: 0} | |
m_GameObject: {fileID: 0} | |
m_Enabled: 1 | |
m_EditorHideFlags: 0 | |
m_Script: {fileID: 11500000, guid: 1095932dd8547fc4c8881bc38a609b08, type: 3} | |
m_Name: test2 | |
m_EditorClassIdentifier: | |
map: {fileID: 2800000, guid: 9e6e7c4d767a20d4ab0c1f577bfc0425, type: 3} | |
m_pathingPositions: | |
– {x: 517, y: 115} | |
– {x: 512, y: 165} | |
m_CTSpawnPositions: | |
– {x: 325, y: 153} | |
m_TSpawnPositions: | |
– {x: 257, y: 548} | |
m_PlantPositions: | |
– {x: 118, y: 87} | |
– {x: 483, y: 121} |
The asset file stores the GUID of the image which is a reference to the image inside Unity’s Assets. The asset file also stores all the positions that were created inside the editor which all can be loaded back into the window once closed.
The current state of the window is working, however, I will be adding connectable nodes, allowing the AI to calculate where they can move and follow a path using an adaptation A* pathfinding.
The link to the source of the window can be found here:
https://github.com/remusjones/CSGOCustomEditorWindow
As I am new to developing for Editors/Windows inside Unity the source is a little cluttered and I will work on updating the window and making it more modular and user-friendly.
Note: when saving the file looks at your [ProjectName]/assets/SavedAssets folder inside Unity, be sure this folder is created.