Jump to content
The Dark Mod Forums

How do I program in the dark mod?


kakarotto

Recommended Posts

Hey everyone,

 

First off I gotta say, WOW..JUST WOW guys. I've been following this mod back in the day when it was just announced. I was pretty excited about the idea of playing Thief in the D3 engine. Eventually it was released, I played it a bit and frankly, I was a bit disappointed because back then there were barely any maps and it was so buggy. I deleted it off my computer and forgot about it...

 

I recently checked out a few popular game mod articles and saw this mod mentioned on every single one of them. I came back here, it's been about a decade since I checked the place out, my old account from back then is long gone and I had to register for the forum again. I'm extremely impressed that this thing is STILL going, now I see that I don't even need to install Doom 3 to play it.

 

Ok, now on to the topic of this post.
I'm looking to learn programming, although my main focus as of this moment is to become a web developer and I'm learning Ruby and PHP, I want to work on game mods. This is the reason why I was looking at game mod related articles which I mentioned in an above paragraph.

 

Which languages are used for this mod?

What kind advice can you give someone who only did a bit of Javascript, HTML and CSS in the past?

I'm aware that this type of software requires a compiler as opposed languages I used that only needed an interpreter.

 

I see that the source code is available for anyone who wants to take a look at it.

 

Thank you,

  • Like 1
Link to comment
Share on other sites

TDM is written in C/C++. Under windows, you need microsoft visual c++, under linux scons to compile.

 

If you want to take a look, you should first learn the basics of c++ (which is close to java which is close to javascript :) ). And you can take a look at the source code, of course.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

HI and welcome. Have you played any recent maps yet?

Which languages are used for this mod?

Core code: Mostly C++. There's some C and assembly and SSE in the lower-level parts of the engine.

There's also a lot of code in the idTech4 scripting language, which is based on c++. I think it'd look familiar to a javascript programmer.

And there's shader code, run on the graphics card. Our current shaders are written in the ARB assembly language which was already a bit archaic when Doom3 was released, but we're experimenting with the modern version (GLSL) for future releases.

What kind advice can you give someone who only did a bit of Javascript, HTML and CSS in the past?

Do the mapping tutorial so you have an idea how the game world is constructed. Work on a couple of game scripts next, which will let you do stuff in a familiar (interpreted) environment while you get acclimatized to the workings of the game.

I'm aware that this type of software requires a compiler as opposed languages I used that only needed an interpreter.

If you're a Windows user, use the free Visual Studio 2013 Community Edition to compile the game and engine code.

  • Like 1
Link to comment
Share on other sites

Do the mapping tutorial so you have an idea how the game world is constructed. Work on a couple of game scripts next, which will let you do stuff in a familiar (interpreted) environment while you get acclimatized to the workings of the game.

 

Oh. This one. Are those 'false streets' textures or something erm... unique? Erm... I mean. I have not read about them yet, at wiki, but... I think they are prerendered pictures that are used as textures somehow... Aren't there more of them? Can I map some buildings, render them, and make my textures alike?

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

Can one change entities' attributes such as Team from inside the script (which are to be written in Python)?

 

E.g. I enter the church and all Hammerites are friendly as though I only went to take a blessing, but when I take someone valuable and someone notice it's missing they alarm and become unfriendly.

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

@Scam,

Typically in TDM you can do a lot on the map editor itself. You could change team specs (and do a lot of stuff) via entities in the map editor. TDM also has a powerful scripting language (is it a language?) that is easy to learn and very useful.

 

http://wiki.thedarkmod.com/index.php?title=AI_Relations_(Editing)

http://wiki.thedarkmod.com/index.php?title=AI_Relations_(Scripting)

 

It is not python, but fast learn. With scripts and entities, the mappers possibilities for custom fanciness is almost limitless.

 

More on scripting here:

http://wiki.thedarkmod.com/index.php?title=A_Beginner%27s_Guide_to_Scripting

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I can recommend making little projects for yourself to learn the code, because there's no better way to learn than doing. You're free on your local version to do any crazy thing you can imagine. This is what makes TDM like 2 games for me (when I was building more anyway) the actual game, and toying with the code or in DR.

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

@dem, I have one more question, how should I execute my map for testing? Look, I've read Wiki, but it's not obvious for me:

 

In the console type and Enter dmap Tut/T001 where you should substitute your subfolder name for Tut and your mission filename for T001. So, if you created your mission file directly in the maps folder then you do not need a folder name and can put dmap T001. If you made a subfolder in maps called MyMaps and named your mission MissionImpossible999.map then enter dmap MyMaps/MissionImpossible999.

 

But,

 

Save it now as any suitable name. You might prefer to save later but I always do it immediately. All missions must go (with exceptions I will describe later in Managing your Mission Files) in the darkmod\maps folder or a folder within that. I urge you to create a new folder for each project within that maps folder.

 

There is not any maps folder in TDM/. I unpacked the startmap following its manual page to TDM/ so it's something like TDM/startmap/maps/startmap.map

 

