New release planning (3.2.4)/ 3.3.0

Discuss the future of Warzone 2100 with us.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

Re: New release planning (3.2.4)

Post by Berserk Cyborg »

VTOLs are rearming for me in master. One issue that I notice in 3.2.3/master is that they do not use all available pads and instead wait to rearm only with the pad closest to them.
moltengear wrote: Did anybody pay attention to this is not the correct mapping?
#4093.
moltengear wrote: Also there is the problem of shadows. Vincent said that he fixed it.
That is only in Vincent's Vulkan build at the moment.
User avatar
moltengear
Trained
Trained
Posts: 170
Joined: 22 Jul 2017, 15:05

Re: New release planning (3.2.4)

Post by moltengear »

I suggested that you first bring the graphics framework to the second thread.
But one programmer said that speed, if it will, is small. But to rewrite the code will be very much.
And now I had another idea. It is necessary to do the opposite. This will be much easier to implement.
:wink:
Second thread.jpg
Second thread.jpg (77.12 KiB) Viewed 7262 times
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New release planning (3.2.4)

Post by Per »

molten, that really has nothing to do with this topic.

Please do post tickets that need fixing before we can release 3.2.4/3.3.0 here, though.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New release planning (3.2.4)

Post by Per »

Berserk Cyborg wrote:VTOLs are rearming for me in master. One issue that I notice in 3.2.3/master is that they do not use all available pads and instead wait to rearm only with the pad closest to them.
Since the rearm code is so convoluted that the "correct" behaviour is hard to deduce, and I am not at all convinced that previous versions had an optimal implementation, either, let's start by asking: How should the VTOL rearm code actually work? Which rearm pad should it pick, and when?

Currently, the expected behaviour seems to be: Pick the closest rearm pad, whether idle or not, fly there, then start landing next to it. Idle rearm pads will then grab hold of it, and make it land on them. This is obviously bad if there is lots of VTOLS, and a single very close rearm pads in one direction and fifty idle rearm pads in another direction. Apparently we don't want to check if the rearm pad is busy before making our way there, i guess because it could be either taken or idle by the time we get there. I'm not sure this "optimization" actually makes things more optimal, though (as illustrated in the example above).

Ideas?
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: New release planning (3.2.4)

Post by Berg »

Make them behave like they did in 3.1.5, where every pad gets used
If a pad is in use with no one waiting for it vtols that are at pads with more move to it so if there is 5 pads and 20 vtol they all have 3 waiting and one being repaired
Its not rocket science
Also fix the unit orders feature that was removed please
Forgon
Code contributor
Code contributor
Posts: 298
Joined: 07 Dec 2016, 22:23

Re: New release planning (3.2.4)

Post by Forgon »

Zepherian would be happy with VTOLs simply rearming as they used to in 3.1.5.

According to him, they should fly to the closest pad, and, if it is currently occupied, fly to the next available one. He also stated that the limitation of of at most 50 pads for at most 150 units often lead to a shortage of pads in multiplayer games, where 90+ VTOLs were not uncommon and up to 135 could be observed at times. Thus, the ratio of VTOLs to pads ought to be the main determinant of behaviour.

To Per: I have unsuccessfully tried to reproduce the assert/crash you mentioned in #4692 as a result of the new quitConfirmation option. Could you give me more details on it?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New release planning (3.2.4)

Post by Per »

Am I the only one no longer receiving replies to trac tickets anymore?
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

Re: New release planning (3.2.4)

Post by Berserk Cyborg »

Per wrote:Am I the only one no longer receiving replies to trac tickets anymore?
I receive an e-mail every time somebody replies to a ticket I am part of. Would the failed forum upgrade have an effect on this?
Since the rearm code is so convoluted that the "correct" behaviour is hard to deduce, and I am not at all convinced that previous versions had an optimal implementation
Yeah, I was looking at it yesterday and it looked weird. It first tries to find the nearest pad, then tries to find any that are free (fails here), and if not they are told to return to base. Or something like that. I'm starting to think everything is "correct behavior". So fragile.

What I think:
1. Find the pad closest to me that is free and not about to be taken by another VTOL and rearm.
2. If none are free, wait to rearm next to the nearest pad. If another pad becomes free then try to rearm on that one.
3. If no pads are built, return to base.
Bethrezen
Regular
Regular
Posts: 661
Joined: 25 Sep 2009, 02:05

