Monday, November 24, 2014

Unreal Notes:

A list of things I wish I knew when I started. It seems like I did went through a lot of #%$@...

Q. When to move things from Blueprint to code?
When things are getting hard to read, or when you decide what something would be and won't change it anymore for gameplay purpose. For example, a raycast function for collision can be moved into C++ code, but a function that sets the health of player should stay in Blueprint.

Q: What are the most useful Blueprint functions?
Branch (the if statement for Blueprint) and Sequence (for executing multiple function block), Select is also important but it is confusing thus less useful.

Q: How should I use events?
Use Tick events wisely, don't put everything in there unless you have no other choices. Use delta time from tick events for timing.
When making events that have both a blueprint side and a C++ side, call the parent function at the end of your blueprint function block to execute C++ side.

Q: Some functions that I need to know how to use?
Select is pretty weird to use, you need to reset the pin type and set pin class to the one you want.

Q: Something about materials?
If in an online tutorial they have a black and white texture and you can't get it right using the exact same blueprint, try setting texture compression format and texture property to mask.
Use material instance to create the variant of the same material, and remember to set material parameters.
If you use a dynamic material, remember to keep a reference to it in your object to really change it dynamically.

Q: Something about post processing?
Check the Style tutorial and the ContentExample tutorial if you want a clean outline material.

Q: Something about AI?
 If you want to do a "stun" for NPCs, try to just eject the controller rather than setting up AI state in different AI trees, it works great if you don't have a more complex AI system in mind.
Now that I think about it, all crowd control effects should be dealt with as controller problems, as it should not change the AI behavior...Need more research.

Q: Something about particle?
Start by copying/pasting someone else's particle, disable different component and see how it goes. Don't create your own particle when you first start.
Don't set particle color to variable if you are not satisfied with the look of the particle. After setting it to variable, the preview window will not work.
Particle System means just one emitter, don't be fooled by the name.
In case you don't know, a particle is a flat rectangle that always faces the camera, a emitter is something that produces these rectangles.

 Q: Something about Matinee cinematic tool?
It is really easy to use if you had any Maya experience, follow the official tutorial. You only need some movement and camera track anyway.
Use two monitors will save you a lot of time.

Q: Something about the UI?
Use widgets and the interface is pretty self explanatory.  There isn't much tutorial about widgets but they are really easy to use. Use Blueprint events such as "on construct" to make your UI widget interact with your game.
For widgets, On Construct events are called WHEN ADDED TO VIEWPORT, not when they are "created". Convenient but hard to realize :/
Also, widget are referred to as "UUserWidget" in code.Remember to #include "UMG.h" and edit the <YourProjectName>.Build.cs file (should be inside your project folder) to have it include "UMG" by adding it like this: PublicDependencyModuleNames.AddRange(new string[] { " UMG"});
If that line already exists, just add UMG into the bracket.
When trying to change the content of the widget, choose the content and check the "variable" check box.

Q: Compilation and general concerns?
Removing a file in Visual Studio does NOT remove them from your project, use the solution mentioned here, rename the file and rebuild.
 Using int could cause unrecognizable type error because of reasons stated here, too bad we found it much too late :<

No comments:

Post a Comment