Announcement

Collapse
No announcement yet.

Trying to understand darkplaces source code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to understand darkplaces source code

    I'd like to have a place where I can ask stupid questions and log my progress. Maybe it will become handy to somebody who digs this thread in a few years.

    I'm currently playing with darkplaces, windows version, winapi only (no sdl). My goal is gamedev and to become a proper programmer already. Maybe I should study unity or unreal engine instead, but let's finish this first i guess.

  • #2
    Code:
    ifdef WINDIR
    	DP_MAKE_TARGET=mingw
    else
    Not sure why there is so much extra space at the bottom of code blocks, tell me if somebody knows.
    Last edited by vibok; 05-29-2017, 09:39 AM.

    Comment


    • #3
      Quake has 2 component to how it works:

      1) The game logic (QuakeC)
      2) The engine.

      DarkPlaces is designed to not need much engine modification. It exposes everything it can to a mod developer.

      Monster behavior, what happens when you push a button, when happens when you touch a rocket .. those all happens in the progs.dat

      You can find the progs.dat by opening pak0.pak using PakScape
      https://www.quaddicted.com/files/tools/pakscape-011.zip

      Some info here in post 2197

      Func_Msgboard: Coding Help

      Quake mods are not engine modifications. For instance, the following mod will run in any engine:

      https://www.quaddicted.com/reviews/lunsp1.html

      On that page, note the presence of a progs.dat with green check mark, it indicates that it isn't just a custom map. The author of that mod also included .qc files for custom monsters it uses.

      /Note: I don't use QuakeC. There are plenty of others who do use QuakeC.

      Whether or not you decide to learn with, say, Unity instead is up to you. Unity has plenty of video tutorials.
      Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

      So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

      Comment


      • #4
        Things I need to understand, in makefile

        1) This bit about dependencies, at the end of makefile

        Code:
        ##### Dependency files #####
        
        -include *.d
        
        # hack to deal with no-longer-needed .h files
        %.h:
        	@echo
        	@echo "NOTE: file $@ mentioned in dependencies missing, continuing..."
        	@echo "HINT: consider 'make clean'"
        	@echo
        currently reading this Auto-Dependency Generation | GNU make

        2) how profiling works, and what are those gcda and gcno files

        Code:
        clean-profile: clean
        	-$(CMD_RM) *.gcda
        	-$(CMD_RM) *.gcno

        Comment


        • #5
          While on topic of QuakeC. Here are a few links.

          wikipedia entry: https://en.wikipedia.org/wiki/QuakeC

          Interesting video tutorial: https://www.youtube.com/watch?v=s7GGLj1yXJE

          general info on QuakeC: http://www.gamers.org/dEngine/quake/spec/quake-spec34/

          Looks like QuakeC support was dropped in Quake 2 in favour of real compilers and real dll. Carmack said that "This wasn't an option when we had to support dos, but I think it is the correct choice now." https://github.com/ESWAT/john-carmac...n_19970313.txt

          There is no reason to use QuakeC or something like that in modern games, I plan on removing it completely. But before that I'd like to dig in and see how it works. And monster ai, I'm curious how it's written, maybe I'll be able to steal some ideas from it.
          Last edited by vibok; 06-13-2017, 03:56 AM.

          Comment


          • #6
            This link is important Quake Developers Pages . Lot's of info, haven't finished reading this all yet.

            If you want info on any modern game's internals, Valve Developer Community and official unity video tutorials are really good. Pleasure to read, even if I wouldn't use neither source nor unity.

            Comment


            • #7
              It looks like Quake 1 lightmaps were handpainted at times. In e1m2 there is a lit circle under the shotgun, and lit areas where nailtraps shoot. And at e1m3(?) there was a shadow in shape of quake logo. I wonder if modern quake map editors (GtkRadiant?) can do that.

              Also I'm curious how the lighting for models is calculated. Probably it's just a single value, and it's taken from the ground under the model. At least Quake 3 did this. Maybe this is the reason to highlight the ground under the shotgun, to make shotgun more lit.

              I think I've read somewhere that some engines overbright maps, that maps appear different in different quake engines. Can somebody confirm this?

              Comment


              • #8
                del
                Last edited by vibok; 06-13-2017, 03:31 AM.

                Comment


                • #9
                  Q1 lightmaps are generated through the use of light entities. Light entities are placed in the levels within the editor, and can be targeted towards other entities to create a spotlight, as you have seen in the shotgun spot in E1M2.

                  The Quake shadow logo is in E1M5, and was made using a 'trick': a BSP object made of brushes in the shape of the logo was recessed above the sky and a spotlight was cast onto it.

                  A general rule of thumb: pretty much everything you see in the original episodes of Quake can be done in any competent Q1 level editor without modifications.
                  'Replacement Player Models' Project

                  Comment


                  • #10
                    Originally posted by vibok View Post
                    modern quake map editors (GtkRadiant?) can do that.
                    JackHammer (also known as J.A.C.K.) and TrenchBroom are modern Quake map editors.
                    Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

                    So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

                    Comment


                    • #11
                      Originally posted by Dutch View Post
                      The Quake shadow logo is in E1M5, and was made using a 'trick': a BSP object made of brushes in the shape of the logo was recessed above the sky and a spotlight was cast onto it.
                      huh, there really is something up there in that room, it looks just like the rest of the sky. Expected something of more complex shape though.



                      Anybody knows of any darkplaces commands that can show lightsources, wireframe, stuff like that? I'll search for map decompiler in the meantime.


                      Originally posted by Baker View Post
                      JackHammer (also known as J.A.C.K.) and TrenchBroom are modern Quake map editors.
                      Thank you~

                      Comment


                      • #12
                        Originally posted by vibok View Post
                        map decompiler
                        Some dead links, but you can find many things:

                        Quake Navigator
                        Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

                        So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

                        Comment


                        • #13
                          http://rome.ro/s/quake_map_source.zip
                          no need to decompile the vanilla maps (disclaimer: the released source does have a few noticeable differences, eg end.map). Besides, q1 map decompilers universally suck.
                          Some Game Thing

                          Comment


                          • #14
                            Awesome, thanks!

                            Comment


                            • #15
                              Maybe you don't need some of the _shared files too, I haven't checked yet.
                              Last edited by vibok; 05-28-2017, 08:46 AM.

                              Comment

                              Working...
                              X