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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

modified TArray

Hello everyone,

I want to build a modified version of the TArray. I know that I only need a maximum of 250 objects per TArray which i have got 1.000 per container. I am accessing them like this:

 uint8 index[40][40][40];
 TArray<object> data[10][10][10];
 object& GetData(int8 x, int8 y, int8 z)
     int8 ix = floor(x / 4);
     int8 iy = floor(y / 4);
     int8 iz = floor(z / 4);

  return data[ix][iy][iz][index[x][y][z]];
  1. I want my short TArrays to have arrayNum and arrayMax changed to uint8 type (I don't need 4 bytes per value). This is the easy part. But do I have to pay attention to something else if I do so? Does it affect memory allocation in some way or will the unsigned type cause problems?

  2. I need a uint8-TArray value in the uint8-TArray, to store indices of "removed" objects or better the indices of objects that can bo overwritten. If I remove them completely out of memory, I would habe to change the indices in the static array which is no fun.

  3. To prevent an endless loop of uint8-TArrays creating itself again and again I will need one vesion with and one without uint8-TArray in it. The one with contains the one without.

I do not want to know if it makes sense but how it's done. I am struggling most with line 24 to 262 of array.h. I am not getting quiet through this and wondering if I can remove this in my modified copy and include "array.h" instead.

Thanks for your help

Product Version: UE 4.19
more ▼

asked Jul 27 '18 at 11:25 AM in C++ Programming

avatar image

8 1 2 3

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

0 answers: sort voted first
Be the first one to answer this question
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