Coder Social home page Coder Social logo

permafrost's Introduction

Permafrost Game

Permafrost is a colony survival game for Windows.

The game was released in April 2020 for Team 2's submission for CS2010.

The latest version of the game can be downloaded here.

Concept

Permafrost is a single player strategy game where a player controls a small group of colonists with the aim to manage resources to achieve survival. Permafrost is a top down colony management and survival game set in a distant post-apocalyptic future. In an attempt to save the world from global warming, humanity built a global system of cooling towers. This however, allowed the AI controlling the towers to overthrow humanity by freezing the earth. The game is set after these events in a hostile frozen wasteland, with humankind fighting for survival.

The player must manage resources, most important to manage is food and temperature. Wandering through the wilderness interactable objects can be harvested for different resources which can be used for building and crafting; offered by Workbenches and Forges. Progression will be met with increased difficulty with random enemy encounters and events.

The game starts with a single colonist controlling a tower. From there the player can harvest resources.

Game Play Tips:

Here are a few tips to get you started with the game. More information is available on our wiki.

  • Early on, wood is a scares resource so crafting an Axe using a work bench should be a high priority.
  • Keep an eye on cold colonists and move them to warmth before they take too much damage.
  • Campfires can be used to provide a small amount of heat, useful for when your colonists are far from home.
  • Enemy towers are guarded by robots, and the towers are located every 7 zones in each direction and can be captured once all robots are defeated.
  • The 10th tower of the game will be more difficult, and will allow completion of the game.

We intend to design the game to be played in a number of ways. A player might want to setup a base around a single tower, and then perform short explorations into other zones to gather resources. Or the player could have multiple small bases in different zone to allow for exploration over a further distance. A nomadic method maybe favourable however is not necessary. The game is balanced in a way to give the player options for how they want to play the game.

Controls

  • W, S, A, and D or Arrow Keys controls the camera.
  • Mouse controls allow for giving instructions to colonists, and for interacting with the UI for buildings, and selecting colonists.
  • Scroll wheel controls Zoom.
  • 1-9 allow for quick selection of colonists.
  • R returns the camera to the centre.
  • ESC opens the pause menu.
  • F11 quickly toggles between full screen.
  • In Dev mode I, J, K, and L can be used to quickly move between zones.

permafrost's People

Contributors

0xmehdi avatar adamshotton avatar ic2000 avatar johncrhamilton avatar jr-morgan avatar mrkrastev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

permafrost's Issues

Better texture content system

Problems

  1. Texture storage is not general and are stored as seperate feild variables

Sucsess Criteria

  1. Textures should be stored in a general eg in a map

Solutions

1a. Factory Class that stores all textures and is used to create Interactables and Items
1b. A statically referenceable map of textures

Camera Scaling origin

Camera scaling currently zooms in on the top left corner of the camera view.
A better option would be the center, or the mouse cursor.

Temerature System

Temperature System

The Temperature system is important for core gameplay.
Each Tile should store a temperature value.
The temperature of one tile should affect the temperature of the next tile.

Temperature spread - Tiles

Each Temperature tick, the difference between the two temperatures multiplied by a constant should be applied to both tiles.

To keep this performant maybe once a frame only two tiles will perform this function. Or multi-threading.

It is also nessesery for the temperature of one zone to effect the temperature of another zone. This could be done on a Zone to Zone basis or a Tile to Tile basis.

It may be important to cap the temperature value of a tile ±100°C for gameplay purposes.

Temperature spread - Interactables

Interactables should also have a temperature.
Their temp should be affected by the temp of the environment

related to #11, #30

Zone system

The world should be divided into Zones, These are stored in the Zone Manager.

One zone will be loaded at a time, this means loading and unloading GameObjects from the GameObjectManager.

Camera System

Camera System.
Should allow panning and zooming by respond to mouse and keyboard input.

Colonist ignores move commands

Colonist will ignore all move goals while an instruction goal is queued.

Steps to repeat

Give a colonist several move instructions, before those move instructions are complete give it a building instruction eg harvest. Then give it a final move instruction.

The last move instruction will be ignored. All move instructions while a building instruction is queued will be ignored.

This is undesirable behaviour.

Basic A* Path Finding (PathFinder)

Objective:
-The PathFinder returns a queue Vector2 as the route.
-The PathFinder needs to deal with horizontal and vertical movement. This however should be expandable to diagonal movement in the future.
-The PathFinder needs to provide a path around obstacles.

Done Criteria:

  • 1: Passing a start tile and end tile will return a queue as the route to the goal.
  • 2: When placing the goal diagonally to the start, the queue should contain no diagonal Vector2s.
  • 3: When placing the goal behind a "wall" the queue will route around the wall.

UML:
Pathfinding1

FPS Counter

