Jump to content
The Dark Mod Forums

Connection to TDM with automation


Recommended Posts

As for point 1, not sure how that looks like from a technical perspective, but you can already launch the .exe with arguments that will specify stuff like project and map name (something like +set fs_game projectName map mapName). So launching a map like this should be easy, then goes establishing the DR-TDM connection I guess? Otherwise, users will need some clear instructions like: Load a map in DR, run TDM and load your map, click the DR-TDM Connection button.

As for dmap, I forgot about this one. Users need to know that adding or resizing brushes in DR won't change anything in Game preview window (most mappers will, I guess). A startmap (dmap + map) button in DR UI would be nice (something like 'Update brushes'). No save sync needed here IMO (takes way too much time), a button would do.

1 hour ago, stgatilov said:

As an author of something like Painter's Wife, I would definitely be against closing TDM every time. Because as long as TDM is running, it has all the assets loaded. An author can decide to disable the hot reload feature but keep TDM alive, and in future just use Restart Game in main menu, probably preceded by dmapping it. If TDM is closed, then he will have to wait until all the textures and models get loaded again.

Not sure what you mean by every time. I just meant to have the 'x' button on the TDM window, which is already there, at least on Windows. If the Preview button in DR will be toggled, it should just send the Exit/Quit command to the TDM console and close the connection. Not sure about a situation when you close the DR itself though. A prompt maybe? "Game preview is still running, do you want to close it as well?" Yes/No

Edited by peter_spy
Link to post
Share on other sites
  • 3 weeks later...
  • Replies 140
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

New video:  

This is how it looks right now. Also attached the code of main class if anyone is interested.   One nuisance is that reloading a map works only after the map is saved. So when mapper moves

I have an idea of adding TDM connection management to DarkRadiant. The plan is to combine it with TDM hot reload features later. Here is a brief list of features: start/connect to TDM, sto

Posted Images

Its awesome to see progress on this being made! This is already a big help to mappers even at this stage.

Right so I had a look at the proposal and here's a blue sky suggestion for the UX/ UI of this little app:

image.thumb.png.454999d16e9c41a7e5d95e7adc52d9e1.png

  • Switchboard-like convention
  • BUTTONS are solid white when clickable,  50% grey when not.
  • LINK LIGHTS show connection status.
  • "Do now" ACTION buttons. Ex. reload map. We can widen this column and add more if need be.
  • AUTO / ON SAVE check boxes. Note: for some you might want BOTH.
  • SETTINGS / HELP. Always good to have some kind of help - link to wiki. Im sure as this thing evolves we will have settings. 

Right so we can add more link types as we go along.

I could see giving lights, sounds, and other things their own links. Maybe those even go under  a drop down under "Update Map" and you can check on / off what things you want to update. 

Hope this is helpful. 

 

Link to post
Share on other sites

I was just thinking, maybe ACTION buttons should always be clickable regardless if that link is connected or not?

A couple other features off the top of my head. These could be in settings or as action buttons. 

- Read out that shows current map / fm

- Reload TDM button

- Keep on top (keeps the app on top of DR when working)

- A settings feature that automatically turns NOCLIP and maybe NOTARGET on when camera link is activate.

Link to post
Share on other sites

The overall layout looks promising, however in wxWidgets we are not drawing custom buttons/UI but using the system-styled widgets. This is what your layout might look like in wxWidgets:

mockup.png.07c0d98bb16c9e93094217fc0ed03065.png

However, the problem with this layout is that there are far too many combinations, many of which don't make sense.

  • Camera sync is either "on movement" or "when button is clicked". So we only need one checkbox and one button on this row.
  • Reload map is either "on save" or "when button is clicked". One button, one checkbox. There is no "on change" because a change which is not saved will have no effect.
  • Update map is either "on any modification" or "when button is clicked". One button, one checkbox. "On save" would be possible but it's not clear how this would be different from the Reload map function.
  • DMAP requires the map to be saved, so like Reload map it cannot have a separate "on change" option. So again this is one button and one checkbox.

