Monday, August 8, 2016

Sea Trading Game- Price based on Supply/ Demand!

Modeling supply and demand is proving to be quite difficult, but I am most certainly making progress. This week I was able to increase/decrease the price based off of the supply and demand, including the short term future supply/demand! This actually took considerably more effort than expected. Previously, I had code to estimate a year's worth of supply and demand, to determine what goods to work on. This was relatively easy. What was far more difficult was to determine the average supply and demand for a sliding window of time. Just that feature took me far longer than expected, and in fact, took almost the entire week. In fact, if you compare my to-do list with last time, you might notice a slight increase in the number of items. The good news, these should be quicker things to complete than what I finished this week.


Aside from that, I was able to use this feature to adjust the price based off of the supply and demand. The price will adjust somewhat, so purchasing a large block of goods or selling a large block of goods can affect the price and be adjusted for accordingly.

Lastly, I was able to add in a "rot" feature, where a good will go bad if sitting in storage for some period of time. There are a few more things that I want to add to this calculation, including thievery, reduced rotting if properly stored, and quite a bit of balancing, but it's coming along slowly.

On the table for this week is a problem I've long debated, and have been unable to find a suitable answer yet. There are many types of food, grains, meats, etc. I don't want to particularly care what type of food is eaten, although I want to store the type of food individually, at least to some extend. For instance, Sheep and Wheat will have very different behaviors, and I want to model that. The question then becomes how do I determine how much food to eat, and of what type? I have a few ideas that I'm going to play with this week, we'll see what happens.

Lastly, a bit of a note about references. For those of you long term followers of this blog, you will know that originally I was planning a 17th/18th century time frame, the age of colonization. As time progresses, I'm shifting that time-frame earlier. The start of the game now is planned for something shortly after Columbus sailed to the United States, perhaps most of a 1530 starting time-frame as opposed to 1610 that I previously considered. A big part of this was an excellent book that I have read called 1493, by Charles C Mann. It has inspired me to change the focus somewhat of the game to the Colombian Exchange, where before Columbus arrived in the Americas, diseases, plants, animals, and even cultural references were very regional, while after the entire world began to exchange these items.

2 comments:

  1. You could use the system the Anno games use as orientation. They essentially differentiates between goods based on what need they fulfill, i.e. cheap/ordinary food is one good while meat as a luxury product is another.
    (This would also allow the "richness" of a port to influence demand.)

    ReplyDelete
    Replies
    1. I'm slowly starting to come up with a somewhat similar system. There are a number of needs. If a need isn't fulfilled, then a penalty is occurred. If fulfilled, then depending on the type of good a different reward will be given. Very similar to what you suggested.

      Delete