Author Topic: Tile Id List?  (Read 2544 times)

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Tile Id List?
« on: September 16, 2009, 02:52:41 PM »
Does anyone have a list of each tile's hex ID?  I want to automate the process of recording tubes for my AI, but if I try doing it by celltype the AI tries to build tubes under buildings because it's stupid.  Anyways, I've tried looking around with no luck.  I figure this is exactly the sort of thing Hooman would keep lying around "just in case" though.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Tile Id List?
« Reply #1 on: September 17, 2009, 12:23:11 AM »
I'm not sure I understand. You want to record tubes that are pre-existing? I'm guessing you tried using the cell type, and found that buildings have tube cell types, which has foiled that plan, so now you want to examine tile indexes?

I believe the tube tiles are consecutive, so if you get the index to the first one, you'll have a range of 16 tiles to check for. I assume you want to limit the search to some smaller region though, so you don't record tubes from an enemy base. You know, attack of the earthworkers and such if they ever lose a tube.



Ok, so... the starting indexes of tubes tiles, by terrain type are:
Code: [Select]
Rock: 929
Mud: 417
Sand: 1678
Each one is consecutive for 16 tiles.

Ex: [929..(929+16-1)]  <- Endpoint inclusive
Ex: [929...(929+16)]  <- Endpoint exclusive

In case you need to know the directionality, I'll release a VB project that lets you view the tile groups found at the end of .map files.

 

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Tile Id List?
« Reply #2 on: September 17, 2009, 08:14:23 AM »
Yes, that was my plan: rather than manually record all of the tubes that the AI needs to rebuild, I wanted to automate the process.  I did however know that underneath buildings was also considered "tube 0."  I thought this would actually be neato as the AI would build tubes where destroyed structures used to be, meaning that even if the structure took awhile to get rebuilt, a tube would be built so things wouldn't disabled for extended periods of time.  Of course, the plan didn't quite work as I had hoped, as the AI awkwardly tubed under the entire structure...

Anyways, back to what I'm looking for.  In this code, tile IDs are used to determine lava possible tiles:
Code: [Select]
// SetAllLava:
// light lavarock: 1C7-1D6
// dark lavarock:  1D7-1F8
// edges:          22F-25E  (between light & dark lavarock)

void SetAllLava()
{
  int x,y,tile;
  LOCATION mapsize(1024,1024);                         // create a point wayoff the map

  mapsize.Clip();                                      // clip it, so we have the mapsize

  for (y=0; y<mapsize.y; ++y)                          // run through all rows
  {
    for (x=31; x<mapsize.x+32; ++x)                    // check every tile on each row
    {
      tile=GameMap::GetTile(LOCATION(x,y));            // get the tile on that position
      if ( ((tile>=0x1C7) && (tile<=0x1F8))            // is this one a lavarock...
        || ((tile>=0x22F) && (tile<=0x25E)) )          // ...or an edge ?
      {
        GameMap::SetLavaPossible(LOCATION(x,y),true);  // -> then set it to LavaPossible
      }
    }
  }
}

I want something that does the exact same thing, except instead of finding black rock tiles and setting them lava possible, it finds tube tiles and records them to a build group.  All I need from you is a list of tile IDs, and I can do the rest myself.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Tile Id List?
« Reply #3 on: September 17, 2009, 11:31:00 AM »
well, bomber, if that doesn't work out, you can always have the AI do what I did in multiplayer before rushing became just about the onbly tactic ever used:

surround each building with tubing.
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Tile Id List?
« Reply #4 on: September 21, 2009, 07:48:47 AM »
Really?  Nobody has this information?

Maybe I'll try PMing BB, he might have this info since he worked on the mapper.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Tile Id List?
« Reply #5 on: September 22, 2009, 12:41:46 AM »
... You read my post, right?

Quote
Rock: 929
Mud: 417
Sand: 1678

Each one of those is the start of a run of 16 consecutive tube tiles.
 

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Tile Id List?
« Reply #6 on: September 22, 2009, 07:16:27 AM »
Oh, I thought that was the starting index of the tilesets, which wouldn't have helped me at all.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Tile Id List?
« Reply #7 on: September 23, 2009, 12:06:31 AM »
speaking of tile ID's, is there any way to just have the tile mode associated with the tile type?  It would be a lot easier than placing them in the mapper, especially on larger maps.
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Tile Id List?
« Reply #8 on: September 23, 2009, 12:26:06 AM »
Yes, it would be. However, there are some issues with that idea which prevented it from being used in practice.

First, a given tile will have different cell types in the original maps, so there is no clear way to automatically assign the correct cell type. The tile group information would be helpful, and I had thoughts of manually adding that information, but as it's a manual process, I just never got around to it. Also, when a lot of the map editor code was written, cell types were perhaps partially forgotten about, and only really remembered after most of the tile pasting code was done. There is also the issue that since Outpost 2 can allow the two to be set independently, it's sort of nice to be able to do so. But yes, even in that case, a good default would have been nice.


Come to think of it, that VB project I posted a few days ago was probably what I was going to use to add the cell type information. But like I said in that post, the project was never really finished, and contains a bit of odds and ends from various tests and ideas that never quite led to the original idea.
 

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Tile Id List?
« Reply #9 on: September 23, 2009, 04:22:43 AM »
Yes, the mapper needn't make cell types perfect, but a default, the most commonly used cell type for that tile, would help mapping a lot.
"Nothing from nowhere, I'm no one at all"

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Tile Id List?
« Reply #10 on: September 23, 2009, 06:42:04 AM »
Why not make the "defaults" user-determined either the first time the mapper is loaded or whenever a new map is made?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Tile Id List?
« Reply #11 on: September 24, 2009, 01:02:21 PM »
I like that idea myself...now if only hacker would give us the source code, lol
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Tile Id List?
« Reply #12 on: September 24, 2009, 01:34:45 PM »
He doesn't like giving out source code, unless it's for something broken and useless, like PCW.  :P  
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Tile Id List?
« Reply #13 on: September 24, 2009, 01:48:55 PM »
yea, but he's busy and he needs to let us have it so he doesn't take time away from stuff for it.
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names