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"

what do I need to know if I want to change the definition of FVector in source code?

Due to some reason, I want to have a EXTREMELY huge map in my game. According to the docs and the source code, the map should be unlimited as long as the world bounds check is disabled. However, I happened to find out that any object could not go further than 16777216.0 on any axis. I assume the problem is due to float type, because the precision of float goes beyond 1.0 at exactly 16777216.0 (the precision of float becomes 2.0 when it is more than this value). And in Unreal Engine 4, world position is described using FVector, which is defined by three float.

I want to modify the source code to define FVector using three double, and I want to know what do I have to take care of, or is there anything I should be aware of before making this modification?

Or, is there any alternative solution? My game is basically a multiplayer game and is it possible for the session to hold multiple maps at the same time, and players are allowed to jump through those maps freely?

Product Version: UE 4.10
more ▼

asked Feb 28 '16 at 04:27 PM in C++ Programming

avatar image

1 1

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

1 answer: sort voted first

First just try, float operates same way as double so it should build, problem is the code that operates vector with float types, they will be still limited, that might be hard to change and you would need to change that i case by case. There possibility that this might break RHI (rendering)

Float is scalable type and GPU renders in scalable fasion (size does not matter propotions do), you might try to lose precision by doing this and might not work right with everything, but this might most easiest and simplest solution: You might consider scale down all size and position varables, in other words shrink everything. Insted 1uu=1cm think 1uu=2cm and by that you will make world 4 times bigger.But again i don't know how this will work with other stuff, but it should be less broken then trying to implement double.

You might also consider level streaming with diffrent level offsetting so you move world around the player, you can always move player if needed, to keep him near center. You need to think out of the box.

Maybe UE4 is not good for what you trying to do, engine are not just graphics, in fact i don't think it's there main feature. Each of engine has it cons and pros, engines are better in one things worse in other.

more ▼

answered Feb 28 '16 at 05:10 PM

avatar image

37.2k 936 172 1116

avatar image Phenyl_Sphinx Feb 28 '16 at 05:33 PM

Thanks for the super-fast answer. In fact, I thought about scaling everything down before, but then I'll have to scale them into very very small and when I spawn such a small actor right in front of players' cameras with a scaling of less than 0.01, it only shows up on the server but not on the client. I am certain the replicates is set and it is relevant to the client. Any clue of how it happens?

(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