Author Topic: Cellmap on a moving unit... does it work?  (Read 1683 times)

madmanntis

  • Guest
Cellmap on a moving unit... does it work?
« on: 25 February 2010, 21:53:07 »
Hullo all. I have a melee unit that's 2 cells wide and 3 cells long. I really don't want to make it size three, so I'm wondering if it's possible to put it on a cellmap..

Quote
  <cellmap value="true">
  <row value="0000" />
  <row value="0110" />
  <row value="0110" />
  <row value="0110" />

Now would that work? Would the cell map orientation be relative to the unit's rotation, or would it always be oriented the same way (like buildings)?

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Cellmap on a moving unit... does it work?
« Reply #1 on: 25 February 2010, 21:58:06 »
I have no idea about the orientation, but I remember a discussion about size 1 units with a cell map of 0.  As I recall, the unit could move normally, except when another unit was occupying his cell.  I don't think anybody brought up the possibility of a larger unit, though.  Of course, the most definitive answer would come from trying it out yourself. ;)

jda

  • Guest
Re: Cellmap on a moving unit... does it work?
« Reply #2 on: 25 February 2010, 23:36:12 »
It's possible but it doesn't work that way.

You have a size 2 unit, so your cellmap is like this:
Code: [Select]
<cellmap value="true">
  <row value="00" />
  <row value="01" />
 
The 0's and 1 above are just for example.

The Dwarf faction has this for the flame team (size 2 unit made up by two size 1 units and an irrelevant connection). Hence its cellmap is setup like this:
Code: [Select]
<cellmap value="true">
  <row value="10" />
  <row value="01" />
It works perfectly and the unit moves around objects avoiding contact with each dwarf but allowing other objects to be in the free ("0") room of it. ;)
NOTE: this is not working in the current Dwarves but I fixed it and will be releasing a new version in a week or two.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Cellmap on a moving unit... does it work?
« Reply #3 on: 26 February 2010, 02:17:40 »
Code: [Select]
<cellmap value="true">
  <row value="10" />
  <row value="01" />
It works perfectly and the unit moves around objects avoiding contact with each dwarf but allowing other objects to be in the free ("0") room of it. ;)

Did you test that thoroughly? Cell maps do not rotate with the model.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Cellmap on a moving unit... does it work?
« Reply #4 on: 26 February 2010, 02:29:07 »
Quote
Did you test that thoroughly? Cell maps do not rotate with the model.

You really need to fix that! :o
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: Cellmap on a moving unit... does it work?
« Reply #5 on: 26 February 2010, 02:57:59 »
Quote
Did you test that thoroughly? Cell maps do not rotate with the model.

You really need to fix that! :o
I think that would be really problematic to fix, since the cell map would only be able to rotate in intervals of 90 degrees.  I think it's an issue with so few implications that it might as well be ignored unless/until there's a need for it to change.

Edit: ... except for rotating buildings, but those probably wouldn't need to rotate smoothly, so 90-degree intervals might be perfectly fine.  Personally I'd prefer only being able to rotate buildings in 90-degree intervals because doing otherwise kinda screws up placement.  You can't really tessellate your buildings very well if one of them is off by a couple degrees (as seen in Age of Mythology).
« Last Edit: 26 February 2010, 03:03:07 by John.d.h »

jda

  • Guest
Re: Cellmap on a moving unit... does it work?
« Reply #6 on: 26 February 2010, 03:54:41 »
Code: [Select]
<cellmap value="true">
  <row value="10" />
  <row value="01" />
It works perfectly and the unit moves around objects avoiding contact with each dwarf but allowing other objects to be in the free ("0") room of it. ;)

Did you test that thoroughly? Cell maps do not rotate with the model.
Darn! I'd done some testing but as it was only around Dwarf buildings (almost all of which had their own problems with sizes and cellmaps) I thought the little glitches I saw were unrelated to the flame team's cellmap itself.
So... I grabed a worker and got my flame team going across it in all directions... It never did touch the worker but on ocasions it avoided it taking a path I didn't expect...
So I grabbed the worker instead and did some testing. The results are simple to read and confirm what you said about the non-rotation of the cellmap (BTW  >:( ! lol). All went well when the flame team was facing top->down or bottom->up. When facing either side though, I could only fit it the worker in the wrong positions (i.e. where there was one of the crew of the team). Easy to understand given the cellmap:

Top-down orientation:
01 - front dwarf on the right
10 - rear dwarf on the left
Bottom-up:
01 - rear dwarf on the unit's left
10 - front dwarf on the unit's right

Left-right
01 - rear dwarf on the unit's left - DARN!
10 - front dwarf on the unit's right - DARN!
Likewise for Right-left ...

Oh well... back to putting the whole cellmap to 1's then... ;D

madmanntis

  • Guest
Re: Cellmap on a moving unit... does it work?
« Reply #7 on: 26 February 2010, 04:39:31 »
Alright! Thanks for the feedback everyone!  ;D Yeah, I guess it'll just have to be a size 3 unit (3x3). Not a big problem.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Cellmap on a moving unit... does it work?
« Reply #8 on: 26 February 2010, 09:30:43 »
I think that would be really problematic to fix, since the cell map would only be able to rotate in intervals of 90 degrees.  I think it's an issue with so few implications that it might as well be ignored unless/until there's a need for it to change.

Yes, for a mobile unit that might have an arbitrary facing, this simply wont work with Glest's mechanics. It's not fixable  :(

Quote
Edit: ... except for rotating buildings, but those probably wouldn't need to rotate smoothly, so 90-degree intervals might be perfectly fine.

This, however, is doable. I was planning to do it when support for shipyards was added, but I was defeated by the map format on those.  Being able to rotate buildings (90 deg increments) would be nice though, ticket added.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

jda

  • Guest
Re: Cellmap on a moving unit... does it work?
« Reply #9 on: 26 February 2010, 19:17:22 »
Sorry for the OT but... exactly to how many facings can a unit face? I'm pretty sure I've seen units facing in a straight horizontal line while moving in a slightly diagonal one...