Posted July 21, 2017 by HopFrog
#Forager #Gamedev #Devlog
Hello all!
The past couple of weeks of work on Forager have fortunately been insanely productive!
Besides some additional secret content, and the usual bugfixing, the following big features have been added to the game and are now fully functional:
When designing the save/load states of the game, the following considerations were taken into account:
I tried several systems to get this one to work. I tried several encryption methods too. Ultimately, there was a direct correlation in encryption and processing times when saving. A stronger encryption meant a slower saving time.
This has a few issues, but the most important to notice is that after the player has been playing for an hour or more (and the map is filled with structures, terrain, particles, objects, and entities), saving would freeze the game for up to 3 seconds. Which of course, was unacceptable and pretty bad UX design.
I ended up having to make a choice between strong encryption and slow save/load times, or mild/moderate encryption and instant save/load times. I chose the latter.
The final version of the saving/loading system automatically saves the game every 5 seconds. And it's quick and seamless! But it also takes into consideration a few other things (is the player about to die in 5-10 seconds from hunger? Then don't save, it's frustrating to load a game and instantly die). Players can drop out of and into games really quickly and seamlessly
The whole game is now being compiled with YYC (YoYo Compiler). The way this compiler works is best explained by reddit user danredux in the /r/Gamemaker subreddit:
"The standard compiler converts code like "NAME='HELLO'" to machine-code, which is basically a list of instructions like "SET VAR NAME TO 'HELLO'". When you play the game, it starts up a program called a "runner", that loads in the list of instructions and starts executing them. That is to say, it would see "SET VAR NAME TO 'HELLO'", and it would find the NAME variable in memory, check that it exists, possibly convert it to a string type, then set it to 'HELLO'.
The YoYoCompiler takes it one step further. It compiles those instructions into machine instructions, which do not need to be read by a program, but are instead read directly by the computer chip. So, "health=10" would be convert to the bytecode "SET VAR health TO 10", which would then be converted to the simple machine code "MOV 0x1000, 10". The computer can understand this directly."
Essentially, compiling in this new way greatly improved performance on Forager. I have of course noticed many of you having FPS drop issues after playing for a couple of hours, and I am glad to let you know this is now solved!
Inspired by games such as No Man's Sky, Forager will now feature 3 distinct difficulty options (or game modes) to choose from at the start of each game.
I will get to tell you more about the modes next month, but for now, here is the gist of it:
That's all for now! I suspect this build will be available to test at the end of August.