My First Game [RTS - 3D Top Down]

Hey guys, not sure if this is the right area but with the recent release of Unreal for free to play around with I have been interested in trying my hand at making a game. I have pretty much all the details in my head or written down for a top down RTS game, mostly naval and air combat. I decided to jump in as I have been looking at videos and tutorial docs but seems better to learn as you go as there is so much going on with unreal it is a lot to take in. I mostly only have experience doing artwork/modelling, so the blueprint system is a godsend if I can work it out fully. Mostly been playing around with the camera, importing my models (which has been a pain as I use an old version of lightwave and FBX export doesn’t play nice) which I think I have the process down now using Blender as a middle man (smooth faces aghh!) and getting an ocean working and animated. Various levels of success on those. I am not targeting high end stuff since it is my first go and looks like it takes a year or so to get to grips and produce anything meaningful, so probably exclusively a mobile based game (basic yet addictive is the idea). Stylized look of a map with ‘decent’ meshes doing the combat on top.

Looking for help and guidance as I go along since there doesn’t seem to be a heap of info for RTS stuff, or at least what I hope to achieve, would appreciate any help you can spare. :slight_smile:

Some of the areas I could use some pointers on…

  • RTS Camera: So I got some terribly basic camera working in blueprint from in one of the example projects (third person I think it was), can’t get it working properly in a new project for some reason (input mappings playing up) but will work it out eventually. Mostly I am trying to work out the overall idea of what I want to achieve as I couldn’t see any info on it after a while looking. Basically the map I have is obviously finite and I want the camera on its furthest zoom out to snap to the borders of that plane so it doesn’t render anything beyond that or be able to scroll/zoom forever. As it is top down (well, 80 degrees) and I don’t need to change the angle of the camera I should be able to do that. So essentially create some kind of boundary ‘cone’ (!rectangle) that the camera can operate within but not go outside to ruin that zoomed out (normal) viewpoint. Was thinking about doing it literally and just creating an angled rectangle for the camera to collide with while zooming but then unsure how to get all the proportions exactly right unless I just throw man hours at it through trial and error. I need to fix the starting point of the camera height to allow for a 1080p (I hope) dimension proportion and maintain it while zooming in and out with a fixed upper and lower limit with height. The player can zoom in a corner and that corner will always be fixed to their screen corner in other words. Obviously would need to be able to select units and ‘snap’ to them and still follow those boundaries as the camera follows the unit. Hope that makes sense!

  • Map Geometry: Is it possible for unreal to use a png file as an ‘object’ with collision and such? Say I have an island drawn out, it will be static and doesn’t need to be a mesh; all it will be doing is to be selectable to ‘build’ things, colour changes and act as collisions for naval vessels. Want to avoid doing any LODS for zooming or needless landscape, just use a high resolution picture of the island. I started messing around with this idea in gamemaker which allowed me to make a map with a large sprite that would collide with meshes and hope there is some equivalent. The ships would be set to collide with the island and the planes obviously go over, with the sea plane beneath the island to keep things simple. I guess I could do a plane with the island and apply it as a material with the transparent areas able to pass through somehow?

  • Water Effects: Looking at various posts on this it seems a bit of a weakness for the engine, I have got a grip of most of it (as much as you can in a few days) and a path worked out for the ocean deformation/material and now working through a buoyancy tutorial. I may just scrap all of it if this is too much for mobiles to handle but curious if there was any consensus on ‘wakes’ left by ships, whether deformation, some sprite for foam or other methods were best practice? Was thinking about some kind of particle emitter attached to the rear of the model might be an idea, can then turn it off when stationary.

Thanks

Hi, ErebusMC :slight_smile: came across your topic, decided to lend a hand.

RTS CAMERA I got quite good with blueprints, will try to make you an RTS camera blueprint - but you might as well just take the RTS example from the marketplace - it’s free - and use it as a base for your project.

MAP GEOMETRY you can use a heightmap to generate terrain, did you know that? You could make one in Photoshop or use a software like WorldMachine. It is going to be a PNG file. Here’s a tutorial I found on Youtube, I’m not the author, but it’s quite helpful.

