Giter Club home page Giter Club logo

microcosm's Introduction

Microcosm

Just a little 4X game written in Python using the library Pyxel. Inspiration taken from games I've played.

Screenshots

Pre-requisites

Playing Microcosm requires an installation of VLC media player on the player's machine. Installation instructions for your favourite operating system can be found here. If your operating system lists python-vlc (or something like that) as an optional dependency, it is advised that players also install that. Naturally, Python is also required, at version 3.10 or above.

Play from release

Begin by downloading the latest release for your operating system.

macOS

  1. Extract the downloaded zip; double clicking it in Finder is the easiest way.
  2. An application will be extracted - right click it and select Open.
  3. In the displayed security-related dialog, press the Open button again to start the game.

Linux

In terms of Linux distros, Fedora is explicitly supported and Ubuntu is built for, but the build is not tested. Other distros should find success in one of these two.

Additionally, only x86 architectures are supported.

  1. Extract the downloaded tarball using tar -xzvf.
  2. A binary will be extracted; run ./microcosm to start the game.

Windows

  1. Extract the downloaded zip.
  2. An EXE file will be extracted - run this to start the game, allowing Windows Defender to run any scans if it asks to do so.

Play from source

  1. Clone the repository.
  2. Run pip install -r requirements.txt
  3. Run pyxel run microcosm

Wiki

The Wiki can be viewed both on GitHub and in-game.

microcosm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

microcosm's Issues

Add settlement summary page

This would include stuff like name, strength, satisfaction, (construction/units maybe?).

Could even go in the status overlay.

Prohibit ending turn while obscured by overlay

While it does stop you most of the time if you don't have a blessing or construction, it is still weird that you would be able to end a turn while being notified that your settlement has levelled up.

Add faction replacements for certain units

Each faction should have one or two units that replace the standard units and provide some difference. Shouldn't be anything major, just an extra stamina point or an extra 5 power/health.

Allow multiple units to place a settlement under siege

Currently, a settlement is only ever under siege by a single unit. This causes issues because when the settlement is taken, only the first unit is marked as no longer sieging.

As an expansion to this, multiple units placing a settlement under siege should quicken the loss of strength of the settlement.

Allow iteration through only movable units

Currently, the space key iterates through all of the player's units. In cases where a player may have upwards of 20 units, it would be better if they could iterate specifically through the units that still have stamina.

The M key makes the most sense for this. Would need to be added to the controls page.

When there are no movable units, the key does nothing.

Improve AI siege functionality so that sieging units don't just wait until they are killed

Essentially, if an AI unit places another settlement under siege, and a unit from the settlement under siege is deployed to attack that AI unit, the AI unit will just continue its siege and ignore the deployed unit. This becomes problematic as it will certainly be killed. AI units should either attack back or move away when they are at medium to low health, and placing another settlement under siege.

Add new overlay type for 'Close to victory'

If any player (user or AI) is 'close' to a victory, alert the user.

Close can be defined as the following:
Elimination: all settlements but one.
Jubilation: has achieved 100% satisfaction in 5 settlements
Gluttony: reached level 10 in 8 settlements
Affluence: accumulated 75k wealth
Vigour: has begun constructing the holy sanctum
Serendipity: has researched two of the three pieces of ardour

Refactor overlay.py

Probably the easiest way to do this is extract out the drawing functionality into a separate class.

Add some more unit plans

Since the original unit plans were added, more blessings have been added.
Make some new higher-powered unit plans based on some of the newer, more expensive blessings.

Note: if you add quite a few, the Units part of the wiki will need to change to have the same 'boundaries' functionality that the blessings and improvements parts have.

Add crusades

  • There should be a list of crusades for players to do for some reward (usually wealth).
  • Can be faction or relic based.
  • Add a crusades menu as well.
  • Crusades should be unlockable based on improvements and/or blessings.

Shorten maximum night length

Currently nights last for a random number between 5 and 25 turns. If you are doing a lot on your turn, this can result in a long time between climatic changes.

Acceptance Criteria:

  • Reduce the maximum night length from 25 to 20 turns.

Expand AI playstyles to account for founding settlements

Currently all AI players are effectively expansionist, so it would be good to change this so there are Expansionist, Neutral, and Hermit AIs. Probably just use existing functionality for Expansionist, settle at level 5 for Neutral and level 10 for Hermit.

Adjust AI functionality to take satisfaction into account