Unless there are some options I've missed, it seems like there is only ever one checkbox and one button on each row, so having three dedicated checkbox columns would be a waste of space.

Link to post
Share on other sites

I don't understand what loading /sending camera to the game would mean. Hot reload means the map in tdm is being synced with dr, right? So why not just a simple on off switch? Dmap is ok, although maybe slightly redundant, since mappers do that from console anyway.

Link to post
Share on other sites
13 minutes ago, peter_spy said:

I don't understand what loading /sending camera to the game would mean.

"Load camera" from game means moving the DR camera to match the current player position. "Send camera" does the opposite, moving the player position to match the DR camera position but it does this dynamically (whenever you move the camera), hence a checkbox rather than a button.

I'm open to suggestions for clearer wording for these options, which need to make clear that the checkbox and button work in different directions (so just labelling them "camera sync" is confusing).

13 minutes ago, peter_spy said:

Hot reload means the map in tdm is being synced with dr, right? So why not just a simple on off switch?

That's exactly what a checkbox is, isn't it? "Update on change" activates continuous hot reload (so any entity modification in DR immediately appears in game), whereas "Update now" does a one-off hot reload but does not automatically update on modification.

13 minutes ago, peter_spy said:

Dmap is ok, although maybe slightly redundant, since mappers do that from console anyway.

Well spotted, I assumed that was just UI for an existing feature but it doesn't look like there are any DMAP options in the existing menu items, so this is essentially a feature request not just a UI change, and these options shouldn't appear in the UI for now.

Link to post
Share on other sites
37 minutes ago, OrbWeaver said:

Load camera" from game means moving the DR camera to match the current player position. "Send camera" does the opposite

Wording is not an opposition then, and it doesn't describe the feature well. "Sync TDM with DR", "Sync DR with TDM" should be clear enough.

 

37 minutes ago, OrbWeaver said:

That's exactly what a checkbox is, isn't it? "Update on change" activates continuous hot reload (so any entity modification in DR immediately appears in game), whereas "Update now" does a one-off hot reload but does not automatically update on modification.

That's still confusing. User doesn't have to be familiar with underlying implementation, hot reload is continuous sync of what's being done with the map in dr, right? So how 'one time hot reload' differs from save map and reload map in TDM, and how's that useful?

All in all, the continuous update of a map and continuous camera sync is the main  feature here, and that's what should be in the spotlight. Ideally, both features would be activated with one button. Not sure if users should be bothered with details such as which camera syncs with which. I guess there could be something like Show advanced settings checkbox with such granular options, but putting so much detailed options in one place creates a lot of informational noise.

Edited by peter_spy
Link to post
Share on other sites
6 minutes ago, peter_spy said:

Wording is not an opposition then, and it doesn't describe the feature well. "Sync TDM with DR", "Sync DR with TDM" should be clear enough.

I'm fine with that wording if users consider it clear enough.

6 minutes ago, peter_spy said:

That's still confusing. User doesn't have to be familiar with underlying implementation, hot reload is continuous sync of what's being done with the map in dr, right? So how 'one time hot reload' differs from save map and reload map in dr, and how's that useful?

Such a question should be addressed to @stgatilov I think, since he implemented this functionality. My only concern is fitting an appropriate DarkRadiant UI around the features.

For what it's worth, I tend to agree: if dynamic hot reload works fine (without saving the map), I'm not sure of the benefit of an extra option which only reloads after save. But perhaps there was a good reason for separating this functionality (performance maybe?).

6 minutes ago, peter_spy said:

All in all, the continuous update of a map and continuous camera sync is the main  feature here, and that's what should be in the spotlight. Ideally, both features would be activated with one button.

No disagreement from me here, and it should be easy to automatically activate a number of default features as soon as the "Enable TDM sync" checkbox is activated.

6 minutes ago, peter_spy said:

Not sure if users should be bothered with details such as which camera syncs with which.

The user has to know this, though, otherwise they will be confused when they activate "camera sync" and find that the DR camera doesn't automatically follow the motion in game.

  • Like 1