Re: New release planning (3.2.4)

Post by Bethrezen »

To my mind this is a simple problem, at least from a logic perspective.

Scenario 1 - You have equal numbers of vtols and pads

This is easy every vtols is assigned a pad and will always use the same pad end of.

How would assignment work the same way it does in every other RTS game that uses air craft either the player can manually assign air craft to a specific pad by selecting an air craft and then selecting a pad simple enough.

Or the computer can auto assign a pad, the way this works is that the computer simply looks for the closest pad that is not currently occupied/assigned to another air craft and then lands there and then that pad becomes it's assigned pad

Scenario 2 - You have more air craft then pads.

This is where things get a bit more complex if you have more air craft then pads the best way to handle this is via a queue system.

The way this works is the vtols looks for the first available unoccupied pad, it doesn't matter where on the map the pad is all the computer is concerned with is that the pad is empty and that it belongs to you.

If the computer can't find an unoccupied pad then the remaining vtols will get in to a queue and simply wait until a pad becomes available and when one opens up the unit that is currently at the front of the queue will go to that pad again it doesn't matter where on the map the pad is the computer only cares that it's empty and that it belongs to you.

The best way to visualise this is to think snake line queue at your local store where every one just waits in a line and when a teller becomes available they will call who ever is at the front of the queue to which ever register is currently available same idea.

Doing it this way you could in an extreme case use a single rearming pad to rearm and repair hundreds of vtols because one by one they will land get repaired and rearmed and then move out the way so the next in line can land and so on and so on until all units have been repaired and rearmed.

now obviously if you have equal numbers of pads and vtols then there is no need for the vtol to move once its rearmed and repaired so its will just stay at its pad until the player gives it an order but if there is more than 1 vtol waiting to use that pad then obviously they will automatically get out the way.

A third possible way to handle this is to simply do away with rearming pads altogether and simply replace them with a hanger and then just make it so the hanger can rearm and repair an unlimited number of air craft, the way this works is that the air craft dock at the hanger and vanish from the map and once they are rearmed and repaired they will pop back out again and land at the rally point to await further instructions.

if you want to see what air craft are currently docked at the hanger then simply click on the hanger and scroll through the list of units that are currently docked there, and once you find the unit or units that you are looking for you should simply select it and then command them in the usually way at which point they will undock and carry out what ever order you just gave them. The way i see this working is very similar to how it works when you put units on a transport ship in campaign mode.

Doing it this way eliminates a lot of unnecessary messing about and would make the code so much simpler, the downside of this however is that this method would require a fair amount of work to implement because first off you would need to create a new model for the hanger then you would have to do all the associated coding which would be time consuming, plus I'm not even sure if the game could actually support this.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New release planning (3.2.4)

Post by Per »

Let me try to draw this (and this is when everyone with any artistic ability should quickly look away...):
VTOL_blank.png
VTOL_blank.png (8.29 KiB) Viewed 7117 times
(You need to scroll the image...)

Here we have two VTOLs, A and B, that have expended their ammo. A is closer to the rearm pads on the left, while B is closer to the rearm pads on the right. The rearm pads on the left are all busy rearming VTOLs. The rearm pads on the right are all idle.
VTOL_315.png
VTOL_315.png (10.7 KiB) Viewed 7117 times
This is how I understand 3.1.5 and earlier behaviour. VTOL B will go rearm to the right. VTOL A will travel to the closest rearm pad to the left, and start to park next to it, setting itself to the "waiting to rearm" state. Before it has managed to land, however, one of the rearm pads on the right will have noticed that it is waiting to rearm, and will pull it in. It would then fly (potentially across the map) to land on the rearm pads on the right. Note that since allied VTOL pads will happily snatch and rearm your VTOLs, this kind of long distance rebasing is not really that far fetched in many player games. We could change it so that rearm pads can snatch targets mid-air, but this makes it even more complicated, and could lead to some quite surprising and dangerous flight paths.
VTOL_simpler.png
VTOL_simpler.png (11.61 KiB) Viewed 7117 times
This is I think a simpler solution, which is what Berserker Cyborg is suggesting above. Once the VTOL is out of ammo, it finds an available rearm pad, assigns it and uses it. If there are none available, they go the nearest busy one. In the all busy case, it behaves similar to 3.1.5. This variant is simpler, less surprising, and I think leads to better results overall.

