Godot: The open source game engine

21 readers
1 users here now

A community for discussion and support in development with the Godot game engine.

founded 1 year ago
MODERATORS
676
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Edska on 2024-09-18 14:08:12+00:00.

677
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/TheOrioli on 2024-09-18 13:23:12+00:00.

678
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/AnnoyingMemer on 2024-09-18 13:08:13+00:00.

679
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/dnxdev on 2024-09-18 12:50:29+00:00.

680
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/pxindie on 2024-09-18 11:49:53+00:00.

681
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Resident_Fuel_7906 on 2024-09-18 10:43:47+00:00.

682
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/oppai_suika on 2024-09-18 09:21:21+00:00.

683
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Tall-Badger1634 on 2024-09-18 00:53:54+00:00.

684
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/dnxdev on 2024-09-18 01:14:11+00:00.

685
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/markusphils on 2024-09-17 22:44:03+00:00.

686
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/stokaty on 2024-09-17 18:59:50+00:00.


I had originally wrote this app using Xcode+Swift (and SwiftUI), but a few people asked for Android support so I rewrote it using Godot.

Developing a conventional mobile app was much more pleasant with Godot than with Apple’s components. Sure, I had to write cell reuse and tab bar logic from scratch but that is peanuts compared to making a video game.

Also, the entire Theme system that Godot uses is OP — it makes it very efficient to iterate styles throughout the app.

Also, now one code base supports iOS, Web, and Android (although the Android app isn’t out yet bc I need 20 testers).

Anyway, just wanted to share this. I wouldn’t be surprised if companies use Godot for cross platform development in the future.

687
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Ashamed-Barracuda225 on 2024-09-17 18:16:24+00:00.

688
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/octaviustf on 2024-09-17 18:09:14+00:00.

689
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/LazenGames on 2024-09-17 16:36:56+00:00.

690
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/SDGGame on 2024-09-17 18:25:12+00:00.

691
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/BeesAreCoolAlsoAnts on 2024-09-17 17:47:26+00:00.

692
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Rasmus_02 on 2024-09-17 15:33:01+00:00.

693
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/AsirRenatus on 2024-09-17 06:26:09+00:00.

694
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Ammar5512-_- on 2024-09-17 11:12:22+00:00.

695
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/baksoBoy on 2024-09-17 10:57:29+00:00.


I'm generating a pretty large 2D world, where most objects like for examples trees and rocks will be their own individual sprite node. If I were to have them as nothing more than sprites, then my game will run pretty slowly (around 30 FPS). I however am using code for each sprite that runs every frame that changes its opacity in certain circumstances. If I were to run this code for all sprites just like that then my computer would probably explode, so what I have done is to add a VisibleOnScreenNotifier2D on each one of these sprites, making it so that the code that changes how they are rendered is only run if the sprite is on-screen. However even with this my game runs extremely poorly (around 4 FPS).

One idea I had for a solution would be to (if possible) completely disable all the logic and stuff that has to be processed for the spites if it is off-screen, however this obviously still comes with the problem of having to constantly detect if it comes on-screen again to resume the logic, so this doesn't really sound possible.

My other idea (which I really don't want to do if there exists a simpler approach) is to somehow store the information of all the sprites, and make it so that whenever the sprite is too far away from the player, it deletes itself and gets stored to some sort of list, and when the player moves, all the newly loaded areas check if they are supposed to have a sprite on them, and then re-generates them before they appear on-screen. This solution sounds pretty involved though, and I'm not entirely sure how I'm supposed to store the information of all the sprites in a way where it is very quick to check if a certain position should have a sprite on it or not (note that the coordinates are integers, so you can theoretically store all positions on the map, which you wouldn't be able to do with floats).

Does anyone have any ideas for how I could reduce the lag?

696
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/coffee80c on 2024-09-17 10:19:00+00:00.

697
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/timeslip1974 on 2024-09-17 05:47:46+00:00.

698
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Complete-Error6373 on 2024-09-17 08:30:16+00:00.

699
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Kolkelight on 2024-09-17 00:44:31+00:00.


I follow this guide:

But how i can space the hexagons correctly?

I made each hex of different to find the problem... but changing "vert_space" and "horiz_space" isn't working....

I don't get it...

var hexagon_size : int = 50
var grid_width : int = 10
var grid_height : int = 10

#DRAW GRID
func _draw() -> void:
  var vert_space = hexagon_size * sqrt(3)/2
  var horiz_space = hexagon_size * 3/2
  for y in grid_width:
    var x_offset = (y % 2) * hexagon_size 
    for x in grid_height:
      var center_x = x * horiz_space + x_offset
      var center_y = y * vert_space
      _draw_hexagon(Vector2(center_x, center_y), hexagon_size, Color(randf(),randf(),randf()))

#DRAW HEX - THIS PART IS WORKING CORRECTLY
func _draw_hexagon(center : Vector2, radius: int, _color) -> void:
  var points = []
  for i in 6:
    var angle = PI * 2 / 6 * i
    var x = center.x + radius * cos(angle)
    var y = center.y + radius * sin(angle)
    points.append(Vector2(x, y))
  for i in 6:
    draw_line(points[i], points[(i + 1) % 6], _color)

700
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/klitchen-games on 2024-09-16 23:09:01+00:00.

view more: ‹ prev next ›