So what should I type in console? The Wiki manual looks a bit outdated.

 

Apart from special materials like water and weather, all the raw material you will use is 'solid' to form different shapes. So we can make panels and place them together to form lots of floating airtight boxes and these can be linked together. The entire game then takes place inside those boxes. One box can hold a tiny cupboard or an entire cathedral and a lot of boxes can hold a city.

 

This means, one huge box and lots of small house-shaped boxes? Or something else?

Ah, by the way. Is it true that using patches for walls and etc. is more preferable than using basic solid blocks? I mean... I climbed onto roofs in 'Tears of Saint Lucia' and occasionally fell down into some house... And it was transparent, from inside I could see the streets. It was one-way textured. So this house was made of patches, right?

Edited by Scampada

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

@dem, I have one more question, how should I execute my map for testing? Look, I've read Wiki, but it's not obvious for me:

 

But,

 

There is not any maps folder in TDM/. I unpacked the startmap following its manual page to TDM/ so it's something like TDM/startmap/maps/startmap.map

 

So what should I type in console? The Wiki manual looks a bit outdated.

It is a bit outdated I fear, but it should work.

For a first try you can just make the "maps" folder, and put your own folder inside there. Or also the startmap folder.

I think that would work, maybe you'd have to change some settings in DarkRadiant first (not sure)

to execute for testing you would then have to type:

dmap ownmapfolder/ownmapname (or startmap/startmap for example)

after its finished go to the console again and type

map ownmapfolder/ownmapname (easily done by pressing up, bringing the last command up, then pos1 and then del (deleting the first letter))

 

For another approach look at that post:

http://forums.thedarkmod.com/topic/9082-newbie-darkradiant-questions/page-236?do=findComment&comment=370980

(Material file not necessary in your case i think, the others should be necessary.)

Link to comment
Share on other sites

I've tried this. It won't load a map because the game had not found mynew.proc file. And dmap warned me of leak. Indeed, I have removed 3 walls manually, then resized and duplicated the last one, and placed 3 new walls as they were before... At least this looked right for me. I guess there was a tiny gap somewhere... How can I check for it in DR? If I put walls together manually.

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

Thanks for the feedback guys. I am not at all familiar with C or C++, I definitely need to learn. Programming games is a whole different world compared to web development, I have a lot of work cut out for me just in terms of trying to learn. I'm still learning web development so this won't be easy.

Edited by kakarotto
  • Like 1
Link to comment
Share on other sites

The Linux community supports open source software and getting them to program and test the game on various distros will do a lot of good. I installed The Dark Mod on windows and it works just fine, I've seen a lot of people say that there's issues with getting it to run on Linux.

 

This could be caused by lack of proprietary video drivers maybe. There are problems with them time to time under Linux.

 

This would be the first fully featured 3d game that runs on a good graphics engine there and many people would probably download it just to check it out.

 

Ahem. No, as far as I know. Nowadays there is much more game ports which run as natives under Linux. Didn't care much though, I'm enjoying Wesnoth and Moria under Linux. Ah, Arx Fatalis, too. Great games.

Edited by Scampada
  • Like 1

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

Thanks for the feedback guys. I am not at all familiar with C or C++, I definitely need to learn. Programming games is a whole different world compared to web development, I have a lot of work cut out for me just in terms of trying to learn. I'm still learning web development so this won't be easy.

I believe you can do much with the inner script language, without need to modify the mod itself. As mapper you probably can script many ideas using no pure C++ at all.

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

Can one change entities' attributes such as Team from inside the script (which are to be written in Python)?

 

E.g. I enter the church and all Hammerites are friendly as though I only went to take a blessing, but when I take someone valuable and someone notice it's missing they alarm and become unfriendly.

 

The situation you describe should not be too difficult to make. You can make a simple stim/response pair, that changes either the team of the player/Builders or the team relation between Builders and the player. For Stim/response see the last page of Fidcal's Tutorial in the wiki (http://wiki.thedarkmod.com/index.php?title=A_-_Z_Beginner_Full_Guide_Page_6).

 

I would recommend going through the whole tutorial, if you plan on starting to map with DR. I found it most helpful and easy to understand. With it, most questions I have seen,that you have asked, should be answered (e.g. running a test mission in TDM). Another remark to scripting: There is also a tutorial on the wiki, but that is, sadly, not yet finished. I myself have absolutely no experience in programming/scripting/coding, but with that tutorial and some help here in the forum, I was at least able to make a small script for my map.

Link to comment
Share on other sites

With it, most questions I have seen,that you have asked, should be answered (e.g. running a test mission in TDM).

 

Aye, I've already got it, but I started reading startmap tutorial and it wasn't working, then I started reading A-Z and all works fine now.

 

By the way, isn't it possible to compile map right in DR? To get the dmap output not starting the game. Or maybe, hmmm... if it's not possible, it may be not hard to implement... A button that will mark all gaps in the current orthoplane with red color... Hmmm, no it doesn't make sense now, I'll think of what I would like to say later. I see no algorithm in that now.

 