Seems like the AI players tend to let their settlements descend into squalor. For example, in a game I just played, I had six settlements with satisfactions of 49, 73, 55, 58, 52, and 56. The other 5 AI players had settlements with satisfactions of 0, 2, 0, 16, 0, 22, 54, and 0. Clearly this will affect their ability to compete.

This could just be as easy as mandating the improvement that yields the most satisfaction when the settlement reaches below 40, or something.

Add a new unit (or something else) that transports other units

Rather than having to move each unit individually, a transport unit would be useful to move multiple units in one. This would function similarly to a garrison, and would be unlocked mid-late game, and have fairly significant stamina. This would likely require large code changes. Deployment would also function in the same way as settlements.

Credit: Andrew

Add some level of randomness to attack results

This has primarily been raised due to the Warrior vs Warrior cycle against an AI where you attack each other and eventually both units die on the same turn. Would be better if this didn't occur.

Add map panning

When pressing an arrow key while holding down the CTRL key, move the map by five tiles in the specified direction instead of the standard one. Use the same clamping logic that exists for standard panning.

Credit: Andrew

Add relics

  • There should be special tiles all over the map that house relics that may be explored by units.
  • Players get a small reward for exploring (usually wealth).

Allow saves to be named

When the user presses enter to save, add a new overlay prompting the user to enter a save name, read the input, and use that as the name for the save file.

This will likely be difficult, and may not even be possible with Pyxel's input reading.

OSError when auto-saving on Windows

Traceback (most recent call last):
  File "C:\Users\james\microcosm\game.py", line 255, in on_update
    if self.end_turn():
  File "C:\Users\james\microcosm\game.py", line 635, in end_turn
    self.save_game(auto=True)
  File "C:\Users\james\microcosm\game.py", line 824, in save_game
    with open(save_name, "w", encoding="utf-8") as save_file:
OSError: [Errno 22] Invalid argument: 'saves/autosave-2022-10-01T12:47:13.json'
PS C:\Users\james\microcosm> Traceback (most recent call last):                           File "C:\Users\james\microcosm\game.py", line 255, in on_update                                                         if self.end_turn():                                      File "C:\Users\james\microcosm\game.py", line 635, in end_turn                                                          self.save_game(auto=True)                                File "C:\Users\james\microcosm\game.py", line 824, in save_game                                                         with open(save_name, "w", encoding="utf-8") as save_file:                                                      
   OSError: [Errno 22] Invalid argument: 'saves/autosave-2022-10-01T12:47:13.json'

Upgrade to Python 3.10

  • Update documentation to reflect that 3.10 is required.
  • Use pattern matching (match) where if-elif-else chains are currently employed (where switch statements would usually be used).
  • Replace typing.Union type hints with the new | type operator.
  • Deal with any other warnings that may appear.

Scale up heathens based on the current turn

This would probably work by having some turn boundaries that would bump all newly-generated heathens to an upgraded unit plan. E.g. Every 25 turns, the next heathen unit plan is used. Would require more heathen unit plans in the catalogue, but potentially the existing get heathen method could be altered to take the current turn and return the correct unit. A fair upgrade could be +10 power and health every 25 turns.

Add terrain-based attacks

There should probably be some advantage for units that are attacking from mountains, and a disadvantage for defending from the sea. Open to ideas on how this should work.
Credit: @jamesgiu and Andrew

Add units that have the ability to heal friendly units

Some units should heal units rather than attack them when clicking on them while adjacent. This would involve adding a new property to the UnitPlan class, as well as a new outline on the map for healable units. There should also be different levels of healer units, for each tier.

Credit: Andrew

Add factions

  • Convert each colour to a faction
  • Base factions mostly around one particular category (e.g. zeal, harvest, etc.)
  • Each faction will have a bonus.
  • Add a factions section to the wiki

Some Overlay cookery

Traceback (most recent call last): File "/home/suttono/tmp/microcosm/[game.py](http://game.py/)", line 182, in on_update self.board.selected_settlement.current_work = Construction(self.board.overlay.selected_construction) AttributeError: 'NoneType' object has no attribute 'current_work'
Happened when Ollie was choosing a construction for his settlement and he clicked away before choosing, deselecting his settlement.

I've noticed a similar thing happening when you're choosing a blessing and you press shift before choosing one, and the standard overlay disappears.

Seems like there are a few deselections that can occur in the overlay at the wrong times.

Show that a save is successful

Simple change, once a save has gone through, change the text in the pause menu to:
Saved โœ… (saved should be green too)
This should reset every time the pause menu is reopened.

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.