Link to post
Share on other sites
6 minutes ago, OrbWeaver said:

The user has to know this, though, otherwise they will be confused when they activate "camera sync" and find that the DR camera doesn't automatically follow the motion in game.

If the workflow would be: a) launch a map in DR, b) launch the same map in TDM, c) press the sync button in DR, most users would probably assume that TDM should sync the camera with DR, and that it may always work in this direction. That would reduce the number of options further.

Link to post
Share on other sites

@OrbWeaverI like what you have there! That makes a lot of sense.  So the checkboxes are basically options for the updates.  I honestly think the wording is fine here- seems logical to what the function is. 
 

Does this seem like something feasible to build and we can start playing around with it? 

Link to post
Share on other sites

@OrbWeaver@peter_spy the Dmap thing was intentional. I personally get tired of switching over to the game and typing dmap in the console. This way we could dmap from DR, continue to work while it maps and then switch back.  That was kind of the idea. 
 

Also DMAP on save could be very handy for certain situations. 

  • Thanks 1
Link to post
Share on other sites
Quote

Not sure if users should be bothered with details such as which camera syncs with which.

Quote

The user has to know this, though, otherwise they will be confused when they activate "camera sync" and find that the DR camera doesn't automatically follow the motion in game.

At the risk of introducing another alternative, why not combine both and have two-way sync?  If you move in DR, it updates in TDM.  If you move in TDM, it updates in DR.  If you want to be in two different places, you turn off the sync.

15 hours ago, peter_spy said:

All in all, the continuous update of a map and continuous camera sync is the main  feature here, and that's what should be in the spotlight. Ideally, both features would be activated with one button.

I agree, but due to the above I see this as 2 toggle buttons: Sync Camera and Sync Entities.  Both of these toggle the continuous updates, no instant update buttons.

15 hours ago, OrbWeaver said:

For what it's worth, I tend to agree: if dynamic hot reload works fine (without saving the map), I'm not sure of the benefit of an extra option which only reloads after save. But perhaps there was a good reason for separating this functionality

In my use of the reloadMap command so far, there are some things hot reload (at least currently) doesn't deal with, that restarting the map does.  So, this gives us 1 more toggle button: restart map on save.  No need for the instant button, since you have to save first for it to be useful anyways.

 

On 12/11/2020 at 9:29 AM, peter_spy said:

A startmap (dmap + map) button in DR UI would be nice (something like 'Update brushes'). No save sync needed here IMO (takes way too much time), a button would do.

The same logic as restarting the map should apply here, if it wasn't for performance.  Perhaps we start with a manual dmap button, and if we get an incremental dmap someday, we can switch over to a "dmap on save" toggle button or better yet fold it into the "restart map on save" button.

 

This gives us a total of 4 buttons - distilling each row from the mockup into only one element.   Based on which buttons are toggled/pressed, we should be able to enable the Game Connection without a dedicated button.  When any toggle is turned on or the dmap button is pressed, enable the connection.  When they're all off, disable the connection.

If we can really boil it down to just four buttons, I'd personally lean towards putting them on the toolbar above the 3D view in DR.  It's got some empty space and toolbars are well suited for both toggle and normal buttons.

Edited by jonri
  • Thanks 1
Link to post
Share on other sites

I wonder why moving around in game would be useful for moving camera in DR in the first place. I need to check how perspective view in DR looks in TDM because of the full rendering features. I don't need the DR camera to move with what I do in the game, so it can remain where it is in DR. When I switch back to DR, I'd expect the camera in TDM would jump to where DR camera is, and that's it.

I probably wouldn't even need to switch to TDM and move around in game, because I could do the same in DR and spend most of my time there.

Edit: I should have mentioned that I use 2 monitor setup, so I have DR on one monitor and TDM on the other - that's why spending 99 percent of the time in DR makes more sense to me.

Edited by peter_spy
Link to post
Share on other sites

I believe the reason 2-way sync doesn't exist is because DR is event driven, i.e. it responds to user mouse and keyboard events, therefore all of the sync options are triggered by DarkRadiant (even if the effect is to receive data from the game, such as "Sync camera back now").

