Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Isometric RTS  (Read 4591 times)

0 Members and 1 Guest are viewing this topic.

Switchboy

  • Newbie
  • *
  • Posts: 17
    • View Profile
Isometric RTS
« on: June 02, 2020, 04:29:30 pm »
About my project
For the last couple of months, I’ve been working in my spare time to create an isometrically projected RTS a la Age of Empires. Development has been on and off depending on how busy real life is. Bear is mind this is my second big project in C++. I've made an RPG roguelike before (which was quite far in development) but that codebase became such a mess that in the end I had to abandon it. So rather then start from scratch I decided to create another game in another (in my opinion underdeveloped by indie developers) genre.
 


The project goals that have been reached:
- Create a custom game engine based upon an isomorphic projection.
- Have actors move around in this world by issuing mouse commands.
- For pathfinding use A-star and or bidirectional A-star.
- Add collectable resources to the world
- Make villagers gather the different resources and bring them to a ‘town center’
- Use these resources to build different buildings
- Require specific buildings to house new population
- Make certain the buildings produce units
- Implement Fog of war
- Interact like an RTS game
- Robust villager AI for doing a task
- Show different animations for these resources
- Generate random map on game startup
- Make the units able fight each other using melee
- Make the actors fight each other using ranged attacks
- Make certain buildings able to perform a ranged attack
- Working minimap

Attainable project goals for the near future:
- Fighting animations
- Different units
- More buildings then houses and town centers
- Different colors on units and buildings for the eight teams
- Implant a basic Rock/Paper/Scissors for damage calculations during battle
- Researchable upgrades for units and buildings
- Flesh out the research with a tech tree
- Basic AI to play against
- Add sounds

Aim for the moon project goal:
- Working netcode to play against friends!

Cool! So where is the code?
https://github.com/switchboy/IsoRTS

Allright, I want to see it in action!
To show off some of the current gameplay I’ve attached a devlog video. For those of you who do not speak dutch it is better to watch it without sound :P

https://www.youtube.com/watch?v=XsZtY1JZatI

What do you think?

Sub

  • Full Member
  • ***
  • Posts: 156
    • View Profile
Re: Isometric RTS
« Reply #1 on: June 03, 2020, 10:33:47 pm »
This is awesome and impressive.  Well done

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9909
    • View Profile
    • development blog
    • Email
Re: Isometric RTS
« Reply #2 on: June 04, 2020, 10:12:11 am »
Really cool project, totally feeling the AoE inspiration in this one :)

Also it's always funny how much Dutch I can understand as a Swiss person. Dutch has so many German/Swiss-German and English words. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Switchboy

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Isometric RTS
« Reply #3 on: June 16, 2020, 10:30:46 pm »
I finally made some progress with drawing sprites, which is not my strongest point. So I could add more buildings to my game:
Mill
Receives food, will allow the construction of farms and food related research. For now I am goin to borrow the concept from age of Empires. But I will look into another way of implementing farms when the game is more mature
Lumber camp
Receives wood and allows research of wood gathering technology

Barracks
Will train melee soldiers and allows for melee related research

Both the mill and lumbercamp are animated sprites:



I am already regretting the way I wrote my buttons and buildings classes. It is really a lot of work to add new stuff this way. I have to edit five files to do so. But it is a good learning experience to bump your head a couple of times for future projects!


New playable release:
https://github.com/switchboy/IsoRTS/releases/tag/melee
« Last Edit: June 17, 2020, 01:28:45 pm by Switchboy »

sidewinder

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Isometric RTS
« Reply #4 on: July 28, 2021, 03:01:22 pm »
This looks very nice? Any updates? I saw on your github that you still do stuff ;-)

Switchboy

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Isometric RTS
« Reply #5 on: August 01, 2021, 02:19:23 pm »
I've done a lot of refactoring and expanding on the project recently.

The most important milestones are:
- There is now a framework for AI scripts to interact with the game
- There is a simple AI to play against
- Units have a fight or flight response when being attacked
- Added a mining camp (which can be used for stone and gold)
- You can now issue move commands on the minimap
- When giving a move order to an unreachable target the actor will try to get as close as possible (unless it is an order to build or gather, then it wil try to find an alternative)
- Lots of rework on the villager AI (searching for alternatives, reporting on activity or being idle, pathfinding)
- Fixed a lot of game crashing bugs (selection lists going out of scope)
- Going back to a mostly single threaded application for stability and prevention of weird behaviour of actors

Things I plan on doing in the near term:
- set some winning and losing conditions so it will be an actual game
- stacking of commands
- rally points for buildings
- handeling of a crowded resource or drop-off point that doesn't tank the framerate
- make the AI attack other players at certain conditions (which can be varied a bit to give AI some personality)
- make a menu to select the amount of other players, AI difficulty and AI personality



EDIT

I just compiled a new release! it has the following changes:
  • Fixed potential crash in distanceToResource()
  • Fixed selection box functions going out of scope
  • Allows stacking of commands by holding down the shit key:
    • A list of actions for a given actor is now generated if the order is given while holding down the Shift button
    • Execute list of stacked commands in order for a given actor
    • Show flags for stacked order targets for a given actor if the actor is selected and the actor is owned by the player


