Author Topic: Unit sizes  (Read 1934 times)

Mr War

  • Guest
Unit sizes
« on: 17 February 2011, 06:48:57 »
Hi, couldn't see this on the wiki..

Ability to make unit width separate from length

Larger units that would be long and thin, like a ship, or I guess wide but short

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Unit sizes
« Reply #1 on: 17 February 2011, 08:27:44 »
 This could be made possible by the "symbiotic pets" ticket  :look:
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

ChupaReaper

  • Guest
Re: Unit sizes
« Reply #2 on: 17 February 2011, 09:01:03 »
Can't you use cellmaps, they could be only for static units but I'm sure I've used them for something that moves. Here's an example of a uni with 2 width and 4 length:
Code: [Select]
<size value="4"/> (must be set at maximum width or length which ever is the bigger of the two)
<cellmap value="true">
<row value="0110"/> (0 = where the unit should not be, so in this case the sides of the unit)
<row value="0110"/> (1 = solid parts of the unit)
<row value="0110"/>
<row value="0110"/>
</cellmap>
Just imagine cellmaps as the shape of the unit made up of 1s.

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Unit sizes
« Reply #3 on: 18 February 2011, 05:02:58 »
Unfortunately I don't think cellmaps update as they move..... :look:
Egypt Remastered!

Proof: Owner of glest@mail.com

ChupaReaper

  • Guest
Re: Unit sizes
« Reply #4 on: 18 February 2011, 13:30:55 »
Unfortunately I don't think cellmaps update as they move..... :look:
Hmm I was worried about that...

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Unit sizes
« Reply #5 on: 18 February 2011, 13:33:18 »
I think we can all agree that the general idea that a cellmap is the best way of defining the size of a movable multi-cell unit?

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Unit sizes
« Reply #6 on: 18 February 2011, 19:32:09 »
I think we can all agree that the general idea that a cellmap is the best way of defining the size of a movable multi-cell unit?

Yep.
Egypt Remastered!

Proof: Owner of glest@mail.com

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Unit sizes
« Reply #7 on: 18 February 2011, 19:39:53 »
If there's some way to make it work, then sure.  I have no idea how it would jive with Glest's cell system, though.  For example, what should this cell map look like when the unit is rotated by 15 degrees?

0100
1110
1111
0110

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Unit sizes
« Reply #8 on: 18 February 2011, 19:54:20 »
Hmmmmmm. I think maybe instead of doing it by cell... The Cell map needs to be an overlay that will take up and tiles it covers. What do you think?
Egypt Remastered!

Proof: Owner of glest@mail.com

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Unit sizes
« Reply #9 on: 18 February 2011, 19:57:50 »
Right now moving units can be any size, but are square - they have an implicit cellmap that is all 1s.

The feature request boils down to allowing a moving model to specify a cellmap.

It would be ok for the path-finding to take into account only the unit size and not the shape of the cellmap, and it would be expected that its unlikely that other units can move easily through holes in a cellmap since the random angle means that each cell in the map might occupy more than one tile on the board.

But within those confines, it seems like a very good generalising of the engine and would allow the use-cases given in the original post, namely ships.

Mr War

  • Guest
Re: Unit sizes
« Reply #10 on: 18 February 2011, 20:52:09 »
The problem that caused me to raise this was that I created a gate which can be open or closed. The gap is two wide. I have a war machine (tank) which has size 3 but looks like only one wide

The war machine cannot go through the gate

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Unit sizes
« Reply #11 on: 19 February 2011, 05:21:00 »
The problem that caused me to raise this was that I created a gate which can be open or closed. The gap is two wide. I have a war machine (tank) which has size 3 but looks like only one wide

The war machine cannot go through the gate

Ah, I believe this would help the ai out with tech. They build a camp and then when it gets big enough some horsemen get trapped because they are size 2.
Egypt Remastered!

Proof: Owner of glest@mail.com

ChupaReaper

  • Guest
Re: Unit sizes
« Reply #12 on: 19 February 2011, 13:00:40 »
When placing and morphing units, could the cellmap be taken into account as my gatehouses wont open or close if another unit is in one of its 0s even though once it opens or closes that will still be a 0. Same for placing units maybe also don't forget to take into account rotating units before placing them.