Announcement

Collapse
No announcement yet.

Link Gun implemented in C++

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

    [PROTOTYPE] Link Gun implemented in C++

    All right, got my hands dirty in the UE4 & UT4 & msvc12 workflow.

    I did implement the Link Gun in native C++, as requested by the challenge.
    No video, sorry, nothing to show that you haven't seen before, as the behavior is the same as the one with blueprints.
    I did arrange some values, like the alternative fire beam, to reflect the DPS of UT3.

    Everything is functional, except some LinkGun-dependent behaviors.
    I used this as a reference: http://liandri.beyondunreal.com/Link_Gun

    To do in the (far) future:
    - team linking to get a stronger beam: team deathmatch isn't the priority, so this has to be done after some work on teamed games modes. (CFT, Team-DM, etc..)
    - vehicles healing: no vehicles at the moment, this has to be done once vehicles are in game.

    Source code : https://github.com/Don-Moahskarton/U...b70fd6faf0af4c


    PS: Thanks to TimEh, I discovered his starter kit for all weapons which made me refactor my code to something cleaner.
    Yup, proudly writing in European B2-class English.
    All grammar mistakes are under copyright protection from my english teacher. Thank you for her.

    #2
    FWIW Team Deathmatch is in recent code so it should be possible to do the linking.

    Comment


      #3
      Edit: Nevermind, taking a look at your code now.
      Last edited by Wail; 07-07-2014, 09:49 PM.
      Join Project: Open Tournament: OpenTournamentGame.com | Project Trello | Discord | YouTube

      Subscribe to /r/UnrealSeries - The subreddit for free & uncensored discussion of Unreal series games!

      Unreal Prime Weapons: Impact Hammer | Enforcer | BioRifle | Shock Rifle | Link Gun | Ripper | Minigun | Flak Cannon | Rocket Launcher | Sniper Rifle | Grenade Launcher | Dispersion Pistol

      Comment


        #4
        Originally posted by Karton View Post
        PS: Thanks to TimEh, I discovered his starter kit for all weapons which made me refactor my code to something cleaner.
        Uh oh. I'm spreading bad practices.

        Originally posted by Mysterial View Post
        One thing I wanted to point out: In general we are still making the end class that LDs place in levels a blueprint, even when all the code is in C++. At that point the blueprint just becomes a content holder. There are two reasons for this: 1) Editing visual aspects is easier and faster in the editor, and 2) Content referenced by C++ is always loaded whereas blueprint references are only used if the map/game/mutators/etc being played reference them. That can be relevant to memory and performance down the line.
        The condensed version... Don't reference content in c++. Reference them in blueprints. Which probably makes the only c++ code needed the specialty link gun stuff.

        Sorry for the inconvenience, I'm still learning the engine. I'll update the base starter kit to explain this.

        Comment


          #5
          Originally posted by TimEh View Post
          Uh oh. I'm spreading bad practices.

          The condensed version... Don't reference content in c++. Reference them in blueprints. Which probably makes the only c++ code needed the specialty link gun stuff.

          Sorry for the inconvenience, I'm still learning the engine. I'll update the base starter kit to explain this.
          Don't worry. I started by looking at your C++ prototypes too, but given that we currently don't have ANY confirmed UT4 content to use it's pretty obvious that referencing anything in C++ is just as a placeholder. Although what I am not entirely clear on is whether we want to declare a certain structure for effects.

          e.g. in LinkGunOrb.h here,

          Code:
            	18 	+ /** socket where the particle effect during flight will be spawned */
            	19 	+ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Projectile)
            	20 	+ TSubobjectPtr<class UParticleSystemComponent> FlightEffect;
            	21 	+
            	22 	+ /** socket where the light during flight will be spawned */
            	23 	+ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Projectile)
            	24 	+ TSubobjectPtr<class UPointLightComponent> PointLight;
          I'm inclined to leave these declarations out as it kind of limits the format of the actor for anyone who might come in later. But at the same time if we know a particular component is pretty much required it seems like it might be ok to add them in C++ rather than adding them to a Blueprint. Not sure here, might just be a content-design philosophy issue with no correct answer.
          Join Project: Open Tournament: OpenTournamentGame.com | Project Trello | Discord | YouTube

          Subscribe to /r/UnrealSeries - The subreddit for free & uncensored discussion of Unreal series games!

          Unreal Prime Weapons: Impact Hammer | Enforcer | BioRifle | Shock Rifle | Link Gun | Ripper | Minigun | Flak Cannon | Rocket Launcher | Sniper Rifle | Grenade Launcher | Dispersion Pistol

          Comment


            #6
            Originally posted by Wail View Post
            I'm inclined to leave these declarations out as it kind of limits the format of the actor for anyone who might come in later..
            Yeah this is what I'm doing from now on.

            Originally posted by Wail View Post
            But at the same time if we know a particular component is pretty much required it seems like it might be ok to add them in C++ rather than adding them to a Blueprint. Not sure here, might just be a content-design philosophy issue with no correct answer.
            I'd say if its needed for functionality, then do it in c++. Cosmetic stuff in blueprints. We'll see what Mysterial has to say

            Comment


              #7
              There is no need to create properties/pointers and default subobjects for visual aspect components unless you are actually going to do something with them in code while the projectile is in flight or some other special handling is required. You can create 'always on' elements much more easily in the blueprint editor and the base UTProjectile code handles deactivating all such effects when the projectile explodes.

              Comment


                #8
                Alright, I'll tweak the code that way.
                Also, I'll see what I can achieve for the team-linking feature.
                Yup, proudly writing in European B2-class English.
                All grammar mistakes are under copyright protection from my english teacher. Thank you for her.

                Comment


                  #9
                  Originally posted by Mysterial View Post
                  There is no need to create properties/pointers and default subobjects for visual aspect components unless you are actually going to do something with them in code while the projectile is in flight or some other special handling is required. You can create 'always on' elements much more easily in the blueprint editor and the base UTProjectile code handles deactivating all such effects when the projectile explodes.
                  Thanks that's the assumption I made in my code but figured I'd ask to confirm.
                  Join Project: Open Tournament: OpenTournamentGame.com | Project Trello | Discord | YouTube

                  Subscribe to /r/UnrealSeries - The subreddit for free & uncensored discussion of Unreal series games!

                  Unreal Prime Weapons: Impact Hammer | Enforcer | BioRifle | Shock Rifle | Link Gun | Ripper | Minigun | Flak Cannon | Rocket Launcher | Sniper Rifle | Grenade Launcher | Dispersion Pistol

                  Comment

                  Working...
                  X