-*- mode: org; -*-
This is a playground for me to try different tech.
Basic approach: tons of javascript speaking JSON to a server. Server only speaks JSON, and HTML pages are few. (screw links)
UI
tabs
Dashboard
cargo
money over time
Systems
travel to other systems
travel time
for nearby systems
news
markets
travel time
Planets (n)
buy/sell cargo
news
Ships (n)
buy/sell ships
buy/sell equipment for a ship
pending orders
status bar on top
money
time (turn #)
design choices
planet economies/markets
Each planet produces and consumes goods at a certain rate, and has a supply.
Each turn affects the supplies at each planet.
market price is determined by 3 variables:
- consumption rate
- production rate
- supply
First, we calculate the usage rate as production - consumption From there, we have two formulas:
- if the usage is 0, price = 10 * (production / supply)
- else price = 10 * (usage / supply)
This is probably still flawed.
consumption | production | supply | should be | rate |
5 | 5 | 10 | around zero | |
10 | 5 | 1000 | negative | |
10 | 5 | 10 | high | |
5 | 10 | 10 | positive | |
5 | 10 | 1000 | very negative |
Every turn there is a random chance of the rates changing, too keep a dynamic environment.
long-lived browser window
server speaks mostly JSON
playable by a bot
order resolution
Orders are issued by players, then processed by the server. There are 2 types of orders:
- trade orders
- movement orders
The orders are gathered from all players, sorted by type (trade or movement), then executed randomly. It is possible for an order to fail, say if two players tried to buy the same good and there wasn’t enough for both. In this case, the first randomly selected order is followed, and the rest ignored.
After trade orders are completed, movement orders are executed.
If any of a player’s trade orders fail, then they can perform other actions.
slow evolution of game and world
tech to try out
JQuery
canvas
Hunchentoot
Elephant
adw-charting
vecto
dynamic animated gifs
cl-unification
work log / todo
UI for buying/selling
use jquery UI slider bar
find ways to represent orders in json
{order:”orderName” options:{opts}}
break up htmlfun into a separate file
figure out jquery goodness to add orders to the pending orders tab
add a global namespace for custom code, call functions on there to add orders.
- add to appropriate list on orders tab
- update count in tab title