Monday, July 18, 2016

Sea Trading Game- Getting demand just right

This week hasn't had a lot of visible progress, but I have been making good progress on the real heart of the game, the trading goods model.

There are two things in particular that I'm working on modeling, the supply and demand. Together, these will create a price for a good. In theory, the higher the demand, the higher the price, and the higher the supply, the lower the price. Of course, it sounds really simple to put it like that, but there's a lot more behind the scenes to make it all work.

This week in particular I worked on the demand piece. I've added a lot of items that will cause demand variation. Certain things will be in higher demand in certain seasons, for instance, or temperature dependent, or even days of the year (Holidays).

The one thing that's been causing me a bit of grief is demand related to novelties, or even addiction. This was quite important in historical, or even modern, markets, and I'm trying to get something that feels realistic. I've got a reasonable first pass at a model, but I'll no doubt have to refine it several times.

I also dusted off my old unit tests, and found a bunch of bugs. I managed to fix all of them, and my unit tests all pass! Unit tests are helping quite a bit with getting the supply/demand formulas correct.

Going forward, here's my rough plan. This week I plan on getting the supply piece figured out. The supply piece is quite a bit harder than the demand, because each city will have to make it's own decision as to what to work on. I'm not quite sure I'll get it to that stage, which is where I'd like to see it, but it'd be awesome if I did! I'm going to use resources such as the following graph, copied from the Wikipedia Supply and Demand Page.

The next major task is to figure out the pricing based on supply/demand. That is going to be rather difficult, and I expect it to take the better part of a week to figure out. Hopefully I can also figure out how to satisfy demand through other means, either loosing interest in something, or having other people ship it, or even starving due to a lack of supply!

Lastly, I'm going to start adding in goods. Hopefully a lot of goods. At the very least, I'll add something in that will test all of the major functionality.

Once this is done, I have a number of things to polish, like improving the displays, artwork, improving contract processing, etc. Those things will take some time, but I'm starting to see the light at the end of the tunnel.

Last thing, I've decided that I'm going to publish this game under a company known as "Old Ham Media". For now, it links to my sparsely populated Facebook page, but that is also something I plan on working on in the short term future!

Monday, July 11, 2016

Sea Trading Game- Modeling Supply and Demand

This week I don't have any pretty pictures, like I've had in recent weeks, but I do have something that is the real essence of the game coming to life. This week I've been working on modeling Supply and Demand, the very essence of economics, and a critical part of my Sea Trading Game. I haven't figured everything out yet, and some of this I want to be a surprise for when people are actually playing the game, but I will share a bit.

First of all, I now have an increasing supply of goods for a port. I'm now taking away from the supply to fill up the ship, and thus there is a limited amount of goods for a given port. I'm trying to model this in such a way that not all goods will be available, at least at the beginning of the game, in all locations, although the exact details of how this will work out I'm still trying to figure out.

I'm starting to add things that manage demand like temperature, season, and even interest in a particular item, such as artwork.

Bottom line is, it's slow work, but it's starting to come together. There's no pretty picture that I can show of the work in progress, unfortunately. I expect I'm going to be in this situation for at least a couple more weeks, hopefully by the end of the month I'll have something I can show for my work.

On tap for this week specifically is to keep making supply/ demand curves, and likely increasing the number of goods available by a few so that I can start modeling some of the more advanced supply/ demand items that I wish to do. If I somehow get to it, then I want to start adjusting the price based on the supply/ demand at a specific location. 

Monday, July 4, 2016

Sea Trading Game- More biomes, seasons, and several performance bug fixes!

This was a very productive week. At the end of it, things looked like this (Clouds disabled, as they make the GIF much larger):

I'm still working on the exact details, but I'm quite happy with how it has been working out so far. I'll probably tweak things a bit at some point in time, but for now, I'm quite content.

There are two things that I did from this. First of all, I added a moisture model, which seems to work pretty well. I also fixed the pathfinding code to be much faster than previously. I added colors for all of the seasons, and allowed for transition between them as you see. I don't think I particularly need to explain more on that front.

This week I'm going to start working on something a bit less glamorous, but still extremely important. I'm going to figure out how supply/demand will work in the game. I'll likely slow down the progress of seasons somewhat at some point in time. I'm going to start adding more goods, now that I have biomes figured out. It's probably going to take a while to get all of this worked out, so there likely won't be much visible progress for a few weeks, but I'll see what I can do.

Monday, June 27, 2016

Sea Trading Game- Biomes, Bitmasking, Clouds, and more!

I know that I said last week that I wasn't going to have much time for game development for the week, and to not expect many updates. The truth is, I found more time than I thought I would have, and ended up doing quite a bit with that time. This is the latest version of what I have.

