Author Topic: Big units of the romans get stuck among the buildigs  (Read 771 times)

Pizza90

  • Draco Rider
  • *****
  • Posts: 282
    • View Profile
Big units of the romans get stuck among the buildigs
« on: 2 December 2012, 22:54:36 »
I dont know if i am the only one who noticed that the big units of the romas (battering ram and turtle formation) are almost useless if played by the AI because at 99% they get stuck among the buildings. Are there ways to improve the handle of these units by the AI? I remember in the roman factions walls were removed because AI could not play them in a correct way, well then this is the same thing, AI produces the unit correctly but then they are just useless and often block the path to other units.

Maybe forcing the workers to build the military camp X tiles away from the forum (hoping that this space doesnt get all filled by the other buildings) would be a workaround for this?
I translated Megaglest in italian and i keep the translation updated.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Big units of the romans get stuck among the buildigs
« Reply #1 on: 3 December 2012, 07:22:03 »
If I recall correctly, the AI is supposed to be constructing new buildings with at least 2 tiles inbetween. However, the turtle formation is a size 3 unit (battering ram is size 2, so not sure why it would be getting stuck, unless there happened to be other units in the way), so I can see it getting stuck. Perhaps the minimum distance between buildings should be defined in the faction XML? The other issue I've seen with unit movement is that if the AI wants to move a big unit and a smaller unit is in the way, it doesn't seem to understand it can move the smaller unit.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

Manric

  • Guest
Re: Big units of the romans get stuck among the buildigs
« Reply #2 on: 3 December 2012, 10:24:49 »
I don't know how the AI is supposed to build, but I do know that size 2 units get stuck very frequently. For example, besides the Roman, I have often seen horsemen, the Norsemen crossbow, the Persian elephant, as well as many non-Megapack units all hemmed in between two buildings. And not temporarily: they get only freed if their base is attacked and the buildings that hold them are pulled down.

MoLAoS

  • Ornithopter
  • *****
  • Posts: 433
    • View Profile
Re: Big units of the romans get stuck among the buildigs
« Reply #3 on: 3 December 2012, 11:37:31 »
It should be relatively simple to add a special closed list that is applied based on a units size. Effectively, if a building adjoins a tile that tile is tested for nearby buildings and marked as "closed for size 2" or 3 or w/e the unit size. Probably up to 4 or 5 tops before it gets crazy, and who needs a mobile size 6+ unit anyways.

There is a lot of literature about this, I expect that the original Glest team didn't deal with it since they didn't use large size units for the most part.

I imagine the most common method is some sort of node map. I'm not a fan but they would get the job done. Shouldn't be more than 100 lines of code tops.

 

anything