WATER EFFECTS You could make a material with displacement maps and tesselation, if you choose that method I could just send you my water shader. It’s something like this - though I added translucency and subsurface:

The problem with it is, this kind of water is not interactive - and it does not have foam. It is possible to achieve interactivity with shaders; I’ve seen interactive grass made with them. But I haven’t yet figured out an effective way of doing that.

You could also use the VaOcean plugin:

https://www.youtube.com/watch?v=7REUMOYmVd8

From what the developer says, it’s going to be amazing - with interactive collision, energy based foam and buoyancy. But those features are yet to come.

The third option is to have nVidia’s WaveWorks - there’s a version of Unreal Engine on their GitHub including it, you need to download and compile it - it looks great, but works better on nVidia cards.

Thanks for replying Rhayader! :slight_smile:

The tower defence camera? Not really what I need when I was looking at it from what I recall, has to have rotation locked, panning and zooming able to lock down in particular places and follow selected units automatically when first clicked (with it allowing you to ‘break free’). Tried a few things and not really came out right for me, plodding away but if you have anything on hand to reference that would be awesome.

Map geometry I am aware of and worked on something similar in the past but wanted to avoid any real geometry as it really isn’t needed. With locked rotation, panning and zoom it only needs to be 2d as it will be a static island for ships and such to go around. I found what I was looking for and been playing about with it for a bit, I was staring it in the face and assumed it was a separate system. The paper 2d stuff allows you to insert a texture and convert into a sprite. From there I have done a shrinkwrap for the collision cage, which was pretty good but too many vertices and polys when it wasn’t needed. Simplified it with ‘simplify epsilon’ slider to reduce points, and have been manually editing a lot of it. Reduced to 35 polys from something like 200, cut the vertices down by about half as well. The only issue is I have 3d models going around a plane that will sit on a sea, so gonna have to tweak a fair bit when I get further in. Thinking I will need to clone the collision plane and extrude it out to give depth as the ‘collision thickness’ slider doesn’t seem to do anything in the preview. Should still be fairly cheap resource wise for something that will make up most of the map. Sprite came out really clean too, has some kind of automatic blurring of the edge pixels

Yeah, got some tessellation waves going, thinking any real physics and collisions are a waste of resource for a mobile RTS game. Just need it to look decent and can cheat some of the effects, so mostly was looking at wakes and how to make some good looking ones on the cheap so was thinking some kind of emitter but just seeing if people had already worked out a best practice for this. Buoyancy I still want ideally, but put it to the side while doing other stuff since it seems a bit involved for me to start with.

Those examples you have given are really cool though, I was having issues with the micro to macro zoom texture and looking decent when zoomed out. Will have to check these in more detail.

Appreciate the help.

About the macro, use the same macro-variation stuff Epic does on starter content materials, cut stone e.g.

Can you give me an example for the camera you need? If I can see something like that in action, might try to make one from scratch.

Btw for buoyancy, you could use the height-map you use for tessellating the waves to z-offset your units. Not perfect (calculating the angle with normal angle and z-offsetting from the blue channel would work better, though not so cheap), but it would certainly work. Basically you just need to calculate your unit’s coordinates in UV space, grab a piece of the height-map, average the pixels and use the value to z-offset the unit.

In case of tangent space normal maps, I’d suggest you still use a height-map for the z-offset, and grab a piece of the normal map, average it. The green value will show your model’s angle in the Y axis, and the red - in the X axis. Though I don’t know whether you should use a flipped-green normal map for this or not.

The good thing about the second approach is that you can make a smooth transition between states (in game logic, divide your sea into cells and smooth-animate the change of angle). You can use any kind of algorithm for that - time-based, space-based, etc. And it’s pretty easy to implement because all you’re using is just a tiled texture. Maybe with some macro-surface variation, which you’re free to ignore.

Came across DotCam’s water shader, it has buoyancy too - guess via a plugin, didn’t have time to look deeper. You might want to take a look, though the implications for performance are unpredictable.

