Course: Building a Block Based Game

One question, how can I know if the new block actor is spawned successfully or not through the code?
There is a “Collision Handling Override” option in the SpawnActor method, I set this option to “Do not spawn”, this will cause the new block actor not to spawn when it is blocked by existing block actor, but the return value of the SpawnActor method still gives a new actor object even if no new actor is added to the world.
image

Good question!

Drag off the return value from the SpawnActor node and search for “Is Valid”.

One of the best well explained courses on the Forum. Thank you!

2 Likes

Thank you - appreciate your kind words. :grinning:

1 Like

It’s so cool!

1 Like

Where can I find detailed explanation for these functions?
The “view documentation” of the node context menu is unavailable, and the explanations in the Blueprint API Reference is also very simple.

@uniwang - as you noted, there isn’t much in the official Blueprint API reference.

One of my very favorite online references is Marcos Romero’s Website (and book): Romero Blueprints: Table of Contents BP

IsValid: Romero Blueprints: BP Compendium: Is Valid

The Humble Bundle currently has Romero’s book at the $1 tier - worth it! Humble Tech Book Bundle: 3D Game Development with Unreal Engine 5

Also, note that there are two versions of IsValid: the function, that returns a boolean, and a macro, that uses the IsValid function and returns an exec path based on the validity of the object:
image
You can double-click on the macro to see it in the StandardMacros library:


And, I’m pretty sure if you have the Unreal C++ code installed, you can find the C++ code for IsValid and study it: Unreal Engine on GitHub

Hope some of that helps!

The Romero Blueprints++ is very helpful, and the Humble bundle is excellent, I have supported $18 to get all the items, they are worth it!
Thanks again for providing the information.

2 Likes

“Ctrl + W” has changed to “Ctrl + D”.

1 Like

Congratulations to you !
Amazing tutorial
You are very didactic.

English is not my mother tongue but as you explain calmly and clearly, I understood everything.

At the end you explain that this system is not suitable for managing thousands of items, what method do you recommend in this case?

Thanks

1 Like

Thank you for the nice comments @JeanMichel_4D

I’ve experimented using Instanced Static Meshes (similar to how the floor block is created) and making many thousands of blocks with good results. Unfortunately it required a substantial reworking of the system presented in this course and was fairly complex. One of the goals when I created this course was to reduce the complexity and still present a fairly useful system.

I hope that helps!

1 Like

Stopping by to say that this tutorial works with Unreal Engine 5.4.3.

How to Build a Block-Based Game

  1. Define Your Concept: Choose the genre and core mechanics (e.g., puzzle, sandbox).

  2. Select a Platform: Use a game engine like Unity, Unreal Engine, or Godot, and familiarize yourself with its programming languages.

  3. Design the Grid: Create a grid layout and define different block types and their properties.

  4. Implement Mechanics: Develop functionality for placing and interacting with blocks.

  5. Develop Features: Establish game rules, design the user interface, and add essential gameplay elements.

  6. Test and Refine: Conduct playtesting to fix bugs and balance gameplay.

  7. Deploy and Publish: Build your game for various platforms and distribute it through appropriate channels.

To use humor effectively in a block-based game and enhance player engagement, consider the following strategies:

  1. Character Dialogue: Create funny and memorable dialogue for in-game characters. Quirky personalities or humorous interactions between characters can make the game more enjoyable and relatable.

  2. In-Game Events: Design events or scenarios with a humorous twist. For example, a block-based puzzle might feature amusing obstacles or funny consequences for mistakes.

  3. Visual Gags: Incorporate humorous visual elements, such as funny animations or unexpected visual surprises when certain actions are performed.

  4. Easter Eggs: Hide humorous references or Easter eggs throughout the game. These can be playful nods to popular culture, inside jokes, or clever wordplay.

  5. Narrative: Use humor in the game’s storyline to keep players entertained. A lighthearted plot or witty commentary can make the game more engaging.

  6. Feedback and Rewards: Provide funny feedback or rewards for player achievements. For example, a player might receive a comically exaggerated reward or a humorous congratulatory message. Incorporate punnyfun or playful words in character dialogue or game events to add a layer of humor and keep players entertained.

By integrating these humorous elements thoughtfully, you can create a block-based game that is both engaging and enjoyable for players.

Regards: Tiktokusd