Beginner looking for advice

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
narffx
Prole
Posts: 5
Joined: Mon Jul 16, 2018 11:20 pm

Beginner looking for advice

Post by narffx »

Hi everybody, since this is my first post I would like to introduce myself, I'm new to game development, so new that I've never start anything.
My background is IT, working with computers/server, etc and some web development, HTML5, CCS3, little Javascript, PHP and MySQL and little little C. I have a basic understanding of if/else, loops, variables, arrays, etc.

This past weekend I decided to create my own game, and as a new player in this, I started with a huge idea, spent like 4 days doing paper notes and graphics of an RPG type of game. After finishing some % of how many points you earn with a new level on an ability to do something (mining, crafting, etc) I asked myself, "Hey, do you know how to do all of this?", "No", "Do you, at least, programmed a Pong or a Snake game?", "No". So those were the answers that bring me back to earth, you don't run if you don't know how to even make your first step.

So my goal went down easily, I think the progression I should make is Pong, Snake, Tic-tac-toe, Tetris, some 1942 type of game, then platform and so on. And even with that though, I realize Pong or Tic-tac-toe need AI to play vs. "Do I know how to program AI?", "No", well, so Snake was what's left and I guess will be the easiest game I can reproduce.

So I started looking for frameworks and ways to develop games (Unity, Godot, Gamemaker2, RPG maker, Java Frameworks, Javascript Frameworks, Pygame, etc, etc) and found Lua and Love2d.

From experience, I've always understand that GUI is beautiful way to work but you never know what's under the hood really, well, Love2d is a framework, there are a lot of things going under but at least, you learn Lua and to code.

My big concern is that using Unity or Godot, after some time, I start to gain bad habits to do things, yes, looks easier, but I don't know if it's correct to start with them.

My main problems and that's why I'm posting this is:

- Is Lua and Love2d a new new beginner friendly framework for starters?
- Is out there some book or tutorial that is a must to enter this world?
- Is Snake a good first game to start with?
- Should I look for source code of Snake games done with Love2d or even C or C++ and convert and rewrite them just to understand how the algorithm works and all or should I start from scratch?

Basically, need some guidance from experience people to tell me in which direction I should go. I don't mind to read docs, tutorials, learn, learn and learn, I just need some advices on this matter.

Hope it wasn't to long to read and thanks in advance!

PD: English not my first language so I'm sorry :)
User avatar
joedono
Prole
Posts: 40
Joined: Mon Mar 04, 2013 6:58 pm

Re: Beginner looking for advice

Post by joedono »

Read through these. There's even one specifically for Snake. The only thing this won't teach you is how to divide your code into multiple files.

https://simplegametutorials.github.io/
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Beginner looking for advice

Post by pgimeno »

Hi, welcome to the forums!

narffx wrote: Mon Jul 16, 2018 11:51 pm - Is Lua and Love2d a new new beginner friendly framework for starters?
I think it is. It lacks an integrated GUI (e.g. an IDE or a level designer or a sprite designer) and any GUI library (for writing your own applications with GUI controls). I think the first lack is actually an advantage: it doesn't get in the way of how you're supposed to do things, but rather leaves you in control of everything and you're able to define the workflow that works best for you.

The second lack may have been a problem several years ago, but nowadays we have a bunch of useful libraries in basically all areas necessary, including GUI, so it's not a problem anymore. In the worst case, you can write your own.

narffx wrote: Mon Jul 16, 2018 11:51 pm - Is out there some book or tutorial that is a must to enter this world?
You need to have a good understanding of how Lua works, but it's not strictly necessary for making your first steps. The book "Programming in Lua" ("PIL") is a good starting point. The only freely available version is for Lua 5.0; there are a few differences with 5.1 but these are minor generally. Ultimately, the Lua 5.1 reference manual is a very dry read, but it's the one that carefully defines how everything works. It's great as a "crude facts" reference, but not good as an introduction to the language.

