Jump to content
The Dark Mod Forums

DarkRadiant & dmap


Recommended Posts

I'd like to get some feedback on the DarkRadiant/D3Engine interconnect. If anybody could check it out, I'd aprreciate that.

 

Get the latest build here: http://darkradiant.sourceforge.net/snapshot.php

 

The above is the latest SVN snapshot containing a d3hook plugin, which should enable users to send the dmap command to DarkMod. The game must be running of course. You'll find the command in the Map menu.

Link to comment
Share on other sites

I'd like to get some feedback on the DarkRadiant/D3Engine interconnect. If anybody could check it out, I'd aprreciate that.

 

Get the latest build here: http://darkradiant.sourceforge.net/snapshot.php

 

The above is the latest SVN snapshot containing a d3hook plugin, which should enable users to send the dmap command to DarkMod. The game must be running of course. You'll find the command in the Map menu.

 

I really have to congratulate you on this Greebo. :) This was something I had hoped we could pull off in some form for quite awhile! Thanks for doing this. It really marries Dark Radiant to Doom 3.

Link to comment
Share on other sites

I'd like to get some feedback on the DarkRadiant/D3Engine interconnect. If anybody could check it out, I'd aprreciate that.

 

Get the latest build here: http://darkradiant.sourceforge.net/snapshot.php

 

The above is the latest SVN snapshot containing a d3hook plugin, which should enable users to send the dmap command to DarkMod. The game must be running of course. You'll find the command in the Map menu.

 

I guess this works only in windows?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

@New Horizon: Thanks for that, appreciated. :)

 

I guess this works only in windows?

No, I spent a considerable amount of time on getting it to work in Linux just as fine (and I went through hell fixing almost all the warnings). :)

 

However, the linked snapshot is of course a Win32 build (as all Betamappers are Win32 users). You'll need to compile the DarkMod source plus DarkRadiant in Linux yourself, if you want to test it.

Link to comment
Share on other sites

@New Horizon: Thanks for that, appreciated. :)

No, I spent a considerable amount of time on getting it to work in Linux just as fine (and I went through hell fixing almost all the warnings). :)

 

Oh very cool - sorry for doubting your abilities :)

 

Nevermind the rest of my post, it was in the wrong thread....

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Btw, I get still _tons_ of gcc warnings, including some about "variable used uninitialized", "wrong access to non-static member" etc. Did you not see these?

You speak about the Darkmod build or the DarkRadiant code? I'll have to test it yet again in Linux, because the latest fixes were done in Win32. I switched to Linux and back to Windows about 10 times today - I'm a bit tired of this right now, but I'll look into it some time.

Link to comment
Share on other sites

You speak about the Darkmod build or the DarkRadiant code? I'll have to test it yet again in Linux, because the latest fixes were done in Win32. I switched to Linux and back to Windows about 10 times today - I'm a bit tired of this right now, but I'll look into it some time.

 

Heh, I removed that section from my post 20seconds after posting :D

 

Anyway, I was speaking about TDM as I hit the wrong console window for compiling :rolleyes:

 

But don't worry, DR also go its share of warnings:

 

