Create an account

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to understand darkplaces source code

I don't want to discourage you but here is one hard fact. You may have a lot of experience, you may be one of the best developers in the world. But you are only single person. You have only 24 hours a day. A team of 10 average people will do more than you. It took me a long time to realize that. It may be fun to code in C seeing that you control every tiny operation. But the development speed will be very slow, there will be tons of bugs. That's why "programmer productivity" languages skyrocketed. Because all people have 24 hours a day. And they usually choose to get something done rather than enjoying themselves.

DarkPlaces is hosted on svn and only LordHavoc and divVerent can add changes there. I haven't committed anything yet.

One word of advice though, install VirtualBox and some GNU/Linux distribution on it (I suggest Debian) and try learning coding there. It is extremely easier. Since Unix was written in C, GNU/Linux has "native" support for C and C++ development. Libraries are installed with a single command. All paths are standardized, etc.

Where can I get a team of 10 people though. Want to work for me, for free?

I looked at darkplaces commit history, there are a lot of people who commited, not just those two.

eh, haven't seen anything as good as ollydbg on linux. Changed back to windows just for it. Executable file format on linux is also weird, many different weird sections that do something, I'll never understand it. Don't want to change os just due to something as trivial as compiling something.

What's wrong with gdb?


You can wrap it in a decent IDE like CodeLite and QtCreator.

With ollydbg I can see everything directly: code, data, stack, registers, and a few buttons on the top if you want to see something extra like list of threads or handles. Great way to learn your cpu and os. With gdb+codeblocks I need to open all this manually, and they never fit on screen. Olly is more comfortable to use, it was designed for working with asm.

I'm not sure how to study assembly output of C++ programs. Can't understand raw asm until I run it in debugger, and see what it changes. Can't just run it in olly, because it doesn't understand dwarf debug info that mingw produces (it only reads .pdb), can't find functions I need, and can't just run to the interesting point because there is this runtime inside that I always stumble upon (unless I disable runtime, but then I can't use exceptions and most of the language features).

gdb+codeblocks rearranges assembly when I enable mixed mode (showing original code in comment above generated assembly), I'm not sure if there is a way to disable that. I'd prefer to see assembly as it is, and have comments rearranged instead. It probably even skips code, I'm not sure.

with gdb+codeblocks, can't easily jump around the code, can only move forward. In visual studio I could just grab the arrow and change the next executed line in that way, with ollydbg I have a hotkey for that, with gdb I have to type "j address" or "set $pc = address".

I wish olly knew how to rewind code. It's a cool feature of gdb that isn't (yet?) supported by codeblocks, and also only works on linux. I'm not sure how exactly it works, can it rewind file operations too?

I wish my debugger could at least show me what changed before some function call and after it, like summary of memory modified and external api called.

Never used CodeLite or QtCreator, how different are they? Got any videos of using disassembly in them? Can you use intel syntax in them?

Can't use Visual Studio, it keeps crashing for me. It's the only program that does that, so I'm reluctant to reinstall my os for just trying to use it. I probably should. Need to do a few things before that.

Also, I'm making my own language anyway, because nothing satisfies me. Maybe I should concentrate on that. It will take years to make, will be outdated by time it will be complete, and I'll die of starvation before getting anywhere close. Good plan.

I never use assembly because it is pretty much irrelevant these days. I simply put breakpoints on the lines of C++ code and look for the contents of C++ variables.

I probably don't need that either. It's just nice to check it in case compiler does something stupid. Or I do something stupid with all those compiler flags.

Nowadays you pretty much need -g -O0 for debug and -O2 or -O3 for release. Everything else is not used often.

How people manage dependencies with C++?

Looked at mpc-hc sources, it uses visual studio, keeps dependencies in thirdparty folder near src and the rest, and uses git submodules to download them. They sometimes duplicate because of that.

It uses bin directory for the final result, and build directory for object files and all intermediate files.

Not sure if I should place dependencies in subfolders, or just keep one folder for sources, one folder for libraries, one folder for binaries.

How the hell I'll tell cmake to do that.

Seems related:

There are a lot of doxygen comments in qcvm that seem autogenerated, the only thing they do is repeat the name of file.

/// \brief Source file that contains implementation of the EntityManager class.
/// \brief Source file that contains implementation of the Function struct.
/// \brief Source file that contains implementation of the GlobalMemory class.

(09-22-2017, 12:55 AM)wiefie Wrote: How people manage dependencies with C++?

Managing dependencies on Windows is a huge pain. I never managed to do that for big project. Managing dependencies on GNU/Linux is simple, you just use your package manager.

(09-22-2017, 08:28 AM)wiefie Wrote: There are a lot of doxygen comments in qcvm that seem autogenerated, the only thing they do is repeat the name of file.

/// \brief Source file that contains implementation of the EntityManager class.
/// \brief Source file that contains implementation of the Function struct.
/// \brief Source file that contains implementation of the GlobalMemory class.

Actually, I wrote them myself. It's just pretty much all headers are the same because they describe the class. The extended documentation is right in front of the class.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Module (music) support for Darkplaces (again) [test it] nilyt 8 3,979 04-21-2015, 08:24 PM
Last Post: BuddyFriendGuy
  Xonotic QCC source won't compile with GMQCC? kristus 4 2,410 11-04-2014, 08:14 PM
Last Post: Mario
  Altering Xonotic Source Code perljamz10 7 7,077 02-26-2013, 06:19 PM
Last Post: Mr. Bougo
  darkplaces wiki down .... hutty 4 4,194 10-13-2012, 09:47 PM
Last Post: hutty
Question media source files of vehicles? poVoq 13 5,815 02-21-2012, 06:16 PM
Last Post: tZork
  Parallelization of Xonotic (and Darkplaces engine) Sarge999 19 12,680 11-21-2011, 03:22 PM
Last Post: Sarge999
  Planning to help with the code - where to start? Exitium 10 5,954 09-19-2011, 10:25 AM
Last Post: Lord Canistra
  [SOLVED] Compiling from GIT fails: darkplaces unfa 10 9,280 06-20-2011, 07:58 AM
Last Post: unicornsteak
  Want to start helping with Xonotic code JayWalker 4 4,190 03-20-2011, 01:46 AM
Last Post: Akari
  Source code for the 0.1 preview release? twistedlincoln 4 4,841 01-03-2011, 09:18 AM
Last Post: twistedlincoln

Forum Jump:

Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-