« Mr.Digi »

Programmer/Developer

Survival Island – Devblog 23

Development of this game was set to not continue. And that was because of some issues that i thought would require the game ot be remade from scratch. I would not have time to do so, so i stopped it completly. But i was bored one day and thought about the game, and then realized a possible fix for the issue. I tried it out and it worked. So development is back on. Welcome to the first devblog in a while. Bugs fixed, things added. And performance fixes.

Performance old and new

There have been many issues with performance. And that comes from me not being too experienced with optimized methods on how to do things. So i have made things so it works, but not so it performes in the best possible way. I have started to change things behnid the scenes now. Everything will still look the same to the player. But the backend of it will be alot more smooth so lag shouldnt be an issue.

Here’s a list of things overhauled for performance:

Object count

Old:

  • Trees: 750
  • Rocks: 300
  • Grass: 1500
  • Smaller grass: 700
  • Bushes: 150
  • Berry bushes: 150
  • Hills: 3
  • Caves: 2

Total: 3555 objects

New:

  • Trees: 100
  • Rocks: 20
  • Grass: 100
  • Smaller grass: 50
  • Bushes: 50
  • Berry bushes: 50
  • Hills: 3
  • Caves: 2

Total: 375 objects

Active object count was a huge reason why it was such severe lag. There was 3555 enviromental objects active at all times running scripts. Aswell as other objects such as dropped items, the player. farmland and crops, chests, caves etc. So alot of obejcts ran scripts constantly. The biggest issue was many enviroment objects constantly running. To fix this, i have changed the enviroment generation to generate spawnpoints for different objects. as coordinates. Objects will then be placed into the players view from a objects pool. Objects outside of the players view will deactivate and be placed in the pool again. This reduces the amount of enviromental objects to 375. 375 is not the amount that will be active, its a max. From testing i have found that usually active at the same time is around 50-100 objects. This includes all objects. That is a huge reduction, so now there is no noticable lag from objects.

Lights

Lights used to be a huge problem, and i still dont know exactly why they were a issue. But it seems to have been fixed by removing Shadow casting. The only thing this means it that lights you put down in your base will go through walls. Me personally have not noticed it too much unless i think about it. But its alright, i’ll look into lights again at a later date, but for now, they work without problems.

Wall/Fence updating

Wall blocks and fences used to run checks every frame to see if they needed to change or not to fit with the rest of the blocks next to it. This was for all blocks meaning if you had 200 walls in your world, all those 200 blocks would run checks every frame. This caused a huge performance drop. To fix this issue, I have changed it so when placing a block, that block will force blocks within 5 meters to update themselves. So only the block you place, and the closest ones will run checks, but only once when you place a block. This made a noticable differance. This change will also be applied to the farmland tiles later on, as these still check every frame.

New decoration item – Bed

I’ve added a bed to the game. The bed is a placeable item you can use to skip nights. The bed will also make a respawn point so you will respawn in you base if you die. Earlier there was never any plan of respawning. But some people play casual, and some people don’t. So having a option to respawn would be great. There will still be a catch to dying. But you wont lose your world. The death menu therefor offer you a respawn option. The bed will be limited to only allow you to sleep at night. There is a little catch. You will only have the respawn option if you have slept in the bed. If you haven’t, you will be left with no world.

Water Can

The water can have gotten a change to how its used. Much like building the watering now follows a grid based system. This means that you can no longer stand lined up between crops and water both at the same time. While this might sound dumb, let me explain the reason. With the new mechanic, the water can, can have 3 levels. Level 1 is 1 tile. level 2 will be a row of 3 tiles. and level 3 is 9 whole tiles.

Tool crafting

Tools are essential when playing a survival game. But the way tools are crafted in many games will cause you to have many of 1 type of tool. So to combat that, crafting the next tier will require the old tier as part of the recipe. So for example, If you have a stone hatchet, but want to craft a iron hatchet. The recipe would be the stone hatchet + some iron. You basically upgrade the tool.

Animals

Animals are of course needed in a survival game. You might remember the rabbit from earlier, it was removed early in the start of the development because I wanted to have ai sorted before adding such. Well, I have. Animal ai works in the same way that the enemy ai does. Just opposite when it comes to chasing. Some animals will run away when you get too close. Some will be calm until you harm them etc. The rabbit is also the only thing at the moment that drops the new resource: Leather. The showcase below show 2 lines. The green line is the direction towards the player. The red line is the direction that the animal can run to get farthest from the player. Animals also spawn during the day, outside of the players view.

Patch Notes – Devblog 23

Added:

  • Added a new decoration item (bed)
  • Added sleeping.
  • Added sprinting when holding shift
  • Added a new cave (temporary to add variation)
  • Added a text displaying the players current stamina (placeholder)
  • Added building sound effect when placing build pieces
  • Added a respawn option to the deathmenu
  • Added new item deathbag (non-functional)
  • Added new resource: Iron (found in snow)
  • Added new resource: Coal
  • Added a sprint animation to the player
  • Added a splash screen before the main menu
  • Added Animal AI
  • Added new animal – Rabbit
  • Added new resource – Leather
  • Added new weapon – Wooden bow
  • Added first arrow type – Stone arrow

Changed:

  • The enter seed ui elements are changed to better fit with the other ui.
  • Changed the way stone walls update.
  • Building will now take a few seconds before a piece is finished.
  • Building pieces will now be placed at 50% opacity until finished built
  • The “E” Interaction prompt now wobbles up and down to better indicate interaction.
  • Changed the way fences update.
  • Sprites for pebble, stick and stone are changed.
  • Tools now require their previous tier as part of their recipe.
  • Changed the shadows of fences to be transparent black instead of green. looks better in all biomes.
  • Changed the watering can can behavior.

Removed:

  • Decoration item – Flower pot

Existing bugs:

  • The player sometimes spawn in the water unable to move.
  • When placing a wall next to a fence. The fence does not update to fit with the wall.

Fixed bugs:

  • Fixed massive lag/framedrops when having 4 lights of more.
  • Fixed lag when picking up dropped items.
  • Fixed a issue causing walking sounds to still play after being stopped by a wall.
  • Fixed lag caused by having many build pieces in the world.
  • Fence gates no longer flicker when walking through them.
  • Fixed tearing in the tilemap when walking.
  • Fixed a issue causing fences close to the gate to flicker when walking through the gate.

Enabled: (things that was disabled in the previous update, but is now enabled again)

Disabled: (disabled is not removed, things listed here will be enabled again eventually)

  • Misc item – Map
« Mr.Digi », October 16, 2023

Leave a Reply

Theme made by Mr.Digi