ase/libs -Ilibs -Ibuild/release/include -Iinclude -Iplugins/dm.d3hook plugins/dm.d3hook/RCF/RCF.cpp
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp: In function ‘int RCF::pollSocket(unsigned int, int, int&, bool)’:
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:25: warning: missing initializer for member ‘timeval::tv_usec’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp: In function ‘int RCF::pollSocketWithProgress(const RCF::ClientProgressPtr&, RCF::ClientProgress::Activity, unsigned int, int, int&, bool)’:
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:61: warning: missing initializer for member ‘timeval::tv_usec’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp: In function ‘void RCF::appendWsabuf(std::vector<iovec, std::allocator<iovec> >&, const RCF::ByteBuffer&)’:
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:151: warning: missing initializer for member ‘iovec::iov_len’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp: In function ‘int RCF::timedSend(RCF::I_PollingFunctor&, int&, int, const std::vector<RCF::ByteBuffer, std::allocator<RCF::ByteBuffer> >&, size_t, int)’:
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:247: warning: missing initializer for member ‘msghdr::msg_namelen’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:247: warning: missing initializer for member ‘msghdr::msg_iov’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:247: warning: missing initializer for member ‘msghdr::msg_iovlen’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:247: warning: missing initializer for member ‘msghdr::msg_control’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:247: warning: missing initializer for member ‘msghdr::msg_controllen’
plugins/dm.d3hook/RCF/TimedBsdSockets.cpp:247: warning: missing initializer for member ‘msghdr::msg_flags’
plugins/dm.d3hook/RCF/TcpAsioServerTransport.cpp: In member function ‘void RCF::TcpAsioServerTransport::open()’:
plugins/dm.d3hook/RCF/TcpAsioServerTransport.cpp:855: warning: missing initializer for member ‘sockaddr_in::sin_port’
plugins/dm.d3hook/RCF/TcpAsioServerTransport.cpp:855: warning: missing initializer for member ‘sockaddr_in::sin_addr’
plugins/dm.d3hook/RCF/TcpAsioServerTransport.cpp:855: warning: missing initializer for member ‘sockaddr_in::sin_zero’

 

:)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

But don't worry, DR also go its share of warnings: :)

Forget about these warnings, there are some struct members not being used by the RCF library. The compiler is pretty anal about this, I'd worry more about "might be used uninitialized" or "is used uninitialized". I won't fix these, I guess. :)

 

Hmm, I get a "Doom 3 not running" error even though it is.

Hm, how is the D3 process called on your end? Is it doom.x86 or something else?

 

The algorithm is as follows:

- Traverse the /proc/ folder

- For each file name matching an integer number, open the file /proc//cmdline

- Try to find the string doom.x86 within the cmdline, return success if found.

 

I don't know of any other way to check for the process, so there you are with my poor man's solution to this problem. :)

Link to comment
Share on other sites

Hm, how is the D3 process called on your end? Is it doom.x86 or something else?

 

Yes, doom.x86 is correct.

 

The algorithm is as follows:

- Traverse the /proc/ folder

- For each file name matching an integer number, open the file /proc/<pid>/cmdline

- Try to find the string doom.x86 within the cmdline, return success if found.

I don't know of any other way to check for the process, so there you are with my poor man's solution to this problem. :)

 

I don't see any obvious reason why that shouldn't work, but you might try using pidof

 

http://linux.die.net/man/8/pidof

 

which encapsulates this functionality in a commandline tool.

Link to comment
Share on other sites

Yes, doom.x86 is correct.

I don't see any obvious reason why that shouldn't work, but you might try using pidof

 

http://linux.die.net/man/8/pidof

 

which encapsulates this functionality in a commandline tool.

 

And just traverses /proc, too :P

 

te@te:~/.doom3/darkmod$ strings /bin/pidof |grep proc
/proc
/proc/version
/proc unavailable.
cannot opendir(/proc)
/proc/%s/stat
/proc/%s/cmdline
/proc/%s/exe
/proc not mounted, failed to mount.

 

:)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

And just traverses /proc, too :P

 

Indeed, hence "encapsulates this functionality". :P

 

A possible advantage of using pidof is that it is already tested and working, so eliminates the need to look for subtle bugs in the homegrown implementation (assuming that there is a suitable way of capturing and parsing the output of a command-line program from a C++ application; I presume one of the exec() variants can do this).

Link to comment
Share on other sites

Indeed, hence "encapsulates this functionality". :P

 

A possible advantage of using pidof is that it is already tested and working, so eliminates the need to look for subtle bugs in the homegrown implementation (assuming that there is a suitable way of capturing and parsing the output of a command-line program from a C++ application; I presume one of the exec() variants can do this).

 

