3D TileEditor

Started by iWasAdam, February 02, 2018, 08:30:40

Previous topic - Next topic

iWasAdam

Really tiny addition:

SubTile picking.
If a tile is 4x4. I can now select the individual cells in a tile

Derron

Subcell-selection grid seems to ignore the "cell padding" - at least it looks as (ignoring the "height"/z-axis of the subcell-graphics) if the bottom left padding is bigger than the top right ones.


bye
Ron

iWasAdam

(had to do a quick check. first...)
No. it's actually ok. The '3d' outline cursor is slightly smaller than a full cell. it is also offset up by a certain amount.
In essence the cursor is just hovering above the tile 'floor'.
In practice, it all work very well ;)

Derron

ahh so it is (z-index wise) "higher" than the sub-cell  - the animation makes this way more visible.

If you plan to have some "place here" marker - than you might animate that marker (move offset 1 by 1 so it "pumps up" - maybe render it multiple times so it has some kind of "smearing"/"lazy fade out" effect - sorry cannot come up with the proper name now).


@ Fire
Are you adding fire hydrants so that fire men only have a specific radius where they can extinguish the fires without needing to refill tanks. For a "place the fire" I think the fire hydrants would be of strategic importance.


@ Materials
Maybe things like gas stations should be existing too - or other special buildings. All these buildings - or their existence in "bigger buildings" have impact on how a fire spreads. So a chemical laboratory floor ... boom. A central gas pump station in the cellar of a building ... holly molly.



bye
Ron

iWasAdam

ok. So here's the problem:
Q. how do you 'logically' move around each cell when the tiles are 4x4 cells and can be rotated and have different contents?
A. Track each tile and its contents into a holding cell layout where 0=floor and 1=occupied. then rotate it onto the actual playmap

And here's the debug result showing the playmap with correct cells


Just believe me in that it works and can be runtime updated, so rooms and contents can move, etc....

This playmap can now be used to track legal moves.

Derron

I do not understand what problem you tackled?

rotation, scale, offsets: things handled by the renderer. As with your debug table the whole thing could be thought of as a 2D grid (ignoring "height" for now).

When moving, you move only the "2D grid coordinates" and then transfer them back to your "screen coordinates" when rendering? This is the same as I do with my iso-grid now. So when comparing tile vs tile I only compare them in their own "2D grid system" (or "map system"). They do not care if you rotate stuff or not as this is a camera thing. If you enable rotation of the elements itself, then this is also only done in the "2D grid system" and should auto-resolve then on rendering.

If you have "subcells" you could either:
- have the tile map be sized to the subcells and create "mega cells" for the now "normal" cells
or
- handle the subcell stuff within your cell functions ... so cells become kind of "layers" with their own cells and the reach all information requests to the corresponding subcell

At least this is how I planned to tackle "multi-cell" items.


bye
Ron

iWasAdam

a tile is a 4x4 set of cells that can be rotated round 90 degrees (including its contents).
E.G. You only need to define 1 corner tile. you just rotate it to get the other four corners.

Derron

But isn't this a matter of

GetTile(col, row).GetCell(cellCol, cellRow)

so the tile is an object returning the cell which is _currently_ at cellCol,cellRow - so the tile handles it's internal rotation or cell amount, cell size .... ?


bye
Ron

iWasAdam

mmm more or less, yes...

It also gets a bit more complex as some items can also be rotated. so a 4x1 wall rotated would become a 1x4 wall. and don't forget items can be offset as well...

Here's a pic that might explain it a bit:


The tiles are the primitives, that can be placed or rotated to make new 'things'

It's a form of abstraction. making a grid based map takes time, but a grid based map made from tiles becomes much quicker - you just need the tile system in the first place...

Here's another D&D one:

RemiD

@Adam>>by curiosity, what is this board game ? (i was a fan of "heroquest" when i was a child / teenager)

Derron

@ Adam
What you do is what I currently try to implement too :-)


white is the anchor tile
gray are the "child tiles"
and grean is a tile acting as "seat" for units.


@ HeroQuest
StarQuest is sitting in the cupboard right 1,2m above my computer :-)


bye
Ron

iWasAdam

#56
the board game is "warhammer quest". It was the next game after HeroQuest

StarQuest was the (non uk) name for "Space Crusade". This was based on the Warhammer (space) quest game "SpaceHulk"
More or less ;)

People got bored of the flat 2d tiles and made their own 3d tiles. This is the system I am attempting to replicate:


Derron

#57
I planned to print some of this stuff on my 3d printer but for now the buddies just do not have that much time to play these things and my son is a sliiight bit to young (2yrs). This summer I will finish my 3d settlers of catan print - so garden time is painting time.


@ StarQuest
Yes they renamed it and also some weapons got names not fitting to the "universe" they belong to. They made things a bit more "child-friendly". Think one of my buddies will have HeroQuest laying around somewhere too - played it the last time in ... <1995, so it's been a while.


@ Grid
Think you just need to make sure that the underlaying "collision layer" is set correctly, individual little offsets, overlaps ... should be then handled by the placed entity objects. So you place an entity and it sets the underground as walkable or not.
Things like poison, gas ... are done in the "entity collides with entity" functions.
So I only use the tile system to declare strictly non-walkable areas (means I do not need to check entities vs entities in that case) and to be the base for alignment and simplified path finding.

iWasAdam

The current 'playgrid' system seems to work extremely well.
It's bases on ints, currently 0 and 1, but I can easily add to that to things like traps, events ,etc.

I'm going to work on a very small game (24hrs) and get that out and tested... Coming together very fast.  :o

iWasAdam

#59
Provision now made for up to 6 'maps', plus loading and saving completed.

First game with the system now has a title and main menu (needed to update some of the UI controls):
BloodCrypt





Still working out details. But I'm liking a limited amount of tiles to place per map (randomly picked). the monsters can be linked to the counter...