技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

Krokosha666/cas-unk-krokosha-multiplayer-coop 深度技术分析

项目背景与痛点

Krokosha666/cas-unk-krokosha-multiplayer-coop 是一款针对 itch.io 平台上的 “Scav Prototype” 游戏的局域网合作模式模组。在多人游戏领域,合作模式一直是游戏体验的重要环节。传统上,许多游戏都在探索多种合作模式,但由于网络环境或硬件限制,局域网合作模式提供了另一种解决方案。该项目定位明确,满足了玩家对高稳定性和低延迟的合作游戏体验需求,在适配硬件性能的同时提供了灵活的操作体验。

核心技术揭秘

Krokosha666/cas-unk-krokosha-multiplayer-coop 采用了一系列现代游戏开发技术,进一步提升了合作游戏的用户体验。项目核心由以下技术架构支撑:

  • 框架与库:依靠成熟的多人游戏框架整合资源,如网络同步、状态管理等。
  • 数据同步机制:通过对玩家操作的实时同步,确保所有玩家的体验一致性。

下面通过 Mermaid 图表展示它的数据流与架构:

graph TD A[用户操作] --> B{"操作同步"} B -->|"成功"| C[状态更新] B -->|"失败"| D[错误处理] C --> E[屏显更新] D --> E

分析

在架构上,Krokosha666/cas-unk-krokosha-multiplayer-coop 充分利用了框架和库的力量,构建了一个高效的数据同步机制。无论在局域网中的玩家何时操作,都能被快速同步并反映在所有玩家的屏幕上。这就保证了游戏过程中的流畅感和一致性,也为游戏体验的提升奠定了技术基础。

功能亮点与差异

相比同类竞品,Krokosha666/cas-unk-krokosha-multiplayer-coop 功夫不在话下:

  • 低延迟服务器:通过局域网部署,本质上避免了网络不稳定给游戏带来的负面效果,这也使得它的表现优于许多需要网络依赖的合作游戏。
  • 高度可配置性:用户可以根据自己的需要调整合作模式的细节,无论是添加自定义规则,还是调整AI难度,都提供了丰富的选项。
  • 本地化支持:简化多语言支持,从用户界面到操作说明,一切都围绕用户本地化体验展开。

应用场景与落地建议

在生产环境中使用 Krokosha666/cas-unk-krokosha-multiplayer-coop,应注意以下几点:

  • 考虑网络配置,局域网合作模式虽是项目优势,但基础配置(如网络适配器、相应硬件性能)需满足一定要求。
  • 功能调优,如添加特殊定制功能,需仔细测试各种操作模式以确保稳定性。
  • 场景选择,适合家庭娱乐和聚会活动,亦可应用于教学和培训情境,通过合作模式提高玩家的操作水平和合作技巧。

综合评价

优点

  • 高质量同步机制,局域网下的性能表现优异,几乎没有延迟。
  • 灵活的功能增减与定制化设计,整体开发架构也体现出开发者背景及技术功底。

缺点

  • 高硬件要求,确保良好性能需适配高品质硬件,可能会部分限制其用户群体。
  • 用户界面配置上相对独立,对于非技术背景玩家,定制化功能的探索可能会遭遇一定难度。

Krokosha666/cas-unk-krokosha-multiplayer-coop 的设计和实现展示了一种优秀的解决方案,充分满足合作模式的用户需求,同时也存在一些局限性,这些需要开发者根据实际场景不断优化和改进。

关于

GitHub 原始描述(英文)

Online Multiplayer Co-op mod for game "Casualties: Unknown"

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
527
价值分
289
活跃状态
活跃

语言占比

C#
Python

README

Stars Latest Release Github Downloads Nexus Downloads Game Version

Online Multiplayer Co-op mod for game “Casualties: Unknown”

Casualties: Together Target Planet

Support developer:

"Buy Me A Coffee"

Install Guide:

Requirements:

Download Game: https://store.steampowered.com/app/4576510
Download BepInEx: https://github.com/BepInEx/BepInEx/releases/download/v5.4.23.5/BepInEx_win_x64_5.4.23.5.zip
Download Co-op Mod: https://www.nexusmods.com/scavprototype/mods/67

Click to show full install guide.

  1. Download all the prerequisistes ^^^^^^

  2. Go to the game root directory.

    • In Steam, Right click on the game.
    • Click Manage > Browse local files
  3. Unzip BepInEx*.zip into the game root directory.

  4. Unzip MPMod*.zip, open mod folder and move the contents into the game root directory.

  5. Now it should look like this

