aliens

Author Topic: Need help visualing rays/lines titles and such.  (Read 1047 times)

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Need help visualing rays/lines titles and such.
« on: March 24, 2022, 09:17:30 am »
Hello,

I need help trying to understand the game's inner working when it comes to world space, tile space, voxel space. But especially tile space.

It would be really helpfull if there was some debug setting that draw "tile boxes" around each tile or something, plus some coordinates here and there or so... to get a better understanding of where stuff is...

Perhaps even click on a tile and then get some coordinate, actually in debug mode I see a click message but I am not sure what the coordinates are inside click ? is that screen space or something else ?

I am especially interested in the titles of "line" "rays" and such.

If those could be drawn as the algorithm does it's thing that would be usefull.. it could get messy if multiple aliens/bullits and such per frame and such... maybe I can then myself put some filter in place or so to only active it for a certain unit or something.

Maybe the game already has some kind of debug settings/parameters for this ?

Bye for now,
  Skybuck.

Offline Yankes

  • Commander
  • *****
  • Posts: 3207
    • View Profile
Re: Need help visualing rays/lines titles and such.
« Reply #1 on: March 24, 2022, 08:12:00 pm »
Enable debug mod, with it will show cords when you click on tile.

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Re: Need help visualing rays/lines titles and such.
« Reply #2 on: March 25, 2022, 10:19:44 am »
I think you mean debug mode and not a debug MOD.

The way I did it was to set some tile status in the map, code used was:

   Position fpos;
   Tile *fTile;

         if (_save != 0)
         {
            fpos = Position( cx, cy, cz );
            fTile = _save->getTile(fpos);

            if (fTile != 0)
            {
               fTile->setSmoke( 250 );
            }
         }

This made the smoke probably go outside of what it was ment to do, and it caused a green "snot" like image to appear on the tiles, but it was good enough to help me understand that the code was actually working very well... at least the first implemented fast voxel traversal algorithm and then I proceeded to fix the new one which has clipping/line/box intersection tests to protect it vs outside grid lines and speed up the code/traversing somewhat by not having check if the voxel is inside the grid per traverse step, those checks are now removed ! ;)