Having DR respond to "events" received asynchronously over a network connection, which do not correspond to any wxWidgets input events, would probably require multiple threads and all of the ensuing timing and race conditions that arise when trying to combine multiple event streams.

Link to post
Share on other sites
8 hours ago, jonri said:

At the risk of introducing another alternative, why not combine both and have two-way sync?  If you move in DR, it updates in TDM.  If you move in TDM, it updates in DR.  If you want to be in two different places, you turn off the sync.

The underlying code only checks when DR camera moves, and continuously enforces same location into TDM (with some inevitable delay). Two-way sync would be hard to implement and more error prone.

To be honest, I consider any type of two-way since with great care and distrust. I once had such "sync" software clear my mobile instead of backing it up, so I prefer to have direction explicit 😁

5 hours ago, peter_spy said:

I wonder why moving around in game would be useful for moving camera in DR in the first place. I need to check how perspective view in DR looks in TDM because of the full rendering features. I don't need the DR camera to move with what I do in the game, so it can remain where it is in DR. When I switch back to DR, I'd expect the camera in TDM would jump to where DR camera is, and that's it.

I probably wouldn't even need to switch to TDM and move around in game, because I could do the same in DR and spend most of my time there.

Yes, exactly.

Constant sync from DR to TDM seems like a perfect thing when you are mapping in DR, and use TDM merely to see the same scene there. I was considering it to become the main mode of operation.

The backsync (from TDM to DR) might be useful when you are testing something. E.g. you tweak some runtime settings which are not immediately visible without player interaction. Or you simply test the game by playing it. At some moment you see a problem in-game and want to quickly fix it in DR before continuing playing. And that's when you click on "sync back", do the quick fix, then switch to TDM again.
So it might be useful in a rare case when you dove into TDM and ran too much away in there. I ditched the idea of continuous sync from TDM to DR, because I believed it was not necessary, and would only complicate things.

 

I don't like most of the names proposed here for camera sync, but I must admit my names are not better either😥
As long as everyone is OK with the idea that continuous sync from TDM to DR is not needed, I would suggest name like "Camera sync" for the main mode, with a more weird "Find player" or "move camera to player" button, if simple "sync back" is not clear enough.

 

Another question is notarget/noclip.

Right now enabling camera sync mode automatically enables notarget, noclip, and god. Without any of them, free flying on DR camera would end badly in TDM, so they are pretty essential. Is there any real need to configure these modes?

By the way, when camera sync is disabled, none are the settings are restored back. That's not very nice and assumes that user either knows how to disable them or simply does not care because uses TDM for visual preview only.

 

  • Thanks 1
Link to post
Share on other sites

To me, the main justification for TDM => DR camera sync would be for pinpointing locations where things go wrong in order to fix them.  For instance you find a place where you've got z-fighting, or an AI is getting stuck on an object, and you want to jump to it in DR.  As this is a more occasional thing, this would bring me back to wanting a button for it instead of it enabled all the time.

Alternatively, we could have a keybinding in TDM to push the location back to DR (or rather queue the location and have DR poll for updates to the value).  And maybe instead of moving the camera in DR when this happens, use the location value to draw a "breadcrumb" in DR (maybe have it look similar to a player start entity but make it easy to find).

  • Like 1
Link to post
Share on other sites
21 hours ago, kingsal said:

@OrbWeaver@peter_spy the Dmap thing was intentional. I personally get tired of switching over to the game and typing dmap in the console. This way we could dmap from DR, continue to work while it maps and then switch back.  That was kind of the idea. 

Note: just like the "Launch the map in TDM" feature, dmapping from DR is not implemented yet. It is of course perfectly OK to discuss them now, but for the first time it's GUI will probably be missing/hidden.

I think right now mappers want "Launch map in TDM" quite a lot. As for dmapping, I recall such ideas too.

