Operation Carnage Decomp ======================== A decompile of Operation Carnage (1996, DOS) and a PC port of it. The decomp builds back to the exact bytes of the original CARNAGE.EXE. The PC and Android ports run that same code. This is an unofficial fan project. No game data is included. You will need the game files from a licensed copy in order to play it. Download -------- Get the latest build from [Releases](https://github.com/wootbeer/opcarnagedecomp/releases). - Windows: unzip and run carnage.exe. Nothing else to install. - Linux: extract and run `carnage`. Works on most distros from the last few years and the Steam Deck. - Android: install the APK for your device, arm64-v8a for most phones and handhelds. Works with Obtainium. Game Files ---------- Copy these from your Operation Carnage folder: RESOURCE.1 to RESOURCE.7, RESOURCE.DES, CONFIG.DAT, HIGH.SCR The game looks for them in this order: 1. The folder given on the command line 2. The folder in the `CARNAGE_DATA` environment variable 3. The current folder 4. Next to carnage.exe, or an `OpCarna` folder next to it or above it Settings and high scores are saved to CONFIG.DAT and HIGH.SCR in that folder, same as the original. Steam Deck ---------- 1. In Desktop Mode extract the Linux build somewhere, like `~/Games/opcarnage` 2. Copy your game files into the same folder 3. In Steam, Games > Add a Non-Steam Game to My Library, Browse, pick `carnage` 4. Go back to Gaming Mode and play It starts full screen on the Deck. Use Steam + X to bring up the keyboard for the password and high score name. Controls -------- Default keys are the same as the original. Arrows move, Ctrl fires, Shift changes weapon, Space drops a bomb. Esc quits, P pauses, F1 is help. F10 opens the settings. F11 or Alt+Enter toggles full screen. Gamepad: | Gamepad | Game | |---|---| | Left stick / D-pad | Move, menus | | Right stick | Aim (see Controls) | | A, Right trigger | Fire | | B | Esc | | X | Bomb | | Y, Shoulders | Change weapon | | Start | Esc (back to the title) | | Back / Select | Settings | | Left stick click | Pause | In the game's menus and screens A and Start confirm (Enter, and Yes) and B goes back (Esc, and No), whatever the remap says. On the pause screen A, B and Start resume. When the game asks to quit, A is Yes and B or Start is No. The buttons can be changed for play in Controls, Remap Gamepad. Settings -------- F10, Select (Back) on a gamepad, or MENU on the touch controls opens the settings. The game waits while they're open. - Display: Default (4:3), Stretch or Integer (whole-number scaling) - Widescreen: Off, 16:9 or Full. In the rooms the playfield fills the screen and the status line (weapon, ammo, health, power-up) goes on top of it. Menus and other screens stay 4:3. Off by Default - HUD: Default or Minimal. Minimal puts health, weapon and ammo, lives, bombs and the power-up small in the top left and the score in the top right, and the playfield fills the picture without the status line - Full screen (PC) - Sound: - Volume, and a level each for Music, Sound effects, Gunfire (your weapons), Explosions and Voices (the announcer and the player's shouts) - More channels: 8 voices instead of 4, so explosions and shots don't cut each other off - Stereo: sounds come from where they happen on screen - Reverb: Off, Low, Medium or High, on the sound effects - Bass boost - Sound variety: each sound a touch different, a little higher or lower each time, and quieter, duller and with more reverb the further it is from you - Heavy impacts: Off, On or Carnage. A kick under every shot and more body on the gun, a low boom under explosions and bombs, thuds on hits, and the music dips on big explosions - All off by Default - Skip waits: any key, button or tap skips the logos, the intro and screen waits. On by Default - Level select: Up and Down pick a level on the password screen, then Enter starts it. On by Default - Touch controls: Auto, Always or Off. Off leaves just the MENU button (Android) - Touch size and opacity (Android) - Touch fire (Android): Default, or Aim stick. With Aim stick the Fire button is a stick: push it any way to aim and fire that way while you move freely with the d-pad. A tap fires straight on - About: the version and where the project lives - Share log (Android): sends the game's log, to help fix problems on your phone. Also on the app icon's long-press menu, and offered after a crash - Cheats: God mode, Unlimited ammo, Unlimited bombs, Always power weapons, Always triple, Always shield, Always killer. All off by Default. They can be on together - Screen rate (Android, on screens that can change): Default lets the phone pick, or pick one of the rates the screen has (60 Hz saves battery on 90 and 120 Hz phones) - Effects (all off by Default): - Intensity: Normal or Carnage. Carnage makes more particles and longer smoke, shakes and rumbles harder, and holds the game still for a moment when a big enemy dies - Screen shake, Rumble, Damage flash - Hit flash: enemies flash white when your shots hit them - Muzzle flash, Sparks, Explosions (smoke, shockwave rings and glow) - Gore and debris: flesh enemies bleed when hit and burst into blood and gibs when they die; machines throw sparks and metal bits - Lighting: Off, On or Dark. Shots, muzzle flashes and explosions light up the room. Dark makes the rooms darker so the light stands out, with a little light around the player - Shadows: sprites cast a shadow on the floor and walls - Moving shadows: explosions and shots throw the sprites' shadows away from them - Ambient occlusion: soft shade on the floor below and right of the walls and under the sprites, the way the game's own art is lit - Surface relief: light picks out the bumps and edges of floors and walls - Bloom: a glow around lava, fire and other bright warm colours. Off, Low, Medium, High or Very high - Lava glow: lava and fire light up the floor and things around them, flickering a little - Heat shimmer: the air ripples above lava and fire - More effects (all off by Default): - Scorch and blood: explosions, blood and hits leave scorch marks, blood and dirt on the floor. They stay until you leave the room - Wall marks: bullet holes, scorch from fire, lighter scorch from plasma - Shell casings: the cannon throws out casings that stay on the floor - Tread marks: tanks leave tracks, walkers footprints - Score popups: points float up where enemies die, big flashing gold for bosses - Electric crackle: little pixel arcs flicker around plasma shots and the super plasma beam, and along the health bar - Lava bubbles, Sparkles (pickups sparkle) - Picture: - Screen filter: Off, LCD, CRT, CRT curved, Scanlines or Smooth (xBR) - Color: Default, Vivid, Warm, Cool, Cinematic, Muted, or By sector (a different look for each sector) - Brightness - Accessibility: Reduce flashing (softer screen flashes and glows, no damage flash) and Reduce motion (no shake or shockwave rings) - Controls: - Right stick: Aim (fire with a button), Aim and fire, or Off. The original had no right stick, so Aim is on by Default - Aim directions: 8 (Default) or 16 - Swap sticks: move with the right stick, aim with the left - Stick dead zone - Left and Right stick sensitivity: 50% to 200%, 100% by Default. Higher reacts to a smaller push - Mouse aim (PC): aim at the pointer, left button fires, right button drops a bomb. Off by Default - Remap Gamepad They're saved to opcarnage.ini in the game folder. Android ------- On first launch pick the folder with your game files. They get copied into the app. Needs Android 5.0 or newer. Touch controls show when you touch the screen and hide when you use a gamepad or keyboard. The keyboard pops up for the password and high score name. Tap the screen to bring it back if you close it. MENU on the touch controls opens the settings. Building -------- Needs CMake and a C++14 compiler. SDL2 is downloaded automatically if it isn't found. ``` cmake -S . -B build cmake --build build --config Release ``` Needs OpenGL 2.1. Tested with GCC on Linux and MinGW for Windows. Visual Studio should work too, open the folder and build `carnage`. Android: open the `android` folder in Android Studio and press Run. For a release build copy `android/keystore.properties.example` to `keystore.properties`, fill it in, then `gradlew assembleRelease`. `tools/release.sh` makes the PC release zips. The Linux one is built on Ubuntu 20.04 so it runs on older systems too. SDL2 and the C++ runtime are built into the program on both, so there are no extra files or runtimes to install. Credits ------- Screen filters: - LCD3x, by Gigaherz (public domain) - CRT, by Timothy Lottes (public domain) - xBR-lv2, by Hyllian (MIT, see `licenses/xBR-lv2-MIT.txt`) Layout ------ - `decomp/` The byte matching decomp and its tools. See [decomp/README.md](decomp/README.md) - `src/game/` The game code, made from the decomp by `tools/mkport.py` - `src/sys/` Stands in for the DOS hardware the game used (VGA, keyboard, timer, XMS, files, sound). Shared by PC and Android - `src/sys/render.cpp`, `menu.cpp`, `settings.cpp` The OpenGL renderer, settings menu and settings, shared by PC and Android - `src/sys/main.cpp`, `plat_sdl.cpp` The PC shell on SDL2 and OpenGL - `android/` The Android project. Its shell is in `android/app/src/main` - `tools/mkport.py` Makes `src/game` from `decomp/src` - `tools/check_shaders.sh` Checks every shader the way phones compile them (needs glslangValidator) The game code is kept as close to the decomp as possible. Changes are marked `PORT:`. To remake it after changing the decomp: ``` python tools/mkport.py decomp/src src/game ``` Issues and Limitations ---------------------- - Sound is a simple mixer standing in for the DiamondWare Sound ToolKit. Should sound the same but needs more testing. - Behaviour is 1:1 with the original, bugs included. Fixes and new features will come later as options.