JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
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

Post by SlevinKelevra » September 21st, 2017, 10:12 pm

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
Carpe noctem

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game

Post by chili » September 22nd, 2017, 1:55 am

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.
Chili

User avatar
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

Post by SlevinKelevra » September 22nd, 2017, 11:34 pm

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.
Carpe noctem

User avatar
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

Post by SlevinKelevra » September 29th, 2017, 5:26 pm

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
Carpe noctem

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game

Post by chili » October 2nd, 2017, 6:03 am

Sounds like some awesome shit. I will take a look at this :)
Chili

User avatar
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

Post by SlevinKelevra » October 2nd, 2017, 3:11 pm

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.
Carpe noctem

User avatar
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

Post by SlevinKelevra » October 3rd, 2017, 9:54 pm

  • 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)
I have added an enemy tank, which can be controled in debug mode (only moving). It can be used to test the attacking state of units: you can give your unit(s) the attack command and then try to escape with the enemy tank.

Next steps:
  • shooting graphics
  • explosion graphics
  • soldiers
Latest code is pushed to the master branch (https://github.com/Erazor1980/JARTS).

BR
Slevin
Carpe noctem

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: JARTS - (j)ust (a)nother (r)eal (t)ime (s)trategy game

Post by chili » October 6th, 2017, 3:09 pm

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.)
Chili

User avatar
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

Post by SlevinKelevra » October 6th, 2017, 5:07 pm

chili wrote:I looked at the natureofcode branch, not sure exactly what it is, but it's pretty dang cool.
Hehe :lol: 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.

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.
chili 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.)
Thx man! "You suck" is supposed to be "Yes, sir!", but feel free to understand what ever you want :D

Yea, I will enable looping for some sound effects.
Carpe noctem

User avatar
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

Post by SlevinKelevra » October 14th, 2017, 12:11 am

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
Carpe noctem

Post Reply