The thing is: running dmap from DR is trivial. But fetching warnings and errors back to DR is more questionable. I can fetch back all the console messages which happened during dmap as one huge text, but not sure what to do with it then. Perform text-based filtering for warnings and errors in DR? Some warnings have additional text printed afterwards, and users won't see it unless they switch to TDM console and manually scroll to it.

Also, could you write the "workflow" (sorry for this word again) when you have to dmap repeatedly?
I had an rather complicated idea about limited hotreload for brushes, and had very faint idea for making dmap incremental...

Link to post
Share on other sites
47 minutes ago, jonri said:

To me, the main justification for TDM => DR camera sync would be for pinpointing locations where things go wrong in order to fix them.  For instance you find a place where you've got z-fighting, or an AI is getting stuck on an object, and you want to jump to it in DR.  As this is a more occasional thing, this would bring me back to wanting a button for it instead of it enabled all the time.

Sounds like what you want is exactly what's implemented, except that it's currently a menu item rather than a button.

47 minutes ago, jonri said:

Alternatively, we could have a keybinding in TDM to push the location back to DR (or rather queue the location and have DR poll for updates to the value).

Again, that's complicating things by introducing a need for DR to "take orders" from another process and trigger UI changes that don't correspond to keyboard or mouse events from the user (and might conflict with those events). It's much safer and simpler to have the currently implementation whereby the trigger to synchronise locations comes from DR menu/button events rather than commands from inside the game.

  • Like 1
Link to post
Share on other sites

@stgatilovYeah I was thinking maybe we could pop the dmap warnings into the DR console?  That might be too much though and flood it. Maybe just a log file for now and then later we can do something fancier? It would be nice to get some kind of confirmation the dmap finished. I personally don’t use the DR console, but maybe this would get me into the habit of checking it as I’m sure there’s useful info there. 
 

Some of the reasons I find myself constantly dmapping: 

- Tweaking monster clip brushes to allow the AI to continue their patrols. 
- Tweaking textures! This is hands down the most tedious thing. Having to dmap and reload just to see texture changes is very time consuming. 
 

Workflow is typically:

- Launch TDM and DR

- Do a fresh dmap and move my cameras to where I want to work

- Tweak texture in DR

- Dmap, wait, load map, move back to troubled area in TDM

- Do this over and over again...

  • Thanks 1
Link to post
Share on other sites
9 hours ago, jonri said:

In my use of the reloadMap command so far, there are some things hot reload (at least currently) doesn't deal with, that restarting the map does.  So, this gives us 1 more toggle button: restart map on save.  No need for the instant button, since you have to save first for it to be useful anyways.

Report it here.

You can always restart the map by going to TDM, hitting Esc and Restart Mission.

I don't like the idea of creating a DR button for everything which mapper might ever need. Better cover something which is either not possible to do manually in TDM, or something which is done too often to bother. Reloading map afresh currently does not sound like this.

Link to post
Share on other sites
12 minutes ago, OrbWeaver said:

Sounds like what you want is exactly what's implemented, except that it's currently a menu item rather than a button.

Yup, I agree with the others and I changed my mind back 🙂

12 minutes ago, OrbWeaver said:

Again, that's complicating things by introducing a need for DR to "take orders" from another process and trigger UI changes that don't correspond to keyboard or mouse events from the user (and might conflict with those events). It's much safer and simpler to have the currently implementation whereby the trigger to synchronise locations comes from DR menu/button events rather than commands from inside the game.

The GameConnection already uses a wxTimer to poll for incoming messages ~10 times per second, and it probably already runs on the right thread.  Shouldn't be hard to have DR send TDM a polling command which replies with the latest location the user flagged from TDM.

Within reason, I'd rather start from what UX makes the most sense to the mapper and deal with the technical implications, than create a clunky experience in the name of simplicity.  I'm just trying to brainstorm some other ideas to avoid the overwhelming sea of buttons/checkboxes.  Generally speaking, locating buttons/commands close to where you expect the user to be when they need them is a good thing.  On the other hand, TDM keybindings are less intuitive than buttons so that might be a good argument in favor of the DR button.

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...