JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
Today only some graphical improvements (unit_improvements branch):
- added own mouse cursor
- added mouse-over-unit blinking
- highliting units inside selection rectangle
- removed white outlines from tank sprites and some small bugs
Still thinking about multi-agent path finding...
BR
Slevin
- added own mouse cursor
- added mouse-over-unit blinking
- highliting units inside selection rectangle
- removed white outlines from tank sprites and some small bugs
Still thinking about multi-agent path finding...
BR
Slevin
Carpe noctem
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
Here's my .02
You need to do tests 1st of all to see if tile is occupied before moving there. This is super important!
When you give a command, units will calculate their route and store it. Every tile they move, they will check the route to see if it is still valid. If not, recalulate. If the target position is occupied when they reach it, retarget to nearest unoccupied tile.
You may want to periodicaly recalculate path even if the current route is still valid. Something might have changed that would have opened up a new path in the meanwhile. But that is optional.
You need to do tests 1st of all to see if tile is occupied before moving there. This is super important!
When you give a command, units will calculate their route and store it. Every tile they move, they will check the route to see if it is still valid. If not, recalulate. If the target position is occupied when they reach it, retarget to nearest unoccupied tile.
You may want to periodicaly recalculate path even if the current route is still valid. Something might have changed that would have opened up a new path in the meanwhile. But that is optional.
Chili
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
Thx Chili! I have implemented something similar. This is the first try (after several fails), which does at least partially work. Avoiding standing units is ok. Moving a group at once has problems. Dog piling could be reduced .
I am really happy, that the first step in the multi agent path planning is done. I know, that there is still a lot to do and still several bugs existing. This topic is even more difficult and complicated than I thought it would be.
If you guys want to try it out, checkout the path_finding branch. I would appreciate any help or further tips.
I am really happy, that the first step in the multi agent path planning is done. I know, that there is still a lot to do and still several bugs existing. This topic is even more difficult and complicated than I thought it would be.
If you guys want to try it out, checkout the path_finding branch. I would appreciate any help or further tips.
Carpe noctem
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
At the moment I am experimenting with some ideas from the book "The Nature of Code" by Daniel Shiffman, which is available online: http://natureofcode.com/book/
I have implemented some stuff from chapter 6 (autonomous-agents) and the result looks really nice! Maybe I will integrate it into my game. The vehicles are able to follow a given path (consisting of Vec2 points in Chilis framework) or follow the mouse cursor. There is also a "separate" function, which should avoid collisions between vehicles.
The movements are pretty smooth and look more "natural" due to additional parameters like acceleration and force. If they are too fast at some point they can leave the path and have to find the way back.
You can find the code in the someNatureOfCodeTests branch (https://github.com/Erazor1980/JARTS/tre ... fCodeTests).
- switch between "mouse mode" and "path mode" with the space key
- add new vehicles with left mouse click
- you can activate vehicles' track drawing with the DRAW_TRACKS define in Vehicle.h
It is still not perfect and I have to tune especially the "separate" function. But I like the smooth movements of the agents very much. My plan is to add it to the main game at some point. I can then still use the A* algorithm to calculate the shortest path. Path following and separation would be done using the Nature of Code approach.
What do you think?
BR
Slevin
I have implemented some stuff from chapter 6 (autonomous-agents) and the result looks really nice! Maybe I will integrate it into my game. The vehicles are able to follow a given path (consisting of Vec2 points in Chilis framework) or follow the mouse cursor. There is also a "separate" function, which should avoid collisions between vehicles.
The movements are pretty smooth and look more "natural" due to additional parameters like acceleration and force. If they are too fast at some point they can leave the path and have to find the way back.
You can find the code in the someNatureOfCodeTests branch (https://github.com/Erazor1980/JARTS/tre ... fCodeTests).
- switch between "mouse mode" and "path mode" with the space key
- add new vehicles with left mouse click
- you can activate vehicles' track drawing with the DRAW_TRACKS define in Vehicle.h
It is still not perfect and I have to tune especially the "separate" function. But I like the smooth movements of the agents very much. My plan is to add it to the main game at some point. I can then still use the A* algorithm to calculate the shortest path. Path following and separation would be done using the Nature of Code approach.
What do you think?
BR
Slevin
Carpe noctem
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
Sounds like some awesome shit. I will take a look at this
Chili
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
After countless hours of trying and failed attempts I have reached an acceptable state of my path planning / path following. It is still not perfect, but by far best of the last 2 weeks. The current status can be found in the master branch.
Looking forward to work on more enjoyable stuff next, like the actual fights.
Looking forward to work on more enjoyable stuff next, like the actual fights.
Carpe noctem
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
- added life bars to units
- added Cursor class with different animations depending on possible action, e.g. attack or move command, not accessible area
- added shooting and explosion sound effects
- added rotating cannon to tanks (pointing to enemy or target tile)
- implemented attacking state:
- right click on an enemy to attack it
- unit(s) will follow enemy, when it is out of attacking radius
- unit(s) will stop, when enemies gets destroyed
- added more displayed details in debug mode (pressing "space" shows additionally the map grid, units' attack radii and paths)
- fixed simultaneous sound effects (when selecting several units, the sound was played louder)
Next steps:
- shooting graphics
- explosion graphics
- soldiers
BR
Slevin
Carpe noctem
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
I looked at the natureofcode branch, not sure exactly what it is, but it's pretty dang cool.
The actual game stuff is looking cool man! Are the airplanes telling me that I suck? The motion looks really nice man, keep it up! (Btw, you can loop sounds in the framework, for the tank moving sfx etc.)
The actual game stuff is looking cool man! Are the airplanes telling me that I suck? The motion looks really nice man, keep it up! (Btw, you can loop sounds in the framework, for the tank moving sfx etc.)
Chili
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
Hehe Its pretty simple bro. There are some "vehicles" which try to follow a given path, consisting of 7 points in this case (they continue with the first after completing the full path). The current path segment is passed, when they reach its end point. So if they are too fast, they have to go back a little.chili wrote:I looked at the natureofcode branch, not sure exactly what it is, but it's pretty dang cool.
Additionally they try to avoid each other. You can add more units with left mouse click -> they will be created at the position of the mouse cursor and directly try to reach the first path segment.
In the "mouse" mode all the units try to reach the mouse cursor, instead of following the path. More units make it pretty funny!
You can switch between both modes with the space key.
Thx man! "You suck" is supposed to be "Yes, sir!", but feel free to understand what ever you wantchili wrote: The actual game stuff is looking cool man! Are the airplanes telling me that I suck? The motion looks really nice man, keep it up! (Btw, you can loop sounds in the framework, for the tank moving sfx etc.)
Yea, I will enable looping for some sound effects.
Carpe noctem
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game
Hey guys,
after an inactive week I recently started to code again. Following updates are included:
- shooting effects
- animated explosions (new SurfaceSequence class)
- damage taken effect (using Chili's Substitution SpriteEffect)
- units attack automatically enemies within radius
- units fight back after taking damage
- improved unit graphics (i.a. new TeamColor SpriteEffect)
- background sound
Besides this I have added some interface stuff:
- "enter" to reset the game
- "esc" to close the game
- "L" to enable/disable life bars
Latest code can be found in the master branch.
As always: I would highly appreciate any Feedback/Suggestions/Tips/Bugs!
BR
Slevin
after an inactive week I recently started to code again. Following updates are included:
- shooting effects
- animated explosions (new SurfaceSequence class)
- damage taken effect (using Chili's Substitution SpriteEffect)
- units attack automatically enemies within radius
- units fight back after taking damage
- improved unit graphics (i.a. new TeamColor SpriteEffect)
- background sound
Besides this I have added some interface stuff:
- "enter" to reset the game
- "esc" to close the game
- "L" to enable/disable life bars
Latest code can be found in the master branch.
As always: I would highly appreciate any Feedback/Suggestions/Tips/Bugs!
BR
Slevin
Carpe noctem