Questions tagged [tree]

A tree is a hierarchical data structure that simulates a tree structure with a set of linked nodes.

Filter by
Sorted by
Tagged with
0 votes
1 answer
53 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 ...
blondie's user avatar
  • 11
0 votes
1 answer
302 views

Parameter "current->parent" is null, don't see why

I'm using Godot for my current project, and it's been going great; but there's a bug I don't understand. I have a certain very simple script on my title screen: ...
Michael Macha's user avatar
8 votes
1 answer
436 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 ...
IanLarson's user avatar
  • 771
0 votes
0 answers
342 views

What is the earliest documented use of behavior trees?

I'm curious about when behavior trees first appeared in the context of AI design. I've looked at many sources (e.g., GDC talks, academic literature such as Behavior Trees in Robotics and AI: An ...
Reign of Error's user avatar
2 votes
2 answers
999 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 ...
Tuntenfisch's user avatar
1 vote
1 answer
88 views

Traversing an acyclic binary tree to construct paths from a given starting node, but the paths come out wrong

The tree is an acyclic binary tree. It's composed of node objects that have a list of connections to link objects (at most 3), and link objects that have a list of connections to node objects (always ...
spacegamer's user avatar
0 votes
1 answer
471 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 ...
Gian's user avatar
  • 113
1 vote
1 answer
1k views

Unity Terrain Tools plants trees sideways

My tree is clearly straight, but painting trees result in sideways ones. What can cause this? Tree is straight when placed manually as a prefab.
IndividualGames's user avatar
1 vote
1 answer
280 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 ...
Степан Адамов's user avatar
0 votes
1 answer
74 views

How do you refer to the objects covering the ground?

Newbye here. In the industry lingo, what is the best way to indicate the objects covering the ground (trees, rocks, ...)? Is props OK?
user avatar
0 votes
1 answer
246 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 ...
Ivan Triumphov's user avatar
0 votes
0 answers
45 views

How can I change some tree's radius and length in C# script in Unity3D?

So, I have this little tree stem. It only has its initial node. All I would like to do is make it grow in length and radius in Update(). How can I do that?
BrKo14's user avatar
  • 1
0 votes
3 answers
508 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 ...
NADER LABBAD's user avatar
0 votes
0 answers
268 views

Cache friendliness of AABB-Tree: binary vs N>2

I found that state-of-the-art physics engines like Bullet and Box2D all use binary AABB-Tree for broad-phase collision detection. I wonder, did anybody tested AABB-tree with >2 branches per node ? ...
Prokop Hapala's user avatar
1 vote
1 answer
945 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 ...
Souvik Datta's user avatar
2 votes
1 answer
2k views

HAA* / HPA* C++ Algorithm / Help

so I have been working on implementing a form of HPA* but i'm really struggling to decide what to do next. https://webdocs.cs.ualberta.ca/~mmueller/ps/hpastar.pdf <- here is the article. There is ...
RNewell122's user avatar
0 votes
1 answer
318 views

How can I rotate childrens nodes with parent node in cocos2dx?

Consider the following code... ...
videogamechef's user avatar
1 vote
0 answers
76 views

Unity-Error within Tree Editor

I've been making a tree in with the Tree Editor in Unity, and for a realistic effect, I need to make all the leaves face a general direction, the problem is that most of them don't face that direction ...
user18723's user avatar
0 votes
1 answer
60 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: ...
rodrigo-silveira's user avatar
-1 votes
1 answer
589 views

How do I create a horizontal tech tree for the web? [closed]

I'm currently using bootstrap, jQuery and KnockoutJS to create a simple game. I would like to make a horizontal tech/research tree where the player can do research to get bonuses. I found a CSS ...
Jeremy Dicaire's user avatar
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.
Jihen007's user avatar
0 votes
0 answers
320 views

Unity has extreme lag while deleting trees from terrain

So I have a terrain with sections of water in it. I just placed a whole bunch of trees in the scene with mass place. However, it spawned trees in the water which I obviously want to remove. But when I ...
mr-matt's user avatar
  • 2,759
3 votes
0 answers
181 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 ...
Justin William Stanley Bryant's user avatar
2 votes
1 answer
2k views

How to ensure a condition in a behaviour tree when processing following nodes?

Example tree (Source): As far as I understood, a sequencer iterates over the children until one failed or all are successful. If one children returns "running", the sequencer will start to process ...
Superwayne's user avatar
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 ...
jokoon's user avatar
  • 5,243
2 votes
1 answer
504 views

How to set indent spacing of a tree in libGDX scene2d?

I've been trying to create a customized UI using scene2d library in libGDX. However I am having troubles as I'm trying to set a custom indent spacing on my Tree object. I have tried to search for the ...
Zigur's user avatar
  • 93
2 votes
1 answer
260 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 ...
mydi's user avatar
  • 51
1 vote
1 answer
49 views

Texturing in blender

I am texturing a tree in bender using the sappling add-on, when i put the tree bark texture (which is saved as .jpg) the texture looks stretched and wierd, ive used "Use UV for mapping" on the curve ...
user18723's user avatar
4 votes
1 answer
116 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 ...
the-alchemist's user avatar
1 vote
1 answer
375 views

QuadTree Checking Collision With Different Levels of Nodes

I am making a QuadTree for a 2D Platformer. Researched on it and I managed to make a pretty good one where each node stores its 4 SubNode and there's a MAX_OBJECTS for each Node and MAX_LEVELS which ...
Quen Figuracion's user avatar
2 votes
2 answers
519 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 ...
user3301833's user avatar
3 votes
2 answers
615 views

Implementing A* with Heap tree

I'm trying to implement Heap into my A* algorithm, However I'm having trouble with implementing one method. The Contains method. Which checks if the heap array has a specific node in it or not. I don'...
David's user avatar
  • 35
0 votes
1 answer
2k 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 ...
Andrew Wilson's user avatar
2 votes
0 answers
2k views

Binary Space Partitioning of 3d Triangle Mesh (for finding nearest points)

I'm writing a Binary Space Partitioning (BSP) tree for the purpose of optimizing finding the nearest point on the surface of a 3d triangle mesh with respect to another point. I'm currently following a ...
Erik's user avatar
  • 21
6 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 ...
user3352250's user avatar
7 votes
2 answers
913 views

Handle movement with QuadTree

I currently have a QuadTree that contains all my Entities. It works well and I've optimized it pretty decently, but the one thing that hurts is that I am removing ...
Tips48's user avatar
  • 321
3 votes
1 answer
842 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 ?
jellyfication's user avatar
5 votes
3 answers
594 views

Algorithm for creating tree-like network structures

I'm trying to procedurally model tree-like network structures with the following properties: A root with variable number of nodes A variable depth of nodes When graphically laid out, edges or nodes ...
emilesilvis's user avatar
3 votes
1 answer
924 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-...
Zoltán Schmidt's user avatar
0 votes
1 answer
282 views

Enumerating full game tree for small board game

I am trying to list all the possible positions in a small board game (nannon) (using C++) So far I have decided to split it into two parts, the pieces that are in home positions and end positions (...
cleerline's user avatar
  • 103
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 "...
Tom's user avatar
  • 21
16 votes
5 answers
11k views

Generated 3d tree meshes

I did not find a question on these lines yet, correct me if I'm wrong. Trees (and fauna in general) are common in games. Due to their nature, they are a good candidate for procedural generation. ...
Jari Komppa's user avatar
  • 7,873
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 ...
Kinected's user avatar
  • 221
3 votes
1 answer
1k views

Tic-Tac-Toe game AI

I'm looking into creating a simple tic tac toe/noughts and crosses game in Actionscript3 and am trying to understand the ideas behind the AI used in a game like this. I've seen some simplistic ...
davidejones's user avatar
1 vote
1 answer
318 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 ...
paul424's user avatar
  • 41
6 votes
2 answers
15k views

How do I optimize searching for the nearest point?

For a little project of mine I'm trying to implement a space colonization algorithm in order to grow trees. The current implementation of this algorithm works fine. But I have to optimize the whole ...
lvictorino's user avatar
  • 2,624
3 votes
2 answers
558 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 ...
mikera's user avatar
  • 1,046
2 votes
2 answers
2k views

Algorithm to generate small tree-like branches?

I'd like to seed a void map with "branches" of sine waves or any other waveform. Something like: Know of any algorithm? Has to be one to generate trees or something like that.
Gabriel's user avatar
  • 1,143
11 votes
5 answers
13k 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 ...
Vittorio Romeo's user avatar
2 votes
2 answers
259 views

Help computing visibility in old 3d game format

I am trying to compute visibility in an old 3d file format. I am using a BSP tree have finally gotten everything built and traversable. Now I don't have any sort of PVS, potentially visible set to ...
Pladnius Brooks's user avatar