UE4 With Casey - Construction Script & Instanced Meshes

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • Today we look at how we can use the construction script to speed up our level building. Also, we take a dive into how instanced static meshes can increase performance.

ความคิดเห็น • 31

  • @joshuakozlowski1106
    @joshuakozlowski1106 6 ปีที่แล้ว +2

    Whoa, I had no idea that changes in the constructor propagated in the editor before run time. How did a 50+ hour unreal course forget to mention this. Awesome video as always Casey!

  • @AshishBorakhadikar1003
    @AshishBorakhadikar1003 6 ปีที่แล้ว +2

    Whoa that's some really good info there.
    Sad to see less Subscriber for such a great channel.
    You are doing Good work Casey. I'm learning a lot about blueprints and construction script all thanks to you.

  • @MiniGameStudio
    @MiniGameStudio 5 ปีที่แล้ว +4

    Thank you. This helped me alot to understand the construction scripts usage.

  • @morrices
    @morrices หลายเดือนก่อน

    Thanks for the video.
    Amazing way to present it! =D

  • @TheSwanDragons
    @TheSwanDragons 2 ปีที่แล้ว

    Thank you! This was so much better than just creating copies of a static mesh object ^.^

  • @kv7164
    @kv7164 5 ปีที่แล้ว +1

    They way i understand construction scripts is that its the actual spawn / construction of an object based on that class, like a Weapon class could have very different weapons spawned based on the variables that are given to the construction script.

    • @ue4withcasey391
      @ue4withcasey391  5 ปีที่แล้ว

      In reality the construction script is just a tool. It has no defined purpose and we can use it for whatever we need.
      docs.unrealengine.com/portals/0/images/Programming/UnrealArchitecture/Actors/ActorLifecycle/ActorLifeCycle1.png
      With this image, you can see that the construction script and begin play fill the same need of happening before tick and any gameplay interaction. However, construction script runs before component initialization. So if you aren't using the construction script to manipulate components, you are better off putting your code on begin play to manipulate variables.

  • @R-SXX
    @R-SXX ปีที่แล้ว

    I wonder if you could use the CS for stuff like vehicle customization? If I have 3 different rims, could I theoretically use the CS to change the bone of a skeletal mesh?

  • @nightwalkerj
    @nightwalkerj 4 ปีที่แล้ว

    Thanks for the tutorial but my stats doesnt list the static mesh calls. Only the mesh draw calls as a whole. How do you see the static mesh/ individual mesh draw calls?

  • @prashantshukla6814
    @prashantshukla6814 4 ปีที่แล้ว +1

    Great tutorial really liked it, except one thing.............ummmmmm....i can't remember :D....It was awesome

  • @Slouworker
    @Slouworker 5 ปีที่แล้ว +1

    How would you make it so that the fence mesh would also stretch up to a certain point before creating another piece?

    • @ue4withcasey391
      @ue4withcasey391  5 ปีที่แล้ว +1

      If you are doing a bunch with repeatable meshes, especially ones that can potentially curve, I would recommend looking into spline meshes. If I find some time I can make a video on that possibly today or tomorrow

  • @Paul-hw7kc
    @Paul-hw7kc 4 ปีที่แล้ว

    How would you use this to create procedural foliage at run time?

  • @ty_teynium
    @ty_teynium 5 ปีที่แล้ว +1

    There should be a tool in window tab or edit tab called CPU Profiler. It shows the stats of the engine's performance on your system so measures how much it's affected. The memory increases. I once followed someone tutorial for buildings and it looks nice but the memory just for one floor was up to 500mb so adding just two or three floors would be 2 to 3 gigs. Now that's just one building though, so if I wanted to make a city with you know multiple buildings, well my computer would jump off a cliff. My point is the Profiler allows you to see how costly on performance this technique is.

    • @ue4withcasey391
      @ue4withcasey391  5 ปีที่แล้ว

      I don't believe the construction script would save what it is doing in memory. Aka there wouldn't be much of a difference in the end result between placing assets and spawning them at run time. That sounds like a separate issue is happening. However, I do agree that building an entire level from construction script isn't smart. However, there are very clear applications of it that can save us time from repeating the same action over and over when building levels.

  • @adamodimattia
    @adamodimattia 3 ปีที่แล้ว

    But can you move them once they are instanced?

  • @jimbotht1091
    @jimbotht1091 4 ปีที่แล้ว

    thank for your video, it's possible to have multiple texture for a mesh instance (sorry for my english google traduction)

  • @zest2heed
    @zest2heed 2 ปีที่แล้ว

    Thanks , very useful tutorial,
    How to add a assembly components/parts to a instance?

  • @PardCode
    @PardCode 6 ปีที่แล้ว +1

    Really good job, mate! As always!

  • @mijonmohammed7463
    @mijonmohammed7463 ปีที่แล้ว

    He talk like Jidion lmaoo

  • @bruceslasher6374
    @bruceslasher6374 3 ปีที่แล้ว

    Thanks so much Bro

  • @TheAxebeard
    @TheAxebeard 5 ปีที่แล้ว +1

    I'm starting over on an old game project I abandoned which involved a procedurally generated city/world. I see how using ISM would be great for roads (wish I knew that before), but I suppose it could also be used to spawn a row of buildings, and mix and match the individual meshes. Gonna have to mess with this soon :D

    • @ue4withcasey391
      @ue4withcasey391  5 ปีที่แล้ว

      Yes it definitely can be. There are drawbacks to ISM though. They behave as if they are all the same mesh in a lot of ways. That means if you can see one of the instances on your screen (one piece of road or building) then your GPU is actually going to draw every instance as if they were all on your screen. So you have to use the ISM with a purpose. This same method can be used to spawn meshes without instancing, however.

    • @TheAxebeard
      @TheAxebeard 5 ปีที่แล้ว

      @@ue4withcasey391 I'm not sure if this method would be best for this, but I'm currently using the Construction Script to procedurally generate map content. The only problem is, it takes forever when the game starts for the stuff to generate. Do you know how I'd be able to randomize the content in the editor, but then lock it into place so it's the same in-game?

    • @ue4withcasey391
      @ue4withcasey391  5 ปีที่แล้ว

      I would have to do a bunch of testing, but you may be able to use "blutility" or run in editor events to do spawning. In theory (I'm not sure if it would work), but I would probably use construction script to randomly generate things and use seeding to be able to recreate the randomness, and then save in arrays all the objects I'm spawning and where. Then I would take that data and throw it into the run in editor events to do the permanent spawning and remove the construction script. I'm guessing there's a few blocks by UE4 in that theory, but I'm guessing with some manipulation in C++ I could get around it. But this is only one of several solutions for the hitch on load.
      Other answers could be that spawning the entire city at start is a mistake. You may only need to spawn sections as you go. Almost like level instancing your city into pieces. Or maybe moving the construction over to c++ if that makes it more efficient.
      Probably doing research on the converting from construction script to permanence would yield some kind of answer that someone has used. Maybe someone has made a plugin for this.

  • @Restart-Gaming
    @Restart-Gaming 3 ปีที่แล้ว

    Great but only works on very flat surface this setup will not work on bumpy or mountain terrain

  • @kellykryspin
    @kellykryspin 3 ปีที่แล้ว

    is there a way to make instance static meshes that i can move around? Like if I wanted to place a bunch of the same boxes around in a room but wanted them to be instances???

  • @louisec6431
    @louisec6431 3 ปีที่แล้ว

    Thank you Casey, your tutorial is very clear as I can easily catch up!

  • @EyefyourGf
    @EyefyourGf 3 ปีที่แล้ว

    You are awesome,just know that!

  • @quetepetinbenfort
    @quetepetinbenfort 3 ปีที่แล้ว

    Thanks a lot!

  • @USAIsrUKEUVngrdBLRckOccupiedUA
    @USAIsrUKEUVngrdBLRckOccupiedUA 5 ปีที่แล้ว +1

    It is really helpful! Thank you!