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

Settlement Markets #144

Merged
merged 41 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
437c127
Created Market & Stall classes.
dmccoystephenson Jul 1, 2023
45f8715
Made settlements contain a market, added debug info & added command b…
dmccoystephenson Jul 2, 2023
118d2fd
Added `Plant Sapling` button.
dmccoystephenson Jul 2, 2023
426972c
Implemented EXIT_SETTLEMENT & CONSTRUCT_STALL behaviors.
dmccoystephenson Jul 2, 2023
b80c13b
Renamed a couple behaviors.
dmccoystephenson Jul 2, 2023
8c37ef4
Categorized behavior types in `BehaviorType.cs`
dmccoystephenson Jul 3, 2023
dc0818d
Separated behavior computation into `in settlement` and `outside sett…
dmccoystephenson Jul 4, 2023
4fa7997
Modified control key mappings.
dmccoystephenson Jul 4, 2023
1d3d736
Fixed status not disappearing after awhile.
dmccoystephenson Jul 5, 2023
90208e8
Modified info displayed to the player when interacting with settlements.
dmccoystephenson Jul 5, 2023
0db7fe5
Added key bindings.
dmccoystephenson Jul 5, 2023
e982173
Modified some key bindings.
dmccoystephenson Jul 5, 2023
9a2c760
Added `minDistanceBetweenSettlements` and `settlementJoinRange` confi…
dmccoystephenson Jul 5, 2023
28a058d
Made pawns join nearby settlements & wait to create nations until the…
dmccoystephenson Jul 6, 2023
81a878b
Fixed floating trees & made pawns plant saplings after cutting down t…
dmccoystephenson Jul 6, 2023
a06f2b4
Made saplings & apples more scarce.
dmccoystephenson Jul 6, 2023
3af643d
Implemented `PURCHASE_STALL` and `TRANSFER_ITEMS_TO_STALL` behaviors.
dmccoystephenson Jul 8, 2023
682f20a
Unassigned owned stalls upon pawn death.
dmccoystephenson Jul 8, 2023
b4a77c7
Implemented `CREATE_NATION` & `JOIN_NATION` behaviors.
dmccoystephenson Jul 9, 2023
15761c0
Implemented test to verify hungry pawns in settlements decide to purc…
dmccoystephenson Jul 9, 2023
f24db45
Renamed test methds in `TestPawnBehaviorCalculator.cs`
dmccoystephenson Jul 9, 2023
d610a43
Implemented `JOIN_RANDOM_SETTLEMENT` behavior.
dmccoystephenson Jul 9, 2023
3cdc448
Implemented the `SELL_RESOURCES` behavior.
dmccoystephenson Jul 10, 2023
4e52dda
Implemented the `COLLECT_PROFIT_FROM_STALL` behavior and added the `b…
dmccoystephenson Jul 10, 2023
6c30d1f
Made items cost more to buy than sell at stalls.
dmccoystephenson Jul 10, 2023
ad5c669
Documented a couple of new commands in README.
dmccoystephenson Jul 10, 2023
6e6cf45
Implemented some more PBC tests.
dmccoystephenson Jul 11, 2023
7465978
Added the `purchase stall` command.
dmccoystephenson Jul 11, 2023
cda759d
Implemented `transfer items to stall` and `collect profit from stall`…
dmccoystephenson Jul 12, 2023
c45d9af
Implemented item cost calculator.
dmccoystephenson Jul 12, 2023
9b96399
Removed stall ownership from player when they leave their nation.
dmccoystephenson Jul 13, 2023
fefa92f
Prevented pawns from attempting to purchase food from foodless markets.
dmccoystephenson Jul 13, 2023
a9312fa
Implemented behavior & command to collect food from stall
dmccoystephenson Jul 13, 2023
a67b975
Added a config option for the metabolism multiplier of pawns inside s…
dmccoystephenson Jul 13, 2023
1153251
Remapped the teleport command to F6 & required debug mode to execute it.
dmccoystephenson Jul 15, 2023
d8fd7d9
Displayed number of coins & apples available in the player's stall.
dmccoystephenson Jul 15, 2023
10ca32b
Fixed null error when interacting with nationless pawn.
dmccoystephenson Jul 15, 2023
7e96ba8
Made render distance configurable.
dmccoystephenson Jul 15, 2023
89de0c8
Added commands to increase/decrease render distance.
dmccoystephenson Jul 15, 2023
475ad18
Documented new commands in the README.
dmccoystephenson Jul 15, 2023
0d66904
Added min & max render distances.
dmccoystephenson Jul 15, 2023
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
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.25.0",
"commands": [
"dotnet-csharpier"
]
}
}
}
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ The following controls are available in the game:
| `N` | Create a new nation |
| `J` | Join a random nation |
| `L` | Leave your current nation |
| `T` | Teleport all living entities to you |
| `F` | Found a settlement |
| `P` | Plant a sapling |
| `Num Lock` | Toggle auto-walk |
| `F1` | Spawn a new pawn |
| `H` | Teleport to home settlement |
| `B` | Build stall |
| `Insert` | Toggle auto-walk |
| `Page Up` | Increase render distance |
| `Page Down` | Decrease render distance |
| `F1` | Toggle show debug menu |
| `F2` | Generate nearby land |
| `F3` | Spawn money |
| `F3` | Spawn a new pawn |
| `F4` | Spawn money |
| `F5` | Spawn wood |
| `F6` | Teleport all pawns to you |

## Game Systems
There are a number of systems that will be implemented in the game. These systems will be used to create a rich and engaging gameplay experience. Details can be found in the [Systems Document](./docs/SYSTEMS.md).
Expand Down
513 changes: 393 additions & 120 deletions src/c#/main/OpenSourceGame.cs

Large diffs are not rendered by default.

27 changes: 23 additions & 4 deletions src/c#/main/behavior/BehaviorType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,31 @@ namespace osg {

public enum BehaviorType {
NONE,

// environment modification
GATHER_RESOURCES,
SELL_RESOURCES,
PLANT_SAPLING,

// movement
WANDER,
GO_TO_HOME_SETTLEMENT,
EXIT_SETTLEMENT,

// trading
SELL_RESOURCES,
PURCHASE_FOOD,
CREATE_SETTLEMENT,
GO_HOME,
PLANT_SAPLING,
PURCHASE_STALL,
TRANSFER_ITEMS_TO_STALL,
COLLECT_PROFIT_FROM_STALL,
COLLECT_FOOD_FROM_STALL,

// construction
CONSTRUCT_SETTLEMENT,
CONSTRUCT_STALL,

// nation
CREATE_NATION,
JOIN_NATION,
JOIN_RANDOM_SETTLEMENT
}
}
243 changes: 154 additions & 89 deletions src/c#/main/behavior/PawnBehaviorCalculator.cs

Large diffs are not rendered by default.

Loading