Jump to content
The Dark Mod Forums

Playing with source code


Always Good

Recommended Posts

I would like to download the source code and play around with it. The source code compilation procedures shows in a pic that the source code must be next to the installed game. I was wondering if we can only play around with the source code with the game installed as well or can we directly run the game from the source code? Thank you

Edited by Always Good
Typo
Link to comment
Share on other sites

The downloads page has links to the compiling wiki and various source versions including the current TDM 2.10 and the bleed-edge SVN version.

https://www.thedarkmod.com/downloads/

If you wish to use the latter, you will need to use assets from the latest Dev Build:

Regardless of which option you choose, you will need to download TDM assets via tdm_installer or at the Moddb page (etc).

If you want to change the game "in real time" then you should study scripting :

https://wiki.thedarkmod.com/index.php?title=Scripting_basics

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I see I am quite new to game development. I wanted to explore existing examples and learn and so I thought I could work with the code directly and play with it. I am installing the game right via the installer but I am curious like can I change how the game would work (after installing) if I change values in the scripts? (I am a programmer so I know what to expect) Thanks.

Link to comment
Share on other sites

2 hours ago, nbohr1more said:

If you want to change the game "in real time" then you should study scripting :
https://wiki.thedarkmod.com/index.php?title=Scripting_basics

Scripting changes are only applied if you reload game, I can hardly call it "in real time" 😁

Anyway, I recommend:

  1. Get source code from SVN trunk.
  2. Get TDM installation (assets) of the latest dev build with tdm_installer.
  3. Read COMPILING.txt, align two directories as described there, build game.

When you build engine from source code, it would copy/overwrite TheDarkModx64.exe and glprogs directory to ../darkmod.
Yes, you can run and debug the game straight from Visual Studio, the solution is configured accordingly.

If for some reason you want to keep clean 2.10 installation or dev build, just copy the whole TDM installation directory: you'll have less confusion this way. It is possible to have single installation but juggle around with executable and glprogs, but I wouldn't recommend that.

Just like Doom 3 engine, TDM considers everything in .pk4 archives (they are actually ZIP archives) as a virtual filesystem. So if you take some pk4 file in TDM installation directory and unpack it to the same directory, the game won't notice it and wll work exactly as before.
If you want e.g. to edit game scripts, find the pk4 archive which contains them, then unpack its contents and delete it. Then you can easily edit the scripts.

 

Link to comment
Share on other sites

21 hours ago, stgatilov said:

If for some reason you want to keep clean 2.10 installation or dev build, just copy the whole TDM installation directory: you'll have less confusion this way. It is possible to have single installation but juggle around with executable and glprogs, but I wouldn't recommend that.

I had this exact idea, but now I see your recommendation to not do that.
 

21 hours ago, stgatilov said:

If you want e.g. to edit game scripts, find the pk4 archive which contains them, then unpack its contents and delete it. Then you can easily edit the scripts.

I have no idea what exactly this is but I will try to explore what all this means. I have to manage school as well so I will see what I can do.

Link to comment
Share on other sites

Just to be clear. (As I see it)

"Playing around" with the assets:
Unpacking/viewing/changing data like 3d-models/textures//sound/GUIs/scripts/etc.
that are inside the pk4-files (Those are just zip files)
info: Wiki - Main page and How to pack your Mission

"Playing around" with missions:
Download a mission from internal mission downloader. And then change the mission with DarkRadiant editor.
info: TDM Wiki - DarkRadiant

"Playing around" with the source code:
The source code of the game engine. more info see posts above and at the wiki.
And fix code bugs in https://bugs.thedarkmod.com/
Info: TDM Wiki - Coding & Scripting

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

There's always two relevant versions of the source code, the version for the latest release and the WIP version. If you're in it for learning early on, if you want to do small little experiments where you just swap new source code in and out without changing assets, or if you have space issues or want to keep things compact, or if it's on some really niche or independent part of the game that updates probably won't touch it, etc., then the release version may be fine for your purposes.

But if you want to get into it seriously, at some point you'll want the WIP version as an independent install, anyway, because it's kind of self-defeating to work on code that's already been made incompatible, and once you do it, it frees you up to do lots of different things without worrying about what it's doing to the game you also want to play sometimes.

As an aside, I really encourage people to play with the source code. You learn a lot about coding generally, since it's always best to learn by doing, and by doing something you're interested in instead of boring textbook problems. And the kinds of experiments you can run on TDM tend to be fun because, as an immersive sim, there are just a lot of fun things you can do with the game and the world.

I think a good way to start, after reading through the code a bit to get a feel for where things are, is to give yourself some random small assignments, like putting in little features or gimmicks, and then search the code for the elements that seem like they'd be most relevant for that thing. And then as you start tweaking things, the problems you run into are going to be teaching you how things fit together. It's a fun way to learn though.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

And about the language used in TDM and DR are mostly C++ and some Python.

The topicstarter has knowledge of Python. So do a forum search and use only searchword "python" and you will get some project for python (like automation for TDM and stuff for DR)

Im not a C++ programmer or python scripter, but i "played" with little projects, over the years. Like Gui design and gathered (and created) sound/music/guis to trying make my own Fanmission. Did some wiki documentation and i scripted several installers for TDM.

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...