Skip to content

A multiplayer block-based space exporation game in active development

License

Notifications You must be signed in to change notification settings

AnthonyTornetta/Cosmos

Repository files navigation

Cosmos

A multiplayer block-based space exploration game, written in rust using the Bevy engine.

If you're interested in playing the game, helping out, pitching ideas, or just hanging out, join our discord server! Join Cosmos's Discord server here!

Screenshots

Cosmos is a game where you can create your dream spaceship that you can pilot through space.

Build your own ship block by block and cruise through space with friends, or make have everyone build their own ship.

Fly by huge, fully-interactable, planets

Beware! In the depths of space, there's always someone that wants you dead. Watch out for pirates! They spawn in pacts and, once they see you, will hunt you mercilessly.

Compilation

To get started, install your OS dependencies here. The dependencies section is all you need to do.

This project requires the latest nightly rust to compile. To swap to nightly, run the command

rustup default nightly.

To run the client, navigate to the cosmos_client directory and run

cargo run

For the server, navigate to the cosmos_server directory and run

cargo run

For release builds, append the --release flag to the build/run commands.

Controls

There is no option to modify controls yet, so for now check out cosmos_client/src/input/inputs.rs to see a list of all controls currently implemented.

Documentation

The first time you view the cosmos documentation, make sure you have mdbook and mdbook-mermaid installed. If you don't you can install them by running the following commands:

cargo install mdbook
cargo install mdbook-mermaid

Every time you want to view the documentation, navigate to the docs/ directory. To have it update as you modify it, run mdbook serve and navigate to the URL it provides, or to just build it run mdbook build.

System ordering

If you want to view the ordering of the systems, run (on linux) cargo run --features print-schedule | dot -Tsvg > ./debug.svg for either the cosmos_client or cosmos_server projects. If the print-schedule feature is enabled, these are setup to use bevy_mod_debugdump to create graphs of the Update schedule. If you need a different schedule, you'll have to change the main.rs file for either project to specify the correct schedule. Note, you'll need graphviz for the dot cmomand to work.

Cosmos Roadmap

See the issues page for the list of current features/bugs in development.

Release 0.0.7a (In Progress)

  • Music
  • Creative Mode
  • Chat
  • Galaxy map
    • Able to view stars
    • Zoom in to view planets
    • Set waypoint
  • Rotating Planet
    • On-planet skybox
  • Dropped item entity
    • When storage is broken, drop items on ground
    • If not enough inventory room when player is mining something, drop item
  • Fix missing chunks on planets

Release 0.0.6a

  • Place rotated blocks
  • Add main menu
    • Customizable settings
    • Specify connection target
  • Missiles
    • Auto targetting
    • Explosion logic
  • Shields
    • Emit a spherical shield
      • Shield size based on multiblock structure
    • Absorb incoming damage
  • Inventory UI improvements
    • Scrollable inventory
  • Escape functionality
    • Escape can now be used to close the foremost open UI menus
    • If no such menus are available, it will instead open the pause menu
      • Pause menu
        • Resume
        • Change Settings
        • Disconnect
        • Quit Game
  • LOD Fixes
    • Consolidate LOD + Normal chunk rendering into one source of truth
    • LOD performance improvements via combining meshes + culling sides
  • Block data
    • Storable fluids
  • Item data
  • Money
  • In-flight UI
    • Weapons selection hotbar
    • Speed display
    • Energy display
    • A way of selecting which systems to use preventing use of systems that are not meant to be actively used
  • Wires
    • Logic
      • Logic blocks
      • Wiring system
      • Logic receivers
  • Planet generation & LOD overhaul
    • Performance improvements
    • GPU-based generation
  • Remove bevy system ambiguities
  • Support NxN texture loading (where n is power of 2)
  • Update to bevy 0.14

Release 0.0.5a

  • Add a gravity well block
    • Remove snapping to structures on collision
  • Camera system
    • Camera block
    • Use left/right to switch between ship cameras
      • Changes where your view is
  • Shops
    • Sell blocks/items
    • Buy blocks/items
    • Generates randomly
      • Implement random structure Generation
    • Implement currency system for player
      • Money GUI
    • Shop GUI
  • Mining beam system
    • Mining beam block
      • Can be placed in line to create more powerful miners
    • Mines the first block hit by the beam after a given time
      • Inserts the item into the ship's inventory
      • Hold lmb to continually fire the laser
  • Pirates
    • Create a number of pirate ships
      • Each ship has a difficulty
    • Difficulty of spawns scales off player's money & ship's number of blocks
    • Basic AI
      • Spawn within 2 sectors of player
      • Spawn in fleets based on player's difficulty
      • If within ~1 sector of player, fly towards player
      • Shoot towards player, trying to predict their position based off distance & velocity
  • Shop
    • Buy from shop
    • Sell to shop
    • Players have money
    • For now shops have unlimited stock & funds
    • Shop block
  • Animated textures
  • Block data system
    • Support for blocks that store their own data
    • Storage block
      • A block that stores an amount of items
      • Can be interacted with to view the items
        • A GUI to view items
  • Sounds
    • Laser cannon fire
    • Block take damage
    • Thrusters moving
    • Space ship idle
    • Background space music
    • Block place/break
  • Multiblock machines
    • Revamp power generation to use reactor multiblock structure
  • Colored laser
    • Colored glass placed in front of laser
  • Inventory GUI
    • Able to open inventory
    • Abstract the 3d block GUI camera
    • Fix the 3d block GUI camera to not render anything except GUI blocks
  • Fix seeing through cracks in blocks
  • Lods
    • Reduced detail rendering of far away chunks to see the entire planet
  • Update to bevy 0.11
    • Update physics
    • Update bevy
  • Update to bevy 0.12
    • Update physics
    • Update bevy
  • Update to bevy 0.13
    • Update physics
    • Update bevy
  • Update asteroid generation to make it decent
    • Add ores to mine on them
  • GUI to interact with inventory
    • Easier way of adding 3d blocks to GUI
    • Move items around in inventory via mouse
  • Structure build mode
    • Interact with build block to enter build mode
    • Build mode
      • Camera becomes a noclip free cam and goes outside of player's body.
      • Player no longer piloting ship, & is able to create + destroy blocks on the ship but ONLY the ship
      • Symmetry modes are added that will mirror blocks on user-defined axis

Release 0.0.4a

  • Galaxy Generation
    • Stars procedurally generated in spiral-like pattern based on seed
      • Create star
        • Light emits from star
        • Load star within system
    • Planets generate around stars
      • Biospheres depend on how close they are to the sun
      • Dynamic biospheres based off temperature
      • Only generate if planet is close enough to player
      • Cube planets
        • Planets will now be cubes instead of flat planes, and will be about the size of the sector
        • Redo saving/loading of planets
        • Dynamically generate chunks & unload them based on players' positions close to planet
        • Make generation work on all faces of planet
        • Block orientation for every block
    • Biospheres
      • Speed up terrain generation
      • Make molten biosphere
      • Enhance grass biosphere
      • Create icy biosphere
    • Asteroids
      • For now just floating rocks in space
    • Save generated universe
      • Save planet locations
    • Fix broken ship functionality
      • Make entities no longer pass through loading structures.
  • Align body with structure
    • Switches to FPS Camera
    • Aligns the player to that structure
      • Fix child locations being not updated based on transform relative to parent
    • Add button to align to structure facing
    • De-align, switch back to free camera
      • Create free camera

Release 0.0.3a

  • Infinite universe
    • (Client) Player can travel any distance from 0,0,0 with no noticable issues, and everything moves relaitve to player
    • (Server)
      • Objects move relative to player world they are a part of
      • Player world moves relative to its player
      • Players can be a part of the same world if they are close enough
      • Requires rewrite of bevy_rapier to support multiple physics worlds
  • Update to bevy 0.10.0
  • Performant ships
    • Ability to have 50 small-sized ships loaded with minimal performance impact
  • Dynamic object loading
    • (Client)
      • Unload objects that are too far away
      • Request entities that server sends if they don't have the entity for them
    • (Server)
      • Unload objects that are too far from any player
      • Load objects that are close to a player & send that info to client
      • Only send information about objects to clients that are close enough to have them loaded
  • Display coordinates in top left (sector, local)
  • Revamp rendering to allow for more than cubes
  • Display hotbar items
    • 3d models for blocks

