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"

Console ShowFlags and Detour Crowd Debugging

Hello Everyone. I'm reposting this from the forum hoping someone will have an answer :) .

While working with the detour crowd system I decided to make crowd actors debug drawing toggles accessible via the console to be able to easily enable and disable it in-game without an engine recompile. To accomplish this I decided to use the ShowFlags console commands like Navigation and DebugAI do (with a ShowFlag.DebugDetourCrowd command). While reading through the engine code I noticed that the show flags declared via the SHOWFLAG* macros can be set :

1) Via the show [Flag] command, this is handled by the current view Exec and sets the view's EngineShowFlags.

 int32 debugShowFlagIndex = FEngineShowFlags::FindIndexByName(TEXT("DebugDetourCrowd"));
 bool bEnableDebugDraw = GetWorld()->GetGameViewport()->EngineShowFlags.GetSingleFlag(debugShowFlagIndex);

2) Via the ShowFlags.[Flag] [1/0] command. This does not set the current view's EngineShowFlags (as I initially thought it would) but only a console variable with the ShowFlag name.

 int32 showFlagDetour = CrowdDebugDrawing::ShowFlagDetourCrowd->GetInt();
 bool bEnableDebugDraw = (showFlagDetour == 1);

In my current implementation I'm checking both and enabling debug if one or both of them are enabled :

 int32 debugShowFlagIndex = FEngineShowFlags::FindIndexByName(TEXT("DebugDetourCrowd"));
 bool bEnableDebugDraw = GetWorld()->GetGameViewport()->EngineShowFlags.GetSingleFlag(debugShowFlagIndex) || (showFlagDetour == 1);

Is this a good implementation or should I do something different ? Why are there two different commands with two different code paths to do what seems to be the same thing ? Am I missing something ? Is using the ShowFlags for crowd debugging a good idea (I'd like to make this a pull request) ?

Product Version: UE 4.9
more ▼

asked Nov 12 '15 at 10:58 AM in C++ Programming

avatar image

1 1 1

(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