An FPS counter in the game would be useful for displaying frame rate, and frame times to measure performance.

UI Feedback

What the problem is

  • There is little feedback to the user that an instruction has been correctly issued.
  • Feedback for Food consumption.

SuccessCriteria

  • Feedback in a combat situation eg warning message.
  • Feedback when an invalid commad is issued eg. a popup under the cursor.

Temperature Effects

Temperature effects for Interactables

Interactables have a temperature Value.

There are a few ways that this could affect them.

  1. Have a dynamic range system consisting of 3 ranges:

    • A range where the colonists are comfortable in,
    • A range where they are "cold" and will eat more and/or be slower. A
    • A "freezing" range where they will take damage.
      This "cold damage" system may not be required however since just having colonists consume more food may be enough for them.

    These ranges should be able to be affected by clothing. The more insulating the clothing that a colonist is wearing. The colder their ranges will extend.

  2. Have the temperature directly affect the amount of food consumed.
    A formula could be created that takes into account the temperature. This formula should be realistic. Some research into how temperature effects food consumption might be useful.
    If a colonist finds them self in a really cold environment then they may consume food unrealistically fast. An alternative to this is to have a fixed rate that food can be consumed.

    The consumption value should be able to be affected by clothing. The more insulating the clothing that a colonist is wearing. The less food is consumed.

For now, we can ignore the effects of a temperature Too Hot. However, this may be a feature we add later so keep that in mind.

These two options are mutually exclusive.

Requires #28, related to #27

PathFindable Enhancement

PathFindable Enhancement

  1. The pathfinder gives a path to the target but since a target might be moving the PathFindable should take this into account.
  2. The PathFindable, once the colonist/entity is at the end of the path, should find a new path to the target again and if the path is null (we are still at the target hence finish) else the target has moved and the colonist/entity should follow the new path to the target again.

Done Criteria:

The colonist moves to where the (moving) target was and then moves to where it was again until the colonist is almost on top of the target.

Action System

Instruction System

Using UI elements, the player should be able to select a building to be created. This will create a building site. A colonist can then be assigned to build the building. Once the building has been built it will allow for unique actions to be performed.

related to #13 and #9

Pathfinder crashes if a path can not be found

Path finder crashes in this scenario:
image
Where there is no valid path between the north and south side of the map. Telling a colonist in one half to move the the other will result in a crash.

An null pointer exception is thrown on this line
https://github.com/JR-Morgan/TeamProject-Game/blob/e5a3f0873de741e87240bcffaadf39b572332a31/TeamProject/GlobalWarmingGame/PathFindable.cs#L100
where path is null because pathfinder.find returned null without throwing a pathfinding exception

Game Object Creation Factory Class

Creation of Interactable Game Objects is a non-flexable system that requires references to many other objects.

A factory class should be used to generate interactables, The method that creates these interactables should take as few parameters as possible, Ideally none. The factory class will be used to by the UI Controller, and in the main Game1 logic.

PathFinder Optimisation

PathFinder Optimisation

The pathfinder should be optimised as much as possible to reduce frame drops and lag. Right now the pathfinder is run instantly (roughly in a single game frame) which is not ideal.

Improve the way the game uses the PathFinder:

  • Try to run the PathFinder over multiple frames to improve useage. This could be done in C# using Tasks.
  • Try set up another game thread to run the PathFinder to reduce the strain it is putting on the main game thread.

Improve the PathFinder:

  • The way PathFinder gets the adjacent tiles is O(n) and this can be improved to O(1).

UI System

A UI system is required for many features eg buildings

UI elements that need to be created are - Drop down lists, Buttons, Lables.
related to #9 and #10

Development UI

Make a ui system to add interactables ( buildings, colonists, trees, etc) in the game world.

This will be used for development purposes to test functionality.

Tile Map

The game requires a Tile Map system. This should be part of the engine.

TileSet should contain a collection of textures
Tiles should contain a texture
TileMap should contain a collection of Tiles and the TileSet

Passive Animals

Passive animals will function very similar to buildings.
For example a rabit will contain an instruction type for hunt which will yeild food, and destroy the animal object.
Animals should move around randomly using the path finding system.

Building menu

Building menu
Creating buildings with resources from a list of buildings in ui

#38 #27

UI Menu Right Clicking

UI Menu Right Clicking

  • After starting the game immediately right clicking will crash the game on line 196 in mouse input method.
  • Reasons as to why it crashes: It is possible that the Choose action menu needs to appear at least once before right clicking.

Finalise World Tileset

Create a list of tilesets that we want for terrain.

Tiles should be 32x32. All assets need to consistant to that style. eg If a colonist will span two tiles, it will be 32x64 in size.

