Friday Dev Update: Clicks, Testing, Optimization, and Map Checking

8:53 AM Unknown 2 Comments





Reversing Left and Right Click on Items





Here is a bit of history on how the buttons got to be how they are now. Originally, you had to double-left-click items to interact with them. We wanted the inventory to be able to be scrolled by a single click and drag, and didn't want players accidentally drinking valuable potions and the like while dragging the inventory.

However, we realized that having to double click so much was annoying. We didn't have right-click doing anything at the time, so we made right-click perform the same function as double-left-click. Eventually, the double left click functionality went away entirely, and we are left with what we have now.









Testing Branch





It is a very unfortunate nature of development that sometimes we mess up and miss something in our own testing, and errors slip through to you. None are at risk more than those brave players that play on the Steam testing branch. I really appreciate all of who do. You are the knights of Salt, taking the brunt of the bad bugs so the general player base can enjoy the game in bliss, unknowing of the valiant sacrifices made to protect them.

With the release of the player journal last week came a bug that caused items to disappear from chests placed on boats. Thanks a ton for those of you who quickly reported the issue so that we were able to get it fixed as soon as possible. It has historically been very rare to have item loss occur due to a bug, but as shown with this patch, it can happen. This week, I have done some work to add some more protections from item loss into the game.

First of all, I went through all of the code involved in item containers and saving them and made it a little bit more robust. I removed some unnecessary code and improved error handling. Secondly, I added a new option when loading a game that allows you to revert the world back to the exact state it was when you last manually saved the game.

For those of you that don’t know, the save system in Salt is semi-manual. Some things, such as your position in the world, are only saved when you save the game. Other things, such as your items, are saved continuously. For example, say you use a bunch of arrows to defeat a pirate captain, get some good loot off him, then quit without saving. When you return to your game, the arrows you used during the battle are missing, but you will still have the loot that you got from the encounter.

I created a new checkbox at the bottom of the load game menu. Checking this will cause the game to load everything to load just as it was when you last manually saved. This will give you a useful option to recover your game should something go horribly wrong during play, as long as you don’t manually save it after said horrible thing happens.

Revert Save Checkbox



Along with all of this, it is still a very good idea to make a backup of your game save before playing on any newly-released testing branch patches. You can find information about save files by clicking here







Optimizations





Also this week I have added in some code optimizations. Here is an explanation for those of you that have interest in the technicalities. As you play the game, all kinds of information is being loaded and unloaded to and from your computer’s memory. Many of the things that are loaded into memory are only needed for a very short time, and then need to be removed.

In some programming languages, the programmer is responsible for removing those bits of data. If they never remove any of the data, the computer’s memory will fill up and the game will crash. In Salt, we use a “managed” programming language. This means that it has systems in place that take care of removing those unneeded things from memory so that I don’t have to worry about it.

There is a downside to this, however. Whenever the memory fills up, a program called the “garbage collector” goes through and cleans up the memory of all the unneeded stuff. It takes a little bit of time to do this, so when the garbage collector does his thing, it often causes a small lag spike in the game.

A lot of the optimizations that I did this week involved creating less garbage so that the garbage collector doesn’t have to run as often. In addition to that, I also made some of the commonly run game code a little more efficient. These changes are subtle, but build up as I do them over time to provide an overall smoother game experience.





Map Checking NPC





Robert is hard at work on polishing up the map and getting it ready for testing. I wanted to tell you guys about something I will be adding in very soon related to the map.

I am very excited about mapping the world of Salt, and one thing I really love in games is being rewarded for big tasks that I am excited to do anyway. It makes me double happy. This how we came up with the idea for an npc that will check your map for you, and give you rewards based on how many islands you have marked, and how accurate you are.

He will also tell you this accuracy information. For instance, if you come to him and have 20 islands marked on your map, but you marked 1 of the islands in the wrong place, he will tell you that you have marked 20 islands with an accuracy of 95%.

The physical rewards will come in tiers and always have an accuracy requirement. I will have to do some testing before determining how many islands and at what percentage accuracy are required for each reward.











- John Gamble (Lead Developer)

This week, I posted a question on our Steam forums about reversing left and right click item interaction. The response has been strongly in favor of the proposition. It has always slightly bothered me that right-click was the primary item interaction button instead of left click. In the post, I told a little bit of the history of how right click got to be the primary interaction button in Salt:The functions of the buttons will be reversed in the next update to the testing branch, and subsequently, the next major patch.