Patch 0.12 is officially online. This week featured a lot of backend work, but also some new stuff for players to see. With any luck this patch will mark the end of large backend projects that affect quite a bit, but aren’t really fun for players. Everyone likes optimization, however it’s probably a little boring in terms of an update.
In any case, we’ll cover the boring things first and get it out of the way. Two major optimizations happened this patch. The first is regarding trees. In order to explain I have to say a little bit about how Verdant Village works. Verdant Village is made using Construct 3. In Construct 3 you create your game on something called “layouts”. Think of them like large canvases that you would paint on. The game that you play is pieced together on a layout.
Normally, you would make a game on multiple, smaller layouts. For example, if you considered Super Mario Bros, like the original 2D ones. Each level (1-1, 1-2, etc.) would likely be made on an individual layout. The point of this is that Construct 3 as an engine loads one layout at a time. So, by breaking up your game into small pieces you can save the engine the lot of trouble and usually optimize your game. Construct can also handle games that run on one massive layout, but it requires more careful tinkering to keep object counts down and code from running rampant. In a brilliant move nearly three years ago I decided to make Verdant Village on one massive layout.
I did this due to some constraints at the time. Mostly having a world that functioned regardless of you being around or not. By which I mean, NPCs moving, crops growing, and various things respawning and changing, even when you aren’t around. All these things are likely achievable in smaller layouts, but at the time I decided one large layout was the better way to go.
So, to the point, one of the things you have to watch in a large layout is the number of objects the game has spawned at once. If you are familiar with the term draw distance in 3D games it is similar to that. A computer can only keep track of so many things before it starts to stutter. This means you have to keep things efficient, which usually means don’t put so many objects in the game along with other things.
The holdout until this patch has been trees, seems dumb I know. Most everything else in the game spawns and de-spawns as you enter and leave zones. Trees however, did not. Due to how they were coded they were always there, in every zone, even if you weren’t. Verdant Village is a fairly large game already, and at this point only about half the map (maybe) is present in the game. The number of trees (and their invisible collision boxes) were about 3,000 objects in total already.
This problem was only going to get worse the more trees I added so I took care of it. Trees now spawn and de-spawn like other objects, reducing their numbers to about 50-100 at any given time. I probably don’t need to say it, but this is a massive improvement that should hopefully help with how well the game runs.
The second optimization that is likely far more important has to do with barn animals. Even if you never purchased any yourself there are some that run around on the farm in town. While checking into some things I noticed the game was running around 150,000 collision checks per second. If you aren’t familiar with coding all I’ll say is, that’s bad. Even for a computer that can do millions of calculations a second it isn’t good to have that level of processing going on every second.
As it turns out the problem stemmed from the animals and how they move around the world. Without going into detail, I re-wrote their movement code and now the game is running about 30,000 – 50,000 collisions a second depending on where you are. This still sounds like a ton but its far more manageable on a PC. In the future I may come back to this and work to lower it more but it would require a lot of careful attention as to not break anything.
That’s it for the boring things. As usual there were plenty of bug fixes implemented. A full change list will be below, but there were two notable things, neither of which was a true bug fix but I don’t have a more accurate term to classify it. First, I went through all the dialogue and hopefully weeded most of the mis-spellings and grammatical errors. To be honest, I wouldn’t be surprised if I missed some. I’ll be doing my best to watch out for, and fix any I find since they are annoying to say the least. If you find one please feel free to send me a message, I promise not to call you a grammar nazi.
The other notable fix also has to do with dialogue in the game. Again, it’s less a fix and more a failsafe. Adding dialogue to the game requires precise additions to the data and sometimes something gets scuffed. When this happens the game would, in the past, throw a 0 in the dialogue box, which would freeze the game forcing you to close it. I’ve added a bit of code so that if a zero is thrown you should receive a message instead. It may be a bit jarring, but it will allow you to continue the game so you don’t lose your progress from that day.
Now for the actual additions. There are two new zones in the game, one exterior and one an interior. If you want to find them, I’d suggest going west through the plains. There is also a new NPC. I’m trying to add the important ones first, I.E. the ones with shops, systems, or important quests tied to them. This NPC has a shop, she only comes to town during 2 days of the week so be on the lookout for her. I feel I should say that I ran out of time so she only has one seasonal schedule. This means she won’t do different things in Summer vs Winter or any season for that matter. Her schedules will be patched in next week however.
I think that’s about it for now, below is a full change list if that’s your jam. As an aside the wiki that people started has also seen some updating. If you’d like to contribute or check it out the link is below. Thanks for reading, hope I didn’t put you to sleep with all the tech talk, hope you all enjoy the new additions.
Verdant Village V0.12 Patch Notes
-Added the Narbell Farm zone.
-Added the Narbell Farm House zone.
-Added Remi to the game.
-Fixed various typos and grammatical errors across all dialogue.
-Optimized collision checking reducing collision checks per second from around 150K to 30K
-Recoded trees in the game to spawn and de-spawn based on the zone you are in, should reduce overall object count.
-Added code to make any dialogue that throws a null value instead throw an error message that will allow the player to continue playing.
-Fixed a bug that allowed you to change your hotbar selection while performing an action.
-Fixed a bug that would make your character unable to interact with anything if you were caught doing something (mining, watering, tilling etc.) at midnight. This patch should also undo this effect if you were affected by it.
-Went over startup code to make the game more accurately apply settings and delete unneeded data.
-Fixed a small lighting bug that resulted in the first day of play not having a proper lighting cycle.
-Altered the lighting cycle in general to hopefully make sunrise and sunset come at more appropriate times.
-Fixed a bug that would allow fruit trees to infinitely gain health over time, I.E. become impossible to chop down.
-Fixed a bug that would make the game infinitely patch every time you started it.
-Added code to the make the game not begin giving you a recap if you were in the middle of moving from one room to another.
-Fixed the “Sprung A Leak” quest which threw a 0 when you accepted it.
- Fixed the “The Sunken Bridge” quest which threw a 0 when you turned it in.
-Fixed an incorrect call that retrieved the wrong sprite for oil in the cooking menu.
-Altered the skill up requirements making the harder to get. Your skills have been altered appropriately to coincide with the new numbers, this may result in your overall skill level going down (sorry).
-Recalculated the Wanderer, Line and Tackle, Forager, and Dark Vision perks to make them harder to obtain. If you already have them you should retain them.
-Fixed a bug with the Line and Tackle perk where you could just cast your line and pull it back instantly to gain perk progress.
-Fixed a visual bug where the quest description for the quest “Dry Cavern” was too long to fit in the description box.
-Fixed a bug where some decorative objects you placed down would show an invisible collision check.
-Fixed a bug where on the change of seasons it was possible for the furniture placed in your house to disappear leaving behind its collision.
-Fixed a bug where planting seeds in a ground tile that was already watered would result in your character being able to water the crop forever with no effect.
-Fixed a bug where if you maxed out a tool proficiency the game would still display your total XP when you hovered it.
-Added code to make non-interactable fruit trees (ones you didn’t plant and can’t harvest) appear with or without fruit based on the season.
-Altered code to make your horse’s running animations more consistent.
-Fixed a bug with objects that were placed on walls incorrectly aligning themselves, sometimes they would disappear behind the wall.
-Deleted a duplicate tileset in one of the mine levels.
-Fixed a small collision map error at the mines entrance.