Announcement

Collapse
No announcement yet.

First Project, Starting a 2D Strategy Game - Wondering how I should set some things up...

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

    First Project, Starting a 2D Strategy Game - Wondering how I should set some things up...

    I've studied most of the documentation and now I'm trying to start my first project, but some things are confusing me or possibly not working like people say they should...

    My idea is for a 2D strategy game that I originally tried coding months ago in C++ with OpenGL, but I got stuck when creating the user interface got tedious and time-consuming because I wasn't sure exactly what I wanted without trying some different things and Unreal Engine's interface system seems ideal for what I have in mind. I tried setting some things up and experimenting but I ran into some problems/uncertainties...

    1. How do/should you set the active camera?
    Initially, I dragged a camera into the level and set Auto Activate for Player to PlayerController0. This worked for testing but I assume it's a bad way in practice.

    My game's going to have a scrollable world map screen, so I decided to make a Blueprint class of the world map and give it a camera. I set that up but after that I couldn't figure out how to set it to use that camera during play. I went into the Level Blueprint to see if I could set it to be the active camera but I couldn't see how. I remember reading about some kind of Add Reference function to select actors that have been placed into a level but I couldn't find it for my class...

    Am I right thinking that I'm supposed to set my world map (which has the camera) as the view target? When I place the Set View Target with Blend function into the Level Blueprint, there's nothing available to select when I click Select Target.

    2. The game I'm planning needs to have several different screens/modes, such as e.g. the World Map screen, the Player Info screen etc.

    I'm not 100% sure where the concept of Levels might fit into this. In a more action-oriented game, each distinct area of world geometry would be a level, but in this case there aren't really any "levels" exactly, but the game does shift between different states...
    Conceptually, I assume that the world map and the locations it contains (cities etc. drawn on the map and interactable somehow) would probably be the "level" of the game, and therefore the Level should probably not change throughout a game if it's just statically portraying the real world for instance.

    However, where do different game screens fit in? I know Unreal Engine has a GameState class, but that seems not to cover the same concept as this at all. How should it be done in Unreal?
    If I have a world map screen populated by moving objects (think DEFCON-style: http://static.giantbomb.com/uploads/...0_21_47_43.jpg) then I want to press a button to move away from that and display some sort of alternate screen while the game continues to simulate, how should I do it?
    One thought I had was simply have some sort of variable somewhere representing the screen and then mark things as visible/invisible depending on what it is.

    I assume in either case that my world map object, and any other objects that should exist from the start of the game in a sort of "global" way, ought to be dragged out into the Level... that seems to make sense.

    Might take a while to get used to the different work flow... I thought I had a good grasp on things after reading so many examples but it hasn't worked out to be so straightforward yet...

    #2
    1. Create a new player controller. You can use a parent on it such as the spectator controller if you want. Set that up to be your default player. For the other part if you select your actor in the level and then right click in your level blueprint it will allow you to place a reference to that actor. The level blueprint is the only type of blueprint that you can do this with.

    2. You can do this just with UMG for a world map etc. Just pause the main gameplay when you open it up and you can allow interaction with the UI and other events while paused when you need to.

    Comment


      #3
      Originally posted by ZoltanJr View Post
      1. Create a new player controller. You can use a parent on it such as the spectator controller if you want. Set that up to be your default player. For the other part if you select your actor in the level and then right click in your level blueprint it will allow you to place a reference to that actor. The level blueprint is the only type of blueprint that you can do this with.
      Excellent, that worked. Never would have thought of selecting the actor first... I think now that sounds familiar from when I was reading the documentation.

      Right now I'm trying to figure out how to pan the camera properly around the world map... so far I've managed to get it working using AddRelativeLocation on the camera in the world map's event graph. One problem is that to get that working I've set player controller 0 to possess the world map pawn on BeginPlay. I assume that would cause a huge problem if I left it that way after I create the player character.

      So... is there some way of getting the player controller to deal with, for example, the 'A' key being held down, and then sending a message to the world map so that it scrolls left? Or is there a completely different better way of doing it?
      Alternatively, maybe I'm thinking about it the wrong way... perhaps the player character should simply have a camera object in the world and look through that? Perhaps then if I hypothetically needed to pan around a different screen, that would be where another level would come in...

      Or of course, maybe it's all about UMG and that would simplify things:

      Originally posted by ZoltanJr View Post
      2. You can do this just with UMG for a world map etc. Just pause the main gameplay when you open it up and you can allow interaction with the UI and other events while paused when you need to.
      Something I've been wondering about is whether or not my world map (and therefore probably almost the entire game) could just be done with UMG entirely, rather than placing things in the level editor...

      The idea for my world map screen being basically:
      - It will probably be the main screen of the entire game that displays the high-level overview of what's happening at a glance and will be the state from where the player will access most other things.
      - The world map graphic will have symbols displayed on it representing things like cities, characters being present at certain locations (perhaps the player is in a certain city and the city symbol changes color or some such), and likely other possibly animated effects (think something like a plane symbol travelling from one city to another, rotated appropriately).

      Should UMG be appropriate for that? Or are there limitations to how you can manipulate the UI objects that might make certain effects difficult or impossible? Is there anything you can't really do with UMG that you can do with Paper2D Sprites?

      Comment


        #4
        Lots of words I'm a noob myself so I don't have a lot of advice on how to set up systems.

        But I will say I am really digging the Blueprints interface. Unreal is a lot like Unity. I was really drawn to the openness of Unity a few years back and tried it out for awhile, had a basic game set up following tuts but all the typing, trying to understand code AND syntax. I got burnt out quickly and moved on. I loved the drag and drop art importing though, sooo nice.

        Recently I got the bug again and decided to try Unreal.

        After a few weeks of working through tutorials here and there I'm starting to REALLY like it. While I'm not a coder, and still following examples, I'm starting to find it pretty easy to 'code' in Blueprints. I can see how one thing effects another, I know how to navigate between objects and share variables, and throw that all at the HUD.

        I'd recommend doing the same, not shelving your project but looking at little chunks and looking for a tut that fits. For example:

        I found one tut that created a health bar (several actually) but didn't do damage. So then I had to find a damage one... And I had to figure out how to get them to work together, so it's a great crash course in just learning Unreal and getting some goals done at the same time.

        It's easy to load a map so going to a full screen map would be fine like that I think. Have to find a tut on saving for that though I'm sure. I haven't got to saving yet

        Under 'videos' Tesla has got some good tuts. Most are pretty short, they don't include 'full systems' but they are good for learning how the different systems work.
        https://www.youtube.com/channel/UC3Q...naFF-q0qjXPDEg

        Comment


          #5
          Originally posted by jay_adams_11 View Post
          But I will say I am really digging the Blueprints interface. Unreal is a lot like Unity. I was really drawn to the openness of Unity a few years back and tried it out for awhile, had a basic game set up following tuts but all the typing, trying to understand code AND syntax. I got burnt out quickly and moved on. I loved the drag and drop art importing though, sooo nice.
          Yes, Blueprints seems quite a logical system for a publicly-available game engine. At first I wasn't sure, and thought I might have preferred to try something more code-heavy, but then I realized that if you're using someone else's engine anyway, it probably makes sense to do it through a custom interface they designed that lets it be exposed to you in exactly the ways they think it should be. Not to mention you can always combine BP with code, though I wouldn't dare try that just yet...

          That and I assume it'll help me understand how certain aspects of materials work a bit better when the interface is a lot more intuitive than painfully creeping forward in code and then having to redo things when you want to change something... and it breaks.

          Originally posted by jay_adams_11 View Post
          Under 'videos' Tesla has got some good tuts. Most are pretty short, they don't include 'full systems' but they are good for learning how the different systems work.
          https://www.youtube.com/channel/UC3Q...naFF-q0qjXPDEg
          Cool, I'll take a look at that. I think I've mostly exhausted the official tutorials (a lot of which are apparently very out of date) and the documentation only goes so far when you're trying to get your head around a new way of thinking...

          Comment

          Working...
          X