Announcement

Collapse
No announcement yet.

[TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Plenty more coming in time. Just finding the time to do it all can be troublesome. I'm really wanting to setup a lot of stuff that has been on my bucket list to learn and experiment with since I started at Epic last April. A lot of focus lately has been on the Wiki lighting troubleshooting guide with Eric though. I've got so many destructibles Tips, tricks, and setups I want to do just to help people out with them. That may become a wiki as well. We'll see what happens.
    Tim Hobson | Learning Resources | Epic Games
    UE4 Documentation
    Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
    _____________________________________________
    Follow me on Twitter @TimHobsonUE4 | My Personal Website
    Photons Be Free: Mini-Tutorials and other Curiosities

    Comment


    • #32
      Other How-To #3: Creating Level of Detail (LOD) Meshes in 3Ds Max for UE4

      **This is specifically for 3Ds Max and may be similar in other Autodesk or modeling applications. **

      Overview:

      This short tutorial will go over the process of creating and exporting LODs with 3Ds Max to UE4.


      Step 1: Base Mesh and LODs

      In this example I've chosen to use the statue mesh found in the Mobile Sun Temple demo from the Marketplace.

      This is my base Mesh showing the shaded model alongside the wireframe mesh.

      Click image for larger version

Name:	1_BaseMesh.png
Views:	1
Size:	209.1 KB
ID:	1074904

      Often times this much details isn't always necessary for a mesh as you move further away from it. There is a lot of detail here that will not be perceptible from further distances. By reducing the polygon count we can create a lower Level of Detail (LOD) version that is not noticeable.

      In the next steps the mesh will be depreciated for lower LODs that we can use to optimize our games.

      Step 2: Creating Lower LODs

      With UE4's LOD system you can use up to 4 LODs.

      LOD 0 is our Base mesh with all the awesome detail! LOD 1-3 will be our lower polygon versions.

      First we create our copies:

      Click image for larger version

Name:	2_Copies.png
Views:	1
Size:	347.8 KB
ID:	1066992

      Top is the Wireframe with Bottom being the shaded model.

      Before starting the first LOD there are two options that are available inside 3Ds Max to depreciate the mesh.

      There is the option of ProOptimizer and Multires Modifiers.

      Both are good in their own right and each has it's own method of depreciating the model, but with one exception. ProOptimizer does it in a destructive way compared to MultRes.

      Here is an example. The mesh in this scene has already had it's UVs completed, but now just needs a lower LOD. ProOptimizer will destroy the UVs in doing so whereas MultiRes will honor them.

      Click image for larger version

Name:	ModifierComparison.png
Views:	1
Size:	314.3 KB
ID:	1066995

      Make your choice based on your needs as they are similar in how they do the tasks for actually depreciating.

      Moving on...

      Select the mesh you want to use and in the modifier stack add the modifier you've chosen.

      For this example I've chosen the MultiRes Modifier.

      Click image for larger version

Name:	MultiResModifier.png
Views:	1
Size:	20.5 KB
ID:	1066996

      This is fairly straight forward for this part.

      Click Generate at the bottom. This will map the mesh so that the polygon count can be reduced.

      The options at the top for Vert Percent are now editable. You can also use the Vert Count option if you have stricter limitations or an OCDness that requires even numbers.

      For the three lower LODs I'll set them up as follows:

      LOD 0 (Base) - 4479 verts - No Change
      LOD 1 - 2240 verts - 50% of original
      LOD 2 - 1120 verts - 25% of original
      LOD 3 - 672 verts - 15% of orginal

      Final Result after setting up LODs:

      Click image for larger version

Name:	3_LowerLODs.png
Views:	1
Size:	359.7 KB
ID:	1066997

      Step 3: Grouping the LODs for use in UE4

      The next part requires the meshes to be "Grouped" so that they can be used as single LOD.

      Select all your meshes and center them up to each other. In Max you can select all the meshes and set the XYZ Locations as the World Origin or use the Align tool from the toolbar.

      With your Meshes all aligned use the menu bar and select Group > Group

      Click image for larger version

Name:	4_Group.png
Views:	1
Size:	135.0 KB
ID:	1066998

      Next give the group a name

      Click image for larger version

Name:	5_GroupName.png
Views:	1
Size:	129.3 KB
ID:	1066999


      Step 4: Level of Detail Utility in 3Ds Max


      In this next step make sure the mesh is selected and then go to the Hammer Icon and select that in the Command Panel

      Click image for larger version

Name:	6_Hammer.png
Views:	1
Size:	10.8 KB
ID:	1067000

      Next select "More"

      Click image for larger version

Name:	7_More.png
Views:	1
Size:	10.8 KB
ID:	1067001

      Select "Level of Detail"

      Click image for larger version

Name:	8_LevelOfDetail.png
Views:	1
Size:	16.7 KB
ID:	1067002

      Click "Create New Set"

      Click image for larger version

Name:	9_LODPanelCreateNew.png
Views:	1
Size:	25.4 KB
ID:	1067003

      The LODs should populate the window in the lower area now.

      Click image for larger version

Name:	10_LODs.png
Views:	1
Size:	26.7 KB
ID:	1067004

      At this point the mesh is ready for export to FBX.

      When exporting the FBX make sure to remember to check export Animations otherwise your LODs will not work.

      Step 5: Importing into UE4

      Once the mesh has been exported to FBX it now just needs to be imported into UE4.

      Make sure to select the option for "Import LODs" like so:

      Click image for larger version

Name:	11_UE4IMport.png
Views:	1
Size:	81.7 KB
ID:	1067005

      Once imported open the mesh in the Mesh Editor.

      On the right side there will be a listing of all available LODs.

      Click image for larger version

Name:	UE4Details.png
Views:	1
Size:	152.5 KB
ID:	1067006

      To see individual LODs use the drop down to select a LOD.

      LOD0
      Click image for larger version

Name:	UE4Base.png
Views:	1
Size:	64.0 KB
ID:	1067007

      LOD1
      Click image for larger version

Name:	UE41.png
Views:	1
Size:	62.7 KB
ID:	1067008

      LOD2
      Click image for larger version

Name:	UE42.png
Views:	1
Size:	63.7 KB
ID:	1067009

      LOD3
      Click image for larger version

Name:	UE43_1.png
Views:	1
Size:	73.5 KB
ID:	1074903
      Last edited by Tim Hobson; 04-22-2015, 10:13 AM.
      Tim Hobson | Learning Resources | Epic Games
      UE4 Documentation
      Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
      _____________________________________________
      Follow me on Twitter @TimHobsonUE4 | My Personal Website
      Photons Be Free: Mini-Tutorials and other Curiosities

      Comment


      • #33
        Updated Day/Night project for smoother transition to day and night using timeline for the light and skylight intensities.

        https://forums.unrealengine.com/show...l=1#post209224
        Tim Hobson | Learning Resources | Epic Games
        UE4 Documentation
        Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
        _____________________________________________
        Follow me on Twitter @TimHobsonUE4 | My Personal Website
        Photons Be Free: Mini-Tutorials and other Curiosities

        Comment


        • #34
          Originally posted by Tim Hobson View Post
          How-To 1: Setting up Local Screen Multiplayer
          Is that all i need when i want to offer a coop feature for my game (using ThridPerson setup)??

          Twitter | Facebook | YouTube | IndieDB

          Comment


          • #35
            Honestly, not completely sure. I've not messed with multiplayer beyond just getting the single screen multiple players set.

            Since it's using the same screen I wouldn't think there would be a need for replication since you're not using a server or anything over a network. As far as I'm aware this should be fine for co-op single screen kinds of games.

            My suggestion would be to setup a simple test level with some events, traps, or other goals and see what you get.
            Tim Hobson | Learning Resources | Epic Games
            UE4 Documentation
            Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
            _____________________________________________
            Follow me on Twitter @TimHobsonUE4 | My Personal Website
            Photons Be Free: Mini-Tutorials and other Curiosities

            Comment


            • #36
              Man that is an awesome tutorial on LODs. Little details like that to make games way more optimized.

              Now if I take my meshes and make them LOD like this, will I have to redo all their placements on the map? Also do LOD's apply to foilage such as rocks/trees?

              Comment


              • #37
                Glad it works for you!

                There will be no need to do re-do their placement. If you have your base mesh already placed all you need to do is create the LODs and you can just reimport the original mesh with the newly added LODs or individually import the LODs in the static mesh editor.

                If you have any trouble feel free to ask.
                Tim Hobson | Learning Resources | Epic Games
                UE4 Documentation
                Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                _____________________________________________
                Follow me on Twitter @TimHobsonUE4 | My Personal Website
                Photons Be Free: Mini-Tutorials and other Curiosities

                Comment


                • #38
                  Other How-To #3: Light Functions with Color


                  Overview:

                  https://docs.unrealengine.com/latest...ons/index.html

                  Light functions do not provide color when a light function material is plugged in. This does not mean that you cannot get a colored image by taking advantage of the system though.



                  All that is needed is to setup a material for each color value for Red, Green, and Blue. With the texture sample you'll plug the single color value into the Emissive pin. Also, in the Material Editor the Material Domain will need to be set to Light Function.


                  NOTE: This can probably be done with a single material and using an instance to switch on or off the various color values or some other method. I've just not looked. If I pursue that method at any point I'll update here.


                  You should end up with something like this for the Red, Green, and Blue materials.

                  Material Setup

                  Click image for larger version

Name:	SoniceMaterialSetup.png
Views:	2
Size:	51.7 KB
ID:	1071264


                  Light Functions in Action

                  Click image for larger version

Name:	SoniceLightFunction.png
Views:	2
Size:	593.9 KB
ID:	1071265

                  Scene Setup: These are all Spotlights with an assigned Light Function Material that corresponds to the color value we will assign it.

                  Top Row: This is three spot lights each with the either the Red, Green, or Blue material assigned. The light color has been changed to the full value for that color using the Color Picker to set the RGB Value. (ie. Red would be set to R=1, G=0, and B=0)

                  Middle: The three Spotlights with the assigned light functions overlaid onto each other.

                  Bottom: The three Spotlights with their Light Function Material assigned with the light's color value left at default of White.
                  Tim Hobson | Learning Resources | Epic Games
                  UE4 Documentation
                  Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                  _____________________________________________
                  Follow me on Twitter @TimHobsonUE4 | My Personal Website
                  Photons Be Free: Mini-Tutorials and other Curiosities

                  Comment


                  • #39
                    Hello Tim,

                    I followed your destruction tutorial with the parking meter. I used the same settings as you. My problem is that if I drive a car into the mesh the car stops/bounces off. I tried changing the impact resistance but it didn't seem to have much of an effect. I want the car to be able to plow through the mesh as it is destroyed.

                    This works if I turn on simulate physics and start awake off. The only problem is that even a small love tap will destroy the object regardless of the impact velocity setting.
                    Spline-Enabled Fence Pack - "Great pack, huge time-saver, top quality and enough variety to really make the assets unique." -Dark Acre Jack
                    Destructible Road Signs - "Seriously awesome. Single blueprint for pretty much all the road signs you'll ever need." -thankstipscom
                    Zipline/Teleporter/JumpPad - "This is a very flexible system for any project, and really simple to implement." -lunyBunny
                    Wooden Storage Pack - "Very good high quality assets and well worth it." -Deathweave
                    Digital Portfolio

                    Comment


                    • #40
                      Hi Osok,

                      Custom Impact Resistance is bugged at the moment with 4.7 and previous version. This was fixed recently and will be included in 4.8 once that releases.

                      This is correct that it will do this when impacting.

                      With a low value Custom Impact Resistance this will resolve that issue.

                      Here is a demonstration video with it set. The first is 4.7 and the second part of the video is 4.8 with CIR working.

                      https://www.dropbox.com/s/khw55w0lbx...tance.mp4?dl=0

                      The original purpose of the FBX Chunk post was to demonstrate the mesh switch rather than focusing on impact velocity or other settings. Once the CIR has been publicly released and fixed I'll update the video for a better demonstration.


                      (comments referencing this post in this thread: https://forums.unrealengine.com/show...l=1#post207604)
                      Tim Hobson | Learning Resources | Epic Games
                      UE4 Documentation
                      Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                      _____________________________________________
                      Follow me on Twitter @TimHobsonUE4 | My Personal Website
                      Photons Be Free: Mini-Tutorials and other Curiosities

                      Comment


                      • #41
                        Originally posted by Tim Hobson View Post
                        Hi Osok,
                        Custom Impact Resistance is bugged at the moment with 4.7 and previous version. This was fixed recently and will be included in 4.8 once that releases.
                        I am happy to hear it is a bug and not something I was doing incorrectly. I look forward to the fix. Thank you.
                        Spline-Enabled Fence Pack - "Great pack, huge time-saver, top quality and enough variety to really make the assets unique." -Dark Acre Jack
                        Destructible Road Signs - "Seriously awesome. Single blueprint for pretty much all the road signs you'll ever need." -thankstipscom
                        Zipline/Teleporter/JumpPad - "This is a very flexible system for any project, and really simple to implement." -lunyBunny
                        Wooden Storage Pack - "Very good high quality assets and well worth it." -Deathweave
                        Digital Portfolio

                        Comment


                        • #42
                          Destructible How-To #4: FBX Chunks Continued - Barrel and Fence

                          Coming Shortly.
                          Last edited by Tim Hobson; 04-20-2015, 03:14 PM.
                          Tim Hobson | Learning Resources | Epic Games
                          UE4 Documentation
                          Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                          _____________________________________________
                          Follow me on Twitter @TimHobsonUE4 | My Personal Website
                          Photons Be Free: Mini-Tutorials and other Curiosities

                          Comment


                          • #43
                            Destructible How-To #5: Using "Do Not Fracture" to make a hole in the wall

                            Overview:

                            The Flag for Do Not Fracture allows assigned chunks to not be break away from the destructible even if enough force has been applied to do so. This can be useful for making sure parts of the destructible never break or if you want to have a simple hole that can be blown away in a wall for your character to go through.


                            Basic Destructible Settings:

                            Click image for larger version

Name:	Basic_Settings.png
Views:	1
Size:	28.7 KB
ID:	1074794

                            For this part, the settings focused on are Impact Damage and Support Depth.

                            It is not required to use Impact Damage, but can be if you want a impact from any physical objects to impart damage on the destructible.

                            Support Depth on the other hand is required to make this work.


                            Chunk Parameters: Do Not Fracture

                            Depth 0: no fracture applied:
                            Click image for larger version

Name:	Depth 0.png
Views:	1
Size:	116.9 KB
ID:	1074795

                            Depth 1: slightly exploded view of the fracture chunks:
                            Click image for larger version

Name:	Depth_1.png
Views:	1
Size:	205.5 KB
ID:	1074796


                            In order to assign the chunks we want to NOT be fracture we need to select them with the mouse. Hold CTRL and LMB to select chunk that you want to assign a flag in Chunk Parameters. When selected you will see a blue bounds box around the chunk.

                            Once you have a selected the chunks you want to assign a flag, go to the Chunk Parameters Tab and select Do Not Fracture.

                            That's it! You have now set up a basic wall that can have chunks that cannot be fractured.

                            Final Results

                            Attached Files
                            Last edited by Tim Hobson; 04-20-2015, 04:44 PM.
                            Tim Hobson | Learning Resources | Epic Games
                            UE4 Documentation
                            Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                            _____________________________________________
                            Follow me on Twitter @TimHobsonUE4 | My Personal Website
                            Photons Be Free: Mini-Tutorials and other Curiosities

                            Comment


                            • #44
                              Destructible How-To #6: Using "Impact Resistance" for better damage effects (ie. glass vs. concrete wall)

                              THIS WILL ONLY WORK WITH 4.8 OR LATER.

                              Overview:

                              This will cover a basic setup for using Custom Impact Resistance to make a destructible that can provide a low resistance to impact like Glass or one that provides more resistance to an impact, like a Concrete Wall.


                              Basic setup for LOW resistance

                              Click image for larger version

Name:	CustomImpactResistance_Low.png
Views:	1
Size:	34.4 KB
ID:	1074799

                              for the basic setup enable Custom Impact Resistance and set a low value. This can depend on some of the Impact Damage and Damage Spread settings as well, but for a basic example this will get you started.

                              Demonstration of LOW resistance




                              Basic Setup for HIGH resistance

                              Click image for larger version

Name:	CustomImpactResistance_High.png
Views:	1
Size:	21.3 KB
ID:	1074801

                              Using High Resistance, the Impact Damage and Damage Spread play bigger roles in the look and feel of your destructible.

                              To find a good starting point for the High resistance, try setting a large value and working your way down to a lower one until you get something that looks OK.

                              At that point, Adjusting the Impact Damage and the Damage Spread can help refine this even further.

                              Demonstration of HIGH resistance

                              Last edited by Tim Hobson; 04-20-2015, 05:21 PM.
                              Tim Hobson | Learning Resources | Epic Games
                              UE4 Documentation
                              Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                              _____________________________________________
                              Follow me on Twitter @TimHobsonUE4 | My Personal Website
                              Photons Be Free: Mini-Tutorials and other Curiosities

                              Comment


                              • #45
                                Other How-To #5: Custom Collision Beginning to End

                                Other How-To #5: Custom Collision Demonstration - Beginning to End


                                Overview:

                                This will be a demonstration of the concepts put forth in the documentation for FBX Static Mesh Pipeline.

                                Documentation: https://docs.unrealengine.com/latest...html#collision

                                Step 1: Collision Shapes

                                There are three types of custom collision that can be used when creating your own custom collision.

                                Click image for larger version

Name:	Types of Collision.png
Views:	1
Size:	216.1 KB
ID:	1074976

                                When making convex collision shapes it’s best to avoid shapes that are like this:



                                Click image for larger version

Name:	Types of Collision_No1.png
Views:	1
Size:	66.8 KB
ID:	1074978]

                                A mesh that is too accurate like this will not be considered as a single convex hull. See Step 3 for examples of why this will not work well as a convex hull.


                                Step 2: Naming

                                Box = UBX_[MeshName]_XX

                                Sphere = USP_[MeshName]_XX

                                Convex = UCX_[MeshName]_XX

                                When creating your custom collision mesh it is important that the mesh name of the collision mesh match the mesh you’re creating for collision. If you’re going to use more than one collision mesh you will simply need to add numbers to each collision mesh. If you're using a single collision hull, there is no need to use "_XX" after the mesh name.

                                For example:

                                Mesh name: Statue

                                I want to add three collision spheres to my mesh.

                                I create the three spheres and name each one.

                                USP_Statue_00, USP_Statue_01, and USP_Statue_02

                                GIF demonstration
                                http://imgur.com/gallery/YuVBZMx


                                Step 3: Import Options

                                Click image for larger version

Name:	Import Options.png
Views:	1
Size:	68.9 KB
ID:	1074981

                                There are two options here that we need to be aware of when importing custom collision.

                                Auto Generate Collision: If there is no collision hulls detected with your mesh using the prefix UCX, USP, or UBX the editor will generate basic collision on import. If these prefixes are detected this option will be ignored on import.

                                One Convex Hull Per UCX: This option when disabled will import more accurate collision, but it will generate multiple convex hulls rather than a single convex hull. See the example below with this disabled. This can sometimes produce errors with collision hulls that are generated though.
                                __________________________________________________________________________________________________________________________________________________________________________________________________________________


                                Box Collision – UBX

                                Click image for larger version

Name:	UBX_BoxCollisionUE4.png
Views:	1
Size:	163.7 KB
ID:	1074983

                                __________________________________________________________________________________________________________________________________________________________________________________________________________________


                                Sphere Collision – USP

                                Click image for larger version

Name:	USP_SphereCollisionUE4.png
Views:	1
Size:	162.7 KB
ID:	1074984

                                __________________________________________________________________________________________________________________________________________________________________________________________________________________


                                Convex Collision – UCX

                                Click image for larger version

Name:	UCX_ConvexCollisionUE4.png
Views:	1
Size:	171.9 KB
ID:	1074985

                                __________________________________________________________________________________________________________________________________________________________________________________________________________________


                                Convex Collision that is too accurate

                                Accurate Collision Mesh

                                Click image for larger version

Name:	accurateCollisionMesh.png
Views:	1
Size:	30.9 KB
ID:	1074986


                                Results with Import options One Convex Hull Per UCX: Enabled

                                Click image for larger version

Name:	Convex_1Hull_Enabled.png
Views:	1
Size:	353.1 KB
ID:	1074987

                                In this image you will see that with the option enabled in the import options the collision that is imported does not look like the more accurate collision mesh we have. This is because that would not be able to make a single convex collision hull.

                                Think about this like a barrel with the inside hollowed out. A single convex collision hull would not be able to provide accurate collision for the interior of the mesh. The collision would simply be a cylinder that is around the barrel as a single collision hull.
                                __________________________________________________________________________________________________________________________________________________________________________________________________________________


                                Results with Import options One Convex Hull Per UCX: Disabled

                                Click image for larger version

Name:	Convex_1Hull_Disabled.png
Views:	1
Size:	375.9 KB
ID:	1074988

                                Now that we've disabled the option for one convex hull we can see that our mesh has more accurate collision that represents the original mesh above. This is done by creating multiple collision hulls from the more accurate collision mesh we tried to import.

                                Click image for larger version

Name:	Convex_1Hull_Enabled_IndividualHulls.png
Views:	1
Size:	392.0 KB
ID:	1074989

                                As you can see in this image with some of the collision hulls pulled off to the side we now have multiple hulls that comprise our collision for the mesh. If you look at the indicated of primitives on the top left of the viewport in the Static Mesh Editor you will see that there is a number referencing how many collision hulls were created.

                                This is not necessarily the best option and it's always better to use lower collision primitive counts where possible.

                                ____________________________________________________________________________________________________________________________________________________________________________________________________________

                                BONUS: Creating Collision in UE4 Static Mesh Editor with AUTO-CONVEX Collision

                                In the Static Mesh Editor go to Menu > Collision > Auto Convex Collision

                                This will open this tab:

                                Click image for larger version

Name:	AutoConvexCollisionTab.png
Views:	1
Size:	22.3 KB
ID:	1074993

                                There are two options here.

                                Accuracy: This will determine how accurate the collision hulls that are generated are to the mesh.

                                Max Hull Verts: This will determine the number of vertices that should be used for each collision hull that is generated.


                                Examples using Auto Convex Collision

                                Accuracy: 0.5
                                Max Hull Verts: 16
                                Num of Hulls: 3

                                Click image for larger version

Name:	AutoCollision1.png
Views:	1
Size:	131.4 KB
ID:	1074996
                                _____________________________________________________________

                                Accuracy: 0.75
                                Max Hull Verts: 16
                                Num of Hulls: 5

                                Click image for larger version

Name:	AutoCollision2.png
Views:	1
Size:	127.8 KB
ID:	1074997

                                _____________________________________________________________

                                Accuracy: 1.0
                                Max Hull Verts: 32
                                Num of Hulls: 24

                                Click image for larger version

Name:	AutoCollision3.png
Views:	1
Size:	132.8 KB
ID:	1074998

                                _____________________________________________________________

                                Auto Convex is getting a good update in 4.8 that will make it much more accurate when generating collision via this method.

                                As you can also see from the number of collision hulls generated, even making out the auto-convex collision settings gives us much less than the 162 by generating our own collision that does not use a single convex hull.

                                The best choice here is to find a balance for what works best for your collision while retaining a more true collision response to your mesh. For objects that need it this would be a good way to get more accurate collision. For objects that don't need accurate collision I would suggest using the box or sphere primitives where needed.
                                Attached Files
                                Tim Hobson | Learning Resources | Epic Games
                                UE4 Documentation
                                Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                                _____________________________________________
                                Follow me on Twitter @TimHobsonUE4 | My Personal Website
                                Photons Be Free: Mini-Tutorials and other Curiosities

                                Comment

                                Working...
                                X