Initial commit
This commit is contained in:
77
description.md
Normal file
77
description.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# TODO
|
||||
|
||||
* Get aoe info
|
||||
* API for it somewhere?
|
||||
* Write simple code
|
||||
* Write tests
|
||||
* Write GUI
|
||||
|
||||
Deal with getting housed
|
||||
|
||||
Put villagers on resource sources
|
||||
* what to do about farms?
|
||||
* one villager per
|
||||
* run out occaisionally and must be rebuilt
|
||||
|
||||
# Outline
|
||||
|
||||
Timeline of villager production
|
||||
* should be able to duplicate them easily and make modifications to compare
|
||||
* throws an error if a task is impossible and a warning if you get idle time
|
||||
|
||||
# Design
|
||||
|
||||
Was originally doing object-centric:
|
||||
each thing contained all information about itself.
|
||||
For example,
|
||||
a Blacksmith was a thing (class) that had fields representing
|
||||
a cost, a time to build, an Age requirement, etc.
|
||||
However, this led to circular dependencies.
|
||||
For example, a Blacksmith required Feudal Age,
|
||||
and Castle Age optionally required a Blacksmith.
|
||||
This made it difficult in Python to have Ages and Buildings in separate files.
|
||||
They had to import each other,
|
||||
which is not possible in any simple way in Python.
|
||||
|
||||
Instead, data is stored in an attribute-centric way.
|
||||
Costs is a class,
|
||||
and it holds costs for Blacksmith, Feudal Age, Militia, and everything else.
|
||||
Dependencies is another class,
|
||||
and Times (i.e., build or unit production times) is yet another,
|
||||
and others are added as needed.
|
||||
|
||||
If you think of the information needed as residing in a table
|
||||
with the rows representing entities (House, Villager, etc.)
|
||||
and the columns representing attributes (Cost, Build Time, etc.),
|
||||
we are storing the data by column rather than by row.
|
||||
As an aside,
|
||||
this is similar to what I've seen described as the fundamental difference
|
||||
between object-oriented (row-based) and functional (column-based) programming,
|
||||
though I'm still using classes and objects.
|
||||
|
||||
|
||||
# Scratch
|
||||
|
||||
```
|
||||
def create(self):
|
||||
self.
|
||||
|
||||
# Assume entries sorted by time
|
||||
# Not necessarily from user, but from queue_villager and move_villager
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
Class Task():
|
||||
requires = {"wood": "lumber camp"}
|
||||
# what if more villagers than farms?
|
||||
|
||||
```
|
||||
|
||||
|
||||
# Assumptions
|
||||
|
||||
* Fixed gather rate for each resource
|
||||
* what about food -- hunt vs farm?
|
||||
* At least one TC always exists
|
||||
* Using no civ bonuses for now
|
||||
Reference in New Issue
Block a user