Code Monkey home page Code Monkey logo

population-simulation's Introduction

Update

This repo is not being actively developed, but the larger project idea is still active. This setup is user-focussed with significant considerations for parallezation, scalable archetecture etc., but I found that many components still need to be designed and this setup doesn't allow for fast enough iteration. In that spirit I've focussed on smaller projects that tackle an aspect of this in the hope that down the line I can take what I've learned and build the project I outlined in the design docs here. Right now I'm mostly focussed on a market based econonic engine and building out developer tooling to make the simulations more interpretable and debuggable while I'm writing them.

2022 update: A fresh take on this architecture with a much smaller scope lives in https://github.com/JoeHowarth/trade-sim


See

How to Run

Requires Rust nightly here

rustup install nightly

git clone [email protected]:JoeHowarth/Population-Simulation.git
cd Population-Simulation
rustup override set nightly
cargo build

In new terminal

cd vue-client
npm install
npm run serve
  • open localhost:8080 in chrome
  • Click on Map Debugger -> Generate Map
  • In other terminal
cargo run
  • now refresh client in browser

In future, won't have to generate map file separately.


Below is outdated

Dynamic Grand Strategy

Grand strategy games like Europa Universalis, Crusader Kings, Civilization, Victoria and even Total War each immerse the player in a simulated world. Which aspects of reality they focus on while abstracting (or ignoring) the rest, defines the experience and the game. Crusader Kings stands out as the only game attempting to model leaders' intricacy and humanity. Victoria, through representing and tying populations' plight or prosperity to events in the world abroad. Each bring a different perspective, yet all feel somewhat static in how they model their world. None besides Victoria even allow for private economy, shifting populations, founding new cities, changing provincial areas, shifting national ideas etc. etc.

Inspired by the Europa Universalis 4 mod Meiou and Taxes and specifically Demian Sky, here I will explore creating a truly dynamic historical simulator and the technical challenges that come with it.

The world should feel alive.

Critical Elements

  • Population
  • Wealth and Trade
  • Ideology, Religion and Culture
  • Food
  • Settlements
  • Knowledge and Technology
  • Leaders
  • Government Structure
  • Diplomacy and Politics
  • Geography and Climate

Eventually, all these elements should be linked together. Of course, doing any of these areas justice requires a monumental amount of work, so it's necessary to start with a smaller scope and focus.

Initial Roadmap

Here's roughly how I envision this project progressing

  1. Workable proceducal map generator
  2. Technical infrastructure MVP
  3. Initial settlement placement
  4. Population dynamics
  5. Trade and economic systems
  6. Re-evaluation

Next we'll take a closer look at map generation and then the infrastructure behind the simulation

population-simulation's People

Contributors

dependabot[bot] avatar joehowarth avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

adamnemecek

population-simulation's Issues

Text Rendering

Figure out efficient and visually high quality text rendering for BabylonJS / WebGL

Split Map Generator into node module

Create a separate node module that contains the map generation code

Reasons:

  • decouples from client code
  • callable on server side if no pre-made maps present (easier install and first run)

Follow-up

  • Simple CLI for generator
  • separate repo?

Subscription UI for debugging + visualization

Currently have text based subscription where specify Section and Component by string. This is cumbersome and error prone

Replace with drop downs generated directly from keys in state objects

Cached Networking

Only send subscribed data to client when it changes

Strategy:
Use Specs update events (sp?) on components

Python Client for graphing and analysis

Run at max speed sending data either to python client or dump relevant data to a json file that can be read by python.

Would allow for easier analysis of subsystems such as

  • using numpy to transform data and get stats
  • graph over various axes
  • compare different runs

Draggable Map

When click and drag on map, camera should move instead of rotating

Configuration

Way to set values via config file or CLI instead of by recompiling. Should make tuning things more straightforward.

Two use cases

  1. Known, stable config options that must exist.

Should via struct with defaults perhaps

  1. rapid prototyping of constants to avoid recompilation

String based hash table, allows dynamic adding and getting without having to change struct.
Handle defaults, or lack thereof, on a case-by-case basis since not meant to be permanent.

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.