Lack of Tutorials!

#1

Yeah i have noticed a lack of tutorials on subjects i need help with…Making an Inventory system, random loot drops from killed mobs, random level generation…Just to name a few…any help on this would be great!

0 Likes

#2

It sounds like you don’t have much experience using the engine. It would be a good idea to start with Defold’s built-in tutorials, then try making something of your own from there.

Once you have a specific task you’re trying to accomplish, try coming up with ways to implement it yourself. If you still need help, try asking about one topic at a time here on the forums.

3 Likes

#3

Additionally to what Anthoryd said; What you are asking for are not Tutorials for Defold but guides on how to create very specific systems, which tend to be highly game specific. There are a lot of these guides out there already and many of them are language agnostic (they might be made for Unity but if you simply change the syntax of the language you could still use it for a Defold game). With that said I do not think that is a good way to learn, you would only learn how to implement one type of system in one particular way. It is better to learn the programming patterns and language features that the system is using which you can then use when creating any of the systems.


To illustrate my point, I could have a simple game that only have a few different items. In that case a system for getting random loot from a killed mob could be as simple as the example below, is complete tutorial really needed for that?

-- Monster.script
local all_loot = {"sword", "shield", "gold", "dagger"}

local function on_death()
  --do a bunch of stuff with your monster
  award_loot()
end

local function award_loot()
  local loot = all_loot[math.random(#all_loot)]
  msg.post("player", "gained_loot", {loot=loot})
end

But this example would never do in a bigger game or even in a small RPG and the same can be said for any of the systems you mentioned. The implementation of the systems can vary a lot. With this in mind you shouldn’t search for “random monster loot drop tutorial” but instead you should break down the system you want to create into smaller parts. In this case it could be as simple as “get a random item in a list” but it could also be more steps like: Reading a data file from disk, storing data to disk, drop rate probability, get random item in list and so on. You can then start to build your system up and if you get stuck you can search for that smaller part.

You wouldn’t build a house before you know how to make a wall. The first part is to figure out how to build a wall.

8 Likes

#4

Once you’re done with the built-in Tutorials, I would suggest looking at @benjames171 github games.

4 Likes

#5

I am learning lua but the problem is the code is different from what i am learning like the local function called award_loot…that is no where in the lua learning tutorials and book i have…So this is confusing to me!

0 Likes

#6

It is recommended that you use local functions and variables whenever you can to avoid unforeseen problems and side effects of globals. The local keyword is explained in the official documentation:

https://www.lua.org/pil/4.2.html
https://www.lua.org/manual/5.1/manual.html#2.4.7

0 Likes

#7

i understand that but what i dont understand if the use of award_loot() dont see that anywhere in my lua learning book or even on any tutorials!

0 Likes

#8

I don’t understand what you mean? award_loot() is a user declared function.

0 Likes

#9

What im learning from my books does not describe user functions or i have not made it that far into the book yet…I have no clue yet how to utilize user functions…Sorry if i am confusing anyone!

0 Likes

#10

Ok, well, being able to create your own functions to reuse pieces of logic and create complex logic from small pieces is a key learning in most programming languages. I assume the book you are reading will cover this.

0 Likes

#11

Learning to program in lua current edition is what im reading…So any help on learning more would be great!

0 Likes

#12

That is a good book. Do you have any prior experience of programming languages?

0 Likes

#13

No i have no prior exp of programming…I asked around and some folks said lua is great for beginners! Picked up the book and started reading!

3 Likes

#14

Yes, Lua, python and some others are good language for beginners. But since it is your first language you need to be prepared that it is going to take some time. Good luck though!

0 Likes

#15

Trying my best to learn but due to learning disabilities its harder for me to learn…im watching this series and need to know if it will help me in my learning and being able to use defold! https://www.youtube.com/playlist?list=PLxgtJR7f0RBKGid7F2dfv7qc-xWwSee2O

0 Likes

#16

Yes that will help a lot

0 Likes

#17

Thank you so much for your help and patients and understanding. Hope i can make my game a reality!

1 Like