Hello! Welcome to my very first blog post here on this site. I wanted to start writing and creating blogs to go more in depth about the different things that I have worked on and accomplished over my college career and onwards, and so this will be my space to do so!
I am starting today with a simple project that I have been working on for the last few weeks, an RTS control system. Going into this project, I wanted to create a typical control scheme that one would find in other RTS games such as the Command and Conquer series or Age of Empires. I knew going in that I would not be able to exactly match those levels of complexity and controls since I only have had a few weeks of work time before writing this blog post, but I wanted to be able to demonstrate the a basic level of the controls that you would expect. I made this within Unity with C#.
How It Works
So first I will start by laying out the controls that are used in the game/project. The camera is moved through W,A,S,D so you can look around the map easily. The unit/units you have can be selected by left clicking the mouse and dragging it over the units you want to move. You can then right click to move the units around the screen, and left click to de-select the units you currently have selected. When selected, units can also be moved into specific formations using the keys X,C,V,B. X forms a square, C a circle, V a diamond and B a line. Finally, there is a button in the bottom right corner that allows for you to train new units to use. Pressing the button will start a countdown and upon reaching 0 the unit will spawn. This is to simulate the training time from buildings in RTS games.
Challenges
During the working period of this project, there were a few different adjustments that I ended up making. Originally with the unit creation button, I wanted to try and make it so that you could click the button and then click where you wanted to place a unit. After a bit of testing I changed the idea however because I felt like the button going straight to the unit creation process was more in line with RTS functionality and more natural for anyone else who might try the project. I also had a minor issue with units moving before they were supposed to, but that was easy to solve by adjusting the starting move vector to the game object position.
Future Plans
If I continue working on this project in the future, there are a few different things I would like to add. First, I had planned a building option to put down a building which can then be selected to spawn units from that. I think that would be a core part of RTS games that would be great to have added into the project. A next step would also be to add unit interactions. This could come in a variety of forms, either making units that can do things such as collect supplies or having units fight units from another team. This would be the addition that can turn this project into a game in a more meaningful way.
Update 1
I have done some more work recently on this project now that I wanted to detail here to better show off my goals with this work and to hopefully make it into a better portfolio piece. My first main update was to change the visibility of who you have selected at any given point. Right now there is no way to tell which units you have selected and which you have not, so I altered the code so that selected units would turn green and when they are unselected they would revert back to white. This should hopefully provide a lot more clarity in any videos of this work.
I also looked into possibly setting up new assets for the units from various free sites but I did not find anything I specifically wanted to use. I also felt that the assets might cause a bit of problems in connection with what I feel is more important in demonstrating the selection of units that I have already structured.
Comments