Btw, why the NPC I put into my test room does fall through the floor down to his belt for a part of second when walking or running in the corners if there is no gaps? After that he 's staying on the floor normally again and continues walking in the same direction. I've tried it myself but I'm not falling nowhere whatever I'm trying to do: run, walk, crouch, jump. Objects that I throw in these places aren't disappearing also.

Edited by Scampada

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

Sounds to me, that the AI is put slightly below the ground and thus falls down. You can just zoom in, to see if that is the case. You could try "snap to grid" or raise the AI by hand. If that does not help, I have no idea.

Link to comment
Share on other sites

Sounds to me, that the AI is put slightly below the ground and thus falls down. You can just zoom in, to see if that is the case. You could try "snap to grid" or raise the AI by hand. If that does not help, I have no idea.

I have raised him by one grid line -- he won't move otherwise because his feet were barely below the ground, so he starts walking normally, but he falls time to time when walking. Why could he put itself below the ground occasionally after he spawns and walks here and there I don't know.

 

It looks like this:

 

https://youtu.be/UZWiOFWF2ks

Edited by Scampada

Stop taffering there, criminal taffer!

Link to comment
Share on other sites

I'm in the same boat as you. I'm following fidcal's A to Z Beginner Guide to get a basic understanding of how the dark mod works and create a map.

Then set small achievable goals for yourself. For instance, I'm trying to add a new weapon to this game.

 

Lots of research as well

- http://www.iddevnet.com/doom3/

- http://wiki.thedarkmod.com/index.php?title=Main_Page

 

on a side note, it's a shame that we came after doom 3 world got shutdown. I heard there were tons of resources that were lost.

I remember someone cloned the wiki and was trying to bring some of the resources back, but I forgot where the link for that was.

Link to comment
Share on other sites

They had a site that explained the syntax for every scripting function. That's something I don't know where to find now, at least in the detail it had, and miss. There's no telling how much was lost that was buried in countless threads on the forum.

 

I remember someone cloned the wiki and was trying to bring some of the resources back, but I forgot where the link for that was.

 

There's the Wayback snapshot of it.

https://web.archive.org/web/20120302232233/http://www.doom3world.org/index.php

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

I'm in the same boat as you. I'm following fidcal's A to Z Beginner Guide to get a basic understanding of how the dark mod works and create a map.

Then set small achievable goals for yourself. For instance, I'm trying to add a new weapon to this game.

 

I think, this is a good way to do it. But although I do not wish to discourage you, I think adding a new weapon is quite high aimed. I am also quite new and tend to plan over my head. I did not want to make a new weapon, put a wrench like in Thief 4. It works quite well, as soon as it is in the inventory (I can in general use it like a key), but creating a new model takes some work. If you have experience with Blender or similar programs, you are fine. Otherwise be prepared for a lot of learning. I myself have spent a couple of hours and only have a model, that is in no way of the quality I would want it to have in a mission. As I said: I don't want to discourage you! I just wanted you to be prepared, that making new models is a completely other thing as building missions.

Link to comment
Share on other sites

You/we/everyone should start new threads about technical challenges. There's so much distributed knowledge between the users of this forum about how to do all of this. The newbie thread isn't the best place because discussions get buried. Personally, I've been meaning to write wiki articles about transparency, scripting, and how the renderer works for more than a year now, but I never quite get round to dedicating several days to the task. There's always something else a bit more urgent. But I'd happily spend a couple of hours here and there posting details and diagrams in a thread for anyone who wants to make use of the knowledge I've discovered right away. That's more motivating than a monolithic wiki article that might or might not get used. I'm sure the same goes for others who know stuff that I don't (like how to set up a new weapon!).

 

Re the lost forum-and/or-wiki mentioned above, I made a specialised webcrawler last year to retrieve the entire content of another wiki from archive.org and I posted it as a working website in a zip file on this forum... I think it was modwiki, but I can't remember for sure off hand. Is there another one we should pull? I guess a forum is harder to organise.

Link to comment
Share on other sites

They had a site that explained the syntax for every scripting function. That's something I don't know where to find now, at least in the detail it had, and miss. There's no telling how much was lost that was buried in countless threads on the forum.

 

 

There's the Wayback snapshot of it.

https://web.archive.org/web/20120302232233/http://www.doom3world.org/index.php

 

I found the wiki I was referring to - https://modwiki.xnet.fi/Scripting

I'm sure this will be extremely helpful for those that like to tinker with TDM and other id tech 4 games.

Edited by bedhead
Link to comment
Share on other sites

  • 3 weeks later...

Hey kakarotto I'm right there with you man I need to learn this engine really well if I want to ever make this coop mode and eventually a full blown mp. One big thing I have to make sure of is making the code super portable so if we ever decide to move on to a new engine.

Edited by c0mputer-fr0d
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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • 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
×
×
  • Create New...