DAY 33
In the previous post I've talked about experimenting with 2 particular "mechanics"/features:
1) Random spawning of an item between two or more spawning points
2) Spawning of an item at a random point in a bounding box
Well, the experiments went forward and both were a success, implementation-wise. Both of these are super-easy to implement and here is a breakdown of how the work internally. Please don't treat this as a tutorial, because I don't know how to explain it as such.
1) Target Points are placed into the world. These target points are then placed in an array. Then the array is linked with a SpawnActor at Location node. In this particular node, an item is called to be spawned. To know what spawn point should the game use to spawn the item, a Random Integer InRange function is to be used, since the target points in the array are essentially assigned to an integer. This Random Integer node is then sent, along with the array, to a Get function. This Get function is then sent into a GetActor Location, which then is sent to the SpawnActor at Location
Ex: You have 3 Target points and in the array, they are assigned a number between 0 and 2. That random integer selects from these 3 integers and spawns the item in the game world.
What this is useful for: aside from the obvious "place collectible at two or more random points" for the player to discover, this is super useful when you want to create a puzzle that has different solutions for each playthrough.
Ex: You must open a door to the next area. The door has 3 indicators above it that tells the player what will open it: a key indicator, a switch indicator and a passcode indicator. One playthough, the player would receive the key, the next playthrough a passcode, the third one the key again, the fourth one the switch and so on. The key would be found in a location, the passcode in a different location and the switch in a different location.
2) A bounding box is created as a blueprint. In the blueprint, both the default scene root is taken and the box itself and are sent directly into the function Random Point In Bounding Box. This function is sent into a Spawn Actor Transform (i believe). For easier access to what to spawn, a variable is created to which the Class type is assigned. This variable is then sent into the Spawn Actor function.
What this is useful for: say you have a Treasure chest hunt. The player is given a specific location ( ex: "the beach at the north of the map") but not the exact location. The player has to dig to find the treasure chest. It may take him 10 seconds, it may take him 3 minutes.
Voila, 2 super-easy features that create interesting choices and situations for the player.
One other super-useful thing I have implemented is a portal card.
If you look in the background, at the cave entrance, you will notice that the cave entrance has some form of fog and lighting to it. That is the portal card. It highlights where the player should go when he/she is in dark areas. Basically, it's a material with gradient and a depth fade added to said gradient. Add it to a plane without collision and you have a portal card. Get close enough and it will disappear completely. Get far back enough and you'll see an illuminated entrance.
What is this useful for: highlighting entrances in the dark, highlighting items or simply use them as light shafts.
Once I get the chance, I will update with video to let you guys see how this portal card works in my game. That's all I've got for now. See you in the next post. Bye.
EDIT Here is the promised video: https://drive.google.com/file/d/1TG6EHcYQG-r1dt32OTG-zpbVp5MjzORR/view?usp=shari...