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"

How do you replicate random values?

Hello,

I have an object in my game which spawns, and sets its own randomly timed fuse by using a Random Float in Range node.

The client and server both spawn an instance of this actor, and each actor ends up choosing a different random value. This causes a desync in events.

What is a good method for generating a random value which is the same for everyone playing?

Thanks

Product Version: Not Selected
Tags:
more ▼

asked Aug 22 '14 at 10:37 PM in Blueprint Scripting

avatar image

nopunintendo
405 11 18 36

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Random Float in Range from Stream should do the job i think.

more ▼

answered Aug 22 '14 at 10:41 PM

avatar image

Jacky
16.8k 671 167 676

avatar image nopunintendo Aug 22 '14 at 10:50 PM

Brilliant! Worked on the first try. I can't believe I overlooked this, it was in one of the blueprint quickshot tutorial videos I watched.

Thanks!

avatar image Samson F. Sep 13 '15 at 07:07 PM

can you post that video?

avatar image nopunintendo Sep 15 '15 at 11:31 AM

It's been awhile so I don't know exactly which video. There's not a ton of quickshots, one is probably called random numbers or something. I'm not home currently but if you search the unreal engine YouTube channel I'm sure you'll find it.

avatar image Rockseller Jan 06 '16 at 04:10 AM

Thanks, I'm going to use this for a game I plan to develop that will have the server and client synced (each instance will have the exact same simulation and just replicate the commands)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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