Jump to content
The Dark Mod Forums

Recommended Posts

  • Replies 88
  • 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

I tested it and it looks pretty good.

  • Live camera synchronisation from DarkRadiant to the game works. The game position moves in realtime as I move the DR camera around.
  • Synchronisation in the other direction works if I choose the Sync camera back now option, but not in realtime. I don't know if this is expected.
  • Hot reload works. I can change the colour of a light and see the change immediately in game if I choose Enable map update mode.
  • Something weird happened to the camera in game at one point — I could no longer rotate in place, because horizontal mouse motions suddenly turned into left/right strafing. However I can't reproduce this reliably. Maybe I just pressed something in game without realising it.

Overall this is very exciting functionality and I'm happy to merge it even in this early state. Being able to click through light shaders in the light inspector and see the lighting change immediately in another window (with full soft shadows) is amazing, and really helps to avoid the limitations of the DarkRadiant lighting renderer.

Link to post
Share on other sites
10 hours ago, OrbWeaver said:

Synchronisation in the other direction works if I choose the Sync camera back now option, but not in realtime. I don't know if this is expected.

Yes, this is how it works.
It is a bit scary to have continuous synchronization in both directions. If there is demand from mappers, it can be added in future.

Quote

Something weird happened to the camera in game at one point — I could no longer rotate in place, because horizontal mouse motions suddenly turned into left/right strafing. However I can't reproduce this reliably. Maybe I just pressed something in game without realising it.

I see the same problem in Ubuntu VM when I press Alt. Hitting it again should unblock the movements.
It is really annoying since Alt+Tab is a common combination.

 

Link to post
Share on other sites
2 hours ago, stgatilov said:

I see the same problem in Ubuntu VM when I press Alt. Hitting it again should unblock the movements.
It is really annoying since Alt+Tab is a common combination.

