Skip to content

Commit

Permalink
Increase Render Distance
Browse files Browse the repository at this point in the history
- Increase base draw distance to 5000.
- Increase max draw distance to 15000.
- Add medium draw distance for certain levels.
- Remove cyclorama from depth buffer.
- Remove cyclorama requirement from gLevelClearColor.
- Change the type of gNumEnemyOfKind to int32_t.
- Raise MAX_SUPERTILE_ACTIVE_RANGE to 20.
- Change all values in gLevelSuperTileActiveRange to fit in the 8-20 range.
- Raise MAX_LIQUID_MESHES to 255.
- Use proper copyright symbol in Windows resource file.
- Update documentation.
Issue jorio#24.
  • Loading branch information
LordNyriox authored Apr 4, 2023
1 parent c2b7cc2 commit a435361
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 58 deletions.
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Bugdom
# <p align="center" width="100%"><img alt="Bugdom" src="docs/bugtitle.png"></p>

This is Pangea Software's **Bugdom** updated to run on modern operating systems.
This version, at https://github.com/jorio/bugdom, is approved by Pangea Software.
[![latest release](https://img.shields.io/github/release/LordNyriox/Bugdom.svg)](https://github.com/LordNyriox/Bugdom/releases/latest)
[![license](https://img.shields.io/badge/license-CC_BY--NC--SA_4.0-lightgrey.svg)](LICENSE.md)
[![repo size](https://img.shields.io/github/repo-size/LordNyriox/Bugdom.svg)](https://github.com/LordNyriox/Bugdom)
[![Build Status](https://img.shields.io/github/workflow/status/LordNyriox/Bugdom/Full%20Compile%20Check/extreme)](https://github.com/LordNyriox/Bugdom/actions/workflows/FullCompileCheck.yml?query=branch%3Aextreme)
[![last commit](https://img.shields.io/github/last-commit/LordNyriox/Bugdom/extreme.svg)](https://github.com/LordNyriox/Bugdom/commits/extreme)

**Download the game for macOS, Windows and Linux here:** https://github.com/jorio/bugdom/releases
This is a fork of Pangea Software’s *Bugdom*, updated to run on modern operating systems.

![Bugdom Screenshot](docs/screenshot.webp)
Forked from [**@jorio**](https://github.com/jorio)’s version, at [jorio/Bugdom](https://github.com/jorio/Bugdom), which is [approved by Pangea Software](https://pangeasoft.net/bug/register.html).

## About this port
**Download the game for macOS, Windows and Linux here:** <https://github.com/LordNyriox/Bugdom/releases>

Bugdom is a 1999 Macintosh game by Pangea Software. You play as Rollie McFly, a pill bug on a quest to save ladybugs from King Thorax’s iron grip on the Bugdom.
## About This Fork

The game was bundled with some Mac models of the era. It is probably the most advanced game that uses QuickDraw 3D. Unfortunately, QuickDraw 3D has not been updated past Mac OS 9, so experiencing the game used to require booting a PowerPC Mac into OS 9 — until this port came out.
[*Bugdom*](https://pangeasoft.net/bug/index.html) is a 1999 Macintosh game by Pangea Software. You play as Rollie McFly, a pill bug on a quest to save ladybugs from King Thorax’s iron grip on the Bugdom.

After I finished porting [Nanosaur](https://github.com/jorio/Nanosaur), Pangea offered to let me port Bugdom. I was excited to update this gem of a game because it was a childhood favorite of mine.
The game was bundled with some Mac models of the era. It is probably the most advanced game that uses QuickDraw 3D. Unfortunately, QuickDraw 3D has not been updated past Mac OS 9, so experiencing the game used to require booting a PowerPC Mac into OS 9 — until [**@jorio**](https://github.com/jorio)’s port came out.

This port aims to provide the best way to experience Bugdom today. It introduces some modern comforts (such as support for arbitrary resolutions) and fixes some gameplay bugs. The overall experience is intended to be faithful to the spirit of the original game, so modifications to the game’s design are out of the scope of this project.
After [**@jorio**](https://github.com/jorio) finished porting [Nanosaur](https://github.com/jorio/Nanosaur), Pangea offered to let him port Bugdom. [**@jorio**](https://github.com/jorio) and [I](https://github.com/LordNyriox) were both excited to update this gem of a game because it was a childhood favorite of ours.

The first release of this port used a custom fork of [Quesa](https://github.com/jwwalker/Quesa) for rendering. Bugdom has switched to a tailor-made renderer as of version 1.3.1.
This fork aims to provide the best way to experience *Bugdom* today. It introduces some modern comforts, fixes some gameplay bugs, and [extends the maximum render distance](https://github.com/jorio/Bugdom/issues/24) to *6 times* that of the original game.

## Documentation
### Documentation

- [BUILD.md](BUILD.md) — How to build on macOS, Windows or Linux.
- [CHANGELOG.md](CHANGELOG.md) — Bugdom version history.
- [LICENSE.md](LICENSE.md) — Licensing information (see also below).
- [Instructions.pdf](docs/Instructions.pdf) — Original instruction manual. Int'l versions:
[DE](docs/Instructions-DE.pdf)
[EN](docs/Instructions-EN.pdf)
[FR](docs/Instructions-FR.pdf)
[IT](docs/Instructions-IT.pdf)
[JA](docs/Instructions-JA.pdf)
Expand All @@ -35,23 +37,25 @@ The first release of this port used a custom fork of [Quesa](https://github.com/
- [CHEATS.md](CHEATS.md) — Cheat codes!
- [COMMANDLINE.md](COMMANDLINE.md) — Advanced command-line switches.

## License
### License

Bugdom is being re-released here (https://github.com/jorio/bugdom) under the [CC BY-NC-SA 4.0](LICENSE.md) license with permission from Pangea Software, Inc.
*Bugdom* has been re-released at [jorio/Bugdom](https://github.com/jorio/Bugdom) under the [CC BY-NC-SA 4.0](https://github.com/jorio/Bugdom/blob/master/LICENSE.md) license with permission from Pangea Software, Inc.

Bugdom® is a registered trademark of Pangea Software, Inc.
In compliance with the ShareAlike clause of said license, this fork is released under the [same](LICENSE.md) license.

## Credits
Bugdom® and Nanosaur™ are trademarks of Pangea Software, Inc.

### Credits

- © 1999 Pangea Software, Inc.
- Designed & developed by Brian Greenstone & Toucan Studio, Inc.
- All artwork herein is © Toucan Studio, Inc.
- All music herein is © Mike Beckett.
- This software includes portions © 2020 Iliyas Jorio.
- This software includes portions © 2020-2023 Iliyas Jorio.

## More Pangea stuff!

Check out my ports of other Pangea classics:
Check out [**@jorio**](https://github.com/jorio)’s ports of other Pangea classics:
- [Billy Frontier](https://github.com/jorio/BillyFrontier)
- [Bugdom](https://github.com/jorio/Bugdom)
- [Cro-Mag Rally](https://github.com/jorio/CroMagRally)
Expand All @@ -60,4 +64,4 @@ Check out my ports of other Pangea classics:
- [Nanosaur 2](https://github.com/jorio/Nanosaur2)
- [Otto Matic](https://github.com/jorio/OttoMatic)

All ports are provided free of charge! If you’d like to support the development of Pangea game ports, feel free to visit https://jorio.itch.io and name your own price for any of the games there. Much appreciated! 😊
All ports are provided free of charge! If you’d like to support the development of Pangea game ports, feel free to visit https://jorio.itch.io and name your own price for any of the games there. Much appreciated!
Binary file added docs/bugextreme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/bugtitle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packaging/Bugdom.exe.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BEGIN
VALUE "FileDescription", "Bugdom"
VALUE "FileVersion", PROJECT_VERSION
VALUE "InternalName", "Bugdom"
VALUE "LegalCopyright", "(C) 1999 Pangea Software, Inc. (C) 2023 Iliyas Jorio."
VALUE "LegalCopyright", " 1999 Pangea Software, Inc. 2023 Iliyas Jorio."
VALUE "OriginalFilename", "Bugdom.exe"
VALUE "ProductName", "Bugdom"
VALUE "ProductVersion", PROJECT_VERSION
Expand Down
2 changes: 1 addition & 1 deletion src/Enemies/Enemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static Boolean KillEnemy(ObjNode *theEnemy);
/* VARIABLES */
/*********************/

short gNumEnemyOfKind[NUM_ENEMY_KINDS];
int32_t gNumEnemyOfKind[NUM_ENEMY_KINDS];
short gNumEnemies;


Expand Down
2 changes: 1 addition & 1 deletion src/Headers/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

#define HITHER_DISTANCE 20.0f
#define YON_DISTANCE 2500.0f
#define YON_DISTANCE 5000.0f // how far the game will render objects in the view frustum

void InitCamera(void);
void UpdateCamera(void);
Expand Down
2 changes: 1 addition & 1 deletion src/Headers/enemy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "terrain.h"
#include "splineitems.h"

#define MAX_ENEMIES 11
#define MAX_ENEMIES 30 // does not scale with render distance

#define DEFAULT_ENEMY_COLLISION_CTYPES (CTYPE_MISC|CTYPE_HURTENEMY|CTYPE_ENEMY|CTYPE_LIQUID)
#define DEATH_ENEMY_COLLISION_CTYPES (CTYPE_MISC|CTYPE_ENEMY)
Expand Down
2 changes: 1 addition & 1 deletion src/Headers/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ extern short gMoney;
extern short gNumBlueClovers;
extern short gNumCollisions;
extern short gNumEnemies;
extern short gNumEnemyOfKind[];
extern int32_t gNumEnemyOfKind[];
extern short gNumGoldClovers;
extern short gNumGreenClovers;
extern short gNumLadyBugsThisArea;
Expand Down
4 changes: 2 additions & 2 deletions src/Headers/renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ typedef struct RenderModifiers

enum
{
kDrawOrder_Terrain = -128,
kDrawOrder_Cyclorama,
kDrawOrder_Cyclorama = -128, // give it a lower value than the terrain to draw it first
kDrawOrder_Terrain = -127,
kDrawOrder_Fences,
kDrawOrder_Shadows,
kDrawOrder_Default = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/Headers/terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ enum

#define TERRAIN_SUPERTILE_UNIT_SIZE (SUPERTILE_SIZE*TERRAIN_POLYGON_SIZE) // world unit size of a supertile

#define MAX_SUPERTILE_ACTIVE_RANGE 5 // max value of gSuperTileActiveRange
#define MAX_SUPERTILE_ACTIVE_RANGE 20 // max value of gSuperTileActiveRange
// The largest map in the game (Night.ter) is 50x40 supertiles == 2000 supertiles.
// Therefore, the maximum useful value for MAX_SUPERTILE_ACTIVE_RANGE is 23 (because (23*2)**2 == 2116 supertiles)

Expand Down
8 changes: 4 additions & 4 deletions src/Items/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ void CreateCyclorama(void)

// Notes on cyclorama status bits:
// - HIDDEN because we'll draw it manually in DrawTerrain.
// - Don't set NOZWRITE, contrary to the original source code. The cyc does appear to clip
// through the terrain and fences on the OS 9 version, effectively reducing draw distance
// somewhat. See: faraway fences seen from the starting position in level 4.
gNewObjectDefinition.flags = STATUS_BIT_DONTCULL | STATUS_BIT_NULLSHADER | STATUS_BIT_NOFOG | STATUS_BIT_HIDDEN;
// - NOZWRITE was set in the original source code.
// The cyc should not clip through the terrain or fences.
// See: faraway fences seen from the starting position in level 4.
gNewObjectDefinition.flags = STATUS_BIT_DONTCULL | STATUS_BIT_NULLSHADER | STATUS_BIT_NOFOG | STATUS_BIT_NOZWRITE | STATUS_BIT_HIDDEN;

gCyclorama = MakeNewDisplayGroupObject(&gNewObjectDefinition);
gCyclorama->RenderModifiers.drawOrder = kDrawOrder_Cyclorama;
Expand Down
2 changes: 1 addition & 1 deletion src/Items/Liquids.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void ApplyJitterToLiquidVertex(TQ3Point3D* p, int type);
/* CONSTANTS */
/****************************/

#define MAX_LIQUID_MESHES 32
#define MAX_LIQUID_MESHES 255 // does not scale with render distance
#define MAX_LIQUID_SIZE 20
#define MAX_LIQUID_TRIANGLES (MAX_LIQUID_SIZE*MAX_LIQUID_SIZE*2)
#define MAX_LIQUID_VERTS ((MAX_LIQUID_SIZE+1)*(MAX_LIQUID_SIZE+1))
Expand Down
54 changes: 29 additions & 25 deletions src/System/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ static const bool gLevelHasCeiling[NUM_LEVEL_TYPES] =

static const Byte gLevelSuperTileActiveRange[NUM_LEVEL_TYPES] =
{
5, // garden
4, // boat
5, // dragonfly
4, // hive
4, // night
4 // anthill
20, // garden
16, // boat
20, // dragonfly
8, // hive
16, // night
8 // anthill
};

static const float gLevelFogStart[NUM_LEVEL_TYPES] =
Expand All @@ -146,11 +146,11 @@ static const float gLevelFogEnd[NUM_LEVEL_TYPES] =

static const float gLevelAutoFadeStart[NUM_LEVEL_TYPES] =
{
YON_DISTANCE+400, // garden
YON_DISTANCE+5500, // garden
0, // boat
0, // dragonfly
0, // hive
YON_DISTANCE-250, // night
YON_DISTANCE+4000, // night
0, // anthill
};

Expand Down Expand Up @@ -199,8 +199,8 @@ static const TQ3ColorRGBA gLevelFogColor[NUM_LEVEL_TYPES] =
// Source port addition: on rare occasions you get to see the void "above" the cyclorama.
// To camouflage this, we make the clear color roughly match the color at the top of the cyc.
// This is not necessarily the same color as the fog!
// NOTE: If there's no cyc in a level, this value is ignored and the fog color is used instead.
static const TQ3ColorRGBA gLevelClearColorWithCyc[NUM_LEVEL_TYPES] =
// NOTE: If there's no cyc in a level, this value is still used.
static const TQ3ColorRGBA gLevelClearColor[NUM_LEVEL_TYPES] =
{
{ 0.352f, 0.380f, 1.000f, 1.000f }, // garden (DIFFERENT FROM FOG)
{ 0.900f, 0.900f, 0.850f, 1.000f }, // boat (same)
Expand Down Expand Up @@ -472,16 +472,23 @@ QD3DSetupInputType viewDef;

gBestCheckPoint = -1; // no checkpoint yet


if (gSuperTileActiveRange == 5) // set yon clipping value
{
gCurrentYon = YON_DISTANCE + 1700;
gCycScale = 81;
}
else

switch (gLevelType) // set yon clipping value
{
gCurrentYon = YON_DISTANCE;
gCycScale = 50;
case LEVEL_TYPE_LAWN: // high visibility outdoor levels
case LEVEL_TYPE_FOREST:
gCurrentYon = YON_DISTANCE + 10000;
gCycScale = 300; // gCycScale = (0.02f * gCurrentYon)
break;
case LEVEL_TYPE_POND: // low visibility outdoor levels
case LEVEL_TYPE_NIGHT:
gCurrentYon = YON_DISTANCE + 5000;
gCycScale = 200;
break;
default: // indoor levels
gCurrentYon = YON_DISTANCE;
gCycScale = 100;
break;
}


Expand Down Expand Up @@ -560,12 +567,9 @@ QD3DSetupInputType viewDef;
viewDef.lights.fogMode = kQ3FogModePlaneBasedLinear; // Source port note: plane-based linear fog accurately reproduces fog rendering on real Macs

// Source port addition: camouflage seam in sky with custom clear color that roughly matches top of cyc
if (gUseCyclorama)
{
viewDef.lights.useCustomFogColor = true; // need this so fog color will be different from clear color
viewDef.view.clearColor = gLevelClearColorWithCyc[gLevelType];
}

viewDef.lights.useCustomFogColor = true; // need this so fog color will be different from clear color
viewDef.view.clearColor = gLevelClearColor[gLevelType];

// if (gUseCyclorama && (gLevelType != LEVEL_TYPE_FOREST) && (gLevelType != LEVEL_TYPE_NIGHT))
// viewDef.view.dontClear = true;

Expand Down

0 comments on commit a435361

Please sign in to comment.