Release 0.0.2a

  • Improved state management
    • Client state management
    • Server state management
    • Core able to utilize both states
      • Block resource loaded in PreLoading state
      • Blocks loaded in Loading state
      • Systems loaded in PostLoading state
  • Ability to pilot Ship
    • Mouse movements steer ship around ship core
    • Standard movement controls mapped to ship acceleration
    • Interact with ship core to enter piloting mode, press interact button again to exit
    • Create max ship speed
  • Ship core
    • Interact with this block to pilot the ship
    • Cannot be mined while other blocks are present on the ship
    • Create block
  • Localized planetary gravity
    • All entities near planet's radius are subject to its gravity towards its relative downward vector
      • The gravitational pull should scale inversely exponentially the farther the distance from a certain threshold (most likely the highest chunk) then remain constant past that point
  • Ship systems
    • Energy system
      • Energy producer block
      • Energy storage block
      • Energy storage system
      • Energy generation system
    • Thruster system
    • Thruster block
    • Allows the ship to move + rotate
      • Faster movement based on # of thrusters
      • Faster rotation based on # of thrusters
      • More energy consumption per thruster
    • Laser cannon system
      • Laser cannon block
        • Can be placed in lines to create more powerful lasers
      • Click lmb/hold to fire the laser
        • The laser is on a cooldown
    • Ship hull block
  • Ability to place more than one block
    • Hotbar
      • Rendering of hotbar
      • Reads items from inventory
    • Inventory
    • Items
      • Item stacks
    • Way of select which item
  • Store block damage
  • Ability to save ships to disk + load them
    • Implement console commands

Release 0.0.1a

  • Player Movement
    • FPS Camera
  • Dynamic Input system
  • Structure
    • Planet
    • Ship
  • Asset Loading
    • Fix UV mapping floating point errors
  • Planet Generation
    • Grass planet generator
  • Server/Client
    • Server controls planet
    • Each player controls its own movement (100% trusted)
  • Ship creation
  • Block registration
    • Block registry with numeric + fixed string IDs
  • Player entity
  • Game State
  • Network communication
  • Sync bodies from server to client
  • Ability to break/replace block
    • Dynamic meshing
  • Dynamic physics bodies
    • Block break events sent to server, server sends back block changed event
    • Selects nearest structure
  • Integrate physics system
    • Physics generator for structures
      • Chunk-based physics
    • Player collider
  • Integrate bevy engine
    • Rendering method for structures
      • Chunk-based rendering
  • Add Crosshair
  • Support re-sizable window

Release 0.0.8a

  • More pirate ships
  • More asteroid types
  • Fuel for reactor
  • Performance fixes
  • Fix server instability
  • Reduce amount of packets server sends per second
  • Rebalance shop prices
  • Add more randomly generated structures (e.g. stations)

Everything that will still have to be done after 0.0.7a

  • Shops
    • Peace zone?
    • Prices based on supply + rarity
      • Keep supply relatively equal between nearby shops
    • Each shop has its own supply of money that it cannot go below
  • Biosphere Improvements
    • Ice biosphere glaciers
    • Better Water block
    • Better Lava block
    • Structures
      • Rocks spawning
      • Undergrowth
      • 1 More tree type
    • Groundwork for biomes
      • Planes
      • Redwood forest
      • 1 Additional forest
      • Ocean
  • Wires
    • Electrical

NPCs

Factions

NPC controlled OR player controlled NPC controlled factions store reputation of other factions + players Factions have different attributes

  • One may steal your ship blueprints
    • To balance this:
      • scrap is collected when you mine melting down ships instead of the actual blocks
        • Different scrap types
      • Substitute expensive blocks for less expensive ones if needed
      • If ship is below 50% success rate, don't produce it again
  • Dynamic faction expansion Bounty board
  • Take down X ship
  • Selling the ship
  • Selling ship designs
  • Buying ship designs