Announcement

Collapse
No announcement yet.

Announcing Section #4 for Survival Game - Setting up the survival game-loop

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

    #16
    Originally posted by SRombauts View Post
    Hi Tom, I took the right to update myself the Main documentation page on the wiki to add section 4 with useful links.
    Great! I forgot to update the page yesterday, thanks!

    Originally posted by LestatDeLioncourt View Post
    One question, I've noticed some calculation for the day/ nightcycle are done in the gamestate class...could/ should I do this calculations inside the TimeOfDayManager or another Actor class if our game is singleplayer only? From what I've read GameState is only useful for multiplayer.
    A GameState will always exist, even for singleplayer games. you wouldn't need to do any of the replication, but the system doesn't need to change.

    Originally posted by Hevedy View Post
    but for that type of example/game will be nice a bigger map with respawn of the items or something ?
    I've been thinking about making a large open map, I'd need to dig into that myself before I could do a section on it. This is something that would be very interesting perhaps post-4.8 which introduces a lot of open world improvements.
    Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

    Comment


      #17
      Ill def check out the components, ty.

      Atm I just realized that storing a spell in my spellbar (Tarray uproperty) only remains in the spellbar for 60 seconds (because the spell gets destroyed in the world). Mind you the only way to keep it inside the spellbar is to simply hide the mesh and remove collision, but that means that it presists through the world. How viable is it to go this route? where by the end of a match we have something like a 1000 hidden actors with no collision.

      I know it sounds pretty inefficient but what alternatives do I have that would be efficient on a multiplayer game. (I know i can directly spawn from a TArray of Tsubobjects, but for reasons such as spell CD, setting instigator, etc, It actually has to be the object stored in the spellbar).


      ty
      Last edited by Venros; 05-20-2015, 08:38 PM.

      Comment


        #18
        Originally posted by Venros View Post
        Ill def check out the components, ty.

        Atm I just realized that storing a spell in my spellbar (Tarray uproperty) only remains in the spellbar for 60 seconds (because the spell gets destroyed in the world). Mind you the only way to keep it inside the spellbar is to simply hide the mesh and remove collision, but that means that it presists through the world. How viable is it to go this route? where by the end of a match we have something like a 1000 hidden actors with no collision.

        I know it sounds pretty inefficient but what alternatives do I have that would be efficient on a multiplayer game. (I know i can directly spawn from a TArray of Tsubobjects, but for reasons such as spell CD, setting instigator, etc, It actually has to be the object stored in the spellbar).


        ty
        That doesn't sound right, you might want to split something up into individual pieces. Ideally your spellbar item is NOT the same actor as your actual spell that is performed or picked up / acquired etc.

        Whatever is "owned" by the player would be a attached component, anything that is cast with an actual effect could be either the component showing some effect and you calling functions for damage and effect application on the current target w/o the need to generate a new spell actor....or if it's an actual projectile / duration effect you probably do need to spawn a new actor into the world that exists for the duration of the spell effect.

        It all comes down to the design of your system, but this is just a quick suggestion w/o having a lot of details ^^ Hope it helps you out!

        - Tom
        Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

        Comment


          #19
          EDIT:

          Hey Tom,

          Sorry for the wall of text lol, so I finally managed to fix the issue by doing the following:

          SpellBar = TArray of Objects (like your weapon array) [Fireball][FrostBolt][etc]
          SpellBar_Internal = TArray of Tsubclassof [Fireball - Class][FrostBolt - Class][etc - Class]

          Lets say I wanted to cast a fireball, so I went to that index and called the function like I previously was (ex: The fireball object managed my spell cooldown) but when it came time to spawn I simply spawned from the fireball class it self.
          Code:
          spellBar[index]->SpawnSpell(spellBar_Internal[index]);
          And because the initial spell that I spawned to store in my SpellBar was off the map and never collided with anything, it never got deleted; and remained as a way to manage my cooldowns.

          Much Appreciated,

          -Ven
          Last edited by Venros; 05-22-2015, 03:14 PM.

          Comment


            #20
            Something between version 2 and 4 of this, causes the zombiebots to spawn off of the player. I am not sure what I am missing, if anyone could offer advice.

            Comment


              #21
              Originally posted by Overpowerdin View Post
              Something between version 2 and 4 of this, causes the zombiebots to spawn off of the player. I am not sure what I am missing, if anyone could offer advice.
              Perhaps this is a bug I need to look into. I haven't seen this happen yet though.
              Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

              Comment


                #22
                Hey Tom!

                I have a (yet another!) question.

                On the ChoosePlayerStart() function, we initially call IsSpawnpointAllowed() and then call IsSpawnpointPreferred().

                Everything looks nice and tidy. Then I noticed... The very same check done in IsSpawnpointAllowed() is done on IsSpawnpointPreferred().

                This check:

                Code:
                	/* Check for extended playerstart class */
                	ASPlayerStart* MyPlayerStart = Cast<ASPlayerStart>(SpawnPoint);
                	if (MyPlayerStart)
                	{
                		return MyPlayerStart->GetIsPlayerOnly() && !Controller->PlayerState->bIsABot;
                	}
                Is there a reason for this I didn't notice, or is it just repeating the same code?
                Can I just replace the code on IsSpawnpointPreferred() with a return true?

                Thank you again!

                Comment


                  #23
                  Originally posted by Zoc View Post
                  Hey Tom!

                  I have a (yet another!) question.

                  On the ChoosePlayerStart() function, we initially call IsSpawnpointAllowed() and then call IsSpawnpointPreferred().

                  Everything looks nice and tidy. Then I noticed... The very same check done in IsSpawnpointAllowed() is done on IsSpawnpointPreferred().

                  This check:

                  Code:
                  	/* Check for extended playerstart class */
                  	ASPlayerStart* MyPlayerStart = Cast<ASPlayerStart>(SpawnPoint);
                  	if (MyPlayerStart)
                  	{
                  		return MyPlayerStart->GetIsPlayerOnly() && !Controller->PlayerState->bIsABot;
                  	}
                  Is there a reason for this I didn't notice, or is it just repeating the same code?
                  Can I just replace the code on IsSpawnpointPreferred() with a return true?

                  Thank you again!
                  Theoretically it isn't required there with the current code flow. If you look at the function name itself, it should work standalone when used elsewhere, so you can wonder: "how can a spawn be preferred, if it isn't allowed" that's why I still check inside that code, especially since I anticipate that function to be used elsewhere later on, with more complex spawning for different gamemodes.

                  The first call of IsAllowed is still useful too since we need to filter out the invalid spawns before we can start building a preferred list and a fallback list of spawnpoints.

                  Hope that helps!

                  - Tom
                  Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                  Comment


                    #24
                    Thanks Tom, for your help.

                    One question that may sound a bit offtopic...when I reconstructed the TimeOfDay Blueprint and tested it I ran into the following issue:




                    it seems that the Blueprint Function can't access the Light Actor....but the Primary Sunlight Actor exist and is a directional light.
                    Are there any special changes to make in BP_SkySphere Actor that I may have overlooked? Or any special access settings for the primary sun actor in the TimeOfDay Blueprint?

                    I still try to find the error by myself, but at the moment my search is not very successful

                    Comment


                      #25
                      BP_SkySphere is a built-in blueprint from the engine. You don't have to create one yourself and there are no modifications required.
                      Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                      Comment


                        #26
                        Originally posted by Tom Looman View Post
                        BP_SkySphere is a built-in blueprint from the engine. You don't have to create one yourself and there are no modifications required.

                        Yes, I know...but for any reasons I have this access issue to the directional light, so, at the moment it seems to me that the SkySphere can't access the directional light. I'll continue searching for the reason of my issue as soon as I'm at home.
                        I've noticed that in the Survival Game the GameModeClass is a blueprint and it also stores BP_SkySphere as a variable. My GameMode is taken directly from code so far, maybe it play a role in the problem.


                        Thanks for your reply.

                        Comment


                          #27
                          Found the issue in my scene

                          The problem was that in my Testscene the directional light was not assigned in BP_SkySphere as directional light actor (in the details panel).
                          The weird thing is, I've tested it in a blank scene with all 3 lights added and it worked fine...here it seems the light was added automatically to the SkySphere Blueprint, in the former scene it wasn't...once I've added it it worked.

                          Comment


                            #28
                            Good to hear!
                            Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                            Comment


                              #29
                              It seems that in 4.8.0 the GameMode Class (AGameMode) has no default timer anymore.

                              Comment


                                #30
                                Originally posted by LestatDeLioncourt View Post
                                It seems that in 4.8.0 the GameMode Class (AGameMode) has no default timer anymore.
                                Yes there are some other API changes in 4.8 too. I'm upgrading the project this week for 4.8 support.
                                Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                                Comment

                                Working...
                                X