Questions tagged [tree]
A tree is a hierarchical data structure that simulates a tree structure with a set of linked nodes.
54 questions
0
votes
1
answer
133
views
Identifying the wall of impact during BSP traversal
I'm building a 2D BSP based physics game and am having trouble implementing what might seem like an easy feature. I'm using Gamemaker as the basis for this project.
Basic Info and Point of Impact ...
9
votes
1
answer
546
views
How can I fit a tree graph into a grid?
I have a tree graph that I'd like to fit into a grid, the result being a grid-based maze that adheres to the tree graph. Are there any good maze algorithms that are able to start with a known ...
2
votes
2
answers
1k
views
How to evaluate a binary expression tree in HLSL without recursion or a stack?
I'm currently working on a dual contouring implementation for which I want to create procedural terrain based on layers of noise. Both, the terrain generation and the mesh creation via dual contouring ...
0
votes
1
answer
785
views
How should I store the objects to render?
From what I understand, in order to show all elements of a 2D game in the proper way, I need to render them in order, from the further away from the camera to the closest. So I should sort them by ...
1
vote
1
answer
379
views
How to implement the “technological tree” drawing?
I want to make a tech tree at least like in Civilization, but I don't know how to do it. I want to fill in some data structure and then display it on the screen in the form of a technology tree, but I ...
0
votes
1
answer
289
views
Can I add non-trees to terrain.terrainData.treeInstances on Unity 3D?
I need to create a brush in which there will be stones, poles, bushes and other elements of the environment. I bought a Prefab Brush. Whether it is possible to add the objects that I draw on the ...
0
votes
3
answers
644
views
How can I destroy trees when placing a building in an RTS?
I am developing RTS game. When I build buildings on the Terrain, any trees that were in that location end up intersecting with the building.
I want to remove all trees from the building's footprint ...
1
vote
1
answer
1k
views
Implementation a Prefix tree or Trie in Unity C#
I am trying to make a word game in unity. The game shall be an online game with 4-6 players. The gameplay is somewhat like this:
Suppose 4 players are playing the game- p1, p2, p3, and p4.
All players ...
0
votes
1
answer
356
views
How can I rotate childrens nodes with parent node in cocos2dx?
Consider the following code...
...
0
votes
1
answer
90
views
Tree of objects in 2D space - children relative to parent
Question
How do we track the position of child objects, relative to a parent?
Context
I have a simple structure that keeps track of a point in space, along with zero or more children:
...
1
vote
1
answer
3k
views
Does Unity support tree data structures?
I'm really confused. Is it possible to use trees like binary trees or data structures in Unity?
I need to introduce artificial intelligence into my game, and use the A* algorithm.
3
votes
0
answers
207
views
Simulating wind (vertex bending)
Right now I'm using the Crytek vegetation bending technique, vertex colors control how much force is applied to the branches, leafs and trunks. I have it working and it looks nice but I'm just using ...
0
votes
1
answer
1k
views
Why do KD trees put the median split exactly on a point?
I've understood that KD tree split points using the median while cycling on each axis. I've also understood that at each node traversal, a nearest search must use a sphere to store to nearest neighbor ...
2
votes
1
answer
306
views
How to prune an AI game tree for a game like Magic?
I've got a game tree structure for my AI that I need to trim in order to gain some depth.
It is a single-player game of perfect information. A good analogy would be a single-player game of Magic the ...
4
votes
1
answer
140
views
What is a viable way of finding the minimum swaps to sort numbers in pyramid?
I have made a game that consists of a pyramid of hexagons with numbers from 00 to 99 randomly positioned in groups of 6, 10 or 15 elements. Now, I'm working to create an auto-solver but for the last 2 ...
2
votes
2
answers
586
views
AI for Shogi, dealing with high branching factor due to drop rule [closed]
I'm writing a Shogi program with a computer player in Java from scratch as my undergradute
dissertation project. Due to the drop rule, when the computer player captures a few pieces, the branching ...
0
votes
1
answer
3k
views
Should I use octree or quadtree for my spacial data structures? [closed]
I would like to know the advantages and disadvantages of using octree or quadtree for spacial data structures? In a 3d gaming setting would you ever need more than 4 children nodes? Does it take ...
7
votes
2
answers
4k
views
Game AI. Behavior Trees struggles
I'm writing a bot for a MOBA game as final project.
Game status is read directly from the screen (that's the requirement).
Now I have come to the AI part. On the first steps it started as some basic ...
3
votes
1
answer
1k
views
Behavior trees - Can sequences and selectors contain conditions?
I can't wrap my head around this. Is it legal for parent nodes to contain additional logic ?
3
votes
1
answer
982
views
Placing nodes in a graph in a random but readable way
I'd like to create a simple map from vertices and lines - you know, like a usual graph. A tree, to be precise.
To select the location of the next point that comes from one, I use a simple circle-...
2
votes
1
answer
2k
views
Behavior Trees and Animations
I have started working on the AI for a game, but am confused how I should handle animations. I will be using a Behavior Tree for AI behavior and Cocos2D for my game engine.
Should my "...
14
votes
2
answers
5k
views
Why are trees shining in background?
Currently I am creating a forest scene in the dark, and the trees are shining far away, but when I get close they are fine. I have the shaders set to "Nature/Tree Soft Occlusion [bark/leaves]", but ...
1
vote
1
answer
383
views
Dynamic quadrees
Recently I started writing a Quadtree for creature culling in Opendungeons game.
Thing is these are moving points and the bounding hierarchy will quickly get lost if the quadtree is not rebuild very ...
3
votes
2
answers
587
views
Is there a way to balance a binary tree continuously?
In my game I have a tree of objects in 3D space, to which new objects are frequently added.
Over time, the binary tree becomes unbalanced which is a big problem for efficiency as the tree can become ...
11
votes
5
answers
14k
views
2D Spatial partitioning alternatives to spatial hashes and quadtrees
I've been trying to implement a spatial partitioning algorithm in my game, but both spatial hashes and quadtrees aren't what I'm looking for.
My level size is not supposed to have a limit (only Int32 ...