All Questions
60 questions
0
votes
2
answers
706
views
How to set GameObject on tilemap through script
In the built in Tile Palette tilemap editor, you can choose a GameObject brush to set custom tile GameObjects. How would I be able to set a gameObject onto a tile through a script?. There is no ...
0
votes
1
answer
38
views
How do I spawn the tiles on the global z axis instead of local z?
I'm trying to spawn infinite tiles in a 3D runner game, but the tiles are spawning at the wrong position and on the wrong axis.
Technically, the code is working as it should, it is spawning and ...
0
votes
1
answer
491
views
Color glitch with tilemap.SetColor() in Unity
I've been experimenting with Tilemap to display tiles (with random colors) in script with SetColor() and other methods:
...
0
votes
0
answers
50
views
I can't add the change I made while the game is running to the list?
I realized that my problem has nothing to do with tilemap or something so I need to update my question.CalculateAgain()
In the script below, I run the ...
0
votes
1
answer
2k
views
How to change size of a SINGLE tile on a tilemap at runtime?
I'm having trouble figuring out how to change the scale (size) of a single sprite (tile) on a Unity Tilemap.
In the game, I place trees as tiles on a tilemap, and when they grow over time, I want to ...
2
votes
2
answers
522
views
Finding nearby tile objects with a certain tag more easily
I have generated a grid with hex tiles. I am using two different types of tiles and would like to at some points ask the tiles, how many tiles of each type they have as neighbours (or really, it would ...
0
votes
1
answer
176
views
How to tile a texture
I'm creating a simple program in C# and now i'm trying to slice an image into multiple tiles similar to a grid pattern so it does not get stretched when drawing to different resolutions.
What i'm ...
6
votes
1
answer
4k
views
How to make different Rule Tiles interact with each other?
I am using Unity's RuleTiles to automatically change sprites of adjacent similar blocks.
For example, when a Dirt tile notices there are two ...
2
votes
3
answers
4k
views
Unity 2D animated tiles library: IsSelected variable not working or not present within RuleTileEditor.cs
I have just tried downloading a library which will allow me to add animated tiles to unity. I have been following this tutorial:http://shadowpeakstudios.com/2018/10/22/unity-tutorial-animated-tiles/
...
1
vote
1
answer
201
views
How to store unique keys for an infinitely generated, chunked world?
My game is made up of chunks which are identified in world space with and X and Y coordinate. Each chunk contains 16 tiles by 16 tiles by 4 layers. So that I don't have to loop over every single tile ...
0
votes
2
answers
702
views
How would you go about placing objects between chunks in a 2D game?
I have a 2D infinitely generated world which is split up into 9 chunks at a time. Three chunks are loaded and three are unloaded whenever a player moves into a new chunk (if the player moves up a ...
0
votes
1
answer
2k
views
Tiles in the Tilemap dont overlap properly
This is my first try making a "proper" game in Unity. I'm using the latest version (2019.2.2 at the time of writing) and I'm writing with C#. This is a project I'm doing for my studies, together with ...
0
votes
0
answers
20
views
NullReferenceException until tile is spawned [duplicate]
I have a tile and tile has enemies spawn positions, and spawner script in it. Everything works fine when tile is spawned, my ray hits the collider in tile and enemies get spawned, but my spawn script ...
0
votes
1
answer
198
views
C# Unity - Multiplying Colors in loop results in wrong results
Good day, I'm trying to generate a tilemap, my current setup is a base tileset, and a few overlays for the different biomes / terrain heights. In my code, I generate each biome's tileset, based off of ...
0
votes
1
answer
155
views
How Can I Fix Where The Tile Spawns?
I am making a 3D game in Unity and C#. I want to spawn another tile when the player is at the end of the current tile. But when I spawn the next tile it doesn't spawn at the right place(just after the ...
0
votes
2
answers
490
views
C# Fastest way to iterate over certain tiles overlapping multiple chunks?
What's the fastest way of iterating over certain tiles overlapping multiple chunks in C#.
Ideally without having to iterate over everything, just a specific set of coordinates? (green cubes example ...
1
vote
1
answer
520
views
Scene building for procedurally generated tile based world in Unity
i'm making a procedurally generated side-scrolling and destructible tile based world. So far I've got :
- the values generator (for deciding which tile to place where)
- a testing scene generating ...
3
votes
1
answer
750
views
Need some insight on mesh triangulation and geodesic spheres
I am making a game that's going to use a Class 1 (This is (n,0)) Goldberg Polyhedron as the map, that is I'm planning on using the hexagons and 12 pentagons as tiles for a tile-based game.
When it ...
1
vote
2
answers
746
views
Efficient way to render tilemap
I have set up a tilemap system, and am rendering it in a way that lets me pan through the map using a camera offset. However, I have discovered it is incredibly inefficient, but am unsure of how I ...
0
votes
1
answer
87
views
only one tile being drawn xna c#
I have been looking at tile engines for the past few days and decided to have a go at my own one for educational purposes. I want to use different textures for the tiles of my map, for example 1 = ...
3
votes
1
answer
299
views
How do I make an AI that stays at a distance from the player act correctly when cornered?
I am working on a few different AIs for a tile-based game. I'm trying to figure out one where that tries to keep a certain distance from the player. So if distance becomes small, move away.
The whole ...
1
vote
1
answer
3k
views
finding a path from one point to another with obstacles help
Im building a tile based game and im implementing my path finding algorithm. Currently, it can find a path from point A to point B with no problems. However, if there are obstacles between point A and ...
0
votes
1
answer
309
views
The camera in a 2D tile based side scroller is moving slower than the player [closed]
In my 2D tile based side scroller, I want a camera that scrolls in the x direction, but not in the y direction. The world is separated into three zones; one on the left and one on the right where the ...
0
votes
1
answer
202
views
Most efficient way to hide out of bounds object in tile based environment [duplicate]
I am working on a desktop game in C#, with Monogame framework. I am storing the tile instances in a 2D Array, for the sake of easy collision detection. But the levels are big (often 100x100 or bigger) ...
4
votes
2
answers
17k
views
Fast, simple procedural 2d island generation
I need to generate tile data for an island based rpg, my goal is have something that looks like this (mountains not required):
For the past few days I have been trying to figure out a satisfactory ...
3
votes
2
answers
2k
views
Zelda-style top-down RPG. How to store tile and collision data?
I'm looking to build a Zelda: LTTP style top-down RPG. I've read a lot on the subject and am currently going back and forth on a few solutions. I'm using C#, MonoGame, and Tiled.
For my tile maps, ...
1
vote
1
answer
282
views
Textures have lines between them when zoomed out
These are two screenshots from my new game, a top-down RTS with tiles. The first one is from a normal view with no zoom, the second one is a zoomed out view of the whole map:
In the first image, the ...
0
votes
1
answer
2k
views
How do I efficiently display image tiles in Unity 4.3 free
I previously wrote a TileEngine with SFML that I would like to port to Unity3D 4.3, but have not found a way to draw a tile on the screen programmatically in Unity.
All I am looking for something ...
1
vote
4
answers
298
views
Cell Lighting Propagation Problem
I have in place a cell-based lighting system that works basically like this: (Not my actual code)
...
0
votes
1
answer
867
views
Efficient approaches to updating adjacent grid tiles when one tile is disabled?
I'm trying to update the surrounding grid of tiles if one of them is disabled (not removed). For example, imagine we have a grid of tiles each with x representing one texture:
...
0
votes
1
answer
3k
views
A*, Tile costs and heuristic; How to approach
I'm doing exercises in tile games and AI to improve my programming. I've written a highly unoptimised pathfinder that does the trick and a simple tile class.
The first problem i ran into was that the ...
1
vote
2
answers
863
views
How to tile multiple procedurally generated textures?
I'm trying to develop a procedural tile generator for a game, mostly for the ground tiles, instead of using "hand-drawn" tiles.
To achieve this I'm using Perlin noise and a sine wave with multiple ...
1
vote
1
answer
2k
views
Best way to load texture2d tiles in xna?
I am making a test xna game as a learning exercise and I have a small question about using 2d textures. Basically the game is a grid of different 'tiles' which are taken from a text map file. I ...
2
votes
3
answers
1k
views
Splitting tileset into individual tiles
I'm trying to split a tileset (from here) into individual tiles.
For debugging purposes I wrote some code to split the tileset into individual tiles and display them on screen, but some aren't being ...
1
vote
1
answer
224
views
Automatic Tile Transitions Not Working Correctly [closed]
I've started writing a tile based game in XNA today using the tutorials here. I'm on the Part 6 - Side Topic - Auto Transitions at the moment. My transitions aren't working correctly as you can see ...
-1
votes
2
answers
215
views
Tile collision, can't get correct behaviour [closed]
I define a tile with a rectangle. This is displayed below.
...
0
votes
1
answer
240
views
Tile Draw Order
I started working on a tile engine recently and have been trying to get this depth sorting for the tiles right. I am using XNA and the SpriteSortMode.Deferred to get the tiles to sort correctly in the ...
2
votes
1
answer
480
views
Collision detection with XNA and TiledLib
I recently started learning XNA and after getting annoyed with creating individuals rectangles each time I wanted to add something I went with TiledLib so I could more easily create levels using the ...
0
votes
1
answer
562
views
Iterating 1D array and getting 2D tile position
I know I'm missing something very obvious here, but I have a 1D array that contains integers.I have a map that is 30 x 30 and the center coordinate is 0,0 (This is actually 3D, but I'm essentially ...
0
votes
2
answers
1k
views
Shuffle tiles position in the beginning of the game XNA Csharp
I'm trying to create a puzzle game where you move tiles to certain positions to make a whole image. I need help with randomizing the tiles start position so that they don't create the whole image at ...
3
votes
3
answers
615
views
Tile based platformer, using larger tiles?
So for my tile based platformer, It has a grid of tiles Occupying 1x1 block for each one.
However, What if I want larger tiles? Maybe doors, tables, etc. They wouldnt fit in a 1x1 tile, so what I ...
2
votes
3
answers
868
views
Collision Detection Problems
So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below.
One problem I'm ...
2
votes
2
answers
2k
views
How to calculate the direction a ball must bounce
I have a tile engine I have made. I can detect collision between the ball(the player) and the tiles. When a collision is detected all the colliding tiles are stored inside a list. My question now is, ...
1
vote
3
answers
3k
views
Designing an entity system for a tile-based puzzle game
I'm developing a tile-based game creation library in C# and along with it I'm creating a game to test all of its functions.
This is a screenshot of the game:
You've probably never heard of the ...
2
votes
4
answers
3k
views
What should I use (controls, methods) to make a 2D tile based map editor?
I'm making a 2d game where each tile is a square and it's viewed at straight angle, no skewing, no rotation, it's pretty simple.
Two weeks ago I tried using DataGridView, but as the number of rows ...
3
votes
1
answer
2k
views
2D Camera Acceleration/Lag
I have a nice camera set up for my 2D xna game. Im wondering how I should make the camera have 'acceleration' or 'lag' so it smoothly follows the player, instead of 'exactly' like mine does now. Im ...
5
votes
1
answer
6k
views
How to create a 3D world with 2D sprites similar to Ragnorak online?
As far as I know Ragnorak Online is a 3D game world with 2D sprites overlayed. I would like to use this style in a game I am making in Unity, so I would like the player to be able to select little ...
6
votes
5
answers
2k
views
Need some advice regarding collision detection with the sprite changing its width and height
So I'm messing around with collision detection in my tile-based game and everything works fine and dandy using this method. However, now I am trying to implement sprite sheets so my character can have ...
4
votes
1
answer
863
views
Character jittering with this tile based collision code
I have been trying to get my collision code working for hours now but with every resource I have tried my character still jitters. First I tried using the platformer sample but my character still ...
5
votes
2
answers
3k
views
How do I resolve a collision of a rectangle with two rectangular tiles at once?
I am having some problems with collision detection between a player and the environment in a tile-based game. I have a player objects, Tiles and what I call ...