Announcement

Collapse
No announcement yet.

TUT: Add particle effects + models + sounds into Quake via .ent files in DarkPlaces

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

  • TUT: Add particle effects + models + sounds into Quake via .ent files in DarkPlaces

    .
    This tutorial is dedicated to Jeff "gdiddy62".
    (I am sorry that it took me so long to make it)


    Dear all,

    I will try to create a tutorial that shows how to add these things into a map via .ent files:
    - particle effects
    - models
    - sounds

    This tutorial will focus on the DarkPlaces engine, because it makes use of dpextensions.

    First of all, we need a tiny QC modification to be able to do this.
    It is already implemented into the "small mod compilation", but you can of course use the tiny extra code in your mod as well (QC-Download see below) if you do not use the "small mod compilation".

    Now we must create the map�s .ent file, which we will modify later on.
    You can create an .ent file for every map (custom or stock ID1).
    Start your map (example e4m3) and open the console. Then type:
    sv_saveentfile
    The e4m3.ent file is now in your maps folder.
    Be careful, existing files will be overwritten !!


    1.) Add sounds into maps
    I want to start with adding sounds in maps, because it is the easiest thing.
    We will make use of the dpextension DP_SV_POINTSOUND here.

    Lets say, you want to add ambience lava sound to lava pools in Quake.
    You only need the sound file in .wav format.
    (there are very nice free sound files available on the internet)
    Put it into you subfolder: ID1\sound\ambience
    Lets say it is called: lava_ambience.wav
    (you will find this file in the "small mod compilation")

    Next thing you need to know is the map-coordinate where it shall be.
    In this case it should be the center of the lava pool.
    To find the coordinates, DarkPlaces helps you with a build in function:
    RTLIGHTS Editor
    So start your map of choice, which you want to modify (example the start map).
    Then type: r_editlights 1 in the console.
    A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
    Now walk over to the "Hard" difficulty entrance of the start map and find the lava pool.
    The best thing is to use noclip, to be able to go everywhere.



    The rtlights Editor tells us that the center of the pool is at:
    X/Y/Z: 860/1000/-96

    The last thing we need to know is the length of our .wav file.
    I implemented a QC-function that lets us play a loop.
    The length of our lava_ambience.wav file is: 3.5 seconds

    Now we have all informations we need and can modify the .ent file:
    Open it with notepad or a similar program.
    Add this block right after the 1st block and save it.
    Adjust the volume to your personal likings (1= max, 0= min).

    So it will look like this for our example (start map):
    Code:
    {			// this is the original 1st block of start map
    "sounds" "4"
    "classname" "worldspawn"
    "wad" "gfx/start.wad"
    "message" "Introduction"
    "worldtype" "0"
    }
    {			// this is OUR new block
    "classname" "info_notnull"
    "origin" "860 1000 -96"	// represents coordination
    "nextthink" "0.1"	// must always be like this
    "alpha" "0.9"		// represents volume (1= max,  0= min)
    "count" "3.5"		// represents time loop (in seconds)
    "think" "sound_think"	// must always be like this
    "model" "sound/ambience/lava_ambience.wav"	// file path
    }
    Next time we start the start map, we will hear a nice lava ambience sound near the lava pool. The further we go away from the lava pool, the more silence the sound will become.
    The loop time is the same as the .wav file length, as you noticed !
    So we will hear the sound in an endless infinite loop.

    If you want to play a short sound file every 10 seconds (like a drop sound in a stalactite cave for example), simply put "count" "10" into the block.
    This will play the stalactite drop sound every 10 seconds.
    You an also have random sound loop times with a few more code lines.



    2.) Add models into maps
    Now we will talk about adding models into maps, because it is also very easy.

    Lets say you want to add a wooden barrel into a map.
    You only need the model itself.
    (there are very nice free models available on the internet)
    Put it into you subfolder: ID1\progs
    Lets say it is called: ton.mdl

    Next thing you need to know is the map-coordinate where it shall be.
    To find the coordinates, DarkPlaces helps you with a build in function:
    RTLIGHTS Editor
    So start your map of choice, which you want to modify (example e4m3 map).
    Then type: r_editlights 1 in the console.
    A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
    The best thing is to use noclip, to be able to go everywhere.
    In our example we want to place the wooden barrel into the middle of the room:



    The rtlights Editor tells us that the center of the room is at:
    X/Y/Z: 80/256/4

    That is all we need to create our .ent file modification now.

    These following features/properties can be set/adjusted in addition:
    A) transparency
    B) scale (= size)
    C) angle
    D) solid / non-solid
    E) bbox size (hit size)

    Open the .ent file with notepad or a similar program.
    Add this block right after the 1st block and save it.
    So it will look like this for our example (e4m3 map):
    Code:
    {			// this is the original 1st block of e4m3 map
    "sounds" "9"
    "worldtype" "0"
    "wad" "gfx/medieval.wad"
    "classname" "worldspawn"
    "message" "The Elder God Shrine"
    }
    {			// this is OUR new block
    "classname" "place_model"
    "origin" "80 256 4"		// represents coordination
    "model" "progs/ton.mdl"		// file path
    "alpha" "1"			// represents transparency (0= max,  1= min)
    "count" "1.1"			// represents scale/size (bigger value = bigger size)
    "angles" "0 40 0"	// represents angle (X Y Z)
    "sold" "1"			// model is solid (=1) or non-solid (=0)
    "sizemin" "-15 -15 -2"		// represents min bbox size
    "sizemax" "15 15 35"		// represents max bbox size
    }
    If you want to be able to walk right through a model, it must be "non-solid",
    if you want the model to block your way (or makes grenades bounce on it)
    it must be "solid".

    If you want it "solid" you also have to set a "bbox size".
    That is the size of the model that interacts with the game mechanics !
    You can see the bbox size in DarkPlaces when you use this cvar:
    r_showbboxes 1
    It colors the bbox and makes it visible for your convenience:

    without bbox-display: with bbox-display:

    In the above example the bbox size is just low enough to be able to jump on it:


    This way you can put interactive or non-interactive models into your maps.
    With a few QC-lines more you can also decide to make them use GYRO or not.
    The "small mod compilation" uses this feature.
    So you can make them even more "interactive"



    Character limit almost reached !
    Please continue to read in next post how to add particle effects into maps.

    .

  • #2
    continuation from post #1


    3.) Add particle effects into maps
    Next we talk about adding particle effects into maps. This is just a little bit more difficult.
    We will make use of the dpextension DP_SV_POINTPARTICLES here.

    If you already read part 1.) and 2.) of this small TUT, you will know what to do first.
    We need a particlefont.
    A particlefont is a texture which includes 64 particle textures in DP.
    It is build like a chess board. Every field has another texture.
    DP brings its own particlefont, but you can use external ones which might be better.
    The "small mod compilation" already includes such an external particlefont.
    If you do not want to use that one, put your own into the subfolder:
    ID1\particles

    That is all we need for now.

    Next, like always, we need to know the map coordinate where you want to spawn the particle effect.
    As described above, we will use DarkPlaces build-in function for this:
    RTLIGHTS Editor
    So start your map of choice, which you want to modify (example the start map).
    Then type: r_editlights 1 in the console.
    A cursor will appear which will tell you exactly the X/Y/Z coordinates of everything you want.
    The best thing is to use noclip, to be able to go everywhere.

    Lets say we want to add steam / haze to the lava pools in Quake.
    So we need to find the center of the lava pool, where we will spawn the effect:



    The rtlights Editor tells us that the center of the pool is at:
    X/Y/Z: 860/1000/-96

    That is all we need to create our .ent file modification now.

    Open the .ent file with notepad or a similar program.
    Add this block right after the 1st block and save it.
    So it will look like this for our example (start map):
    Code:
    {			// this is the original 1st block of start map
    "sounds" "4"
    "classname" "worldspawn"
    "wad" "gfx/start.wad"
    "message" "Introduction"
    "worldtype" "0"
    }
    {			// this is OUR new block
    "classname" "info_notnull"
    "origin" "864 985 -96"	// represents coordination
    "nextthink" "0.1"	// must always be like this
    "think" "seven_think"	// must always be like this
    "model" "hardentrance"	// represents effect name
    }
    Important:
    Each effect must have a unique effect name.

    The .ent file is done.

    Now DarkPlaces knows to spawn the effect "hardentrance" next time you start the map.
    But before you can actualy see something, you must declare the effect properties !

    And this is where it gets a little difficult.
    DarkPlaces uses a very structured/easy particle effect syntax script.
    But as always: A minute to learn, a lifetime to master.

    Please read the wikipedia description/explanation for every single effect parameter:
    click me and read me

    I will focus in this TUT only on the basic necessary effect params.

    DarkPlaces reads the effect properties from an external file:
    effectinfo.txt
    Map specific particle effects should be declared in a map specific effectinfo.txt (example):
    start_effectinfo.txt
    The map-specific-effectinfo�s belong into ID1\maps (just like the .ent files).

    So we will create a simple .txt file and rename it to start_effectinfo.txt.
    We open it with notepad or a similar program and add the effect properties:

    A) effect name
    This is the first line. We of course use our unique effect name from the .ent file:
    effect hardentrance
    B) amount of particles
    We usualy start with "1" to see how it looks
    countabsolute 0.1
    C) effect type
    We want to create steam/haze/smoke, so we use "smoke" type
    type smoke
    D) particle color
    We want a lava color, so we use red/orange
    color 0x6f0f00 0xe3974f
    E) particle texture
    We will use textures 0 till 7 (randomly) to make it look realisitc/varied.
    Textures 0 till 7 (= 1st row of particlefont) are ideal for steam/smoke effects.
    tex 0 7
    F) particle size
    We start with medium size
    size 2 4
    G) Transparency behaviour
    We need a very transparent effect for steam, that slowly dissappears
    alpha 50 80 7
    H) gravity
    Steam shall slowly rise up, so we will use a small negative gravity
    gravity -0.004
    I) declare the field+limits where the effect shall be
    We need the steam/smoke ALL over the lava pool.
    If we do not "stretch" the effect spawning area, the effect will only appera on the origin !!!
    With this line we stretched the area to cover the complete lava pool:
    In X-direction 160, in Y-direction 200
    originjitter 160 200 0
    J) Finetune the origin point
    We can also finetune the origin of the effect (sometimes necessary, if we use small particles, that must exactly meet one specific point
    With this line we move the origin (= give in the .ent file) a little bit in Y-direction
    originoffset 0 10 0
    K) Make the smoke "alive" by jittering it
    Most of the times it is nicer/better to have the particles use a volume instead of a "single line" during their movement.
    velocityjitter 4 5 2
    L) Make the smoke slowly increase its size while it vanishes
    Realistic smoke needs a sizeincrease while moving upwards
    sizeincrease 3.2

    Our "start_effectinfo.txt" looks like this now:
    Code:
    effect hardentrance
    countabsolute 0.1
    type smoke
    color 0x6f0f00 0xe3974f  
    tex 0 7
    size 2 4
    alpha 50 80 7
    sizeincrease 3.2
    originoffset 0 10 0
    originjitter 160 200 0
    velocityjitter 4 5 2
    gravity -0.004
    bounce 1
    (EDITED: Please do not copy/paste the above content, it will lead to issues if you copy/paste it due to its format.
    I added a download link with this file below. That will work with no issues.)


    Save it and restart your Quake to see if you like it.

    Now you can adjust the effectinfo-settings without the necessity to restart Quake or the map.
    If you need a correction, simply do it in the effectinfo file, save it and write cl_particles_reloadeffects into the console.
    The next second the new settings will be used.
    This saves time and nerves

    Do not worry, once you have a litle bit experience, you will be able to add the steam/hate/smoke to every lava pool in every map.

    Be aware, that if you increase the spawning area, you must also increase the particle amount, because the amount will be used/stretched over the complete area.
    So a small area needs a much smaller amount of particles than a big area.
    Which is logical.

    Be also aware that more particles means more fps impact...



    Please find some examples for each chapter 1.) 2.) 3.) in next post.
    .
    Attached Files
    Last edited by Seven; 08-26-2013, 04:05 PM. Reason: updated DP-Wiki link

    Comment


    • #3
      Hello,

      Please find more samples, links and downloads in this thread: click






      [ame=http://www.youtube.com/watch?v=ZG3IUNuApo0&list=UUbX7uVIXqMzBza0YmLJuMdw& index=1&feature=plcp]solid_and_non-solid_models_addon.avi - YouTube[/ame]

      [ame]http://www.youtube.com/watch?v=UYJoRFefgTI&feature=plcp[/ame]

      DOWNLOAD for above models + effects

      ==========

      Acid bubbles:
      [ame]http://www.youtube.com/watch?v=GzAKH518srY&feature=plcp[/ame]

      ==========

      Some more crazy ideas:
      [ame]http://www.youtube.com/watch?v=ivDInWz4--I&feature=plcp[/ame]

      [ame]http://www.youtube.com/watch?v=u4AbzMdHswE&feature=plcp[/ame]
      Last edited by Seven; 05-03-2012, 08:46 AM. Reason: added some more samples

      Comment


      • #4
        Worth the wait!



        This is exactly what I needed Seven and was worth the wait! Thank you so much for this!!!

        I'll have to mess with it tonight after work and children are put to bed!!

        Comment


        • #5
          Nice tut seven,I was wondering how to add the sounds.
          Also is there a way to add triggers to them?
          WARNING
          May be too intense for some viewers.
          Stress Relief Device
          ....BANG HEAD HERE....
          ---------------------------
          .
          .
          .
          .
          .--------------------------

          Comment


          • #6
            Starting to learn

            Here is my first attempt at adding fog to the start platform of e1m2 Seven. I had to tweak it from my first coordinates, but it worked. Actually the first thing I did was add a monster growl in my start map after you go through the teleport! I'm gonna have fun with this guys...THANKS SEVEN!!
            Attached Files

            Comment


            • #7
              Nice initial 4:20 post...
              www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

              Comment


              • #8
                Very Nice Jeff !
                WARNING
                May be too intense for some viewers.
                Stress Relief Device
                ....BANG HEAD HERE....
                ---------------------------
                .
                .
                .
                .
                .--------------------------

                Comment


                • #9
                  Originally posted by R00k View Post
                  Nice initial 4:20 post...
                  Nice catch!,now if only I had somethin to celebrate that "locked in" 420 moment.
                  Want to get into playing Quake again? Click here for the Multiplayer-Startup kit! laissez bon temps rouler!

                  Comment


                  • #10
                    Thanks bluntz.
                    For me it is a big deal to learn this. I'm sure for others more talented than me it isn't anything at all. I'm going to keep at it and learn as much as I can. I've wanted to add the fog effect to all of the slipgates and platforms for some time and now I can. I'm excited to experiment with other things now!

                    Comment


                    • #11
                      Originally posted by bluntz View Post
                      Nice tut seven,I was wondering how to add the sounds.
                      Also is there a way to add triggers to them?
                      Hello bluntz,

                      my code is too weak to add triggers.
                      The extra QC code (which is "remote controled" via the .ent file) must be extended quite a lot to do this. But then it will not makes sense to proceed this way anymore. Because doing in QC directly what you want to do is the better way I guess.


                      Originally posted by gdiddy62 View Post
                      Here is my first attempt at adding fog to the start platform of e1m2 Seven.
                      Actually the first thing I did was add a monster growl in my start map after you go through the teleport!
                      Hello Jeff,

                      a monster growl to scare the player is a very nice idea
                      Unfortunately this would need a trigger (like bluntz mentioned),
                      because it should only play when you leave the teleporter...


                      Originally posted by R00k View Post
                      Nice initial 4:20 post...
                      Hello R00k,

                      I dont know what meaning is behind "4:20".
                      Could you explain ?



                      @ all

                      I noticed something in chapter 3.) of this TUT:
                      When you copy/paste the effectinfo.txt content, the lava steam goes through the floor and looks terrible.
                      It has something to do with the text format, that you copy/paste.
                      So I added a download link for the "lava steam" effect.
                      This way it works as it should (even though the content is identical).
                      That is funny... I never saw a text format affecting a file.

                      I am sorry for those who already copy/pasted the lines and ended in ugly results.

                      Best wishes,
                      Seven

                      Comment


                      • #12
                        Seven,
                        Thanks again and you're right that a trigger would be better. Right now the sound goes in a loop after the player goes through the teleport. I'm really happy to know more now and feel more confident in experimenting.

                        Regards,

                        Jeff

                        Comment


                        • #13
                          Hello Seven,
                          thank you for this bunch of work!

                          This is a very detailed tutorial.

                          Now it should be "idiotensicher"

                          Comment


                          • #14
                            Hello Jeff,

                            I have been thinking about it and maybe you could do the following (as long as we have no trigger):

                            Put a .wav file with various growl sounds together.
                            It should be a bit longer. Lets say 20 seconds or so.
                            Put quiet passages between each growl sound.
                            Then use "count" "30", and a low volume.
                            That makes it a bit random. It could be used as ambience sounds then.
                            Maybe this is somehow useful for you.


                            Hello webangel,
                            yes Thank you, that was my intention. I hope it really is...



                            @ all

                            I updated post #3 with some other samples/downloads/links.
                            Those have been shown in this forum earlier, but maybe help to give some inspiration...

                            I will add one more pack with very new things in a few days.

                            Have fun playing around with it.
                            Seven

                            Comment


                            • #15
                              Interesting idea Seven. I'll try it tonight.
                              Thanks!

                              Comment

                              Working...
                              X