Bing Chat AI is amazing for helping with defold programming

After customizing the Defold Guru GPT it finally gives me satisfying answer to this question :smiley: It looks like you need to “teach” it a lot… :stuck_out_tongue:

And this is even better:

1 Like

Bing does link to the documentation (see those links after Learn More:).

1 Like

This is what always frustrated me with unity. There are so many old examples it’s hard to know if you’re doing it the best way.

Perhaps, but it does suggest that you should set a self.hit in the collision response and check if this value is true every frame. Not very efficient… :slight_smile:

1 Like

I wouldn’t follow this advise :smiley:

I mean, AIs are great, but amount of halucinations they have, make it only a tool for better searching than any creative or technical expert right know. I love that it quickly parses huge amount of texts and data and gives at least some overview of what it is. It’s great for summaries. You still have to be educated and know what you are doing. That’s all good news though, we ain’t gonna be replaced :smiley:

This is also why I wouldn’t use a bot to help me create a script, as it wouldn’t know what the best approach is either.

By all means, play with it, but also be very wary of what it actually produces as output.

1 Like

I created my own GPT. I just pointed it at Lua 5.1, Defold API, and defold forums. So far it’s working pretty good.

Well it’s not a “bot”, it’s AI. But it’s really cool in that you can even load up your final scripts and have it analyze them for you and give you suggestions. So you double check your work.

Plus for someone new to coding in defold/LUA it really speeds up the process. Optimization can come second (if there is a performance issues). Also since I point my GPT only to the current Defold API and LUA 5.1 (plus defold forums…which is where some old stuff can get mixed it). But so far it appears to be doing pretty well. I’m going to test to see if it can help me write a LUA module to track game objects. Pretty simple I know but we’ll see how it does.

I will say this…teaching ChatGPT how to use current best practices for defold is a lot like trying to teach the human cent-iPad to read (south park reference…that fits).

holy shit! i gotta try this out!

1 Like

Well, I think that all these language models all evolved in the direction of making the conversation as natural as possible, by making it sound very confident in what they are describing. To a certain degree I would argue that they have been taught how to lie blatantly to sound that convincing.

Eheh, I’m still amused when ChatGPT invents whole apis and methods in Defold that don’t really exists. The scary part of course is that most uneducated people take the output of such models almost as dogma.

Even at work I’m seeing incredible results in certain areas and laughable ones in others, mostly because the model is being fed information that is wrong or the eye of the person who has to check that is not trained enough.

2 Likes

I find that searching the forums or documentation is more reliable and sometimes even faster than getting a correct answer from ChatGPT 3.5 regarding Defold information. Some of the responses I’ve received are esoteric at best.

I wonder if other engines have this problem. My guess is that there just aren’t enough people posting Defold code online. We also don’t know what data is used in training these models.

2 Likes

Yes GPT3.5 is terrible for this. You should try bing chat as that uses GPT4 and GPT4-turbo. Or if you pay for GPT4 you get to upload files. Which is amazing. You can create a custom GPT where is primariliy only looks at the APIs and forums if you want…then it’s a lot more accurate. I’m able to upload several files and tell it to do X. And it does. It may miss a thing but then I just tell it to review what it sent me it looks wrong…and wammo…great.

BTW: ChatGPT wrote this for me to track attributes for objects created in my game. Works perfectly and cleaner than I could do.

local M = {}

local objects = {}

function M.create_object(name, initialAttributes)
	objects[name] = initialAttributes or {}
end

function M.set_attribute(name, key, value)
	if objects[name] then
		objects[name][key] = value
	end
end

function M.get_attribute(name, key)
	if objects[name] then
		return objects[name][key]
	end
end

function M.add_increment_attribute(name, key, value)
	if objects[name] and objects[name][key] then
		objects[name][key] = objects[name][key] + value
	end
end

function M.percent_increment_attribute(name, key, percent)
	if objects[name] and objects[name][key] then
		objects[name][key] = objects[name][key] * percent
	end
end

return M

After a lot of testing of GPT4 and even using custom GPT, that has access to knowledge (I prepared specially for it txt files with documentation, API, tutorials, etc, because I think it doesn’t read any of the zip file at all) and it still can produce wrong code, wrong suggestions, incorrect “tutorials”, misused API functions or non-existing functions even, etc. It takes a lot of time to actually “teach” it only then to get the same wrong answer after some time given same prompts.

The above chunk of code is simple though and it’s correct imho, mainly because there is a lot more materials about Lua - and above is pure Lua.

GPT4 is better for other type of tasks like - laying out ideas, suggestions taking its rather general knowledge on programming. Sometimes it is even more helpful, but I still see more value in reading documentation and API on my own.

4 Likes

Check this out. ChatGPT nailed it!!!

https://chat.openai.com/share/17c026b7-fc75-4a41-becc-a6270bb9a996