Page 1 of 2
Where to Start?
Posted: Mon Sep 05, 2011 8:04 am
by AsherOS
Hello, I'm Asher. I'm both new to the forums as well as LUA and Love2D. So I wanted to know where everyone thinks I should get started, obviously I need to learn LUA, so I figure that's the first step, but if there is anything any of you think I should know, please tell me.
I have learned the Basics of a few other languages (so I understand all the underlying functionality of programming) including Processing, very little of Basic and also Python. The reason I hopped around was for logistical reasons, but the two languages I really want to learn are LUA and C++. so any help is much appreciated.
Re: Where to Start?
Posted: Mon Sep 05, 2011 9:08 am
by kraftman
AsherOS wrote:Hello, I'm Asher. I'm both new to the forums as well as LUA and Love2D. So I wanted to know where everyone thinks I should get started, obviously I need to learn LUA, so I figure that's the first step, but if there is anything any of you think I should know, please tell me.
I have learned the Basics of a few other languages (so I understand all the underlying functionality of programming) including Processing, very little of Basic and also Python. The reason I hopped around was for logistical reasons, but the two languages I really want to learn are LUA and C++. so any help is much appreciated.
the first few chapters of programing in Lua
http://www.lua.org/pil/ are worth a read so that you can get your head around the syntax etc, then check out the tutorials on the wiki.
Re: Where to Start?
Posted: Mon Sep 05, 2011 9:12 am
by ivan
If you are new to Lua I would say, start by learning how tables work since tables are the primary and unique data storage that the language offers. Love2D is only a tool so I wouldn't really spend too much time 'learning how it works'. The point of a game engine is that you don't need to know how everything works.
C++ on the other hand is much more complicated. You don't really need to know C++ if you want to make games in Love2D. I suppose that if you want to learn C++ the easiest route is to start learning the STL data structures like vectors, lists, maps and so on. Once you know the ins and outs of STL you can try making your own data structures which will introduce you to templates and object oriented design.
Re: Where to Start?
Posted: Mon Sep 05, 2011 9:39 am
by AsherOS
Thanks for the replies. I figure I'll start out with that LUA intro guide. And don't worry I know Love2D is only a framework, but it seems like the best option for making 2D games with LUA. As for C++, I'll learn that when I have a strong background in programming with simpler languages.
Thanks again. Also, is there anything on Programming structure for games? Because that's always the hardest thing for me to wrap my head around, when it comes to programming.
Re: Where to Start?
Posted: Mon Sep 05, 2011 1:45 pm
by Taehl
The structure of a game is unique to every game. Out of the six-ish games I've made with Love, every one of them worked very differently. The general idea is Input (player presses buttons) -> Update (make game objects do things) -> Draw (show the game stuff on the screen), but that's where the similarities start to break down.
Re: Where to Start?
Posted: Mon Sep 05, 2011 4:01 pm
by Tesselode
Just use a structure that makes sense to you. Frameworks like LÖVE give you a lot of flexibility.
Re: Where to Start?
Posted: Mon Sep 05, 2011 6:54 pm
by AsherOS
Thanks! I'll keep that in mind. could someone give me an example, using a platformer game? I understand inputs and outputs, but I was more wondering about the things that are handled by the game, like the AI. How do you make the AI modular?
Re: Where to Start?
Posted: Mon Sep 05, 2011 7:11 pm
by SoggyWaffles
The main things I learned from coming to Lua from Python:
- +Lua's table structure is VASTLY different
+Lua isn't a traditional OOP structure. It doesn't have the built in class structure that Python has
So, once you get those things down you'll be fine. As for AI, a simple solution is a State Machine (hit up the google). Welcome and good luck!
Re: Where to Start?
Posted: Mon Sep 05, 2011 7:38 pm
by ivan
AsherOS wrote:I understand inputs and outputs, but I was more wondering about the things that are handled by the game, like the AI. How do you make the AI modular?
This is a bit of a tricky question. The short answer I believe is: depends on how specific the behavior of your AI agents will be. For platformers it's pretty easy to make modular behaviors because 99% of the time agents need to either move or rotate.
State machines are good for some types of AI but are not modular at all because the transitions between states are usually coded into the states themselves. There's another approach called behavior trees. I actually wrote a couple of articles on programming AI in Lua using behvaior trees:
http://2dengine.com/doc_1_3/gs_ai.html
http://2dengine.com/doc_1_3/gs_ai2.html
Re: Where to Start?
Posted: Tue Sep 06, 2011 12:05 am
by AsherOS
Thanks, your tutorials are very helpful. I guess I'll have to get my LUA feet going now.