Right, that would make sense. Normally what I do is bring down the console in order to switch to another application, because otherwise the game window continues to capture the mouse and I cannot click anywhere outside the game (which is not ideal in this situation, because now the console is obscuring half the window and I can't see the live updates). I must have tried Alt+Tab without bringing down the console and that is what entered the strafe mode.

Link to post
Share on other sites

I've moved the game connection code into its own plugin, which is now built when --enable-darkmod-plugins is set (on Linux). This was more work than I originally anticipated since I had to move quite a few classes from the radiant/map tree into libs/scene instead, so they could be used both by the plugin and the main Radiant module. I also had to expose certain methods on pure virtual interfaces which were previously only defined in implementing subclasses, which was relatively straightforward.

Hopefully I've done all the necessary legwork at the code level, so that when @greebo eventually merges this it will be a simple matter of updating the Windows build scripts to match the new code layout.

Link to post
Share on other sites

I still haven't got around to look into that, been always busy with either work or my ongoing DR work. I try to keep focused on one thing at a time, but I'll do it eventually.

Talking about moving Map code to scenelib, I'll have to check whether these changes will conflict with the UI/logic separation efforts in my master branch, but I guess everything can be resolved in a good way.

Link to post
Share on other sites
1 hour ago, greebo said:

I still haven't got around to look into that, been always busy with either work or my ongoing DR work. I try to keep focused on one thing at a time, but I'll do it eventually.

Talking about moving Map code to scenelib, I'll have to check whether these changes will conflict with the UI/logic separation efforts in my master branch, but I guess everything can be resolved in a good way.

No problem — I'm not trying to pressure you into merging it right away, just getting the code into a reasonable state so that when you do get time to merge it there shouldn't be too many obstacles.

  • Like 1
  • Thanks 1
Link to post
Share on other sites

I merged everything into my master branch now. It was quite the ride, since the architecture has changed quite a bit in the meantime. I re-played some of the commits to orbweaver/master, but the huge merge commit I was unable to integrate, it was just not matching up. I also had loads of conflicts, mostly because of the architecture changes, but also due to tons of whitespace adjustments. (If you guys want to make my life easier for the next merge, please don't change the whitespace of an entire file, it makes it really hard for me to spot the relevant code lines in a git conflict.)

The plugin is compiling in Windows now, but I haven't even tested it. I have to download the correct mod version first, and I'm out of time for today. I'll also do some refactoring in the plugin itself.

Link to post
Share on other sites
14 hours ago, greebo said:

(If you guys want to make my life easier for the next merge, please don't change the whitespace of an entire file, it makes it really hard for me to spot the relevant code lines in a git conflict.)

Sorry, that was probably my fault. Sometimes when I encounter misalignment due to mixed tabs/spaces on successive lines, I use Vim's :retab command but forget to select just the affected method body, which results in Vim converting tabs to spaces in the entire file.

Link to post
Share on other sites

No worries there. I still appreciate the fact that DR has more than one active developer these days, so thanks for doing the merge work and making it a plugin.

By the way, I didn't check the compilation in my Linux VM yet, if you could check out my master branch some time to see if it compiles, that'd be great.

And on a related note, I can confirm that the game connection plugin is working with the 2.09 dev build. 👍

Link to post
Share on other sites
5 hours ago, greebo said:

By the way, I didn't check the compilation in my Linux VM yet, if you could check out my master branch some time to see if it compiles, that'd be great.

No problem. The attached patch fixes all Linux compilation issues that I encountered.

I wasn't sure what to do about this line in PassiveSocket.cpp:

    SOCKET         socket = UINT_PTR(CSimpleSocket::SocketError);

UINT_PTR isn't defined anywhere, so I assume it must be a Windows-specific type, but CSocketError is just an enum not a pointer, so I'm not sure of the intent here. Does it work on Windows because SOCKET and UINT_PTR are both typedefs of the same type (e.g. unsigned int*)? The original clsocket code looks very odd: I'm not sure why the author used the SOCKET variable to store an error code which is a completely different type of data.

In any case, I had to remove the UINT_PTR because it does not compile on Linux, and I replaced it with C++11 construction:

    SOCKET         socket{CSimpleSocket::SocketError};

But I don't know if this is just going to reintroduce whatever problem you were fixing by adding the UINT_PTR cast.

Also, be aware that you accidentally (I presume) added a compiled radiant/darkradiant binary in this commit:

commit 0270caa70ede357888a4ec23fc43520424c54e0f
Author: codereader <greebo@angua.at>
Date:   Sun May 3 15:22:40 2020 +0200

    #5231: Compilation in gcc working, this will likely fail when at runtime pretty fast.

 create mode 100755 radiant/darkradiant

 

0001-Linux-compilation-fixes.patch

Link to post
Share on other sites

Oh my, I definitely didn't want to check in the darkradiant binary. I probably screwed up using git stage. edit: I just checked, luckily it's not a binary, it's a libtool-generated file, phew. It would have been several MB, bloating the repo needlessly. Still, that file should be removed.

And thanks for the patch, I'll apply it. The UINT_PTR type-cast was to fix a conversion warning, yes. I didn't check beforehand and failed to see it wasn't a portable type, must've confused it with something else. Maybe I'll check it out another time, but I can live with that warning just fine, so I'm happy to apply the fix that makes it compile again.

Link to post
Share on other sites

Had to change that initialisation another time, since it didn't compile in Windows. I replaced it with a static_cast<SOCKET>, now it's compiling without warnings.

Link to post
Share on other sites
21 minutes ago, greebo said:

Had to change that initialisation another time, since it didn't compile in Windows. I replaced it with a static_cast<SOCKET>, now it's compiling without warnings.

That doesn't surprise me all that much — I have a feeling that brace initialisation is actually more strict than normal construction and won't allow certain implicit conversions of parameter types.

Using static_cast seems like the ideal solution here in any case, since casting one type to another is indeed what the code is doing.

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...