Get it here:
https://github.com/switchboy/IsoRTS/releases/tag/stacking
« Last Edit: August 03, 2021, 05:02:28 pm by Switchboy »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9909
    • View Profile
    • development blog
    • Email
Re: Isometric RTS
« Reply #6 on: August 05, 2021, 12:39:16 pm »
The path finding can still be improved, like when you select all four people in the beginning and navigate them somewhere, it's interesting how two of them will move backwards first, probably because the other fields are occupied by other people.
There also seems to be some "recentering" going on, when you move someone from a task (e.g. getting wood) to walk somewhere. They first teleport to the next center of the tile, before moving to the wanted location.
In AoE the people can walk through fields, but here they seem to navigate around them. Maybe this is intentional?

When I first started the game, it loaded for a long time and then simply closed. But with the next run it works now. Do you generate something or write some file at first run?

One thing that can make the feel of the game a lot better, is if you provide indicators on the action. Like when I point someone to a tree, I get the same animation as if they are just walking there. As such I don't get the visual feedback, that I've just given them the command to chop trees.

The camera movement seems a bit annoying to me. I'd expect a fixed "border" (50-100px or so) inside the window that would move the world and not having the move the mouse outside the window. I'd even argue that moving the mouse outside the window should not move the world.

Also I'm really confused about the AI take over. :D
I was typing my response here and when I tabbed back to the game, all my villagers seem to have died and the AI has taken over in a different part of the map. :D
« Last Edit: August 05, 2021, 12:46:39 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Milten

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Isometric RTS
« Reply #7 on: August 06, 2021, 01:17:25 am »
Interesting project:D

For me it started perfectly (without any loading).
After ca. 5 minute the fps dropped (to 1 or maybe 2?) and the AI took over (probably the same case as eXplOit3r described)
The second start was normal - fps-Droppes a few times, but more solid than the first one.
« Last Edit: August 06, 2021, 01:53:21 am by Milten »

Switchboy

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Isometric RTS
« Reply #8 on: August 11, 2021, 10:25:13 pm »
The path finding can still be improved, like when you select all four people in the beginning and navigate them somewhere, it's interesting how two of them will move backwards first, probably because the other fields are occupied by other people.
There also seems to be some "recentering" going on, when you move someone from a task (e.g. getting wood) to walk somewhere. They first teleport to the next center of the tile, before moving to the wanted location.
In AoE the people can walk through fields, but here they seem to navigate around them. Maybe this is intentional?

When I first started the game, it loaded for a long time and then simply closed. But with the next run it works now. Do you generate something or write some file at first run?

One thing that can make the feel of the game a lot better, is if you provide indicators on the action. Like when I point someone to a tree, I get the same animation as if they are just walking there. As such I don't get the visual feedback, that I've just given them the command to chop trees.

The camera movement seems a bit annoying to me. I'd expect a fixed "border" (50-100px or so) inside the window that would move the world and not having the move the mouse outside the window. I'd even argue that moving the mouse outside the window should not move the world.

Also I'm really confused about the AI take over. :D
I was typing my response here and when I tabbed back to the game, all my villagers seem to have died and the AI has taken over in a different part of the map. :D

Interesting project:D

For me it started perfectly (without any loading).
After ca. 5 minute the fps dropped (to 1 or maybe 2?) and the AI took over (probably the same case as eXplOit3r described)
The second start was normal - fps-Droppes a few times, but more solid than the first one.
Thanks for the feedback.

The AI is controlling player 2. For debugging purposes I made tab temporarly a "switch player button". It can't get you back to player 0 (the human player) though.

On startup the game is generating a random map. It also does some checks to see if the map is indeed playable. It it finds the map unplayable (unable to spawn enough resources or actors near those resources) it will start over. It will try that a couple of times. Map generation actually had quite some bugs an quircks that got fixed the last couple of days.

On pathfinding: the routine is pretty simple right now 2d A* where two actors can't occupy the same tile at once. This sometimes leads to 'funny' routes being taken because one of the cells needed for the shortest route was occupied by another actor. You can actually see the paths and blocked cells by pressing the 'S' key.

The AI is also very scripted at the moment to a point that it can fall in a loop by giving villagers commands to resources they can't reach. In the new release actors keep an internal list of impossible tasks and would 'refuse' them. This frees up processing power from running unnecessary A* sessions. At the moment the AI is not reactive to this situation. I have to think of a way of catching such a stalemate and let the AI do something else instead.

A very busy dropoff point can also lead to stagnation and A* hogging resources until all the villagers have a route. This could also cause FPS drops. Having multiple actors on one tile would probably solve some of these issues. Or maybe letting the actors of the same team communicate and do a side step if that resolves a stalemate.

I do have to say that now minimap generation is not taking 50% of the CPU time slowdowns because of pathfinding or AI issues are less noticable

Here is a new release: https://github.com/switchboy/IsoRTS/releases
« Last Edit: August 11, 2021, 10:27:23 pm by Switchboy »

Switchboy

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Isometric RTS
« Reply #9 on: September 09, 2021, 01:01:15 am »
Took most of the feedback I got here to heart in the last couple of weeks.

A short clip of my latest feature:
A content aware mouse pointer :P

https://www.youtube.com/watch?v=xZbtKNFhW8Y

 

anything