alt text

  1. Go back to steam and click Play.

  2. In main menu, multiplayer related buttons should appear.

    • (To go back to singleplayer you need to press the Deactivate MP Mod button in Settings > General!)
  3. (optional) Upvote/Share/Support the mod.

FOR LINUX USERS
  1. Add this to launch options WINEDLLOVERRIDES="winhttp=n,b" %command%
    • It tells proton to load BepInEx.

Warning:

If installation doesn’t work, Try again.

Make sure to launch the game through Steam Library if Steam Lobbies don’t work.

It’s recommended to have good internet connection for optimal experience.

!!!
IF YOU ENCOUNTER ANY GLITCHES, CRASHES, OTHER ISSUES - BLAME THE MOD, NOT THE ORIGINAL DEVELOPER OF THE GAME
!!!

To go back to singleplayer you need to press the Deactivate MP Mod button in Settings > General!

Features:

Steam Lobbies
Real voice chat with in-game effects.
Middle Mouse Button to point at a location.
Right click to interact and heal other players.
Stay close to others to share body temperature.
Spectator mode when dead.
Sleeping is disabled.
Hunger and thirst is slowed down.
Carrying incapacitated players.
Any dead players respawns at next layer.
Unchipped option is individual.
Most of these features can be tweaked in the in-game console.
Also this mod can run as a dedicated server. (its not real headless)

There’s no client prediction.
There’s no network ownership.
There’s no deterministic RNG.
There’s no anticheat.
This mod only adds a simple co-op experience to the game.

Full feaure list:

Disabled sleeping. (tied to the rule “EnableSleep” )
Disabled time scale buttons. (don’t try re-enable this actually)
Player friendly fire can be enabled with the “PVP” rule.
Middle mouse click to highlight a location at your cursor, for the other players to see.
Stand close to other players to share body temperature.

Text chat and Voice chat are dependent on your characters ability to speak, same distortions apply to your messages.
MP3 Player now is a boombox instead of replacing background music.

Right click on a player to open a player interaction context menu.

  • Inspect health panel and perform any actions.
  • Inspect their inventory and take their items.
  • Use any usable item on them (Feeding).

When a player dies, they are put into spectator mode.

  • All dead players respawn after living players reach the next level.
  • (if rule “Permadeath” is true, respawns are disabled)
  • Player can be revived from traders.

To continue to the next layer, half of all players must reach the end.

  • Straggles will get killed if they take too long.
  • Only the Host gets prompted to continue the run.
  • DrillPod works the same, all players must be in the pod to continue.
  • (tweaked by the rule “LayerFinishConditionPlayerPercent”)

Player health regen and decay is tweaked.

  • Death is much faster if there are no comrades nearby. ( tweaked by the “AdditionalHealthDecay” rule )
  • Health regeneration is boosted. ( tweaked by the “AdditionalHealthRegen” rule)

All these rules can be changed only by the Host by running the command “rule [rule name] [new value]”

You can eat your friends after they died.

  • The rule “CanAmputateHealthyPlayers” allows you to steal limbs of living players.

Traders first impression reputation is calculated from the prettiest of the bunch.

How to enable all console commands:

The Host must enter this console command:
rule sv_cheats 1
To let Client into server console mode they need “admin” privilege.
      (Given by “adminpriv [player]” or “adminpriv-password”)

Building:

Run script scripts/prepare_workspace.py

It copies the game and installs BepInEx.

Visual Studio 2022 is recommended.

Open the project and compile it.

Hit F5

You have to launch multiple instances of the game manually or using scripts.

Uuhh

Credits:

Credits are listed in “About” menu inside the mod.
Creature Current owner.
Krokosha666 Original developer. (Retired)

Contributors:

Dune - Sync, Optimizations
VtLoader - Bug fixes, Locale
Gary the Cat, Dannad, Meow, Jimmyking, Kidihh, Dawn, mayzmae, ItsVoidSK
…And a bunch of playtesters

Supporters:

Bleh :P, EthanTheProtogen, RoyMartini, Jazun, Alexx__, vega, Zmechol1337, plasterjello, Doctor Callico, vivikat, Ariyah, killthebudget, _stuck_, ShaoAZ, JameisonAus, Kidi, BluBerryToaster, Katomou, Nemean_Lion732, Locko2265, Trenchburner, TheBoathead, Diesel, Malbyte, KaliVasquez, Mitirich, Shiro, ChrisTheDragon

评论

暂无评论