RTS I'm working on

Having finished the course I am now trying to make an Historic / Fantasy RTS game.

I’ve been working on a building / object placement system. The houses I found free on the asset store, the green shader, for when the object is being placed,I created myself after doing a shader course on udemy.

Quite pleased with the results so far. I still a lot of work to do on this feature (it goes berserk if the terrain isn’t flat!)

6 Likes

This looks really good Stephen :slight_smile:

I’ve been working on blocking placement when obstacles are in the way and when the slope of the terrain is too great.

Looking good, it is one of those behaviours that as a player you just expect, but perhaps don’t always appreciate someone having to have worked on. What happens if you try to build a house in the sea? :wink:

1 Like

As it is, as long as the terrain was flat enough, you’d have a wet house to call Atlantis :slight_smile:

I hadn’t considered this but it’s now on the todo list :slight_smile:

1 Like

hehe, I thought that may be the case… only takes the one nut job like myself to spoil a good plan! :crazy_face:

I suspect you may later identify other terrain types that perhaps become areas that you cannot build on, lava or ice perhaps, for example.

Really like the look of the functionality though - well done Stephen :slight_smile:

Awesome job, looking forward to see more of it as you develop

1 Like

Thanks.

Today’s challenges are getting the prefab to sit on sloped ground correctly. The system currently raycasts to the screen and puts the object on the terrain at an angle of the normal it hits. This can lead to the following issues.

image
Being placed where it should not be allowed. I need to check the ground under the edges of the prefab not just the centre.

image
Not lining up where it should be possible to be placed.

A lot of games will extend the bottom of the model more, and not place it directly on the 0 y in game.

3 Likes

If you could raycast from each corner of the base downwards you may be able to calculate an angle/rotation for the model as a whole taking into account the four points. This wouldn’t address the issue of the first screenshot though… although saying that… if you measured the distance from the four corners of the model downwards, if the distance was greater than x then make the model go red and down allow it to be placed…

Another thought was - surround it with rocks/hedges, but of course that would perhaps only be appropriate if you were using this to design your own scenes, if it was to push this out as a tool then maybe that isn’t quite so appropriate :slight_smile:

1 Like

I’ve made some progress on this. I’ve sorted out the problems above and added construction of buildings. Select a worker (the capsule in the video) and then click on a building and the worker will move to the building and start constructing it.

Next I’m going to add a progress bar.

4 Likes

Hello Stephen,

that looks very interesting!!!

I’ve added a progress bar to the buildings and sorted out some bugs.

Not shown in the video but I’ve also added functionality to place the same building type multiple times by holding down the left shift key. A bit of refactoring and this feature will be complete :slight_smile:

3 Likes

Looking very nice Stephen, reminds me of playing Age of Empires and building the little houses in that…

Perhaps you could configure your builder to be associated with the job before placing the foundations, e.g. give the builder a job to build the house, once placed, he/she could then start the building work.

Another nice feature would be to queue the build actions, e.g. select builder, select job type (build house), place one or more foundations, after the first, the subsequent are queued in a job list for that builder. Once the first is complete he/she moves to the next.

Just a thought :slight_smile:

1 Like

Privacy & Terms