Both the above variants have the consequence that if you have 49 busy rearm pads at the far end of the map, 1 VTOL pad close to the enemy base, and 100 VTOLs coming back to rearm, then all 100 VTOLs will land at the 1 close rearm pad. I think any optimal solution would require each rearm pad to have a rearm queue, as suggested above by Bethrezen. The returning VTOL can then find out which rearm pad to wait by simply by checking the length of each pad's queue, and add itself to the one with the shortest queue. This solution might actually save us a bit of CPU time, since currently each idle pad iterates over every allied droid every frame to check for potential rearm targets, which is a bit silly.
Forgon
Code contributor
Code contributor
Posts: 298
Joined: 07 Dec 2016, 22:23

Re: New release planning (3.2.4)

Post by Forgon »

To Per: I have still not been able to reproduce the bug you mentioned in #4692.

This must mean I am not building this game correctly. After compiling with `./autogen.sh && ./configure CFLAGS='-O2-gstabs -g -g2' CXXFLAGS='-O2 -gstabs -g -g2' && make` in a clean chroot of my ArchLinux installation, neither does the assertion fail nor does the game crash when other assertions fail.

Do you have any idea as to why that might happen?
OFelix
Rookie
Rookie
Posts: 25
Joined: 01 Jul 2015, 22:36

Re: New release planning (3.2.4)

Post by OFelix »

Per wrote: Both the above variants have the consequence that if you have 49 busy rearm pads at the far end of the map, 1 VTOL pad close to the enemy base, and 100 VTOLs coming back to rearm, then all 100 VTOLs will land at the 1 close rearm pad. I think any optimal solution would require each rearm pad to have a rearm queue, as suggested above by Bethrezen. The returning VTOL can then find out which rearm pad to wait by simply by checking the length of each pad's queue, and add itself to the one with the shortest queue. This solution might actually save us a bit of CPU time, since currently each idle pad iterates over every allied droid every frame to check for potential rearm targets, which is a bit silly.
May I suggest that when choosing a pad the VTOL should look at the Queue Length * Distance.
This would help to avoid flying long distances, possibly over enemy territory. to get to a pad which happens to be free.
Additionally, if you are flying from the target under attack back to the pad and then taking off to attack the same target again then the distance becomes even more important.

You may also want to consider variables such as re-arm time and journey time to fly to the pad.

Thanks
Keep up the good work! :-)
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: New release planning (3.2.4)

Post by Berg »

Allied Pads do not snatch vtols at the moment and it seems you are trying to over complicate the code just make it do what it did before in 3.1.5.
The idea that pads behaved badly in 3.1.5 never crossed my mind as they always seems to do their jobs.
Bethrezen
Regular
Regular
Posts: 661
Joined: 25 Sep 2009, 02:05

Re: New release planning (3.2.4)

Post by Bethrezen »

May I suggest that when choosing a pad the VTOL should look at the Queue Length * Distance.
This would help to avoid flying long distances, possibly over enemy territory. to get to a pad which happens to be free.
Additionally, if you are flying from the target under attack back to the pad and then taking off to attack the same target again then the distance becomes even more important.

You may also want to consider variables such as re-arm time and journey time to fly to the pad.

Thanks
Keep up the good work! :-)
that's actuality not a bad idea and would work well in conjunction with the method i already suggested, yes its a little more complicated but adding in that extra check might stop some unexpected unwanted behaviour that could happen if you kept it super simple as suggested.

now as for how to handle vtols when playing with a partner, I'm of the opinion that it might be a good idea to put that one on the back burner until there is a setup in place that works for single player whether that be single player campaign or single player skirmish, once there is a system in place that works for the majority of people in single player then the system can be given another pass to see how it can be enhanced for team play.

Personally I'm a big believer in the KISS principal (Keep It Simple Stupid) because if you make it simple then you make it hard to foul up and you make it easer to fix issues when problems happen.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New release planning (3.2.4)

Post by Per »

Support for allied rearm pads snatching VTOLs has been in the code for a very long time already. I guess it is just one more thing that just doesn't quite work right.
Post Reply