Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

What architectural setup should i be using?


I just started using UE4 and I am struggling with designing how to layout my code and what classes to use/what classes should be doing what. The basic idea i am going for is a 3rd Person Multiplayer Shooter where the map is a randomly generated maze that shifts and changes while you are playing the game. This will be a session based game much like Halo. I made the mistake of jumping right into the programming without thinking to much about where things should go and ran into a lot of issues when i started doing the multiplayer. I was having issues getting things to spawn and replicated correctly and i believe this is because i designed things poorly. Also the more i right the harder it is already getting to maintain and work with. So my current implementation that i am confused about is as follows:

I have a MazeCreator class that extends Actor (AMazeCreator). I have a MazeTile class that extends Actor (AMazeTile)

AMazeCreator basically runs some algorithms and builds an NxM sized maze and then spawns multiple AMazeTile actors with the proper animation in order to render the maze. Then on a certain time interval recalculates the maze in the background and updates the animation state of all the AMazeTiles. This works great! I even added a little check to only render AMazeTiles that are within a certain range of the player to eliminate having all the tiles being rendered and ticked all the time.

The first problem came in when i introduced multiplayer and replication. My first thought was to just have the server generate the maze and then send the maze spec down to the clients and have each client deal with rendering the maze. This is where i ran into a lot of issues. Replicating the FTile ** that is used to hold the specs of the maze didn't seem to work and just trying to spawn the tiles the client players dont seem to be able to spawn any actors.

The second problem was i personally feel like im going about this the wrong way and Im thinking that maybe I should make the AMazeCreator really just part of the GameMode. That way its only run on the server and then the GameMode keeps the state of the maze and spawns the actors and replicates the actors down to the client. This still doesn't help with rendering and having hundreds of actors in play all at the same time but i think that can be fixed by disabling actors that are certain distances away from all players or something like that.

So now im ranting but basically this question is really an open discussion about what would be the best way to setup my classes for a game that requires the replication and managing of hundreds of actors and where should that spawning code live.



Product Version: UE 4.17
more ▼

asked Feb 24 '18 at 02:15 AM in C++ Programming

avatar image

46 2 6 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question