unreal noobie: day 1

i’m a bit confused.

i’ve written c/c++ for 10+ years on many different projects, so the language is not the issue. i’ve written simulators and real-time communication apps without an issue. i’ve even written simple games, which is why i’m looking at Unreal… to step up the quality of the rendering model.

but what i’m having an issue with is the overall flow. basically, where it all begins.

looking thru tutorials and docs online, they all seem to focus around the editor. i generally get the idea of dropping an object on the scene and letting it render… but where is ‘main()’? what controls where it starts? is it just the starting position and the user takes it from there?

as a c++ dev, i sort of expected something along the lines of:


int main()
{
  TheWorld        world.load_map( "my_land.map" ) ;
  ActorMap        actors = world.load_actors( "scene01.txt" ) ;
  Actor            *hero = world.load_actor( "my_hero.model" ) ;
  UserController  the_user ;

  world.place( hero, Coord(10,10,10) ) ;

  while (!world.do_things())
  {
    world.process_input( the_user.get_input() ) ;
    world.tick() ;
  }
  return 0 ;
}


from there i would be able to iterate to find or create various actors, attach AIs, and/or move it around the scene.

but i’m not seeing this.

if anyone would kindly toss some light on my confusion, it’d be most appreciated.

This is all handled as data, not as code. Just like you’re already wanting to load the actors as data, everything here is going to be loaded as data to keep iteration time small. Recompiling because the designer wanted to change what map you’re going to load first wouldn’t be very fun.

This is handled by putting things in the right place in the editor. Defining hardcoded positions for actors and level geometry would be incredibly tedious, and iteration time is key in video game development.

The update loop is written for you, and is optimized quite well with hundreds of people having taken a look at it over the lifespan of the engine. Most of those people will have a lot more experience than you in writing tight, efficient game loops, and that’s okay. Because your goal is to create gameplay.

Iterating over actors is easy, but when and why determines where you would do it.

Attaching AI is something you usually want to be doing at the blueprint level or in the actor’s constructor. No reason to build the actor and then attach things, instead subclass the type of actor you need and add the AI you need in the code or a blueprint. (Blueprints are great for letting artists and designers take over after code has been written.)

Moving around the scene depends on when and why. For AI the AI should handle that. For the player the input bindings should handle that. For physics based objects the physics system should handle that. As a last resort overriding Tick() could also handle that.

Give an exact thing you want to do and we can help. Maybe try following this tutorial from Epic themselves, it gets you started on using Unreal from a programmer’s perspective, but it also covers materials, particles, and blueprints so you can have an idea of when they’d be helpful. If you’d prefer text tutorials you could try this one instead, which also briefly covers importing art assets, physics, blueprints, and animation via FSM.

A good place to get started on most projects from a C++ perspective is to implement your own game mode and character, both of which are covered in the tutorials above.