10 ms·
Grid – A Lua Game Engine
- panchicore3 6y agoFor the record, Grid is also a racing game https://www.codemasters.com/game/grid/ https://www.codemasters.com/game/grid/
- Kataphract 6y agoWhy do people use Lua in a world where we have Python?
- symmitchry 6y agoDoes Python have any good game engines? PyGame project is a nightmare. Lua's https://love2d.org/ https://love2d.org/ is amazing.
- cmrdsprklpny 6y agoGrid appears to be based on LOVE: https://www.planimeter.org/grid-sdk/api/Game_Loop https://www.planimeter.org/grid-sdk/api/Game_Loop
- mjbrusso 6y agoThey are not comparable with Pygame, but easier for beginners: https://pygame-zero.readthedocs.io https://pygame-zero.readthedocs.io https://github.com/mjbrusso/game2dboard https://github.com/mjbrusso/game2dboard Disclosure: I am the author of game2dboard
- EamonnMR 6y agoI'm curious as to what you found nightmareish about Pygame... It's SDL.
- symmitchry 6y agoYears of being extremely difficult to run on a Mac (no pip install), horrible website update (the old one was bad, but at least it was cool & functional), and on-going issues like this: https://github.com/pygame/pygame/issues/555 https://github.com/pygame/pygame/issues/555 There's not even a note on the website that it's entirely broken in Mojave. It's just _always_ something. Compared to LOVE and numerous other projects which just worked right out of the box. I'm a total Python guy, but Pygame has always been frustrating.
- EamonnMR 6y agoFair enough. Though I have similar complaints about other packages on mac (Python and Ruby MySQL packages being good examples.)
- rishav_sharan 6y agoI recently found https://arcade.academy/ https://arcade.academy/ Haven't used it myself but it looks feature rich and has an active community.
- shezi 6y agoArcade is pretty nice. It's what pygame should be, at least in terms of installability. https://arcade.academy/ https://arcade.academy/
- BoysenberryPi 6y agoLuaJIT is much faster than Python, directly interfaces with C, incredibly small,and the language itself is very simple. This is also built on top of LOVE2D which is written in Lua and is arguably one of the best game frameworks out there.
- ABS 6y agojust a minor nitpick: LOVE2D is written in C++ :-)
- Quenty 6y agoLua has significantly better performance than Python, but the big reason is that Lua has a very nice C/C++ API that makes it easy to integrate with other programs. Combined with a 20k LoC source code, and you have a programming language that is cheap and easy to embed, fast, and simple. Batteries are not included, so it’s very light weight.
- jimbauwens 6y agoBecause Lua is much simpler than Python, but not in a way that makes it less powerful. You can grasp the entirety of Lua in your head, with all its semantics and behaviour, which is less easily done with Python (in my opinion).
- rishav_sharan 6y agoIMO, these are the main reasons; 1. Embeddability. You can create a game engine in a performant systems language like c++ and embed lua in it for the scripting. 2. Speed. The lua interpreter is much faster than python in general. When you throw luajit into the fix, they are not really comparable at all. 3. simplicity: lua is tiny. and one of the easier languages for non coders (game designers, artists) to get started with. 4. Effortless C interop. You can make lua bindings for anything written in c with minimal effort. Now to this specific engine. lua has one of the simplest and most beloved game frameworks out there - Love2d. its almost a foundational game framework for so many people (like pygame in python, XNA etc), including yours truly. Its been a beginners choice for over a decade now. Grid is built on top of Love2d. btw, just in case you are interested in a python game engine, you should try out Arcade. Its pretty feature rich and aimed at beginners.
- samatman 6y agoI'm constantly asking a similar question: Why do people use Python in a world in which we have Lua. Never gotten a satisfactory answer.
- aspaceman 6y agoLua is very easy to parse fast in a way python isn’t. It makes it adaptable to embedding, JIT and other optimizations. The cost is a less elegant syntax. I understand a lot of folks hate working with Lua, but it fits a certain niche.
- mhd 6y agoSeriously asking or just trolling? This statement could be made for almost any language. Why did we start with Python when there was Perl? Why did we start with Perl when we could use shell and awk? Why did we start writing something like awk when we could just have dedicated C programs? Why C when we had BCPL/Algol? Why Algol when we had... okay, granted, there's a limit. Regarding the specifics: Lua is very simple, you can keep the whole language in your head easily, the table mechanism is very powerful, and the whole thing is easy to embed. Which is why it was used in commercial games and thus is industry/genre-relevant.
- hashmal 6y agoEase of embedding has been pointed out. Another reason for using Lua in games is that its garbage collection strategy is well-suited for the task. Python uses reference counting (which has a predictable performance profile but can lead to long pauses if a large object graph is deallocated at once) and stop-the-world GC for reference cycles.
- Pxtl 6y agoHave you ever tried to embed a python interpreter? Lua is both easier to embed and allows you to have a strict interface. Look up the history of bastion/rexec in Python - with python there's no possibility of controlling untrusted code.
- andrewmcwatters 6y agoHi Kataphract, Much like many people turn to Python for scientific scripting, for example, Lua has gained a reputation for being easy to use in the game development world.
- StreamBright 6y agoI am not sure this is not a trolling attempt.
- imprettycool 6y agoI like how that comment has more responses than the OP
- deleted 6y ago[deleted]
- fiblye 6y agoI liked the speed and the power of tables. It's also an incredibly simple language. I learned the ins and outs in a couple of days and was able to get right to work on making a game. Almost never did I have to reference documentation after that--it all fit in my head without even really trying to memorize it. Python, on the other hand, has loads of features, but that results in me often looking up the right way to do something since there are so many layers to it. What Lua provides is rather bare, yet powerful and incredibly easy to jump right into.
- dang 6y agoUrl changed from https://github.com/Planimeter/grid-sdk https://github.com/Planimeter/grid-sdk, which points to this.
- _sidewalkchalk_ 6y agoany examples of games made with this?
- s_y_n_t_a_x 6y agoI'm making a mobile mmorpg using this engine. We're currently in the early spriting & game mechanic planning phases but Grid has been a perfect starting point. It's the sweet spot in-between LÖVE (Grid extends LÖVE) and a heavier engine like Defold, the multiplayer features are killer. If you're wanting to make a tile-based multiplayer game, I highly recommend it.
- cabyn 6y agoAre you posting anything on GitHub publicly? I'd be interested in seeing some sample code!
- s_y_n_t_a_x 6y agoUnfortunately, not. Parts of the game I may open-source, but it won't be fully open and it's nowhere near ready.
- TiccyRobby 6y agoLua is a little confusing language for me because you need to throw out most of the things you know because it has its own way of doing things, it is not necessarily a bad thing but it is confusing. Luckily, it is a very small language so it wouldn't take that long to grasp it all. The most confusing thing was the fact that (almost) everything seems like a hashtable.
- ebg13 6y agoIgnoring metatable weirdness, I think "you need to throw out most of what you know" is quite wrong. The main thing you need to know is that Lua's table type can be numerically iterated between index 1 and the first gap where numeric index has nil value using the ipairs iterator in addition to the non-exclusively-numeric unordered pairs iterator. A common pitfall with sparse tables is that the length shortcut # returns seemingly the wrong result if you aren't aware of that first part. Most of the difficulty writing in Lua comes from the fact that there's no first class support for OO-style Classes, so you have to fake them, and there's no standard library so you end up reinventing a lot. But other than that, it's a dead simple language with few features.
- joe-collins 6y agoEven the OO shortcomings of Lua aren't very different from the Javascript of the recent past. The two languages are quite similar, save that Lua indices are 1-based and JS comparators are nightmare fuel. My pet peeve is that it's somewhat verbose in using keywords rather than single-character punctuation to mark blocks and clauses.
- grawprog 6y agoLua's lack of integer support caused me some issues. Using floor() around everything wasn't really an ideal solution and I ended up changing languages for that project. Metatables are cool, but have some weirdness to them. For OOP i ended up using metatables to make a simple prototype(rather than class) based system, but it was hacky at best. Tables themselves are pretty awesome and powerful, but I have to admit, working with them gets a bit tiresome in ways working with dedicated arrays and hash maps don't. You have to remember exactly what kind of data is in your tables and looping through them can be a pain. Overall though, I still love lua, it's the language that helped me 'get' programming and I wouldn't actually appreciate dedicated data structures and typed variables so much if I hadn't had the experience of starting with a more free, loose and simple language like lua. Also, its ability to easily interface with C and be easily embedded has made it appear in so many different and sometimes strange and just downright cool applications. I've been playing with the solarus engine lately, it uses lua for its scripting, it's the first time I've written any lua in a while, but i've been enjoying it as I rediscover all the little cool things I like about it and i still think it makes a good first or second language for people. Having the reinvent the wheel isn't necessarily a bad thing when you're learning. That hacky prototype system I made helped me understand OOP far better than just using classes in other languages had. Even if it didn't really work all that well in the end. It really made me appreciate what a built in class system actually gives you.
- andrewmcwatters 6y agoThank you for posting this, Bambo! I was curious why we were seeing 10s of new stars all of a sudden and trying to figure out where the GitHubbers were coming from. Grid Engine 9 is now the largest pure-Lua game engine on GitHub. As s_y_n_t_a_x has mentioned in this thread, I built the Grid Engine on top of LÖVE. I came from the hlcoders world, having used the Source Engine for several years, and was upset the 2D world didn't have sophisticated game engine technology like the 3D solutions in the field. There's tons of great game software out there! But to me, a game engine isn't just a load, update, draw framework. There's a lot of hard work involved past binding libraries together. A game engine needs an architecture, it needs to do multiplayer serialization for you, and give you a meaningful way to load maps out-of-the-box, and so much more. Too many hobbyists are rolling this themselves, and I hope to continue to bring rich game development features OOTB to other hobbyists like myself. If you're interested in Grid, but don't find something quite right with it, could you tell me? I've worked on this project for at least the past 6 years from what my logs tell me, but it only continues to get better thanks to people like you all reading posts like this and giving me feedback over the years. Thanks again, Andrew
- emmanueloga_ 6y agoHey I know you mentioned it here and it is shown on the getting started tutorial, but may be useful to mention it on the front page too: the engine is built upon Love 2D.
- andrewmcwatters 6y agoThank you for your comment. I will make sure that I emphasize this in newer marketing collateral.
- emmanueloga_ 6y agoI also saw this on your repo [1], I was wondering if you are planning to move from Love to it, or what is it about? (just curious :-) 1: https://github.com/Planimeter/lgf https://github.com/Planimeter/lgf
- 6y ago
- lostgame 6y agoI would appreciate more examples on the web site - it seems like there are very, very few details on e.g. capabilities, etc.
- andrewmcwatters 6y agoI will prioritize this based on your feedback.
- cabyn 6y agoThat would be awesome, going to tinker with this tomorrow!
- andrewmcwatters 6y agoThank you for saying so! I will be available if you need anything at all.
- jmaa 6y agoApparently the developers are reading this thread, so I have a request: Please reduce your website's dependence on javascript. Doesn't leave a great impression when I need to fiddle with noscript before seeing static text.
- andrewmcwatters 6y agoI would do more of this if I had a simpler way of pulling documentation from the GitHub Wiki repo. I’m sorry the experience was poor, and I’ll consider this feedback as I make improvements to our documentation and marketing collateral to make it nicer to use. My apologies. I work hard to win over developers, many times one at a time, and so your feedback isn’t lost on me.
- nightowl_games 6y agoThis looks interesting but the documentation needs more information. I dont want to "mess around" for a few days to learn what this thing is good at. I want to read the docs and be ready to make stuff. eg) https://www.planimeter.org/grid-sdk/api/networkvar https://www.planimeter.org/grid-sdk/api/networkvar https://www.planimeter.org/grid-sdk/tutorials/Getting_Started https://www.planimeter.org/grid-sdk/tutorials/Getting_Starte...
- andrewmcwatters 6y agoI will prioritize this immediately. I believe one should be able to understand all of the concepts the engine offers within short order, and clearly I need documentation to back that belief. Everything is there to get started in just minutes, reducing any installation friction typically found with larger game engines, but I agree that documentation should be able to reduce the cognitive friction such that one can get started faster. Thank you for pointing this out. If you're so inclined, sample game code comes with the engine for the time being to understand how it works. I realize this isn't completely ideal, but feedback like this is critical to the direction I take.
- nightowl_games 6y agoThanks for taking my feedback. I suggest for the Tutorial sectiona that you walk the reader through making the type of game that you think this engine excels at making. Would also like to know more about the networking capabilities.
- mmlkrx 6y agoIf you're looking for inspiration on how to organize your docs, I found this resource really valuable: https://documentation.divio.com https://documentation.divio.com You can see the documentation system in action in this project: https://www.brachiograph.art https://www.brachiograph.art Regarding Grid, personally I always like to look at example applications built with framework/library/engine so seeing a list of projects that utilize Grid would be nice.
- 6y ago