Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Proton Beam

  1. #1

    Proton Beam

    Hi guys,

    I'm hoping you BGE experts can help me figure something out, or at least point me in the right direction with what I'm trying to do.

    What's the best way to do a Ghostbusters (1984) style animated proton beam, for a fps game in the BGE? Can animated curves be used in the BGE?

    I would like for one end of the beam to "lock on" to the intended target and have the beam dance around wildly between the target and the barrel of the beam thrower.

    How would this be done, if it could be done at all?

    I've been playing around with some ideas on how to do this, by all failed miserably.

    TIA
    fitz



  2. #2
    Moderator Monster's Avatar
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    13,799
    There are several ways to do that.

    A) Play sprite animations. Track the target and scale the size it ends there. Pretty simple and effective. Dependent on the view angle it might look flat (as it is flat).

    B) Curves - no - not supported.

    C) Particles. Have one or more emitters that track to the target and are scaled to end there (similar to A). The emitters should emit particles (objects) between origin and target. This can be done by letting emitter objects play curve animations.

    D) Python calculation: manipulate the vertices of one or more meshes via Python.



  3. #3
    Member BluePrintRandom's Avatar
    Join Date
    Jul 2008
    Location
    NoCal Usa
    Posts
    18,775
    ok

    Code:
    start  = player_weapon.worldTransform*Vector([x,y,z])
    End = player_weaponRay.hitPosition
    p2 = ( (start * 3 )+ end)/4
    p3 = (start+end)/2
    p4 = (start +(end*3))/4
    
    # this is start, 1/4, 1/2, 3/4, target 
    list = [p1,p2,p3]
    #then we do
    for point in list:
        y_offset = -Range*.5 + (bge.logic.getRandomFloat()* Range)
        z_offset = -Range*.5 + (bge.logic.getRandomFloat()* Range)
        point += weapon.worldOrientation.col[1]*Vector([0,y_offset,z_offset]) 
    
    #now simply connect the dots.
    bge.render.drawLine(start,p1,color)
    bge.render.drawLine(p1,p2,color)
    bge.render.drawLine(p2,p3 ,color)
    bge.render.drawLine(p3,end, color)
    this is what it looks like in practice


    we can place 3d object at start point, and stretch to end point for each point in chain also
    use more or less points based on distance etc.
    Last edited by BluePrintRandom; 17-Apr-18 at 00:26.
    Break it and remake it - Wrectified
    If you cut off a head, the hydra grows back two.
    "headless upbge"



  4. #4
    Member BluePrintRandom's Avatar
    Join Date
    Jul 2008
    Location
    NoCal Usa
    Posts
    18,775
    Attached Files Attached Files
    Break it and remake it - Wrectified
    If you cut off a head, the hydra grows back two.
    "headless upbge"



  5. #5
    Thanks for the quick responses, the videos were very inspiring... looks like I've got some python to learn.

    Is there a way to add thickness to the beams or would that open a can of worms not worth dealing with?

    Thanks alot!
    fitz



  6. #6
    for some reason i feel like giving this a shot. Ill help figure it out. I like blue prints video, but the blend didnt work for me. i may keep the code for later. thanks.

    About the proton pack rays. I do have an idea using my old curve file. seems like it needs 2 objects the red sine wave like center, and a more conventional electricity look , but in a beam like form. I do have a way to do it but lets see. ill get back to u later.



  7. #7
    Member BluePrintRandom's Avatar
    Join Date
    Jul 2008
    Location
    NoCal Usa
    Posts
    18,775
    you have to left click to activate the code cuervo*
    Break it and remake it - Wrectified
    If you cut off a head, the hydra grows back two.
    "headless upbge"



  8. #8
    @Blueprintrandom I got it. just read the console. error on vector. its cool. works



  9. #9
    its comming along. just need the lightning around the red beam. the hard part is done.



  10. #10
    Done. Well at least the proof of concept. its using the same script twice, not good, but my ac is broke n time to get some air. n drink a beer. lol

    I will fix it with all the dazzle later.
    Attached Files Attached Files



  11. #11
    proton_stream.png
    here. just got back n a lil buzzed so.. do i fix it or forget it? lol

    if u guys like it n need it, ill jazz it up a bit, but this is pretty close to the idea of the proton pack stream.

    dont ask it just works. hah
    Last edited by cuervo1003; 17-Apr-18 at 22:05.



  12. #12
    That's EXACTLY what I was trying to do, you guys are definitely way better at the BGE than I am - all these are great!



  13. #13
    I've been messing with your photon_blaster and trying to figure out how the code works, but I can't seem to get the lightning to work like in the screenshot.

    Is it just an animated texture? I can never get animated textures to work properly and I don't want to break the rest of the beam animation, is there some things I need to change. I tried turning on the animated textures in the UV editor, but that didn't work and anything after that I am not familiar with as I don't mess with the BGE that often.

    Thanks again for the .blend file.
    fitz



  14. #14
    can u send a pic of what is happening?

    this new file has no errors for me so send image of console for errors.

    This is the newer file i put all both meshes to use the one shader code.
    proton_stream.png

    the file should just work when u press p. Here is the latest file.
    Attached Files Attached Files
    Last edited by cuervo1003; 19-Apr-18 at 08:44.



  15. #15
    The most recent .blend works perfectly, I was referring to the previous one.

    These look really fantastic.



  16. #16
    Member Nick Manchul's Avatar
    Join Date
    Apr 2016
    Location
    Ukraine
    Posts
    399
    Originally Posted by cuervo1003 View Post
    can u send a pic of what is happening?

    this new file has no errors for me so send image of console for errors.

    This is the newer file i put all both meshes to use the one shader code.
    proton_stream.png

    the file should just work when u press p. Here is the latest file.
    - under what conditions can I use this file? Tutorial, free reference, in commercial terms?
    my main Thread | my Youtube channel | my Cloud



  17. #17
    I dont care how u use it. when i put stuff out its for free use. if u get rich off it let me know. lol

    go sub to my channel.
    https://www.youtube.com/user/carlosa..._as=subscriber

    I'm assuming u liked it?
    Last edited by cuervo1003; 20-Apr-18 at 02:04.



  18. #18
    Member Nick Manchul's Avatar
    Join Date
    Apr 2016
    Location
    Ukraine
    Posts
    399
    Originally Posted by cuervo1003 View Post
    I dont care how u use it. when i put stuff out its for free use. if u get rich off it let me know. lol

    go sub to my channel.
    https://www.youtube.com/user/carlosa..._as=subscriber

    I'm assuming u liked it?
    - recently I watched the video on Youtube, there was missed one punctuation mark, and this was the reason for breaking the multimillion-dollar contract ... somewhere in Canada.
    - you have a good channel, good graphics in games. Also a good shader ...But probably I will use my experience with a possible future project.

    A good solution (especially for shaders) can be officially sold (copy) - 1-5 percent of the game for a few shaders (weighty), or by other arrangements.

    A simple scheme:
    - free to download, it does not mean free to use
    - free to download and free to use, it does not mean - free to commercial use or free to editing

    and... The Law says so - if you downloaded someone's scene (resources) without specifying a license, then a full copyright for the owner. CC BY 3.0, GPl - these are not empty words.

    Thank you.

    p,s and Super Mario Galaxy is not a brand (тм)? Just stupid will later work on someone ... In what country do you live (work), why did your intelligence not warn you?

    The key to successful freelancing (individual creativity) is the use of fully licensed software (resources, names).
    And if your hands are folded behind your back when you are walking around and think - the spiritual world, it is also your spiritual slavery for your theft ... and you are unlikely to go to your project (final).
    In a place where nothing can be seen or heard, everyone knows, and mechanics works irreproachably.
    Last edited by Nick Manchul; 20-Apr-18 at 05:08.
    my main Thread | my Youtube channel | my Cloud



  19. #19
    @ Nick So i come and decide to help my fellow blender users, mostly because i feel obligated as a vet user i have been helped so much by the blender artist community. Kinda sux to see that is how u feel. I do understand what ur sayng but i don't care about it. I enjoy just playing my game and am a true fan of mario. I have thought of rewraping it as my own game( new models same code). I see it as constructive criticism as if feel i only get shit because its obvious i can make any game i wanted. I tend to make librarys of my code for later use, and my format for SBG is made to suit these needs. Its basically a learning experience n even though i havnt finished SBG i have matured enough to know making anything else is possible and how to handle people that are negative towards something i'm passionate about.

    vine_curve.png
    ps: that electric proton pack shader benefited for this project and was able to be changed from a ride-able vine to the proton pack in a less than a day. I wish i could have showed it off in my game but i took it out and went out of my way to do it for u guys so.. Now u can use in for what ever you choose thanks to me and i have to wait till i get to show it off in my "failed" game. ur welcome i guess.
    Last edited by cuervo1003; 20-Apr-18 at 13:00.



  20. #20
    Member Nick Manchul's Avatar
    Join Date
    Apr 2016
    Location
    Ukraine
    Posts
    399
    Originally Posted by cuervo1003 View Post
    @ Nick So i come and decide to help my fellow blender users, mostly because i feel obligated as a vet user i have been helped so much by the blender artist community. Kinda sux to see that is how u feel. I do understand what ur sayng but i don't care about it. I enjoy just playing my game and am a true fan of mario. I have thought of rewraping it as my own game( new models same code). I see it as constructive criticism as if feel i only get shit because its obvious i can make any game i wanted. I tend to make librarys of my code for later use, and my format for SBG is made to suit these needs. Its basically a learning experience n even though i havnt finished SBG i have matured enough to know making anything else is possible and how to handle people that are negative towards something i'm passionate about.

    vine_curve.png
    ps: that electric proton pack shader benefited for this project and was able to be changed from a ride-able vine to the proton pack in a less than a day. I wish i could have showed it off in my game but i took it out and went out of my way to do it for u guys so.. Now u can use in for what ever you choose thanks to me and i have to wait till i get to show it off in my "failed" game. ur welcome i guess.
    - I may not correctly understood, but I have no complaints about you - you have everything beautiful. But extra caution, as well as respect for someone else's copyright - superfluous does not happen.
    And I also feel there is a need to share my examples - I also learned a lot on this forum - a little gratitude for the help.

    Thank you for attention.
    my main Thread | my Youtube channel | my Cloud



Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •