Planet HEXBUG in VEXcode VR provides a whole area of the planet to explore. As you begin coding the VR HEXBUG nano to traverse the planet, there are many different strategies that can be implemented. If you are unfamiliar with the story of Planet HEXBUG, please see this section of articles about getting started with Planet HEXBUG.
The information below is provided to help you dive further into strategy-based coding in Planet HEXBUG. If you are not familiar with the basic gameplay elements like eating food or defeating enemies, see this section of articles.
While this is a starting list for strategies, there are many additional options that can be discovered by combining multiple methods (like a food-focused strategy that also attacks enemies when they are detected, or a home-focused strategy that avoids enemies to save battery life when collecting food).
A great way to get started with your strategy is to use example projects in VEXcode VR. Examples are provided for each aspect of game play, such as Finding Food, Bringing Food Home, Detecting and Fighting Enemies, and more.
Select an example that aligns with your basic strategy and run the project to see how the VR nano moves and what blocks are used. Then you can add additional blocks into your project to continue that behavior or modify it to fit your strategy.
To learn more about using example projects, see this article.
If using a food-focused strategy, the VR nano can aim to consume food only when necessary to elongate its lifespan and your game.
One way remain to food-focused while speeding up the amount of days elapsed is by using the hibernate function of the VR nano.
The hibernate function allows the VR nano to move underground and hibernate until its battery reaches the specified level. While underground, time speeds up so the number of days survived rapidly increases while the battery level rapidly decreases.
Note: In the video shown here, the AI view has been disabled to keep the emphasis on the hibernation. To learn more about the Playground window and how to turn these views on and off, see this article.
However, by only using the hibernate function along with finding food, it could take a significant amount of time to level up the VR nano and may make your VR nano vulnerable to enemies.
In this image, you can see that the VR nano has gained 2 Experience Points (XP). This is from eating the food after hibernating in the above video.
Another strategy for the long-term survival of your VR nano could be gaining energy and refilling your battery through fighting and defeating enemies.
As the VR nano travels farther from home, the enemies become stronger and the VR nano must gain enough XP to level up and defeat them.
Each of the colored-zones in this image aligns to the color of the VR nano as it levels up. It is recommended to only attack enemies that are within the zone the VR nano matches and only when it has a full or mostly-full battery to ensure survival. For more information about attacking enemies, see this article.
While dangerous, this strategy ensures the VR nano levels up quickly and can then explore more of the planet.
Each VR nano action earns a specific number of XP, as shown in the table. Defeating enemies are the actions that earn the VR nano the most XP in the game.
Use the (Enemy level) block to determine the level of an enemy before approaching. This could be used to create logic where if the Enemy level is less than the level of the VR nano, the VR nano would approach that enemy and attack.
As shown in the table above, the VR nano can also earn 5 XP for each piece of food brought home. By maximizing the capacity of the VR nano's backpack, it can bring home more food with each level gained.
By elapsing time collecting food and bringing it home, the VR nano can extend its life. And because food is almost always available in the backpack of the VR nano while collecting food, there is a reliable source to refill the VR nano's battery when it gets low.
To determine the carrying capacity of the VR nano's backpack, see the capacity indicator in the Playground window. The VR nano begins by being able to carry two pieces of food.
You can also use commands in VEXcode VR to determine the capacity of the backpack while a project is running. In this code snippet, the VR nano would go home once the amount of food in the backpack of the VR nano is equal to its capacity. You could then use similar blocks to determine how much food to drop off at home before going out to collect more.