Tiles

  • Snow Tile
  • Tundra Tile
  • Grass
  • Snowy grass?
  • Water
  • Sand
  • Dirt?
  • Ice

Interactable world objects:

  • Snow Covered Tree (maybe a couple variants, couple big and a couple small)
  • Ore node (Rusty Iron)
  • Berry Bush
  • Cotton

Interactable animals / Enemies

  • Rabbit
  • Polar Bear
  • Robot
  • Colonist

Buildings

  • Tower
  • Farm / Feild
  • Oven
  • Camp Fire
  • Forge
  • Storage Building
  • Walls

Items / Resources

  • Wood
  • Ore
  • Metal
  • Knife
  • Clothes
  • Cloth
  • Wheat
  • Berrys
  • Bread
  • Cooked and Raw meat

Feel free to add anything else to this list

UI Decoupling

The UI is currently very coupled to it's logic and actions.

Success criteria

  • The actions the UI peforms should be decoupled from the actuall UI implementation

  • The actions the UI peforms should be less coupled to the Game's logic. Eg the use of a factory class specified in #82

  • Reworked Instruction Menu

  • Reworked Building and Spawning Menu

  • Reworked Inventory Menu

  • Reworked Main Menus

Colonist instruction system

Finalise the colonist instruction system.

Decide which method we are going to use
###1. Job Roles
Method used in Rimworld and Oxygen not-included.
The player will set a tree to be choped, this gets added to a prioritisable list of instructions to be executed by any colonist with the role associated with the instruction, in this case chopping wood.

Roles could be groupd into some key groups

  1. Build (building, and demolishing)
  2. Cooking (crafting food)
  3. Hunting
  4. Craft

###2. Repeted instructions
A colonist is given a routine, they will follow these instructions on repete, indefinatly.
Select colonist, issue series of instructions, execute these on repete.
For example Chop wood, move wood to storage building The colonist will walk a (a selected tree, a selected group of trees, or any tree?), then walk to the selected storage building.

Fix problem when loading tile maps

Curently, Textures are assumed to be 16x16px.
Curently, The tile map is assumed to be 50x50 tiles.
The game should be support proper rendering of larger tiles and tile maps.

Building System

Building System

Buildings are GameObjects that will display a texture and span multiple tiles.

Buildings should be interactable and store a list of actions that colonists can perform. (eg Craft, Store, Farm, etc.)

Pathfinding

By default, Buildings should be non-walkable.
This may require changing the walkable Boolean of the Tiles that the building spans.

related to #13 and #10

Movement is based on framerate

The speed in which the Colonist and Rabit move increases with a higher framerate.
This speed should be constant regardless of framerate.

Combat System Rework

What is the problem

  1. Combat is only supported between one colonist and one enemy.
  2. Combat requires the enemy to be on the left, and the colonist on the right.
  3. There is code specific to bear and robot in the enemy class. The enemy class should be general.
  4. Many methods are unnessesry or overly complecated.
  5. Non-primitave data types are used instead of primitave ones.
  6. Enemies don't roam.
  7. Enemy class stores a list of every colonist.

Sucsess Criteria

  1. A list of all colonists should not be stored by each enemy.
  2. Combat can occur from either right or left (but not up or down)
  3. Enemy should be general, robot and bear should be subclasses.
  4. Simplification of many of methods.
  5. Changing Boolean to bool and String to string.
  6. Enemies should be roaming using the Engine.Pathfinding.RandomAI class.

Create a method of reading Map files

The game requires that we read a file that contains data for the levels.
For now we have chosen to use a CSV file that contains integer values.

A class should be created that will parse these files and create the tile map

Fix UI crashes

  • Crash when pressing Do Nothing before Crafting Menu is constructed

Resource and Inventory System

Resources are items in the game such as Wood, Food, Metal, Cloth etc.
A Resource system is required to store and represent these items.
We decided that our Inventory System should tied to a resources weight.

The Inventory should store all resource types, and a value (decimal?) for the weight of that item.
The inventory requires a UI system to display the inventories.

We decided that the colonists as a group would have a shared inventory. And that a storage building could be made for long term storage of resources.

The inventory system should be built in a way to change this however so that colonists could have separate inventories.

So at the moment a resource can be tied to a colonist, or an interactable.
The resource system will interact with the interactable system, when an instruction is issued, a resource will be yielded. In the InstructionType class. the resource yield should be specified for each instruction.

Combat System

A System that allowes colonists and enemies to peform combat.
colonist, enemies, and hostile animals are required to beable to peform combat with eachother.

Related to #14

Passive moving Intractables staying in one general location

PassiveMovingInteractable Bug

Currently Passive moving Interactables should move around the map and currently they only move around in their general area to then move far away only to go back to their general area.

Ideally they should move around in their general area and then move far away to move around generally over there (repeat).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.