Author Topic: [fixed] incomplete buildings bug in 3.5.2  (Read 2169 times)

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
[fixed] incomplete buildings bug in 3.5.2
« on: 14 June 2011, 05:47:36 »
after watching as an observer to test AI of my mods Annex and Chasm i noticed that Ai tends to start building a structure then walks away to harvest resources or begin building a new structure, leaving it unfinished, sometime to never return to finishing it for several minutes. Since this affects both of my mods i dont believe this is mod related.
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: incomplete buildings bug in 3.5.2
« Reply #1 on: 14 June 2011, 06:15:03 »
I've noticed this, too. This did not usually happen in past versions, but only since 3.5.2. It might be a side effect of the improvement where AI ensures they repair main their buildings when those get damaged.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

MJR

  • Guest
Re: incomplete buildings bug in 3.5.2
« Reply #2 on: 14 June 2011, 08:33:52 »
I've notice this behavior from the AI's to start buildings and then stop before they were done long before 3.5.2 even on regular Glest they did this but not as much as on MegaGlest. Sometimes two or more buildings go unfinished all the way to the end of the game sometimes. Other times if the game last long enough the AI gets back to finishing the building but not always. As I said I've seen this behavior even back to version 3.3.2 on MegaGlest.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: incomplete buildings bug in 3.5.2
« Reply #3 on: 14 June 2011, 16:04:04 »
i was going to report this.

But yeah, the problem is.

1. If a worker leaves a "building" process, the building process is effectively STOPPED! Meaning it will NEVER resume, you can go around this tho, by having the worker repair the building this is however subjet to "repair - ability" rules, and as such, a building that should take 10 seconds suddenly can take 60 seconds, dependant on repair skills, if NO unit is aviable to repair, you just lost the building's matrials

Solution?.
Add a cancel button/ability wich have a refund option. This button need to be avbable during construction like the waypoint "skill"
WiP Game developer.
I do danish translations.
"i break stuff"

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: incomplete buildings bug in 3.5.2
« Reply #4 on: 15 June 2011, 00:50:09 »
Solution?.
Add a cancel button/ability wich have a refund option. This button need to be avbable during construction like the waypoint "skill"
Don't refund it... If no units can repair (or if repair is lower than build speed), that is a mod problem, a mistake on the modder's behalf. If people can refund buildings, they'd do that to every in-construction building they have when they are attacked. Ideally, if you have to kill a unit, expect nothing back. Smart building is a tactic, not something that can be thrown around at whim.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: incomplete buildings bug in 3.5.2
« Reply #5 on: 15 June 2011, 03:12:49 »
Solution?.
Add a cancel button/ability wich have a refund option. This button need to be avbable during construction like the waypoint "skill"
Don't refund it... If no units can repair (or if repair is lower than build speed), that is a mod problem, a mistake on the modder's behalf. If people can refund buildings, they'd do that to every in-construction building they have when they are attacked. Ideally, if you have to kill a unit, expect nothing back. Smart building is a tactic, not something that can be thrown around at whim.

Its not a modder's mistake if its intentional, he may have a good reason to not have a repair skill, beside it is his mod.  MANY commercial RTS have abilities to refund units, including highly successful ones such as C&C Starcraft Rise of Nations t name a few... You don't necessarily have to get all resources back, only a portion.
Anyway, this should be a separate feature request topic as it doesn't have anything to do with the Bug of AI not finishing their buildings. (well only slightly...)

As for me I've watched observer matches between AI since many versions ago and never noticed this behavior. (not even in 3.5.0) Not saying that MJR is wrong but this is my observation at least. Either way, its a big problem now as Mega Cpu has moments where there be 2 or more of the same structure started but not finished simultaneously. (ex worker attempt to build a barracks, stops building, attempts 2nd barracks, stops building, another worker attempts to build yet a 3rd barracks, stops and moves to repair first barracks) very strange...
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: incomplete buildings bug in 3.5.2
« Reply #6 on: 15 June 2011, 20:29:43 »
Its not a modder's mistake if its intentional, he may have a good reason to not have a repair skill, beside it is his mod.  MANY commercial RTS have abilities to refund units, including highly successful ones such as C&C Starcraft Rise of Nations t name a few... You don't necessarily have to get all resources back, only a portion.
Anyway, this should be a separate feature request topic as it doesn't have anything to do with the Bug of AI not finishing their buildings. (well only slightly...)
:thumbup: Would be a great feature. I'd probably use it more when I accidentally place buildings at a bad place. Bad place=blocks other buildings or the opening of the building is blocked. Happens every now and then.

MJR

  • Guest
Re: incomplete buildings bug in 3.5.2
« Reply #7 on: 16 June 2011, 07:42:35 »
I only play single player games and I've watch my AI ally start buildings every since version 3.3.7. Most of the time they never get around to completing them because my AI ally is wiped out before they get to it and the few times they last long enough to get back to it it has been anywhere from 2 to 15 minutes since they started the building.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: incomplete buildings bug in 3.5.2
« Reply #8 on: 16 June 2011, 23:11:43 »
I checked the code and there is definitly something wrong. I must talk to softcoder a bit becasue I don't get the full idea of this repair behaviour. At least I can prevent the Ai from stopping building things to help repair on another building.

Update:
some things I saw:

unitCountAlreadyRepairingDamagedUnit is comuted a wrong way:
-  Repair command is given to a position but its checked for a unit in the current command to count up the unitCountAlreadyRepairingDamagedUnit
- UnitCountAlreadyRepairingDamagedUnit must be checked before entering the second for loop. else it will at least always add a unit.
- buidling units should not get a repair command instead and should not stop building another building ( thats what the people saw )

And are really all buildings "castles" as the variable names in the code make you think?

But as I said maybe I just don't got the idea ....

« Last Edit: 16 June 2011, 23:37:13 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: incomplete buildings bug in 3.5.2
« Reply #9 on: 20 June 2011, 09:04:18 »
I fixed this now ( and added a bit better behaviour vor cpu-mega too ).
Its NOT in svn yet, as I still need to test a bit with the new Mega behaviour. I hope to check it in later today.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: incomplete buildings bug in 3.5.2
« Reply #10 on: 20 June 2011, 09:08:29 »
Cool! Please remember to commit it.  :thumbup:
What's the better behavior for CPU Megas?

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: incomplete buildings bug in 3.5.2
« Reply #11 on: 20 June 2011, 11:52:35 »
Units which are currently producing something are typically not used to attack. Only exception is something is inside their attack range.
By this for example thunderbird productions are not aborted to attack with a shamen, but totems still stop their production if an enemy is in range.

But thats the current state.
( this discussion is getting out of topic  :-X )
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: incomplete buildings bug in 3.5.2
« Reply #12 on: 21 June 2011, 00:12:16 »
this should be fixed now in svn
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

 

anything