Announcement

Collapse
No announcement yet.

Announcing Section #2 for Survival Game - Weapons & Interaction

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

  • Announcing Section #2 for Survival Game - Weapons & Interaction

    We're announcing the second section of the survival sample game today! The documentation will be up by the end of next week, in the meanwhile you can grab the latest source at GitHub (https://github.com/tomlooman/EpicSurvivalGameSeries). Which will continuously be worked on for the 12 week period! Use the tagged release for stable builds each section, once available.

    UPDATE: Get started with this project RIGHT HERE or get right into SECTION 2

    To give you an idea of what's coming I have setup a short premise for the game:

    "The game is a third person survival game focusing on familiar mechanics from games in this genre.

    You'll have to find a weapon to defend yourself.
    Food and ammunition are spread throughout the level and so you are constantly on the search for resources.
    Enemies may be anywhere, making too much noise while scavenging to survive will attract attention.
    The environment will have interactive objects to help your defence
    The game will support coop play with a buddy.
    Survive as many days/nights as possible.

    You will end up with a basic third person game, fully networked & a small environment with interactive objects that you may use as a base for your own survival game."
    (Please note that features are subject to change, and feedback from you is taken into account when moving forward with the game's direction)

    As mentioned in the original announcement thread of this project, there will be 6 sections total, each focusing on different gameplay concepts to help you understand how C++ works with Unreal Engine 4!

    Features that are planned for this section:
    • Weapons support, featuring an automatic rifle
    • Flashlight (as "weapon")
    • UT Style Inventory
    • Damage Handling, Death and respawn
    • Extended AnimBlueprint
    • On-player visual inventory (eg. see what you or your buddy is carrying)


    Concepts that are covered this section:
    • Working with arrays
    • Dealing & handling damage in ue4
    • Attaching/detaching actors
    • Using sockets in C++
    • Structs
    • Manipulating materials & parameters in C++
    • Driving FX with Physical Materials


    Every two weeks a new section will be announced with a new thread alongside it!

    Please use this thread for questions and feedback you might have!

    Screenshots:

    Click image for larger version

Name:	section2_overview02.jpg
Views:	2
Size:	170.2 KB
ID:	1148237

    Click image for larger version

Name:	flashlight_01..jpg
Views:	2
Size:	94.4 KB
ID:	1147908

    Get started with this project RIGHT HERE or get right into SECTION 2
    Last edited by Tom Looman; 04-16-2015, 09:55 PM.

  • replied
    Originally posted by Tom Looman View Post
    What's the problem? the generated.h files don't need any manual work, the Unreal Header Tool automatically creates these files for you each compile.
    Where did or does it create the STypes.h from? I am trying to understand how to create a file like this but the documentation I have read did not make it clear. I followed some examples and they did not work.. or at least do not work as of 4.12.. maybe something is different

    I tried to follow this https://answers.unrealengine.com/que...d-structs.html which I thought seemed right and it did not work.

    Leave a comment:


  • replied
    Originally posted by joshcamas View Post
    In one of the screenshots, I saw there was some nice blood effect going on. How was this done, exactly? Could you share the textures/particles?
    Everything is available in the project files that you can download mate. The blood FX is from the ShooterGame sample, I re-used it for this project too.

    Leave a comment:


  • replied
    In one of the screenshots, I saw there was some nice blood effect going on. How was this done, exactly? Could you share the textures/particles?

    Leave a comment:


  • replied
    Originally posted by VeyDlin View Post
    I also can not get ".generated.h" in STypes.h
    What's the problem? the generated.h files don't need any manual work, the Unreal Header Tool automatically creates these files for you each compile.

    Leave a comment:


  • replied
    I also can not get ".generated.h" in STypes.h

    Leave a comment:


  • replied
    Originally posted by liXiang View Post
    i have another question about Skeleton socket . Different rifles have different Skeleton root causing the different result when attached to the same socket. how to sovle this problem except modify the source skeleton file? thank u..
    You can rotate the socket after adding it to your skeleton inside the viewer where you added the Socket.

    Leave a comment:


  • replied
    i have another question about Skeleton socket . Different rifles have different Skeleton root causing the different result when attached to the same socket. how to sovle this problem except modify the source skeleton file? thank u..

    Leave a comment:


  • replied
    I have a doubt that how to control the weapon's force when its bullet hit the actor . i found that when I shoot the bomb, it will move. when i shoot the barrier, it can't move. I did not find where to set the power of weapon hit.

    Leave a comment:


  • replied
    I know that Tom,
    But when I I test this code on your project everything was Ok server and clients can shoots to each other, but in my project that's code not working I don't know what's wrong in my project, everything is like your project I'm using your project as a learning resources every things is same ... I don't know where I made a mistake.

    Leave a comment:


  • replied
    It checks if we are allowed to apply damage, which only happens on the server-side OR when the actor is torn off (bTearOff) from the server OR if the actor has authority to make changes, eg. to take damage.

    Leave a comment:


  • replied
    Hi thanks for your answer.

    I have another question.

    I don't know why when clients shoots each other or shoots to server this function returns false but when server shoots to other returns true... Why this happens?
    Code:
    bool ASWeaponInstant::ShouldDealDamage (AActor* TestActor) const
    {
    if(TestActor)
    {
     if(GetNetMode() != NM_Client ||
    TestActor ->Role == ROLE_Authority ||
    TestActor->bTearOff)
    {
    return true;
    }
    }
    return false;
    }

    Leave a comment:


  • replied
    Worth adding that you can also do MyPtr.IsValid() on a Weak Object Pointer to check if it is NULL as well (not nullptr, but NULL!)

    Leave a comment:


  • replied
    Originally posted by Vahid View Post

    and another question is what is difference between these two type of pointer ? both compile fine in STypes.h

    Code:
    TWeakObjectPtr<class ASCharacter> PawnInstigator;
    class ASCharacter* PawnInstigator;
    TWeakObjectPtr is a weak pointer to the character. That means it doesn't hold on to the character in memory. Meaning that if all other pointers are gone except this one, the character will still be deleted from memory. If we were using a regular pointer, it would be kept in memory until this last pointer to the character was removed too.

    To get the pointer from a TWeakObjectPtr is done through .Get() like so: ASCharacter* MyPawn = PawnInstigator.Get() This returns the pointer IF it still exists, so make sure you check for nullptr after (if (PawnInstigator != nullptr) { }) before using it.

    Hope that helps.

    Leave a comment:


  • replied
    I think i found my mistake.
    I created STypes.h by right click on SurvivalGame folder in VS solution explorer and Add Item .
    This time i create a .txt file in windows explorer and change name and format to STypes.h and every things is OK and project compiled successful but there is a problem inside STypes.h there is no

    Code:
     #include "STypes.generated.h"
    Why engine didn't add this line ?

    without that line GENERATED_USTRUCT_BODY() not working... and compiler give errors.

    and another question is what is difference between these two type of pointer ? both compile fine in STypes.h

    Code:
    TWeakObjectPtr<class ASCharacter> PawnInstigator;
    class ASCharacter* PawnInstigator;
    Last edited by Vahid; 10-28-2015, 06:00 AM.

    Leave a comment:

Working...
X