« Mr.Digi »

Programmer/Developer

Survival Island – Devblog 14

This weeks devblog have fixed a number of bugs and issues, aswell as added some new crops. The health and heart count is also saved now. New Ai have also been started, so i expect the enemy ai to be finished within the next few weeks. Once that is finished, a playtest will be conducted. To sign up for the playtest, please fill out this form: Playtest Signup

Enemy AI progress

This week i started work on the Ai system. And my plan is not to make it super inteligent so it predicts your every move, I simple want the ai to be able to roam freely, and spot the player with line of sight and attack while also avoiding objects and other enemies. Aswell as the ability to pathfind towards a set target. So far i’ve given the enemy the idle state, wich is simple enough. But i’ve also added the roaming state. And roaming might not sound too difficult, but its actually more complicated than most people think. Yes you can set a direction, and move the enemy in that direction. But then what happens if you hit a object? Will the enemy know how to turn and walk away from it, or will it just continue walking into it?

The enemy ai shoots 16 raycasts out from the enemy in 16 different directions. with a small distance for checking for collision with any object that exists on a default layermask. If the enemy is walking in a direction and the raycast pointing in that direction collides with something. It will choose a nearby raycast and walk towards that instead. The collision check for each raycast also checks the 2 most nearby ones for collision. This is just for added security so the enemy wont walk into the edge of a object if the raycast is just not touching it. Here is a preview:

The green lines are the raycasts, they turn red when they collide with something. This lets the enemy know it cant walk in that direction.

New placement mechanic

This week i spent a good amount of time reworking the placement mechanic for objects. Previously it checked by colliders and triggers. So if it hit a collider/trigger, it would add that object to a list. And if the object held by the place could be placed on the objects in the list, then allow placement. But that caused some issues. The collider check sometimes detected objects near the collider causing it to not allow placement where it should allow. As a example: Placeing a door on the floor between two walls did not work most of the time. This is because doors cant be placed on walls, and the check would also detect the wall when it was not in the check range.

Now the placement uses Raycasts. Only the first object hit by the raycast at the specific tile is checked against the helt item. This causes the top most object to be detected by the raycast, wich is what i intended. So currently it seems to work perfectly. But i’m not saying that its the 100% final version of the placement mechanic.

Hammer changes

The hammer is now switched over to use the same mechanic as the placement for checking objects in tiles. The hammer can only destory player placed objects, and will give a refund depending on what you destroy.

New crop – Radish

Radish is now in the game, can be found in common treasure chests. The radish gives a set amount of hunger and health. Later on it will be used for more foods in a cooking system. But that will be later on in the games development.

New crop – Cabbage

With the idea of a cooking system there must be cabbage. Currently cabbage will give some hunger and health, but will be more used in the future when a cooking system is added.

Patch Notes – Devblog 14

Added:

  • Saving to the health system. It now saves you health and number of hearts.
  • Added a settings page to the main menu.
  • Added new crop – Radish.
  • Added new crop – Cabbage.
  • Added particle effect applied to crops that are finished growing.

Changed:

  • The fog in both the cave and main world is now less intense.
  • Placement mechanic uses raycasts instead of collision checking.
  • The hammer now uses raycasts instead of collision checking.
  • Now when placing or destroying there is no green or red square, graphic is updated.
  • Fences now connect with walls, making it look more natural when connecting.
  • The see through for layer is now disabled when not in a cave. Will be used for something later down the line.

Removed:

Existing bugs:

  • Items can get picked up into the backpack when the player dont have a backpack.
  • Item information panel can sometimes show a little outside the screen at the top.

Fixed bugs:

  • Fixed a issue causing the player position not to load correctly.
  • Fixed a issue causing trees to become black when the player spawned under them.
  • Fixed a issue causing it to be possible to rain in caves.
  • Fixed a issue causing chests to spawn at a previous chests location if another chest was destroyed.
  • Fixed a issue with the placement of objects, entire mechanic changed.
  • Fixed a issue with the hammer causing it to destroy more objects than intended.

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

  • Enemy Skeleton (disabled due to the ai being reworked)
  • Flower Enemy (disabled due to the ai being reworked)
  • Flower Pot (will be changed later on)
« Mr.Digi », August 14, 2022

Leave a Reply

Theme made by Mr.Digi