plixel

joined 2 years ago
[–] plixel@programming.dev 13 points 2 days ago (3 children)

I've used Mullvad for a couple of years now and they're great.

[–] plixel@programming.dev 3 points 3 days ago* (last edited 3 days ago) (1 children)

I understand where you're coming from. AI can be a learning tool to help fill in some gaps in knowledge, however the moment you don't understand what it's doing and just copy and paste the code, it no longer become a tool but instead a crutch. Instead of copying and pasting code you can take the time to look into why it's doing what it's doing. For Godot in particular they have really good documentation and there's plenty of resources to learn. GD script is a pretty easy language to learn on a surface level. You should do some research into game design patterns and basic programming concepts.

I did take a look at your code and while you do have your main.gd organized, having a large monolith like that with 1100+ lines of code that has multiple responsibilities is certainly a choice. Typically you want your scripts to handle specific responsibilities, that way each script and each object that contains that script has a single responsibility. This helps with efficiency and debugging since you have smaller scripts running and if something breaks you know what broke without everything else falling apart. You employed that partly with your save manager and notification manager etc. But you could certainly pare down your main script. Also considering how much it's handling I'm curious as to what the structure of your game looks like. Godot likes to have nested objects but based off your code yours doesn't seem to be conducive to that. Also there appears to be some needless abstractions with your variable storage.

Anyways I think taking the time to research and learn some basic programming principles and game design patterns would go a long way to help you. Coding can be difficult and seem like a black box when you first get started, and AI can seem like a way to pierce through that, but if you don't learn why it's recommending the code it is then you'll never really understand what your own game is doing and that's not helpful to you or your players.

[–] plixel@programming.dev 55 points 1 month ago (24 children)

I literally just switched over from Google a few months ago and finally got all settled in. Just great. Does anyone know of any good alternative? I know Tuta exists, are there other options?

[–] plixel@programming.dev 9 points 3 months ago (1 children)

You can install Ollama in a docker container and use that to install models to run locally. Some are really small and still pretty effective, like Llama 3.2 is only 3B and some are as little as 1B. It can be accessed through the terminal or you can use something like OpenWeb UI to have a more "ChatGPT" like interface.

[–] plixel@programming.dev 1 points 11 months ago

Thanks for this!

[–] plixel@programming.dev 4 points 1 year ago

I really liked Kagi at first, especially since I use it mainly for programming as well, but recently I feel like the quality has gone downhill. Right around the time they integrated the Brave stuff I've noticed a significant amount of me having to scroll down past the usual Google-like fluff results before getting to actually relevant information. It's a little sad to see because when I first used it, it was so good now it basically feels like a skinned Google-lite at this point. I'm still a customer but only because I haven't found a good alternative yet.

[–] plixel@programming.dev 1 points 1 year ago

Thanks for the explanation! Your explanation led me down a rabbit hole of seeing if there's a way to cancel an await call, from what I can tell there was no clear way to do so. In my case I ended up connecting the signal to a secondary function instead of utilizing the await command, I'm not entirely sure if there's an advantage to utilizing one method over the other.

[–] plixel@programming.dev 1 points 1 year ago

I didn't have access to my computer when I posted this so I was hoping to get some info while I was away from it. Thanks to another commenter, it looks like it has a very minimal impact. Good to know for future reference!

[–] plixel@programming.dev 4 points 1 year ago

Thanks so much for testing that out! That's very informative and even more thorough than what I was looking for! I wasn't at my computer when I posted this so I couldn't test it myself.

I ended up connecting the signal to a secondary function to run on finished to avoid any potential memory errors, but it's super helpful to know that the performance impact is minimal.

19
Await Question (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by plixel@programming.dev to c/godot@programming.dev
 

I'm curious what happens if you use await for a signal, but the signal is never received? Does this cause some kind of hangup?

For example if I have a function structured like so:

func foo():
    do something
    await signal.finished
    do something else

And the "finished" signal never comes, does the await call just hang indefinitely?

[–] plixel@programming.dev 1 points 1 year ago (1 children)

Interesting!! Yeah that's exactly what my node structure is. So basically instead of using signals and sending from one Map child to the other, use spawn_object as a child from hexgrid and then just call the spawn object function as needed since the hexgrid script already has a reference to the index and location of each tile. Thanks so much for the advice I'll give it a shot! I ended up working out the signals issue I was having anyways but it seems like your suggestion is a cleaner solution!

[–] plixel@programming.dev 1 points 1 year ago* (last edited 1 year ago) (3 children)

I see okay so I understand that the intent is to decouple scenes from each other, however from the tutorials I've seen they typically say that to establish the connection you need to run get_node() from the script you are establishing the connection to. So for example if you have:

*Parent
    **Child 1
    **Child 2

You would emit from Child1, then establish the connection from Child2 using:

var script = get_node("root/Parent/Child1")
script.some_signal.connect(some_function)

Is that the correct interpretation? Or am I misunderstanding? Thanks in advance btw I appreciate all the help in understanding this!

[–] plixel@programming.dev 1 points 1 year ago* (last edited 1 year ago)

Hm..I didn't even consider that the emit might be happening before the connection. I have them both running from separate on_ready methods. Perhaps I should be running connection though _init. Typically in unity I would just use C# actions and use OnEnable to establish the "connections." It make sense that the code could be emitting before I even have a chance to connect to it, which is why my test fails.

 

Hello all!

Like most people I find myself a recent refugee from the Unity fiasco. I've been trying to prototype a project in Godot and I've been running into an issue I would think would be pretty easy to find a solution to as it seems to be a pretty fundamental building block of any project in Godot. Perhaps I'm misunderstanding how to accomplish this in Godot, but essentially I'm instantiating a number of tiles to be used for a grid system in my game. I want these tiles to be able to emit their index and transform values and then have other scripts pick this information up as needed. From what I've read signals are the way to do this, however whenever I try to send a signal with or without parameters nothing seems to happen. I seem to be able to connect to the signal just fine but the method doesn't seem to be called.

Here's an example of me defining the signal and then emitting it:

signal index_transform()

index_transform.emit()

And here's how I am connecting and attempting to call the method in a secondary script:

func _ready() -> void:
	var hexGrid = get_node("/root/Main/Map/HexGrid")
	hexGrid.index_transform.connect(Callable(self, "_get_hex_index_transform"))

func _get_hex_index_transform():
	print("I'm Connected")

And when I'm passing parameters from what I understand I should only have to include the parameters like so:

signal index_transform(index, transform)

index_transform.emit(tile_index, tile_coordinates)
func _ready() -> void:
	var hexGrid = get_node("/root/Main/Map/HexGrid")
	hexGrid.index_transform.connect(Callable(self, "_get_hex_index_transform"))

func _get_hex_index_transform(index, transform):
	print("I'm Connected")
	print("INDEX: ", index," POS: ", transform)

However neither of these seem to work. What am I doing wrong?

view more: next ›