Good video, also, something a lot of people miss is that you can set the tick interval of an actor, so instead of using a event timer that ticks every second or few seconds, you can just set the actor's tick interval (Found in class defaults) to what you need. I have a foliage/resource management actor, when I chop down a tree it gets added to an array, and then on the event tick I have a function that respawns the trees in increments, but it only ticks every few minutes. Obviously this isn't viable for every actor, but it is a good use case.
@thegamedevcave
Ай бұрын
love that extra bit of added info! didn't think about that but that's a really good point to add!!
@RandomGuyyy
Ай бұрын
"Premature optimisation is The Devil." "Make it work first, then make it Good." "Get it done and let the protestors howl!" Just three of the many quotes I claim to live by.
@thegamedevcave
Ай бұрын
100% true, although the quote on premature optimisation also is often misused as an excuse to write bad code that you already at the time know will need to be replaced. Don’t worry about getting all the fine points optimized but also, if you know some code you’re writing is bad, don’t write it like that in the first place. The more experience a programmer has though, the easier it is for them to see this while writing the initial code. We all have to make mistakes to learn not to do certain things in certain ways :)
@rk_iv
Ай бұрын
Minor correction: most character movement is not simulated by chaos physics, including the launch node. Chaos physics has its own copy of the world that it simulates on a separate thread, but character movement is a completely separate update through the movement component which all happens on the game thread.
@thegamedevcave
Ай бұрын
Thanks for the correction!!
@RC-1290
Ай бұрын
I entirely agree with this video. If there wasn't such a big overhead of a bunch of actors having an event tick enabled at all (compared to for example Unity's Update function), it may not have been as standard a piece of advice. In some cases it can just be faster to have one actor's event tick call functions in other actors.
@prodev4012
Ай бұрын
How much better are behavior trees compared to just using tick for AI? Doing all my npc stuff in bp instead of bt's is where I require tick the most because behavior trees are so hard to work with
@thegamedevcave
Ай бұрын
Behaviour trees don’t really improve preformance, it’s more a matter of it being a form of coding that makes more sense for a decision making ai. Once you get used to them they are way nicer to work with to build ai than coding everything in blueprint, especially when your characters start having to do more and make descisions beyond 1 or 2 tasks
@prodev4012
Ай бұрын
@@thegamedevcave Didn't know that, thanks! I know there is a new state tree feature for ai, have you used that much yet or plan to make a video on it?
@thegamedevcave
Ай бұрын
@@prodev4012 I do have a video planned for it! At the moment state trees seem to lack debugging tools which makes it hard to recommend using them but they are really promising, I like the idea of them!
@deyama2012
Ай бұрын
State trees have a log, telling you which branches, transitions were ticked/triggered for every frame since startup during this and even previous launches, it highlights current node and tasks' BPs pause on breakpoints as any other BP code would. What else would one need?
@thegamedevcave
Ай бұрын
@@deyama2012 compared to behavior trees where you can see key values and active tasks in realtime, that's still slightly lacking in my opinion. behavior trees have very easy to see feedback on what is happening in them. I dont think having a log is a full substitute for that. It's enough to make it workable though, but not enough to make it my go-to choice for AI at the moment
@GreyManFaustus
Ай бұрын
Now we're getting daring!
@thegamedevcave
Ай бұрын
waiting for the angry mob to storm my house any moment now...
@RandoYoutubeAccount
Ай бұрын
Kinda unrelated, but do you use VS Code as your main IDE? I'd like to figure out the right way to set it up for a UE environment if so! I tried last year while following some guides but I couldn't figure out the intellisense issues.
@thegamedevcave
Ай бұрын
I personally use rider, but I used VSC for a while too
@jameshughes3014
Ай бұрын
is there a more efficient way to do things periodically - say every tenth of a second, other than using timers or branch statements on event tick?
@thegamedevcave
Ай бұрын
If you need to do something every X time, using a looping timer is the best way to do it usually
@sitraash
19 күн бұрын
I wish good luck to those who say "don't use tick" to try to make AI without it.
@thegamedevcave
19 күн бұрын
behavior trees, but that effectively also runs every frame (for the most part) so yeah... but if you're hard codign your AI in your controller or character, still stuffing everything into tick isn't great. lots of stuff only needs to run when it needs to run. sometimes though, you do need to update a value constantly which is where you can use tick, and of course you should ( that's why i made this video :) )
@deyama2012
Ай бұрын
As others have mentioned there is a field to change tick interval and if needed you can put some logic into it's own actor component and set it's tick interval (which is separate from the actor's tick) to a bigger value. Another useful thing might be to disable actor's or actor component's tick altogether by default or on begin play, then enable it from within some local function and then disable it again when the work is done. I use it for liquid wobble logic, which I then stop when it's velocity is close to zero
@ehabelbadry2313
Ай бұрын
whatever you say Master ✨✨
@MaviLeb
Ай бұрын
Just use event tick and other features as much as you need them. I think the first priority should be that the code is well structured and easy to understand. If for some reason the profiler shows problems with performance at a later time, then restructure that part. And it probably won't be the part of the code you initially thought would be the bottleneck, anyway.
@thegamedevcave
Ай бұрын
the general advice of " dont throw everything into event tick because it is easy that way" still stands. Fundamentally, the idea of functions calling other functions , that call functions (and we can keep on going like that) is important to how actual programming works. But, avoiding tick like the plague because "event tick is bad" is the result of that "avoid event tick" advice, i just wanted to make this video to add a little nuance back into that for the people who are too stuck into avoiding event tick. But to be clear, you should feel free to use it, not abuse it.
@MaviLeb
Ай бұрын
I do agree, that is why I have written that the code should be well-structured. If you put everything in event tick, that would be the opposite of well-structured code. If anyone puts everything in the tick event, he or she will find out, that it won't take long until the code gets hard to read, understand and possibly impossible to fix bugs without restructuring significant parts of it. However, as a learning experience it is worth a lot. We learn most from our mistakes, after all.
@ericfieldman
Ай бұрын
I couldn't figure out how to remove mapping contexts and UI blueprints and apparently it's because I added them on the "triggered" triggers and not the "started" trigger so it was adding 1 per frame and then deleting one of very many. So I learned the hard way it's probably not that terrible to do stuff per frame
@thegamedevcave
Ай бұрын
to be fair, it's really not clear what "triggered" does, it should really be called "input tick" or something like that XD
@ericfieldman
Ай бұрын
@@thegamedevcave yeah, and it also shows up first, cuing me to think the implication is the one tick. But I figured that out after a long time and it served as a lesson that if I give up the idealistic notion that I'll put down 20 nodes that'll do exactly what I think, or ditch the pressure to be so amazing that that works all the time, and instead clarify the values of everything at the earliest steps onward, I'll be better. I'm finally starting to get stuff done that way
@ViralUnrealEngine
Ай бұрын
Bro for niagara series can you make: inizialiazion mesh reproduction and mesh locatio (for fire on character)
Пікірлер: 30