I'm still playing with the clouds in particular, I have a few things in mind, will see how they work out. This is still an early test, so let me know what you think!

I also changed the way the wind is shown on the graph. It's still slower than I would like, I'm trying to figure out how to improve that, but it is much more visible, and I'm happy with the direction it is going. Along with that, I started using more realistic wind patterns, basically I set up the trade winds, with a bit of noise.

It can be seen on both of the previous images, but I've been working on bitmasking, basically making the land not look so smooth. Here's a closer up picture to show how it looks. I totally scrapped the system from last week, and went with a shader based approach, which I document exactly how I did it on the Game Development Stack Exchange.

Movement is no longer easy to do diagonally if both primary directions have land. As there isn't a visible gap between them, it seemed the appropriate thing to do.

I also fixed a bunch of small things, too many and small to enumerate them all. Sufficeth to say the game is better than before.

The way I generated the biomes allows for a slight seasonal variation, although I don't think the seasonal variation is quite what it should be. I'm working on how to make it work best still, but it should be cool when I can get it worked out. It's a task for this week, but lower priority.

This week I'm planning to get the other half of biome creation figured out, namely getting the moisture part done. When I'm finished, we should have something like deserts being formed, which should look really cool if I can get it all figured out! Beyond that will be numerous speed improvements, the game doesn't work as well as I'd like when fully zoomed out. I'm also trying to work out a more seamless noise, there are still visible seams if you know where to look.

Thanks to Jon Gallant, BTW, for his tutorial on world creation, which I used in some part to complete. He's got some great games, including one in the work called GORB that I'll highly recommend when complete.

Monday, June 20, 2016

Sea Trading Game- Continuing to move to an XML file, and bitmasking.

Most of this week was spent converting a bunch of hard coded numbers in to an XML file, so after much work I ended up with essentially the same thing that I started out with, but considerably more robust. In the process, I was able to fix the old tutorial mode, improve the noise model usage to use the cylindrical noise model across all of the various parameters that are used, and others. Bottom line, it will make my life a lot easier for testing, future development, and could allow for modding in the future, all of which should be helpful!

After that was complete, I had a bit of extra time, which allowed me to start bitmasking. Bitmasking is the process to take square looking tiles and make them look more natural. I've only barely started the process, and I'm still working to make it look prettier, but here's my first attempt at bitmasking:

I'm going to play with the colors quite a bit, as well as the designs, but it's a start at least. I hope to have quite a bit more in the short term future. I'm still trying to decide exactly what I want to do with it, and how I want it to look, but it's coming along, slowly, and I'm happy for now that I have the capacity to add this in the first place!

This next week will likely be a slower week than has been typical recently, I've got a number of personal things to manage this week. I'm hoping to continue with the bitmasking, and then start on adding other biomes.

Monday, June 13, 2016

Sea Trading Game- Improving the lay of the land

This week as promised I've been working to improve the way the procedural generation works, and how it looks. This is the result.

I'm going to still be playing with the textures, and one thing that I'm going to do is to add in some different types of biomes, to add more variety than I currently have. I'm also planning on smoothing out the map so it doesn't look so pixelated, even though fundementally everything will still be tile based, there will be some smoothing factors.

I did also make some improvements to speed up the rendering process quite a bit. The end result is the map can be quite a bit larger than it was before, without difficulties!

Aside from that, I'm now moving all of the world generation in to the configuration file I recently set up. It's taking a bit of time to get right, but it will make things easier once it is all done.

Also, you might notice there are a few different types of land. I have islands, lakes, land, and ocean tile types currently. They each show up a little different, and will have different characteristics. Island ports will act very differently than land based ones, they will have different wants and provide different items than a typical port.

As a whole, the game progresses on, and the next few weeks should be very exciting in continuing that trend!

Monday, June 6, 2016

Sea Trading Game- More realistic worlds!

At long last, I'm starting to have more realistic looking worlds. I tried a number of techniques to generate the worlds, I ultimately settled on something similar to Jon Gallant's procedural generation in his blog. Here's an example of one such world created:

I still have a few kinks to work out, but I'm happy overall with the design! The ship is now randomly placed. The world is now cylindrically mapped, meaning you can move almost seamlessly from the left hand side to the right hand site. I've made quite a few other changes as well, it's starting to look like a real world!

On tap for this week is to continue to make the land more realistic. I'm planning on adding texture to the land, make islands unique. I might add in costal land, which might have some hazards associated with it, I'm not sure yet. I will add in a lakes feature, which will cause them to look different than other locations. I'm also planning on tweaking how the land masses are created. Another large problem is the city distribution, which has way too many at the poles, for instance. As you can see, the current pattern shows some promise, but it isn't quite what I had in mind. There's also a whole host of performance issues that I'm planning on working through. Stay tuned for more!