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"

Tips for organize c++ code files?

Hi, i found that you can not create folders on Unreal Editor's contents viewer like blueprint.

and if i try to organize my codes on Visual Studio by just create filter on solution explorer, it just get reset at some point.

So i want to ask some advanced unreal users that how they organize code files. so that i can organize my code files :)

Product Version: UE 4.21
Tags:
more ▼

asked Dec 14 '18 at 03:55 PM in C++ Programming

avatar image

hhm1573
7 1 1 3

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

2 answers: sort voted first

C++ classes in Content Browser is just for blueprint only users, more naturally you should use Class viewer in Window->Devlopment Tools->Class Viewer, it hsows class in inherence tree, blueprints included. You cna not change organization in content browser, because C++ classes are just virtual assets created on runtime, while other assets are uassets files which can be moved.

VS project is not needed for compilation, it only exist for you to open end edit files, it get regenerated if you right click uproject file and generate them, also class wizard in editor will trigger regeneration of project files. With regeneration all configuration in project gets overwritten back to default settings, thats why it resets.

There only 2 ways to organize cod filese:

  1. Stack them up in Source and module folder like default it does

  2. Make Public and Private folder inside it, Public should have header files that will be exposed outside of module, private should have all cpp files and header files to classes not exposed to outside of the module

more ▼

answered Dec 15 '18 at 01:13 AM

avatar image

Shadowriver
33.3k 915 164 1088

avatar image hhm1573 Dec 15 '18 at 09:39 AM

thanks for detailed kind answer :)

and i am sorry but i can't get what 'stack them up in source and modue folder like default it does' mean.

you mean make folder inside Source folder like 'make public and private folder inside' and put files in it? or is there any way to stack up files?

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

Simply close everything, go to file explorer, make your sub folders and move files arround.

 Here some exemple of folders i use
 
 Dynamics
   traps
   logic
   gameplay
 Units
   player
   enemies
 UI
  Menus
  HUD
 Wolrd
  Special(thing that extend some pluggings)
 User (profiles/option)
 

Then right click on your upluggin file and select regenerate vs files Open vs solution and try to rebuild => it will fail Fix all includes as you moved files ( thats why there is no "drag &drop" in UE/vs )

Once it build, your are set :-)

more ▼

answered Dec 15 '18 at 11:08 AM

avatar image

Firefly74
1.3k 11 15 29

(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