Skip to content

Commit

Permalink
Add project
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 committed Oct 6, 2023
1 parent 3348745 commit 4bdeaf0
Show file tree
Hide file tree
Showing 6 changed files with 816 additions and 0 deletions.
140 changes: 140 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<p align="center">
<img
src="https://github.com/wopox1337/Server-Side_SmokeNade/assets/18553678/0cd2739a-b8c7-414c-aa92-b3cbd797579b"
width="320"
height="240" />
<img
src="https://github.com/wopox1337/Server-Side_SmokeNade/assets/18553678/86eee384-81ad-4ae6-a61d-fb6094c4fb2f"
width="320"
height="240" /><br>
<img
src="https://github.com/wopox1337/Server-Side_SmokeNade/assets/18553678/8f6edaa8-ebef-4bc7-b9eb-f8cd3a1fda7c"
width="320"
height="240" />
<img
src="https://github.com/wopox1337/Server-Side_SmokeNade/assets/18553678/b3830ce1-4ee5-470e-9682-ab30942a962e"
width="320"
height="240" />
</p>

<p align="center">
Is an AMXModX plugin that enhances the smoke grenade effects in <a href="https://store.steampowered.com/app/10/CounterStrike/">Counter-Strike 1.6</a> (and CS: Condition Zero).
</p>

<p align="center">
<a href="https://github.com/wopox1337/ServerSide_SmokeNade/releases/latest">
<img
src="https://img.shields.io/github/downloads/wopox1337/ServerSide_SmokeNade/total?label=Download%40latest&style=flat-square&logo=github&logoColor=white"
alt="Build status"
>
</a>
<a href="https://github.com/wopox1337/ServerSide_SmokeNade/actions">
<img
src="https://img.shields.io/github/actions/workflow/status/wopox1337/ServerSide_SmokeNade/CI.yml?branch=master&style=flat-square&logo=github&logoColor=white"
alt="Build status"
>
</a>
<a href="https://github.com/wopox1337/ServerSide_SmokeNade/releases">
<img
src="https://img.shields.io/github/v/release/wopox1337/ServerSide_SmokeNade?include_prereleases&style=flat-square&logo=github&logoColor=white"
alt="Release"
>
</a>
<a href="https://www.amxmodx.org/downloads-new.php">
<img
src="https://img.shields.io/badge/AMXModX-%3E%3D1.9.0-blue?style=flat-square"
alt="AMXModX dependency"
>
</a>
</p>

## About
This plugin recreates smoke grenade effects (puffs of smoke) on the server side,
provides a more realistic look to smoke grenades in the game
(as it was changed in later iterations of the game such as CS:S, CS:GO, CS2).

### Why is it needed
The default smoke sprite (`sprites/gas_puff_01.spr`) is too transparent
and doesn't allow you to take advantage of the smoke grenade in gameplay.

### Advantages over standard game smoke
- Improved transparency of the smoke cloud;
- Fixed poor smoke density in 16-bit video game mode;
- Smoke doesn't disappear on HLTV;
- Smoke can't be abused by reconnecting to the server;
- Smoke is always created (even if the client has a congested network channel);
- Ability to change the visual look of the smoke cloud.

### Advantages to other similar plugins:
- Ability to set any custom sprite to display smoke;
- Client FPS doesn't drop much;
- Server FPS doesn't drop much;
- The server doesn't flood the client's network channel to display the smoke cloud;
- Doesn't break compatibility with the game:
- Bots understand where smoke is located;
- Cannot see nickname through smoke (mp_playerid);
- Hostages can react to smoke grenade;
- Overview map can show smokes.
- Easy to adjust the color, duration and performance of the smoke cloud;
- No render bugs when positioning the smoke cloud on water;
- Smoke cloud has a very close to the original visual appearance (authenticity);
- Smoke cloud doesn't stay in a new round;
- Cannot be abused with the client command `fastsprites`;
- Smoke doesn't disappear before its lifetime expires;
- Smoke doesn't disappear if the player's internet connection is poor;
- Smoke doesn't disappear if you move away from it.
- Smoke doesn't flicker.

### How it works
The plugin blocks the sending of the event to the game client
and recreates smoke clubs using server-side entities,
exactly repeating the shape and animation of the standard smoke.

### Important note
> If the smoke effect is fully recreated (`amx_smokegren_replacemode` == `3`), the server load is increased 2x.
> Using full smoke grenade recreation (3) is not recommended for servers
that have more than 10 players online (e.g. servers with 32\32 players online).

> Also be careful with setting the parameter `amx_smokegren_pieces`,
it directly affects the shape and quality of the smoke grenade,
affecting the server load when using smoke grenades.

> In special cases it may be necessary to set a larger number of allocated edicts
using the startup parameter `-num_edicts` (at least `2000`).

### Calculations
With standard parameters:
- amx_smokegren_replacemode `1`
- amx_smokegren_pieces `8`

One smoke cloud will create `17` entities.

At maximum parameters:
- amx_smokegren_replacemode `3`
- amx_smokegren_pieces `10`

One smoke cloud will create `41` entities.

## Acknowledgements:
- [ReGameDLL_CS](https://github.com/s1lentq/ReGameDLL_CS) authors;
- To everyone who has previously tried custom smoke and their code examples;
- To the Counter-Strike developers (for their bugs, including);
- Community https://Dev-CS.ru/ (the most friendly and experienced team of developers).

## TODO:
- Correct the remaining visual inaccuracies.
- Implement API;
- Improve integration with GameDLL;
- Optimize sprite;

## Known bugs:
- If the smoke duration changes, the grenade entity may not match the smoke duration.
- Tell me

## Downloads
- [Release builds](https://github.com/wopox1337/ServerSide_SmokeNade/releases)
- [Dev builds](https://github.com/wopox1337/ServerSide_SmokeNade/actions/workflows/CI.yml)

## Contacts
- https://dev-cs.ru/members/4/
Binary file added .github/Server-Side_SmokeNade.mp4
Binary file not shown.
47 changes: 47 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [master]
paths-ignore:
- "**.md"
- "**.spr"

pull_request:
types: [opened, reopened, synchronize]
release:
types: [published]

jobs:
build:
name: "Build"
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup AMXXPawn Compiler
uses: wopox1337/setup-amxxpawn@v1
with:
version: "1.9"

- name: Compile plugins
working-directory: cstrike/addons/amxmodx/scripting/
run: |
compile() {
sourcefile=$1
amxxfile="$(echo $sourcefile | sed -e 's/\.sma$/.amxx/')"
output_path="../plugins/$amxxfile"
mkdir -p $(dirname $output_path)
echo -n "Compiling $sourcefile ... "
amxxpc $sourcefile -o"$output_path" \
-i"include"
}
export -f compile
find * -type f -name "*.sma" -exec bash -c 'compile "$0"' {} \;
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"sarrus.sourcepawn-vscode"
]
}
Loading

0 comments on commit 4bdeaf0

Please sign in to comment.