Yeah, true about the "tried and tested", also it might work on systems without a /proc file system etc.

 

But I had thought more about using a library instead of a command line program.

 

PS: @greebo; dmap works fine here!

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

SYSTEM(3)				  Linux Programmer’s Manual				 SYSTEM(3)

NAME
   system - execute a shell command

SYNOPSIS
   #include <stdlib.h>

   int system(const char *command);

 

But, it might be nicer to just incorporate the code for pidof into DR rather than relying on an external app. It's probably using a GPL-compatible licence.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

But, it might be nicer to just incorporate the code for pidof into DR rather than relying on an external app. It's probably using a GPL-compatible licence.

 

From:

 

 

Probably the most significant compatibility fix involved changing how keychain detects currently running ssh-agent processes. Previously, I was using the pidof command to do this, but it had to be removed since several systems don't have a pidof.

 

Unfortunately the solutions on that page given are a lot of shell code, which doesn't help us, really.

 

From the pidof manpage:

 

pidof is actually the same program as killall5; the program behaves according to the name under which it is called.

 

Hohum, no wonder I don't find the source for pidof...

 

I think reading /proc is the best way, so we need to find out why it doesn't work. What we can do is litter the PID finding code with debug statements and see where it goes wrong.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I added the debug output to the plugin now. I hope it compiles, I did not switch to Linux just to add these few lines...

 

It compiles and still works :)

 

However, I found "dmap" from DR not really usable:

 

* it is at least a factor 6 slower than running "dmap" in Doom3 in the main menu (having another map open does of course slow it down) (maybe the camera updates while DR displays the console output?)

* after doing the dmap from DR, I can no longer close D3, it hangs on exit. And since the window steals the focus I have to switch to a text console and when I then kill doom.x86, and get back to my desktop, the mouse pointer is stuck, meaning you need to CTRL-ALT-BACKSPACE (kill) my desktop - including all open programs...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

* it is at least a factor 6 slower than running "dmap" in Doom3 in the main menu (having another map open does of course slow it down) (maybe the camera updates while DR displays the console output?)

You had a map running during compile or was D3 idling in the console?

 

Regardless of the status, there is a small "network" overhead when sending the console output from D3 to DarkRadiant. Also, DarkRadiant calls gtk_main_iteration(); very frequently, which might slow down stuff a bit.

 

* after doing the dmap from DR, I can no longer close D3, it hangs on exit. And since the window steals the focus I have to switch to a text console and when I then kill doom.x86, and get back to my desktop, the mouse pointer is stuck, meaning you need to CTRL-ALT-BACKSPACE (kill) my desktop - including all open programs...

I experienced that too. D3 is catching the mouse input after finishing the dmap command (when the main GUI is activated again). You can escape this by opening the console (Ctrl-^ on my end), this gives you the mouse pointer back.

Link to comment
Share on other sites

You had a map running during compile or was D3 idling in the console?

 

Idling in the console.

 

Regardless of the status, there is a small "network" overhead when sending the console output from D3 to DarkRadiant. Also, DarkRadiant calls gtk_main_iteration(); very frequently, which might slow down stuff a bit.

 

Hopefully that can be optimized so that DR doesn't update the GUI 100 times a second :)

 

I do have a Dual-Core CPU, but it seems linux holds both processes on one core - makes sense as they need to communicate, anyway.

 

I experienced that too. D3 is catching the mouse input after finishing the dmap command (when the main GUI is activated again). You can escape this by opening the console (Ctrl-^ on my end), this gives you the mouse pointer back.

 

Yeah, I know, you get the mouse pointer back with "^" - would be good if that "open console" command could be issue by DR automatically, tho.

 

Anyway, but once you switch back to doom and try to quit it, doom just hangs and when I kill it via (CTRL+ALT+F1 => killall doom.x86) I get that stuck mousepointer.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
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.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 5 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...