LevelViz 002 Vantage point system first version review
2016-03-20 12:58 PM
I’ve just gotten the first version of LevelViz done. It consists of 2 parts. LevelViz itself and a small environment I’m doing in Unreal to help show off how it works. Here is a screenshot from yesterday showing the kitchen area of the environment I’m working on.
It introduces the concept of vantage points which are essentially static cameras placed around the level. The author then links these vantage points together and you end up with a graph of camera connections. From this graph the UI is generated with navigation widgets.
Here is a video I put of of me authoring some vantage points, linking them together and then viewing the level and generated UI to navigate around the environment.
Here is how the overall development and process works
For example here are 3 vantage points that are linked.
The red lines between the cameras areeditor only lines I draw between camreas so you can see their relations. Any 2 cameras with a red line joining them are cameras that can be transitioned between each other. If you were on one camera with 2 red lines leading to other camera then the UI would generate 2 buttons on the screen with thumbnails that show the other cameras view. If you press them then your camera will transition to the camera at the other end of the red line.
The UI is pretty simple right now. It has a series of image custom widgets that have render target textures. There some functionality to tell the UI which image widgets are bound to which vantage points. When that binding happens the image widget’s render target is drawn to by the vantage point. Right now it’s fully rendering to the target all the time but my plan is to change that to only render once when the level loads so that I can get a performance benefit. This project is mainly for static scenes and I want it to be used on touch devices so using a lot of render targets that are actively drawing all the time is not a good idea for performance. Especially when it can be logically offloaded to the loading phase rather than the ingame phase.
Here is an ingame shot of what it would look like if you were at a vantage point with 2 links to other vantage points. Clicking either thumbnail would trigger a transition to the linked vantage point.
The vantage points are implemented solely in C++ and I’ve begun to do some work to make editing vantage points easier for the user. There are 2 parts to this.
The first part is relatively simple. I overridePostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) of type AActor. This is so when I select a vantage point and link it to another vantage point the linking is bi-direction. I do this all in code. This is to reduce a significant amount of tedium for the user setting up links between vantage points on both sides.
The second part involves customizing the details panel for my vantage point actor type. What I want to to is implement a custom editor in the details panel for vantage points so things like blend time and curves could be edited rather than just the default array view that the unreal engine provides by default. I’m currently in the process of figuring this out but I have a basic custom editor setup that currently only displays a button per object. Here is an image to hopefully better explain what I’m trying to do.
Just to get the custom details up takes a fair amount of work and understanding of some core concepts.
The first step is you need to create a new code module. By default a new code project in unreal generates a runtime module. What we need to modify the editor though is an editor module. The unreal module system takes a little while to get acquainted to but once you figure it out it’s a great pattern for making modular, composable applications and editor extensions with the unreal engine.
I’ve been quite surprised at how reasonable the build time for unreal engine c++ projects.I suspect their module system helps a lot to reduce build times by simply being able to better determine when to not build something. Anyone serious about programming in the unreal engine environment should put the following module documentation on their reading list.
The second step is you need to make a class that inherits fromIDetailCustomization. I should warn 4.10+ users. I found that the typenames in the 4.9 documentation no longer exist in the codebase. I had to do a fair amount of grepping through engine code to see how details customization was implmented in 4.10. It’s generally the same but a lot of the typenames have changed so keep that in mind if you are having trouble with details customization in 4.10.
Once you inherit from IDetailCustomization you can ovveride a method calledCustomizeDetails(IDetailLayoutBuilder& DetailBuilder) which as you see will pass you a builder object. With this you can modify how the detail panel is built and inject your own UI code.
Finally the last step involves drawing the UI using Slate which is the Unreal engine’s GUI drawing framework. Slate is really interesting. It’s essentially a declarative UI focused DSL that is built from liberal operator overloading. This means that while it looks different, it’s actually valid C++ and as such benefits from a lot of compile time error checking. It’s quite cool but also carries a bit of a learning curve. Here’s a snippet that simply draws the 2 buttons in the screenshot above. This is run once per button (the code is inside a loop).
I wasn’t particularly happy with the first version of my UI. So while I will be working on making a much nicer UI I will also be focusing on making the UMG content asset abstract enough that if a user wanted to create their own UI they would only need to make a new UMG widget and inherit from my custom UMG class. They could then have all the data they need from the plugin to create their own UI if they choose to do so.
Essentially I provide the model, controller and an optional view and the user can choose to create a new view if they like.
That covers the broad picture of what has been done for this update but I wanted to touch on one more thing. The ocean and sky system. This is part of a large ongoing unreal engine community project which you can use in your unreal projects. The group of people involved in this have been doing amazing work. If you want to learn more about the ocean and sky system the home of the project is on this unreal forums thread :
My next project for the Unreal engine will not be a game. It will be a special set of tools which artists can use to set up an interactive viewing environment to display their art in-engine. Users will setup various camera vantage points in their scene and link them together. The project will then use this to make a UI for end-users to be able to navigate and view the environment without having to use the complex control schemes you typically see in video games. The idea is that this UI will be ideal for both PC and touch device usage.
I’ll also be working on a new environment because doing environment art is relaxing for me
After completing my previous unreal engine project for the Tower Jam game jam I’m very comfortable with the game systems in the engine I hadn’t previously worked with such as AI, animation, UI and setting up a custom character. I decided for the next step I should pick a project that digs a lot deeper into the internals of the Unreal engine.
The major components to this project will be the following
Unreal editor modification for specific data types - In-editor custom visualization - Camera systems - Advanced Native/Blueprint communication - Advanced UMG - Slate UI framework - Authoring a plugin for the Unreal engine
I don’t intend for this to be a particularly large project ultimately. I’m anticipating a lot of difficultylearning how to build and deploy a clean plugin for the Unreal engine but I’ve been surprised at how easy things have been in the past so maybe I’ll get lucky.
Here is my current set of milestones. Anything that is crossed out is complete already so as you can see I’m currently finishing up the second milestone.
Implement first version of a vantage point and vantage point manager. The vantage point represent the view at a specific position while the manager handles transitioning between each vantage point. - Get vantage point transitions working. Use existing unreal camera blending logic if possible.
Setup basic UI with thumbnails that represent a vantage point view.
Setup bare bones scene for testing.
User can select the first vantage point to use when start up the game rather than the first camera in the vantage point array.
Make sure that we also modify the player start to be near to the vantage point so that the game doesn’t start up with a crazy camera blend involving the camera moving across the entire level.
Setup basic UI with thumbnails that represent a vantage point view. Use render targets so that the thumbnails show what they represent. - Animate buttons in and out of the scene when transitions occur.
Have the buttons slide off the left side of the screen when a transition occurs. - Have a small button on the bottom left of the screen to show/hide thumbnails.
Spend a small amount of time working on the test scene.
In editor representation of the cameras transition relations to each other. See image below.
Customize details panel for editing vantage points and transition relationships. See image.
For human interest here are the first 2 pages I wrote up for the initial design of this project before moving over to Evernote.
Next here is some evolution of my test scene. I wanted to make a nice modern beach house hanging off a cliff. Sort of like a lot of the really fancy houses you might think of on the coastline of california. Here is what it first looked like.
Turns out I didn’t like the tall protrusion in the middle of the scene so I removed it for a flatter layout. I also adjusted the lighting to roughly match the direction I’m intending to have for the final project. I want it to be like a sun setting towards the deck of the house.
Finally I started some work on the back portion of the deck. This is where the open layout of the main area of the house is. It transitions into the deck with the idea that almost anywhere in the house always has a nice view of the ocean. The separated potion is the master bedroom.
I haven’t been able to play FPS games for a long time. This is due to me playing a lot of FPS’s in my late teens and early 20’s coupled with the fact I actively developed FPS games from my late teens to my late 20’s. I totally burned out on the genre. I also carry the opinion that while many FPS games have gotten more interesting from a story perspective, they have regressed from a basic gameplay (or gamefeel as some might say) standpoint. I still feel like Doom is one of the pinnacles of design in regards to just getting the right feel for movement and combat in an FPS. I also find the level design to be a lot more interesting. This is probably why I’m still able to go back and play Doom to this day.
I decided one early morning to give Shadow Warrior a try. It was just sitting there in my Steam library. Yet another game I bought on a Steam sale with the vague notion I might play it some day.
I have to say I’m pretty happy with this game. The general fighting mechanics and flow of the game feel quite nice. Thegame hasexplicit level based design, complete with kill/item/secret percentages displayed in a post-level completion screen. Very much a throwback to the old Doom shareware era FPS games. It’s still a little linear but better than most modern FPS level design.
The sword mechanics are pretty good. Good enough that I generally enjoy using the sword enough to make it one of my primary weapons. It’s continually upgradable and has a series of special moves that involve double tapping a direction then pressing the left or right mouse button to unleash some attacks such as an area of effect attack that immobilizes all enemies around you in middair. I didn’t expect to ever really enjoy a melee weaponthis much in an FPS.
The environments are also verynice. They might not win any overall fidelity awards but the composition and theme of the levels is always interesting and varied which is much more important to me than boring but technically proficient environments. The levels feel as if the designers and artists put their personal touch on them. Much like some older FPS’s and FPS mods from a time where there was less scrutiny from art direction which caused environments to feel to homogenized.
The story is pretty stupid as you would expect from a game like this although it wasn’t as bad as I thought it would be. It’s been a long time since I played the original Shadow Warrior but if my memory serves correctly this version isn’t as inane as the original. The dialogue is still bad but not nearly as embarrassingly bad as the original. My memory might be misleading me though, it’s been about 20 years since I played the original game.
If there was one thing I would like to see in the game, it’s an option to have a ultra high quality cherry blossom tree model
Rocket League is pure competitive fun and the most fun I’ve ever had playing a soccer video game. Who would have thought mixing high powered cars and soccer together would work so well?
The online matchmaking portion of the game is very well designed and implemented. On both the backend and frontend.
Finding a game rarely takes me more than a minute and after completing a game I don’t have to go back to the main menu and find another game. The frontend flow assumes I’m going to play another game so all I have to do is hit the accept button to say that I want to keep playing. From that point the game uses all the other players in my game who pressed accept to keep playing to create the next game. The matchmaking backend then fills in the empty slots from people who left the game and I’m back in and playing my next game very quickly.The Rocket League developers obviously understand how important it is to minimize the waiting and downtime between actual gameplay and they did a great job at addressing these issues.