Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit ec11d72

Browse files
authored
Merge branch 'master' into cmake
2 parents 8802cee + cb0f977 commit ec11d72

File tree

12 files changed

+24935
-111
lines changed

12 files changed

+24935
-111
lines changed

.github/workflows/compile.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
# separate terms of service, privacy policy, and support
44
# documentation.
55

6-
name: Windows 32bit
6+
name: Game
77

88
on:
99
push:
1010
branches: [ "master" ]
11+
paths:
12+
- common/**
13+
- devtools/**
14+
- game/**
15+
- public/**
16+
- responserules/**
1117
pull_request:
1218
branches: [ "master" ]
1319

@@ -18,32 +24,19 @@ env:
1824
# Configuration type to build.
1925
# You can convert this to a build matrix if you need coverage of multiple configuration types.
2026
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
21-
BUILD_CONFIGURATION: Release
27+
BUILD_CONFIGURATION: Debug
2228

2329
permissions:
2430
contents: read
2531

2632
jobs:
27-
build:
33+
Windows:
2834
runs-on: windows-latest
29-
3035
steps:
3136
- uses: actions/checkout@v4
3237

3338
- name: Add MSBuild to PATH
3439
uses: microsoft/[email protected]
35-
36-
# ENABLE THIS ON FIRST TIME SETUP
37-
#- name: Install Strawberry Perl for Shaders compilation
38-
# run: choco install strawberryperl
39-
40-
- name: Install Shader Dependencies
41-
run: cpan String::CRC32
42-
43-
44-
- name: Compile Shaders
45-
working-directory: ${{env.GITHUB_WORKSPACE}}
46-
run: ./materialsystem/swarmshaders/buildshaders.bat game_shader_generic_swarm deferred_shaders
4740

4841
- name: Build
4942
working-directory: ${{env.GITHUB_WORKSPACE}}

.github/workflows/msbuild.yml renamed to .github/workflows/shader.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
# separate terms of service, privacy policy, and support
44
# documentation.
55

6-
name: MSBuild
6+
name: Shaders
77

88
on:
99
push:
1010
branches: [ "master" ]
11+
paths:
12+
- materialsystem/**
1113
pull_request:
1214
branches: [ "master" ]
15+
paths:
16+
- materialsystem/**
1317

1418
env:
1519
# Path to the solution file relative to the root of the project.
@@ -18,31 +22,24 @@ env:
1822
# Configuration type to build.
1923
# You can convert this to a build matrix if you need coverage of multiple configuration types.
2024
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
21-
BUILD_CONFIGURATION: Release
25+
BUILD_CONFIGURATION: Debug
2226

2327
permissions:
2428
contents: read
2529

2630
jobs:
27-
build:
31+
Main:
2832
runs-on: windows-latest
29-
3033
steps:
3134
- uses: actions/checkout@v4
32-
33-
- name: Add MSBuild to PATH
34-
uses: microsoft/[email protected]
35-
36-
#- name: Restore NuGet packages
37-
# working-directory: ${{env.GITHUB_WORKSPACE}}
38-
# run: nuget restore ${{env.SOLUTION_FILE_PATH}}
39-
40-
- name: Install support for Visual Studio 2010..?
41-
run: choco install microsoft-build-tools-2013
42-
43-
- name: Build
35+
- uses: shogo82148/actions-setup-perl@v1
36+
with:
37+
perl-version: "5.32"
38+
distribution: strawberry
39+
40+
#- name: Install Shader Dependencies
41+
#run: cpan String::CRC32
42+
43+
- name: Compile Shaders
4444
working-directory: ${{env.GITHUB_WORKSPACE}}
45-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
46-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
47-
run: |
48-
& "C:/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe" /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
45+
run: ./materialsystem/swarmshaders/buildshaders.bat deferred_shaders

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ materialsystem/shaderlib/Release/
1515
*.user
1616
/materialsystem/swarmshaders/.vs
1717
*.filters
18+
*.vsidx
19+
/.vs
20+
/.vs/SourceDEFUN/v17/Solution.VC.db-shm
21+
/.vs/SourceDEFUN/v17/Browse.VC.db
22+
/build
23+
/materialsystem/shaderlib/.vs
24+
/materialsystem/swarmshaders/.vs

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# ![SourceDEFUNLogo](https://github.com/user-attachments/assets/6c237c45-86cd-450d-b5ea-2160bd8fc295) SourceDEFUN
1+
![SourceDEFUN Logo in 3D](https://github.com/user-attachments/assets/397abd0b-926b-4347-a0a6-16bb58abb661)
2+
3+
Compile status: [![Game](https://github.com/Sectonidse/SourceDEFUN/actions/workflows/compile.yml/badge.svg)](https://github.com/Sectonidse/SourceDEFUN/actions/workflows/compile.yml) [![Shaders](https://github.com/Sectonidse/SourceDEFUN/actions/workflows/shader.yml/badge.svg)](https://github.com/Sectonidse/SourceDEFUN/actions/workflows/shader.yml)
24

35
**November 5, 2004: Valve releases Source Engine's SDK into public. People started making mods for the bestselling game, Half-Life 2. Years have passed and now we're stuck with Source SDK 2013, being the last publicly released and outdated since release** (based on Orange box's Source SDK, while Portal 2 branch is already finished) **SDK. Strata Source team formed to fix this, tried to be community's hero, but failed, because Valve's Licensing doesn't allow making licensed SDK to be released publicly. *It's time to do something about it.***
46

@@ -23,16 +25,25 @@ Quake >>> GoldSRC >>> Source >> Alien Swarm > Deferred > SourceDEFUN
2325
- [ ] Linux Support
2426
- [ ] DXVK Support (man i wish it was possible to support Vulkan instead of DXVK)
2527
- [ ] First Person Camera, ported to Alien Swarm branch
28+
- [ ] Chromium Embedded Framework
29+
- [ ] Menu
30+
- [ ] CSS Theme
31+
- [ ] JS execution
2632
- [ ] Ambient Occlusion
33+
- [ ] Sandboxed Python Support (like VScript!)
2734
- [ ] SourceDEFUN Mod Installer (does moving mod to sourcemods for you and more stuff)
2835

2936
...and probably more soon!
3037

38+
You can watch the progress [here](https://github.com/users/Sectonidse/projects/2/views/1).
39+
3140

3241
## Building
3342

3443
### Windows:
35-
You have to use Visual Studio 2022.
44+
> [!WARNING]
45+
> Even though the solution was upgraded to support VS2022, it will be deprecated soon in favor of CMake.
46+
3647
To compile the shaders you must install Strawberry Perl, then execute ./materialsystem/swarmshaders/buildshaders.bat
3748

3849
### Linux:
@@ -43,6 +54,10 @@ Make sure to install these packages through your package manager:
4354
**UNFINISHED.**
4455

4556

57+
> [!NOTE]
58+
> macOS won't be supported anymore because there is no reason: if you want to play anyway, just switch to Linux.
59+
60+
4661
## Information
4762

4863
### Cannot do anything?
@@ -82,3 +97,13 @@ All of them have comments like this:
8297
`game/client/deferred/deferred_client_common.h`
8398
`game/shared/deferred/deferred_shared_common.h`
8499
`game/server/deferred/deferred_server_common.h`
100+
101+
102+
------------------
103+
## SECRET: Impossible things that would be cool to have
104+
* Mapbase support
105+
* Native Vulkan (Not DXVK) support
106+
* Material System that can use PNG/JPG instead of VTF
107+
* Independent Texture sizes that doesn't fit into powers of 2
108+
* Subsurface Scattering
109+
* Exporting into a standalone game (this will require leaked Source Engine which shouldn't be used for commercial purposes)

configs/activities.json

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,44 @@
2525
" A: I mean don't you like it? Would you like typing a lot of ACT_WEAPON_*_*? I would not. "
2626
],
2727
"ACT": {
28-
"0": ["INVALID", "RESET", "IDLE", "TRANSITION", "SCRIPT_CUSTOM_MOVE", "FLY", "HOVER", "GLIDE", "SWIM", "JUMP", "HOP", "LEAP", "LAND", "SHIPLADDER_UP", "SHIPLADDER_DOWN", "STRAFE_LEFT", "STRAFE_RIGHT", "ROLL_LEFT", "ROLL_RIGHT", "TURN_LEFT", "TURN_RIGHT", "CROUCH", "CROUCHIDLE", "STAND", "USE", "ALIEN_BURROW_IDLE", "ALIEN_BURROW_OUT"],
28+
"0": ["INVALID",
29+
"RESET",
30+
"IDLE",
31+
"TRANSITION",
32+
"SCRIPT_CUSTOM_MOVE",
33+
"FLY",
34+
"HOVER",
35+
"GLIDE",
36+
"SWIM",
37+
"JUMP",
38+
"HOP",
39+
"LEAP",
40+
"LAND",
41+
"SHIPLADDER_UP",
42+
"SHIPLADDER_DOWN",
43+
"STRAFE_LEFT",
44+
"STRAFE_RIGHT",
45+
"ROLL_LEFT",
46+
"ROLL_RIGHT",
47+
"TURN_LEFT",
48+
"TURN_RIGHT",
49+
"CROUCH",
50+
"CROUCHIDLE",
51+
"STAND",
52+
"USE",
53+
"ALIEN_BURROW_IDLE",
54+
"ALIEN_BURROW_OUT",
55+
"LOOKBACK_RIGHT",
56+
"LOOKBACK_LEFT",
57+
"COWER"],
2958
"RUN": [0, "AIM", "CROUCH", "CROUCH_AIM", "PROTECTED"],
3059
"WALK": [0, "AIM", "CROUCH", "CROUCH_AIM"],
3160
"COVER": [0, "MED", "LOW"],
3261
"RANGE": ["ATTACK1", "ATTACK2", "ATTACK1_LOW", "ATTACK2_LOW"],
3362
"DIE ": ["SIMPLE", "BACKWARD", "FORWARD", "VIOLENT", "RAGDOLL"],
34-
"CLIMB": ["UP", "DOWN", "DISMOUNT"]
63+
"CLIMB": ["UP", "DOWN", "DISMOUNT"],
64+
"SIGNAL ": ["1", "2", "3"],
65+
"SIGNAL": ["ADVANCE", "FORWARD", "GROUP", "HALT", "LEFT", "RIGHT", "TAKECOVER"]
3566
},
3667
"1": "Needs finishing!"
3768
}

devtools/bin/valve_perl_helpers.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ sub LoadShaderListFile
362362
my $inputbase = shift;
363363

364364
my @srcfiles;
365-
&MakeSureFileExists( "$inputbase.txt", 1, 0 );
365+
366+
# Why was it checking if directory is a file?
367+
# &MakeSureFileExists( "$inputbase.txt", 1, 0 );
366368

367369
open SHADERLISTFILE, "<$inputbase.txt" || die;
368370
my $line;

game/server/ai_activity.cpp

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,54 @@
88
#include "ai_activity.h"
99
#include "ai_basenpc.h"
1010
#include "stringregistry.h"
11+
#include "../../thirdparty/json.hpp" // Include nlohmann/json.hpp
12+
13+
14+
using json = nlohmann::json;
15+
using namespace std;
16+
17+
void traverse_json(const json& j, const string& prefix, vector<string>& paths) {
18+
if (j.is_object()) {
19+
for (auto& [key, value] : j.items()) {
20+
if (key == "1") {
21+
continue;
22+
}
23+
string new_prefix = prefix + key;
24+
if (key.back() != ' ') {new_prefix += '_';}
25+
traverse_json(value, new_prefix, paths);
26+
}
27+
} else if (j.is_array()) {
28+
for (size_t i = 0; i < j.size(); ++i) {
29+
if (j[i].is_number() && j[i] == 0) {
30+
continue;
31+
}
32+
if (i == 1) {
33+
continue;
34+
}
35+
string key = to_string(i);
36+
string new_prefix = prefix;
37+
if (key != "0") {
38+
new_prefix += key + '_';
39+
}
40+
traverse_json(j[i], new_prefix, paths);
41+
}
42+
} else if (j.is_string()) {
43+
string path = prefix + j.get<string>();
44+
paths.push_back(path);
45+
}
46+
}
47+
48+
vector<string> json_to_paths(const string& filename) {
49+
// Read JSON file
50+
ifstream file(filename);
51+
json j;
52+
file >> j;
53+
54+
// Store paths
55+
vector<string> paths;
56+
traverse_json(j, "", paths);
57+
return paths;
58+
}
1159

1260
// memdbgon must be the last include file in a .cpp file!!!
1361
#include "tier0/memdbgon.h"
@@ -88,57 +136,12 @@ int CAI_BaseNPC::GetActivityID(const char* actName)
88136
//-----------------------------------------------------------------------------
89137
void CAI_BaseNPC::InitDefaultActivitySR(void)
90138
{
91-
ADD_ACTIVITY_TO_SR( ACT_INVALID );
92-
ADD_ACTIVITY_TO_SR( ACT_RESET );
93-
ADD_ACTIVITY_TO_SR( ACT_IDLE );
94-
ADD_ACTIVITY_TO_SR( ACT_TRANSITION );
95-
ADD_ACTIVITY_TO_SR( ACT_COVER );
96-
ADD_ACTIVITY_TO_SR( ACT_COVER_MED );
97-
ADD_ACTIVITY_TO_SR( ACT_COVER_LOW );
98-
ADD_ACTIVITY_TO_SR( ACT_WALK );
99-
ADD_ACTIVITY_TO_SR( ACT_WALK_AIM );
100-
ADD_ACTIVITY_TO_SR( ACT_WALK_CROUCH );
101-
ADD_ACTIVITY_TO_SR( ACT_WALK_CROUCH_AIM );
102-
ADD_ACTIVITY_TO_SR( ACT_RUN );
103-
ADD_ACTIVITY_TO_SR( ACT_RUN_AIM );
104-
ADD_ACTIVITY_TO_SR( ACT_RUN_CROUCH );
105-
ADD_ACTIVITY_TO_SR( ACT_RUN_CROUCH_AIM );
106-
ADD_ACTIVITY_TO_SR( ACT_RUN_PROTECTED );
107-
ADD_ACTIVITY_TO_SR( ACT_SCRIPT_CUSTOM_MOVE );
108-
ADD_ACTIVITY_TO_SR( ACT_RANGE_ATTACK1 );
109-
ADD_ACTIVITY_TO_SR( ACT_RANGE_ATTACK2 );
110-
ADD_ACTIVITY_TO_SR( ACT_RANGE_ATTACK1_LOW );
111-
ADD_ACTIVITY_TO_SR( ACT_RANGE_ATTACK2_LOW );
112-
ADD_ACTIVITY_TO_SR( ACT_DIESIMPLE );
113-
ADD_ACTIVITY_TO_SR( ACT_DIEBACKWARD );
114-
ADD_ACTIVITY_TO_SR( ACT_DIEFORWARD );
115-
ADD_ACTIVITY_TO_SR( ACT_DIEVIOLENT );
116-
ADD_ACTIVITY_TO_SR( ACT_DIERAGDOLL );
117-
ADD_ACTIVITY_TO_SR( ACT_FLY );
118-
ADD_ACTIVITY_TO_SR( ACT_HOVER );
119-
ADD_ACTIVITY_TO_SR( ACT_GLIDE );
120-
ADD_ACTIVITY_TO_SR( ACT_SWIM );
121-
ADD_ACTIVITY_TO_SR( ACT_JUMP );
122-
ADD_ACTIVITY_TO_SR( ACT_HOP );
123-
ADD_ACTIVITY_TO_SR( ACT_LEAP );
124-
ADD_ACTIVITY_TO_SR( ACT_LAND );
125-
ADD_ACTIVITY_TO_SR( ACT_CLIMB_UP );
126-
ADD_ACTIVITY_TO_SR( ACT_CLIMB_DOWN );
127-
ADD_ACTIVITY_TO_SR( ACT_CLIMB_DISMOUNT );
128-
ADD_ACTIVITY_TO_SR( ACT_SHIPLADDER_UP );
129-
ADD_ACTIVITY_TO_SR( ACT_SHIPLADDER_DOWN );
130-
ADD_ACTIVITY_TO_SR( ACT_STRAFE_LEFT );
131-
ADD_ACTIVITY_TO_SR( ACT_STRAFE_RIGHT );
132-
ADD_ACTIVITY_TO_SR( ACT_ROLL_LEFT );
133-
ADD_ACTIVITY_TO_SR( ACT_ROLL_RIGHT );
134-
ADD_ACTIVITY_TO_SR( ACT_TURN_LEFT );
135-
ADD_ACTIVITY_TO_SR( ACT_TURN_RIGHT );
136-
ADD_ACTIVITY_TO_SR( ACT_CROUCH );
137-
ADD_ACTIVITY_TO_SR( ACT_CROUCHIDLE );
138-
ADD_ACTIVITY_TO_SR( ACT_STAND );
139-
ADD_ACTIVITY_TO_SR( ACT_USE );
140-
ADD_ACTIVITY_TO_SR( ACT_ALIEN_BURROW_IDLE );
141-
ADD_ACTIVITY_TO_SR( ACT_ALIEN_BURROW_OUT );
139+
string filename = "../../configs/activities.json";
140+
vector<string> paths = json_to_paths(filename);
141+
142+
for (const auto& path : paths) {
143+
ADD_ACTIVITY_TO_SR(path);
144+
}
142145

143146
ADD_ACTIVITY_TO_SR( ACT_SIGNAL1 );
144147
ADD_ACTIVITY_TO_SR( ACT_SIGNAL2 );

0 commit comments

Comments
 (0)