Got the ocean looking better, using the example given in this tutorial A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums I have been playing around with my own version of it but not going for super-realistic… my colours are all stylized for a start. Got the macro vs micro zoom levels worked out so looks good fully zoomed out with different wave speeds and no noticeable repetition. Just added transparency and tweaked it to roughly where I want it as I’ll be putting another layer underneath for the ocean floor as my RTS will have subs so need to see them and contrast against something. Have painted the ocean floor texture, but having a rethink on how the land is made since sprites don’t have the depth needed to sit in the ocean and deal with the displacement. So may do a box with some alpha setting applied, not a focus right now. Fairly happy with the ocean, will change some of the placeholder textures and tweak performance but about right for now. Yeah I saw the excellent work DotCam and everyone is doing but I think their ultimate goal is aimed at the upper end, not really needed for me although I will come back to it down the line no doubt. I really like the look of this ocean - UE4 Ocean Water Shader WIP - YouTube so might aim for that when I revisit it.

Here is a close-up of the ocean so far; cube is just to reference transparency and the lighting isn’t angled right for the top down view as yet (specular and reflections are working). Really basic but stylised:

For the RTS camera, got the zoom clamps working thanks to an excellent tutorial I found. Now the only real issue that remains for the basic functionally is pan clamps, I need different zoom levels to have different pan clamping so figured I would do a blocking volume hollowed out to contain the camera. Doesn’t stop the camera though and tried loads of things with the collision but not working. I may just move onto other parts until I learn more, or find a tutorial, may try posting the question to Unreal. For an example I found this video of the plague inc. game Plague Inc. - Gameplay AppGemeinde - YouTube which is essentially what I want, you zoom in and pan on a fixed map. So got everything working except the panning which would be most easily solved by a collision box for the camera, since I need to angle the volume so it ‘snaps’ to the default view/zoom/pan. Just haven’t got the hang of collision.

The buoyancy info is very helpful, thank you. Not a deal breaker by any means, especially if performance drops although I’ll be doing a LOD level to a sprite when zoomed out so shouldn’t be too bad if I account for that in the blueprint. Still mostly concerned about the ‘wake’ of the ship rather than the buoyancy as there is some good info for that already including yours. Will start playing around soon, I was thinking instead of an emitter maybe a child mesh of the ship that arcs into the ocean and has a ripple displacement and sea foam material. Although considering the angle of the camera is fixed I could just get some realistic sprite animation with some differing alpha levels, would just need to worry about clipping… would be cheaper I guess.

So to sum up from the original post:

- RTS Camera: Got the camera working in a new project, I have the right starting zoom levels and implemented zoom clamps that allow for close-ups and a full view of the map as its limits. Now looking at stopping panning, been unsuccessful with blocking volumes which seemed designed for this, passes right through currently.

- Map Geometry: I worked out how to set this up as a sprite and collision shrink mapped and cleaned up to very few verts/polys but now thinking of trying to set up a box with the map and alpha mapping so I can have depth as I get clipping from the ocean displacement. I can get around the clipping easily enough by raising the height of the map but even at the limited angle of the fixed camera you can see some hovering and will be an issue with collision down the line I am sure with smaller units. If that fails I may end up using the terrain heightmap geometry as originally suggested.

- Water Effects: Got my ocean set up, happy with the animation fully zoomed out and zoomed in as well now and got good transparency for submarine units. Still haven’t implement buoyancy but got lots of good info on this so not a real problem. Just been thinking on how to map the buoyancy to LOD levels as fully zoomed out will have the mesh replaced by a sprite and don’t need any bells and whistles. So still working out a best way to do wakes of the ship, was originally thinking of an emitter. Now included the idea of a mesh curved into the ocean with a displacement map, or going full cheapskate and doing a sprite animation. Will experiment with them as there doesn’t seem to be much info around on any best practice, unlike setting up an ocean or buoyancy. I may leave this until further into making the game since I would need to compare performance and only got a few units on screen at the moment anyway.

Thanks again for all the help so far! :slight_smile:

Pretty cool, eh? Waiting for some more news on your progress.