You'll definitely need to be well acquainted with the language if you are going for an RPG kind of game, and in that case the PIL book will help quite a bit. I always prefer to have some advance knowledge before diving into something head first, because it helps me associate the concepts that I already know. But everyone is different, and what works for me may not work for you.

If you decide to take that route, get just enough knowledge about Lua as for knowing basic stuff, and then try to write something using that knowledge; if you need a more advanced concept, check it out and implement it, and so on.

One piece of advice is: try to modularize your code, but avoid global variables as much as possible. It should be possible to avoid them completely, but that may be undesirable in some circumstances, to avoid complicating some things unnecessarily. In any case, keep them to a minimum. You may need to acquire experience in order to know how to avoid globals in certain cases, so don't get too frustrated if you don't see how.

narffx wrote: Mon Jul 16, 2018 11:51 pm - Is Snake a good first game to start with?
It's one decent starting point.

narffx wrote: Mon Jul 16, 2018 11:51 pm - Should I look for source code of Snake games done with Love2d or even C or C++ and convert and rewrite them just to understand how the algorithm works and all or should I start from scratch?
My advice is to try to do it all by yourself. Try as hard as you can, and only if you get stuck, check out how others have solved the same problem. If you manage to go all the way to the end without getting stuck, still check how others did it, so that you can get ideas of how to do it better (or possibly decide that your way is better, which can also happen).

narffx wrote: Mon Jul 16, 2018 11:51 pm PD: English not my first language so I'm sorry :)
Neither is mine, but your English is pretty fine :)
narffx
Prole
Posts: 5
Joined: Mon Jul 16, 2018 11:20 pm

Re: Beginner looking for advice

Post by narffx »

Thanks for the advices.

I will start learning Lua, just to get familiar with the sintax and how things work.
After that I will start with the Snake game without looking at the example in https://simplegametutorials.github.io/.
If I get stuck, will take a look.

Guess I'm staying with LÖVE, I kinda like Lua sintax and seems there's a good community behing both, Lua and LÖVE.

Thanks again for the advices!
MissDanish
Citizen
Posts: 65
Joined: Wed Mar 07, 2018 11:21 pm

Re: Beginner looking for advice

Post by MissDanish »

narffx wrote: Wed Jul 18, 2018 5:57 am
Guess I'm staying with LÖVE, I kinda like Lua sintax and seems there's a good community behing both, Lua and LÖVE.

Thanks again for the advices!
The community is amazing, I have been helped by them a bunch of times. Also one thing I'd like to say, don't be afraid of starting over and scrapping projects in the beginning. I am finally making a good project, but there were like 20+ failures (both finished and unfinished projects) that lead me to this. :)
aidalgol
Prole
Posts: 19
Joined: Tue Feb 07, 2012 7:53 pm
Location: New Zealand
Contact:

Re: Beginner looking for advice

Post by aidalgol »

I'd second what everyone else has said, and also add some recommended reading: Finishing a Game by Derek Yu. I haven't finished a game yet myself, but the advice in that article has helped keep me from flailing even more than I do.
narffx
Prole
Posts: 5
Joined: Mon Jul 16, 2018 11:20 pm

Re: Beginner looking for advice

Post by narffx »

Thanks again for the advices,

I already started with the Snake game, it's taking me a lot of time but I guess it's normal. Still not looked at any code, only basing on Lua and Love documentation. The whole idea of the looping in the draw and update fuctions took me like 1 day to understand it correctly (well, still not understand quite) but I will get used to.

At the moment I have a green square (snake) with up, down, left, right movements if it goes out of screen (800x600) comes back from the other side and i'm working on the what I call food random respawn. Collisions on food is almost done and have the score +100 every time snake eats food.

Hard part is when snake get's bigger after eating food. I still not figure that one out but I've done more than what I was specting.

I will post the code after I have a much more "finished" game so you can give me advices on what is right/wrong or what I could have done better, etc
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Beginner looking for advice

Post by raidho36 »

You can keep the snake segments as a list of coordinates. Every time it moves, a head cell is added at the head and tail cell is removed. When snake eats something, a head cell is added but tail cell is not removed.
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests