Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Spawner #1122

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
be599c3
Implement the multiplayer spawner in C++ using TS++ (#1065)
ZivDero Oct 4, 2024
434313c
Extend BaseUnit to accept more than one entry, use all values from Bu…
ZivDero Oct 6, 2024
aa103ed
Remove saved game folder stuff that's been incorporated into main Vin…
ZivDero Oct 25, 2024
3151e97
Reimplement scenario reading, implement spawn houses (#1123)
ZivDero Oct 26, 2024
165a225
Reimplement trigger actions, events, implement TS-patches trigger act…
ZivDero Oct 27, 2024
b81b5d5
A number of smaller features
ZivDero Oct 27, 2024
8ecd4a1
Add support for more than two sides for Sidebar, Speech and Loading S…
CCHyper Oct 28, 2024
198eb0c
Refactor and cleanup
ZivDero Oct 28, 2024
0e230c9
Allow the observer to start centered at a random position
ZivDero Oct 29, 2024
7aca0c8
Fixes and refactor
ZivDero Oct 29, 2024
eea7a90
Make weeders respect the stop command
ZivDero Oct 31, 2024
505ded2
Reimplement Start_Scenario
ZivDero Nov 1, 2024
72f428e
Allow customizing the options color per side
ZivDero Nov 1, 2024
36bfe10
Adjust statistics to be always collected
ZivDero Nov 1, 2024
50606cb
Move MP AI Base nodes and Spawn Houses outside the spawner
ZivDero Nov 1, 2024
b9c6325
Fix infantry not checking if their owner house was null on scenario load
ZivDero Nov 1, 2024
7528d52
Add 2 MP difficulties
ZivDero Nov 1, 2024
5640dc1
Move when alliances are formed
ZivDero Nov 2, 2024
39cfe6f
Make AllyReveal reveal objects to allies automatically
ZivDero Nov 2, 2024
84caa39
Patch Make_Ally to reveal allies' units on start in MP
ZivDero Nov 2, 2024
eaa1c87
Add unit promotion indicators
ZivDero Nov 2, 2024
95d2fee
Document DifficultyName
ZivDero Nov 3, 2024
9a5a378
Turn off autosaves when a player disconnects
ZivDero Nov 4, 2024
f86a9b4
Update docs regarding saved games
ZivDero Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This page lists all the individual contributions to the project by their author.
- **Belonit (Gluk-v48)**:
- Check for Changelog/Documentation/Credits in Pull Requests.
- Docs dark theme switcher.
- Porting the YR MP spawner from C to C++ and YR++, used as a base for the Vinifera spawner.
- **CCHyper/tomsons26**:
- Vinifera foundations: TS++, game.exe hooker, extension system and other core features
- Implement `CurleyShuffle` for AircraftTypes
Expand Down Expand Up @@ -130,6 +131,9 @@ This page lists all the individual contributions to the project by their author.
- Implement various controls to customise target lasers line.
- Implement various controls to show and customise NavCom queue lines.
- Implement customizable mouse cursors and actions.
- Extend `BaseUnit` to accept a list of vehicles.
- **CnCNet Contributors**:
- Tiberian Sun TS-patches spawner, Yuri's Revenge CnCNet spawner that served as a base for Vinifera spawner.
- **Kerbiter (Metadorius)**:
- Initial documentation setup.
- **MarkJFox**:
Expand Down Expand Up @@ -163,6 +167,7 @@ This page lists all the individual contributions to the project by their author.
- Implement the Torpedo logic from Red Alert 1 for BulletTypes.
- Add `BuildTimeCost`.
- Allow scenarios to have custom score screen bar colors.
- Add support for more than 2 sides' loading screens, sidebars and speeches.
- **secsome**:
- Add support for up to 32767 waypoints to be used in scenarios.
- **ZivDero**:
Expand Down Expand Up @@ -200,4 +205,18 @@ This page lists all the individual contributions to the project by their author.
- Update and finalize custom mouse cursors and actions, add customizable weapon & EMP cursors.
- Implement support for a Saved Games subdirectory.
- Fix a bug where if the player loaded a saved game, the score screen timer would report the time since the saved game was loaded, instead of since when the scenario was first started.

- Implement the multiplayer spawner.
- Extend `BaseUnit` to accept a list of vehicles.
- Allow `BuildConst`, `BuildRefinery`, `BuildWeapons` and `HarvesterUnit` to properly have multiple entries.
- Port Rampastring's trigger actions from TS-Patches.
- Allow manually aiming AA buildings.
- Add support for more than 2 sides' loading screens, sidebars and speeches.
- Disallow loading campaign saves from other playthoughs, as well as from skirmish.
- Allow customizing the options color per side.
- Fix a bug where units could gain veterancy by killing allies.
- Fix a bug where a trigger could delete itself, leading to a crash.
- Fix a bug where AI Triggers' `MultiSide` wouldn't correctly consider all houses.
- Fix a bug where newly created objects wouldn't reveal shroud for allies with `AllyReveal=yes`.
- Fix a bug where mission `Ambush` wouldn't work correctly.
- Add unit promotion sounds, EVA and flashing.

6 changes: 5 additions & 1 deletion docs/Bugfixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ This page lists all vanilla bugs fixed by Vinifera.
- Fix a bug where crew wouldn't exit from construction yards when they were sold or destroyed.
- Fix a bug where you could sometimes get extra crew to exit a building that was being sold and was destroying/undeploying.
- Fix a bug where if the player loaded a saved game, the score screen timer would report the time since the saved game was loaded, instead of since when the scenario was first started.
- Fix a bug where units could gain veterancy by killing allies.
- Fix a bug where units could gain veterancy by killing allies.
- Fix a bug where a trigger could delete itself, leading to a crash.
- Fix a bug where AI Triggers' `MultiSide` wouldn't correctly consider all houses.
- Fix a bug where newly created objects wouldn't reveal shroud for allies with `AllyReveal=yes`.
- Fix a bug where mission `Ambush` wouldn't work correctly.
95 changes: 91 additions & 4 deletions docs/Mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,32 @@ This page describes all mapping-related additions and changes introduced by Vini

## Campaign Settings

### Campaign Side

- `Side` can now be set for campaigns, allowing the customisation of which **HOUSE**'s loading screens this campaign should use.

In `BATTLE.INI`:
```ini
[SOMECAMPAIGN] ; Campaign
Side=0 ; integer, the index of the house whose loading screens will be used for this campaign.
```

```{note}
To preserve compatibility, the campaign's `Side` defaults to `0` if its scenario names contains `GDI`, to `1` if it contains `NOD`, and to 0 otherwise.
```

```{note}
This setting only affects the loading screen graphics used.
```

### Intro Movie

- `IntroMovie` can now be set for campaigns, allowing the customisation of the intro movie that plays before the campaign path starts.

In `BATTLE.INI`:
```ini
[Campaign]
IntroMovie=<none> ; string, the intro movie name (without the .VQA extension) to play at the start of the campaign.
[SOMECAMPAIGN] ; Campaign
IntroMovie= ; string, the intro movie name (without the .VQA extension) to play at the start of the campaign.
```

### DebugOnly
Expand All @@ -27,13 +45,38 @@ IntroMovie=<none> ; string, the intro movie name (without the .VQA extension) t

In `BATTLE.INI`:
```ini
[Campaign]
DebugOnly=no ; boolean, is this campaign only available in Developer mode?
[SOMECAMPAIGN] ; Campaign
DebugOnly=no ; boolean, is this campaign only available in Developer mode?
```
For testing/debugging versions of the Tiberian Sun and Firestorm campaigns, download [BATTLE_DEBUG_CAMPAIGN.INI](https://github.com/Vinifera-Developers/Vinifera-Files/blob/master/files/BATTLE_DEBUG_CAMPAIGN.INI) and place it in your game install directory.

## Scenario Settings

### AI Base Nodes in Skirmish/Multiplayer

- Vinifera allows enabling base nodes for the AI outside of campaigns.

In a scenario file:
```ini
[Basic]
UseMPAIBaseNodes=no ; boolean, should the AI use base nodes for base construction, like in campaign?
```

### Custom Loading Screen

- The scenario file can now specify which loading screen to use.

In a scenario file:
```ini
[Basic]
LoadingScreen400= ; string, the name of the loading screen to use with this resolution.
LoadingScreen480= ; string, the name of the loading screen to use with this resolution.
LoadingScreen600= ; string, the name of the loading screen to use with this resolution.
LoadingScreen400TextPos= ; Point2D, a custom offset for the loading screen text and bars.
LoadingScreen480TextPos= ; Point2D, a custom offset for the loading screen text and bars.
LoadingScreen600TextPos= ; Point2D, a custom offset for the loading screen text and bars.
```

### Ice Destruction

- Ice destruction can now be disabled.
Expand All @@ -60,3 +103,47 @@ ScoreEnemyColor=250,28,28 ; color in R,G,B, color of the enemy's score bars
## Script Actions

## Trigger Actions

### `106` Give Credits

- Give `P3` credits to House `P2`.

### `107` Enable Short Game

- Enable Short Game.

### `108` Disable Short Game

- Disable Short Game.

### `109` Reserved

- Does nothing.

### `110` Blow Up House

- Blow up all units and structures of House `P2`.

### `111` Make Elite

- Make all attached objects elite.

### `112` Enable AllyReveal

- Enable `AllyReveal`.

### `113` Disable AllyReveal

- Disable `AllyReveal`.

### `114` Create Auto-Save

- Schedule the creation of an auto-save at the end of this frame. Works in MP and SP.

### `115` Delete Object

- Silently delete all attached objects from the map.

### `116` Assign Mission to All

- Assign Mission `P2` to all attached objects.
164 changes: 163 additions & 1 deletion docs/Miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,127 @@ This page describes every change in Vinifera that wasn't categorized into a prop
- Harvesters used to drop their cargo as Tiberium Riparius on death. They will now drop the Tiberium types they are carrying, instead.
- It is no longer required to list all Tiberiums in a map to override some Tiberium's properties.
- `FreeUnit` or `PadAircraft` would in some cases affect the cost of a building. This functionality has been removed.
- `BaseUnit` now accepts a list of units. Players will be granted the first unit in the list that has their house listed under `Owners=`.
- The AI now correctly considers all entries of `BuildConst`, `BuildRefinery`, `BuildWeapons` and `HarvesterUnit`.

## Spawner

- Vinifera implements its own spawner, capable of starting a new singleplayer, skirmish or multiplayer game, as well as loading saved games.
- To start the game in spawner mode, the `-SPAWN` command line argument must be specified.
- The spawner's options can be configures in `SPAWN.INI`.

In `SPAWN.INI`:
```ini
[Settings]
; Game Mode Options
Bases=yes ; boolean, do players start with MCVs/Construction Yards?
Credits=10000 ; integer, starting amount of credits for the players.
BridgeDestroy=yes ; boolean, can bridges be destroyed?
Crates=no ; boolean, are crates enabled?
ShortGame=no ; boolean, is short game enabled?
BuildOffAlly=no ; boolean, is building off ally bases allowed?
GameSpeed=0 ; integer, starting game speed.
MultiEngineer=no ; boolean, is multi-engineer enabled?
UnitCount=0 ; integer, starting unit count.
AIPlayers=0 ; integer, number of AI players.
AIDifficulty=1 ; integer, AI difficulty.
AlliesAllowed=no ; boolean, can players form and break alliances in-game?
HarvesterTruce=no ; boolean, are harvesters invulnerable?
FogOfWar=no ; boolean, is fog of war enabled?
MCVRedeploy=yes ; boolean, can MCVs be redeployed?

; Savegame Options
LoadSaveGame=no ; boolean, should the spawner load a saved game, as opposed to starting a new scenario?
SaveGameName= ; string, name of the saved game to load.
AutoSaveInterval=7200 ; integer, interval in frames between auto-saves.
NextAutoSaveNumber=1 ; integer, the number of the next campaign auto-save to make.

; Scenario Options
Seed=0 ; integer, random seed.
TechLevel=10 ; integer, maximum tech level.
IsCampaign=no ; boolean, is the game that is about to start campaign, as opposed to skirmish?
CampaignID=-1 ; integer, ID of the campaign (from BATTLE.INI) to start
CampaignModeHuman=1 ; DiffType, difficulty used by the human player in Campaign.
CompaignModeComputer=1 ; DiffType, difficulty used by the AI players in Campaign.
Tournament=0 ; integer, WOL Tournament Type
WOLGameID=3735928559 ; unsigned integer, WOL Game ID
ScenarioName=spawnmap.ini ; string, name of the scenario (map) to load.
MapHash= ; string, map hash, only used in statistics collection.
UIMapName= ; string, name of the map, only used in statistics collection.
PlayMoviesInMultiplayer=no ; boolean, should movies be played in multiplayer.

; Network Options
Protocol=2 ; integer, network protocol to use.
FrameSendRate=4 ; integer, starting FrameSendRate value.
ReconnectTimeout=2400 ; integer, player reconnection timeout.
ConnTimeout=3600 ; integer, player connection timeout.
MaxAhead=-1 ; integer, starting MaxHead value.
PreCalcMaxAhead=0 ; integer, starting PrecalcMaxHead value.
MaxLatencyLevel=255 ; unsigned byte, maximum allowed Protocol 0 latency level.

; Tunnel Options
TunnelId=0 ; integer, tunnel ID.
TunnelIp=0.0.0.0 ; string, tunnel IP.
TunnelPort=0 ; integer, tunnel port.
ListenPort=1234 ; integer, listen port.

; Extra Options
Firestorm=yes ; boolean, should the game start with Firestorm enabled?
QuickMatch=no ; boolean, should the game start in Quick Match mode?
SkipScoreScreen=no ; boolean, should the score screen be skipped once the game is over?
WriteStatistics=no ; boolean, should statistics be sent?
AINamesByDifficulty=no ; boolean, should AI players have their difficulty in their name?
CoachMode=no ; boolean, should defeated players that have allies not have the entire map revealed to them upon death?
AutoSurrender=yes ; boolean, should players surrender on disconnection, as opposed to turning their base over to the AI?
AttackNeutralUnits=no ; boolean, should neutral units be targeted by the player's army automatically?
ScrapMetal=no ; boolean, should explosions use alternative animations from the `ScrapExplosion=` list?
ContinueWithoutHumans=yes ; boolean, should the game not end even if the only players left alive are AI?
DifficultyName= ; string, and override for the difficulty name printed at the start of the scenario.
```

- Information about the local player is read from the `Settings` section, for all other players - from `OtherX` sections, where `X` ranges from `1` to `7`.

In `SPAWN.INI`:
```ini
[PLAYERSECTION]
IsHuman=no ; boolean, is this a human player?
Name= ; string, the player's name.
Color=-1 ; integer, the player's color.
House=-1 ; integer, the player's house.
Difficulty=-1 ; integer, the player's difficulty.
Ip=0.0.0.0 ; string, the player's IP address.
Port=-1 ; integer, the player's port.
```

- Additionally, AI players (always come after human players) have these options parsed from sections of the format `MultiX`, where `X` ranges from `1` to `8`.

In `SPAWN.INI`:
```ini
[MULTISECTION]
Color=-1 ; integer, the player's color.
House=-1 ; integer, the player's house.
Difficulty=-1 ; integer, the player's difficulty.
```

- Additionally, the spawner reads configuration for each house. Player houses come first, in the order of their color (increasing), then AI houses.
- Alliances are read from sections of the format `MultiX_Alliances`, where `X` ranges from `1` to `8`.

In `SPAWN.INI`:
```ini
[MULTISECTION]
IsSpectator=no ; boolean, is this house a spectator (observer)?
SpawnLocations=-2 ; integer, spawn location of this house. 90 and -1 mean spectator, -2 means random.

[ALLIANCESSECTION]
HouseAllyOne=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllyTwo=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllyThree=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllyFour=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllyFive=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllySix=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllySeven=-1 ; integer, index of the house this house is allied to, -1 means none.
HouseAllyEight=-1 ; integer, index of the house this house is allied to, -1 means none.
```

## Quality of Life

Expand Down Expand Up @@ -39,6 +160,44 @@ PrePlacedConYards=no ; boolean, should pre-place construction yards instead of
; NOTE: This option has priority over AutoDeployMCV.
```

## Auto-Saves

- When playing campaigns, Vinifera will now make auto-saves for the player at equal intervals. The number of auto-saves to keep, as well as the interval, can be customized.

In `SUN.INI`:
```ini
[Options]
AutoSaveCount=5 ; integer, the number of auto-saves to keep simultaneously. Setting to 0 will disable auto-saves.
AutoSaveInterval=7200 ; integer, the interval between auto-saves, in frames.
```

## Human Difficultiy

- Vinifera adds to possibility to optionally use a different diffiulty level for the human player when their difficulty is set to `Normal`. The new difficulty must have its values be provided in the same manner as vanilla difficulties in a new section, `HumanNormal`.

In `VINIFERA.INI`:
```ini
[Features]
HumanNormalDifficulty=no ; boolean, should the human player use a separate difficulty when on normal difficulty?
```

- Additionally, difficulty names can be customized.

In `VINIFERA.INI`:
```ini
[Language]
DifficultyEasy=Easy
DifficultyNormal=Normal
DifficultyHard=Hard
DifficultyVeryEasy=Very Easy ; 2 extra difficulties used by the XNA Client (CnCNet)
DifficultyExtremelyEasy=Extremely Easy
DifficultyAIEasy=Hard
DifficultyAINormal=Normal
DifficultyAIHard=Easy
DifficultyAIVeryEasy=Brutal ; 2 extra difficulties used by the XNA Client (CnCNet)
DifficultyAIExtremelyEasy=Ultimate
```

## Multi-Engineer

- Vinifera fixes `EngineerDamage` and `EngineerCaptureLevel` to be considered by the game, like they were in Tiberian Dawn and Red Alert.
Expand Down Expand Up @@ -156,7 +315,10 @@ Due to the nature of its use, this feature is only available when Vinifera is ru

### Command Line Options

- Vinifera adds a number of command-line arguments allowing the user to skip the startup movies, or skip directly to a specific game mode and/or dialog.
- Vinifera adds a number of command-line arguments.

- `-SPAWN`
Launch the game in spawner mode.

- `-NO_STARTUP_VIDEO`
Skips all startup movies.
Expand Down
Loading
Loading