Alpha's particle effect workshop

Discussion in 'Work-In-Progress Mods' started by Alpha2546, March 29, 2015.

  1. MrTBSC

    MrTBSC Post Master General

    Messages:
    4,857
    Likes Received:
    1,823
    @Alpha2546

    what do you think about changing either color or intensity (or both) between the laserturret´s beams
    think that would be worthwhile?


    one thing that could be changed about the kestrel and piranha maybe is adding simple white-ish jettrails to their MG weapon? but not sure on that one ...
    otherwise that is about it what ideas i have ... ... for now ...
    Last edited: June 8, 2015
    Alpha2546 likes this.
  2. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    hmmmm I never thought about it but thats doable with the turrets I think. Yeah I haven't really though about it. Maybe some kind of plasmaballs would come in handy for those two units.

    I'm also thinking about adding new muzzle textures to the game to give it an end polish on some units. If you have muzzle animations example then that would help me out a lot.
  3. MrTBSC

    MrTBSC Post Master General

    Messages:
    4,857
    Likes Received:
    1,823
    so generaly for tanks/cannons/slugtypeweapons i would say just to add some extra smoke to the muzzleflash ... maybe extending the flash in length a bit?
    beammuzzleflash maybe only adjusting the color to the beamweapons?
    Alpha2546 likes this.
  4. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    Ooooooh could you gib me the papa for this/teach me how to do this? Love it.

    P.S. Your dox and slammer effects inspired me to make lasery effects for some other units. Still working on it, but you can check it out here: https://bitbucket.org/domdomdom/com.pa.domdom.laser_unit_effects/
    EDIT: Screenshot for the lazy:
    [​IMG]
    Last edited: June 9, 2015
    ace63, cdrkf and Alpha2546 like this.
  5. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Just gonna guess:
    He made a picture in photoshop then saved it, converted to .papa and used it as a texture for a particle emitter. Looks like this is facing: camera also?
    Last edited: June 9, 2015
    Alpha2546 likes this.
  6. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    The conversion step is the one I am not sure of. Are there any format requirements to allow for an alpha channel? If not too hard I could be making my own particle textures which would be awesome.
    cdrkf likes this.
  7. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Hey @dom314 its pretty easy and you can do it too. Let me help you out mate.

    I first used @DeathByDenim Texture editor to read the particle textures. I readed up the texture softdot since it is widely used and is simply the bread and butter in particle effects.

    Selected the file, export it to get the right size and all. You'll now have an editable .png file.

    Open up photoshop to edit the image to your imagination resave the file and copy it to the Planetary Annihilation\media\pa\effects\textures\particles map

    After that open up command prompt in the "bin_x64\tools\" (or 32 bits depends on the OS). (holding left shift and right click will give you an option to open a command prompt in the /toolsmap. Saves time playing around with the cd command).

    Type this in the command line
    Code:
    papatran "..\..\media\pa\effects\textures\particles\TEXTURENAME.png" -o "..\..\media\pa\effects\textures\particles\TEXTURENAME.papa"
    I got that from the conversation between killer kiwi and bgolus in the papadump and papatran thread. SOURCE
    You only need to reedit the "texturename.png" and "texturename.papa" and press enter and it should work.

    No idea how format saving is done in the papatran but I'm guessing you can give it different parameters in commandprompt. In this case it already works fine using the above commandline. Papatran apparently automatically searches for a .settings file in the map to find out how the conversion should be done. Handy quote from bgolus.

    And there you go! You have you're own cool particle textures you can use. Added the heart textures that I use for the love cannon. The heart texture is pretty solid ready. The softheart could have more of a soft glow to the outside but not sure of I'm going to do that since the standard heart pretty much gives me what I need.

    Ohyeah and those effect from the pic look awesome! You don't mind me copy and reediting some of the effects you did right (you'll get credited ofcourse)? I see something railgunny which MRTBC really liked (shellers effect). My plan was to do it with python (like the submarine trails) to get the railgun trail I needed. My inspiration comes from the mass effect 2 thanix cannon (fired at 1:00 in the youtube vid below). We'll see how it goes I guess.

    Attached Files:

    MrTBSC and dom314 like this.
  8. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    Woot, thanks that's really helpful.

    Sure why not. If you want help with generating something in python, I can probably help with that. Perhaps even teach you a bit of python xD.

    The form of the current 'sheller' effect is generated by adding 5 extra string emitters to the trail. Each of these emitters has an offsetX,Z time curve that is a linear combination of random sine waves with various periods and amplitudes. The sine curve periods are integer multiples of each other so that the actual period of the combined sine waves matches the life time of the emitter.

    EDIT: The relevant part of src/base_arty/base_art_effects.py:
    Code:
    # waves - the number of sub wavelets to add to the system (will have a period that is equal to base)
    # amplitude - how big the waves are
    # amplitudeRange - range of amplitude size for sub wavelets
    def sine(waves, amplitude, amplitudeRange):
        wavelets = []
        s = range(1, waves * 2)
        waves = int(waves)
        for w in xrange(waves):
            f = random.choice(s)
            s.remove(f)
            a = amplitude + random.uniform(-1, 1) * amplitudeRange
          b = f * math.pi * 2
          c = random.uniform(0, math.pi * 2)
          wavelets.append([a, b, c])
       return wavelets
    
    def wave_to_offset(wavelets, period, dt):
       t = 0.0
       offset = []
       while t < period:
          v = 0
          for w in wavelets:
             v += w[0] * math.sin(w[1] * t / period + w[2])
         offset.append([t, v])
         t += dt
       return offset
    
    def run():
        base_string['lifetime'] = 0.8
        for t in xrange(5):
            string = copy.deepcopy(base_string)
            # produces arrays of random sine wave parameters ( with sine(10, 0.3, 0.1) )
            # then we make an offset time curve from those parameters
            string['offsetX'] = wave_to_offset(sine(10, 0.3, 0.1),  base_string['emitterLifetime'], base_string['emitterLifetime'] / 100.0)
            string['offsetZ'] = wave_to_offset(sine(10, 0.3, 0.1), base_string['emitterLifetime'], base_string['emitterLifetime'] / 100.0)
            base_trail['emitters'].append(string)
        string = copy.deepcopy(base_string)
        string['lifetime'] = 1
        string['sizeX'] = 1
        string['spec']['green'] = [[0, 1], [1, 0.5]]
        base_trail['emitters'].append(string)
    
    Last edited: June 9, 2015
    Alpha2546 likes this.
  9. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    Btw, the latest version of the mod has effects for the pelter as well which is probably a lot closer to what you want already. Have a look inside /mod/pelter/
    Alpha2546 likes this.
  10. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Thanks dom :D . Its gonna take me some time to understand it all but I'll let you know whem i'm struggling with something. Again thanks for all your help mate. You always work with such professionalism.

    Good stuff!
  11. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Okay @dom314 . I've been fiddling around with that python script. Couple of questions ofcourse.

    first of all how do I generate the neccesary json file. (or PFX). I have the script filled in with my leveler projectile effects trail.

    About the trailing.

    So I've changed period to 0.4 since that kinda is the lifetime of the trail in total. So in that time it needs to spin.
    base trail Lifetime is altered to to 0.4 too since that needs to be the max lifetime.

    Then i've noticed another one which is string lifetimes which is 1. What is that then? after that the string spec green too with a couple of values. Is that colour and alpha values?

    Code:
        string['lifetime'] = 1
        string['sizeX'] = 1
        string['spec']['green'] = [[0, 1], [1, 0.5]]
    It just needs to look like the base trail part except with thinner lines (sizex should probably be 0.35 instead of 0.75 then).

    I'm struggling with where do i edit the amount of waves. and the size of the waves (which is amplitude I guess?).

    You're code with my changes.

    Code:
    def sine(waves, amplitude, amplitudeRange):
        wavelets = []
        s = range(1, waves * 2)
        waves = int(waves)
        for w in xrange(waves):
            f = random.choice(s)
            s.remove(f)
            a = amplitude + random.uniform(-1, 1) * amplitudeRange
            b = f * math.pi * 2
            c = random.uniform(0, math.pi * 2)
            wavelets.append([a, b, c])
        return wavelets
    
    def wave_to_offset(wavelets, period, dt):
        t = 0.5      #I changed this
        offset = []
        while t < period:
            v = 0
            for w in wavelets:
                v += w[0] * math.sin(w[1] * t / period + w[2])
            offset.append([t, v])
            t += dt
        return offset
    
    def run():
        base_string['lifetime'] = 0.4  #I changed this
        for t in xrange(5):
            string = copy.deepcopy(base_string)
            string['offsetX'] = wave_to_offset(sine(10, 0.3, 0.1), base_string['emitterLifetime'], base_string['emitterLifetime'] / 100.0)
            string['offsetZ'] = wave_to_offset(sine(10, 0.3, 0.1), base_string['emitterLifetime'], base_string['emitterLifetime'] / 100.0)
    
            base_trail['emitters'].append(string)
    
        string = copy.deepcopy(base_string)
    
        string['lifetime'] = 1
        string['sizeX'] = 1
        string['spec']['green'] = [[0, 1], [1, 0.5]]
    
        base_trail['emitters'].append(base_dot)
        base_trail['emitters'].append(base_softdot_overlay)
        base_trail['emitters'].append(base_trail)
        base_trail['emitters'].append(base_trail_flicker)
    
        loader.save_json(base_trail, "base_ammo_trail.json", indent=2)
    So how do I generate those surrounding spinnin tails with the looks that are defined in the base_trail section and how do I get the python file working.

    Ohyeah and thanks :)

    Attached Files:

  12. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    Heh, okay well I ended up making my mod generator a lot more complex than previously. The line loader.save_json is the one which stores the trail, but that is some of my own code.

    Quick question, do you want a spinny trail? or a randomish looking trail?[​IMG]
    This is kinda what I am making with my sine function, the idea is that if I choose a function that looks like that for both the X and Z offset, I will have something that is random, but is also smooth.

    If you want to make a spiral effect, it is going to be a lot simpler. I can actually write one from scratch that should make it easier for you to understand.

    Oh, and just so you know, the base_arty script of mine generate effects that are actually pink. I then patch that effect to make the components green/blue and purple depending on the weapon they are used for... You can see the patch files inside /src/pelter and /src/holkins.

    Updated

    Attached Files:

    Last edited: June 9, 2015
    Alpha2546 likes this.
  13. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Meh I first thought I wanted a spiral effect but I think getting the random looking trail is going to look cooler. A couple of those would be better.
  14. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Released the leveler effect just a few minutes ago. Looks really cool now. Unfortunately no railgun lines along with it but those can be always added in the future ( with some help of @dom314 :). I hope you like the colour @MrTBSC !

    lev1.jpg

    lev2.jpg

    Ohyeah added the files to this post @stuart98 . You can edit change or do whatever you want with it. Just put some credits in and its all good :).

    Attached Files:

    MrTBSC and planktum like this.
  15. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Could you send me the pfx for the yellow version?
  16. MrTBSC

    MrTBSC Post Master General

    Messages:
    4,857
    Likes Received:
    1,823


    .... ..... HELLOOOOOOO SISTEEEEERRRR!!!


    that looks sweet ... looking forward to see it in action in game! :D
  17. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
    I think that looks excellent. Do you want rings added to it or nah?
    Actually I just realised that you could spawn ring particles.

    So I have some comments:
    - Make the muzzle flash blue?
    - Perhaps the trails should be thicker? I think thickness actually communicates 'umpf' pretty well.
    - The leveler has a really tiny splash radius. The hit effect looks a bit busy? Dunno.
    Last edited: June 12, 2015
    Alpha2546 likes this.
  18. MrTBSC

    MrTBSC Post Master General

    Messages:
    4,857
    Likes Received:
    1,823
    i have to see alphas leveler effect in game yet
    but considering your own effectmod
    one thing i like to suggest is to be carefull not to saturate the projectiles too much ... "umpf" imo is not neccesarily communicated by the projectile itself but by its launch and impact ... projectilespeed also matters (as well as audio but iirc you guys can't do much about that at the moment ?)

    i will link some examplevideos later .... kinda difficult with the phone
    Alpha2546 and dom314 like this.
  19. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196


    Hmmm not sure about this. I think the rings need to be smaller at first? @MrTBSC what do you think?
    Alpha2546 and killerkiwijuice like this.
  20. MrTBSC

    MrTBSC Post Master General

    Messages:
    4,857
    Likes Received:
    1,823
    yes agreed rings need to be closer to the trail



    ... .. but holy screw does that look gorgeus
    dom314 likes this.

Share This Page