x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Event tick

Hello

If Event Tick is being called every frame, does that mean that if i have better pc and have some high fps, my event tick will be called more often than someones who have low fps rate?

For example:

Every time event tick is firing i get healed for 20 hp. and it passed 5 frame in 1 second... that means 100hp healed. Now, someone has bad pc and he got 2 frames in 1 second, and he got healed for 40 hp.

In online gameing this is bad.

So, if i have online game, does that mean i should have universal LAN or INTERNET frame-rate, or some kind of universal event tick for every player so there are no such "bugs" lets call them like that, that someone gets healed more becose he got better pc and his fps?

Is my assumption right, and if it is how would that be fixed in ue? What should i use instead of event tick? If not, please explain me where i make mistakes...

Product Version: UE 4.21
Tags:
more ▼

asked Nov 21 '18 at 06:50 PM in Blueprint Scripting

avatar image

abstractSubject
5 1 3

avatar image Tuerer Nov 21 '18 at 07:19 PM

That's right, that's how Ticks work.
For such things as healing etc. you can use timers, for example. They are based on time, not frame rate.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Yes, tick is executed on every frame, more frames = more ticks, so every change you do there will be dependent on number of frames rendered in specific time spans (some games does that, most prime UE4 example is Street Fighter V and many other fighting games which depends on frame precise input and they slow down on slower FPS and tries to keep consistent 60FPS). And this is why Delta Time (also know as Delta Secounds) argument in tick event exists, which is estimated time that passed between frames, allowing you to scale changes in tick to time that passed, like this:

 X = X + (Y*DeltaTime)

This will change Y variable as "change per sec" value as DeltaTime having time span between ticks in secouds multiplying any value to it will scale it to time passed. so if Y will be 20, X will increase 20 every second.

Maximum delta time in UE4 is 400ms (if im not mistaken), after that game state will freeze as next tick will always get 400ms delta time. UE4 also use delta time for any time flow control altering systems, like time dilation, UE4 will fake actors that there less time has passed between ticks by decreasing delta time while in reality it is executed in normal pace and as result there ticking code that use delta time will slow down the actor. Engine also pauses actors by simply not ticking them and actors freeze.

As Tuerer mentioned there also timers, those are also dependent on time alteration but there logic is separate from tick management code.

more ▼

answered Nov 21 '18 at 11:16 PM

avatar image

Shadowriver
34.5k 917 164 1094

avatar image abstractSubject Nov 22 '18 at 02:23 PM

Okay..I will accept that.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question