0 votes

Does anyone know how to create an endlessly repeating 2D TileMap like in civilization in Godot? Similar to the way the map edges are a portal for the camera.
The TileMap is generated at runtime.

in Engine by (41 points)

1 Answer

0 votes

What you are looking for is a whole topic named Procedural generation, there are many ways to implement it.

You can search online for the algorithms themselves, and maybe some godot implementation.

Example in godot by kids can code - endless 2d terrain

Example in unity - Endless city

by (1,202 points)

Sorry, I wasn't specific enough. I don't want to generate new terrain again and again but I want the lower end of the map to be connected to the upper end and the left side to the right side. So that you scroll over the same map again and again, as if the ends of the map were connected to a portal. It's like being on a globe.

well in that case(if you have 1 player) move the tiles instead of player, or just extend the tile map an from a certain point => boom => teleport

In my game there is no player, you just control the camera. If I would teleport them, the transition from the top to the bottom and from the left to the right end, or the other way around, would not be smooth.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.