WTF is this post about
This post will be a list of the events that lead to me making a finished playable 1v1 RTS of some sort. Since I love the Relic worldbuilder and the mechanisms they use, my project will mirror some of the COH2 RTS style items such as Crush maps, Pathing maps, WW2, etc.
Since I am a noob at latter day OpenGL, I will be focusing on game engines such as UNREAL ENGINE and UNITY. I also have no idea how to animate a 3D object so there will be some learning pains involved with BLENDER as well. Since I have a very low IQ (IQ > RelicIQ), progress will be slow.
STEPS TAKEN SO FAR
1) Created a Zombie 3D model in BLENDER with a few simple animations: Idle, Walk, and GetHit.
2) I spent 2-3 weeks learning UNREAL ENGINE. UE can use either C++ or node based BLUEPRINTs to create game code. I took simple BLUEPRINTS to the point of making a simple level with spawning enemies that I could explode and shoot their chunks around. Anything past this I felt I needed to get into C++ to go any further towards an RTS. After watching the UE tutorials made by UE and seeing the C++ crash and not run correctly in their videos, I decided to try Unity. UE also felt like it was trying to to too much. So doing the simplest tasks became very difficult.
3) The first day in UNITY was like a dream come true. Unity was laid out to make games. It was not overly complicated like UE. You could figure things out intuitively where UE required watching a 30 minute video and taking notes or forget it. In a day or so I was at the same point I was in UE. And in the next day or two I had some of the tools to start making an RTS. Stuff I could probably never figure out in UE.
UNREAL ENGINE 3-4 WEEKS PROGRESS
UNITY WEEK 1 PROGRESS
The UE pictures look very sexy. But NONE of the required RTS elements are there.
The UNITY version already has selectable units that move around on a terrain. You will also notice the DEBUG info on the left side of the screen that is missing from UE.
RTS ELEMENTS NEEDED
A) Map making tools. Internal or External.
B) Access to the Height map of the terrain.
C) Access to the objects on the terrain.
D) Ability to spawn objects.
E) Pathfinding code.
A, B, C) In UNITY day 1, I could easily read every object on the map, height maps, etc and save the info to a text file. This means I can use UNITY as my worldbuilder.
I then wrote a C# tool to load the map objects and create/export the IMPASS maps for Low, Medium, and Heavy crush. This will all be done in UNITY at some point.
D) While creating the map and figuring out what scale to use, I created code to just spawn objects wherever I click. Buildings, Units, trees, ground splats, etc. Ready to spawn units and make bomb splats on the ground when they go off.
E) The tool was then used to test FLOW FIELD style pathing code for unit movement (GREEN MAP). this is done here since it is easier to debug and test. Since it is in C# it will work in UNITY when moved over.
Next steps are to implement pathfinding in UNITY and create SQUAD based code. FLOW FIELD pathing is not the best choice for low numbers of units so shall we have squads of 10 guys maybe???
DAY 7 PROGRESS
1) Squad variables created.
2) FLOW FIELD pathing added to UNITY and units path as a squad to selected points.
3) No squad formations yet so speeds are randomized to keep units spread out.
4) Wasted many hours debugging UNITYs shitty ATAN2 function.
DAY 9 PROGRESS
1) Burned out my brain trying to work with the shitty UNITY UI elements. So not a lot of progress. Its amazing what you can do in OPENGL with two commands requires 47 steps and two YOUTUBE videos and a bunch of UI components. I really think I should see what OPENGL commands I can write in Unity. I have heard rumor it is possible.
2) Made a UI Health status icon that hovers over the units similar to COH2. COH2 selects a certain unit and the icon follows that unit. Which is nice because it tells you what unit will go where on the terrain. May have to implement that.
3) Made a small section of railroad and the beginnings of a munition point. Not sure what to do for points. If they are too big they should block sight/shots. No one wants that.
NOTES: Had the epiphany that each player should have a dedicated FLOW FIELD retreat map created at the start. Since any retreating unit can use it, that means NO PATHING CALCS will ever be required for retreats.
Currently running the default UNITY pipeline. Which has no SPLAT or SPLINE capability. There are two other render pipelines to choose from including the High Definition Render Pipeline. The HDRP does allow SPLATS (decals). Nowhere near as ez to use as Coh2 though.
Since I have worked in the Quake 3 map editor for years I am running an awesome version called OpenRadiant that exports maps as Wavefont OBJ 3D files (The person who wrote this is a legend). Then the OBJs get loaded into Blender and exported as FBX, which UNITY deals with better. Made the houses, boxes, railroad, and muni point in OpenRadiant.
Radiant is the best editor for fast simple 3D objects.
COH2 Worldbuilder best for terrain based editing.
DAY 12 PROGRESS
I keep getting hung up on little things so progress has been slow.
1) Created 3 squad types for USF.
2) Created health bar icons for squads and tanks.
3) Created resource income for manpower, munitions, and fuel.
4) Created simple models for Manpower, munition, and fuel points. Each has its own icon with health bar for capturing. Points are also capturable and add to resource income.
5) Added MOVE TO UI graphic for user clicks on terrain.
6) Began particle system tracers for weapons and tank fire. Still very early.
DAY 13 PROGRESS
1) Reworked Camera movement to be more precise.
2) Added basic MiniMap. Can click the map to move camera and right click to move units. No double click yet.
3) Added VORONOI calcs in C# Map program. May start the territory drawing code soon. Should be straight forward.
The next large piece is probably Fog of War. May have to buy something from the Asset Store for the current version (may not be able to write shaders etc).
DAY 15 PROGRESS
1) Added FOW with sight blocking. I added a plane over the terrain and write calculated FOW data into the plane texture. It is a hack that will only work for flat terrains.
2) Created a new sight check algorithm based on spiralling out from the position we are in and checking off degrees in an array if they are blocked. It is not perfect but runs decently for now.
3) Currently using the pathing data for sight blocking. Needs updated to a new sight map.
DAY 17 PROGRESS
1) Added FOW to minimap.
2) Adjusted some textures settings.
3) Created a base HQ building.
4) Created Tank Trap model.
5) Created a burned out Sherman carcass.
6) Started building the UI textures.
It gets very annoying knowing that I can draw the FOW in two lines of code in OPENGL. But it takes a ton of badly optimized code to do it UNITY. Just have to pretend I know nothing about 3D coding.
DAY 19 PROGRESS
1) Upgraded terrain texture quality.
2) Added Precise map for individual pathing on Infantry, Light vehicles, and Mediums.
3) Added Vision map for sight blocking calculations.
4) Added Infantry cover map. Currently set unit decorator with cover color.
5) Tagged all objects on the map with their Sight blocking, Pathing, and Cover settings.
DAY 21 PROGRESS
1) Reworked the unit information icons. Player count background changes color when in cover.
2) Added VP points and code.
3) Added time clock.
4) Added simple AI. Spawns units and takes points. No combat yet.
5) Spent hours trying to get Unity to put the health bar back where it was supposed to be after editing the unit icons. And then I nearly formatted my hard drive and ate some cyanide. Unity UI system sucks ass. One line of OpenGL code = 47 adjustments and settings and code in Unity.
DAY 27 PROGRESS
Not too much progress. Made a post below with details.
1) Started combat engagement code.
2) Setup some tables for damage, rate of fire, etc.
3) Added COROUTINES to smooth out FPS dips.
4) Reworked AUDIO to create a 3D feel in stereo.
DAY 29 PROGRESS
1) Purchased a 3rd party package to allow for splats. Took some time to learn and am not 100% I will keep it. For now it is doing fantastic job but has some glitches in the current version of Unity. Still no SPLINES. I have seen a couple 3rd party apps but will wait to purchase.
2) Made a couple textures to test the new splat tools (all except crater under tanks which is vCoh until I make a new one).
3) Currently only using STATIC splats. Meaning they are done at edit time. The tool is capable of some DYNAMIC splats (done at runtime) but I have not looked into it yet.
DAY 35 PROGRESS
Progress has slowed. Had a few RL things pop up etc.
1) Unity has a cool feature where it never crashes. If your code sucks, it will just jump out of your routine and keep on trucking. This is bad when your code is mostly working but things are acting bizarre. Took a while to track down a few bugs that worked 90% of the time.
2) Added a TRACER look to units firing.
3) Added some home made Unit movement and death sounds. They are very bad.
4) Added retreat button and hotkey.
5) Added reinforce button.
6) Added AI retreat and reinforce code. Set to retreat on 50% squad health.
DAY 55 PROGRESS
1) Been working on getting tanks to move around and shoot. For infantry tanks shots are AOE only. And for other tanks, direct hits only. It is super fun when the tank models are not rotated where they should be and Unitys rotations are backwards. It really starts to screw with your brain.
2) Added Infantry and Vehicle kill counts to UI.
3) Added unit selection icons just above the menu. These are top right screen in Coh2. Which is really far from the menu. So for casual mouse only play they are at the bottom for now. Maybe have options where to put it later.
Still moving very slow. It is summer here and RL is busy. Since I now have tanks working, I need to create some form of anti-tank squad. There are AT weapon models for the squads. Until now I have been using the prefab models so I will need to make my own for AT. Maybe I should just quit