#1 Members - Reputation: 127
Posted 09 April 2012 - 12:54 PM
I just wanna some opinions pro's or con. Thanks for help guys ;D
#2 Members - Reputation: 232
Posted 09 April 2012 - 01:53 PM
As you said, everything you can do in a scripting language you could do in C++, but anything that helps speed up production is a good thing, right?
Of course, there is a little overhead to run the scripting interpreter on top of your game but with today's systems you should see much of an impact.
#3 Members - Reputation: 3673
Posted 09 April 2012 - 02:33 PM
The voices in my head may not be real, but they have some good ideas!
#5 Members - Reputation: 2747
Posted 09 April 2012 - 06:35 PM
You can leverage C++ in ways that yield a great deal of performance, but at the same time it has essentially no guardrails and pitfalls are not uncommon -- things like memory leaks, maintaining ownership of resources correctly, and the rabbit-hole of premature optimization. In truth, a large part of the game-specific elements don't need all the performance that C++ can offer you, and so it doesn't make sense to expose that part of the code to all the potential pitfalls. Instead, you can implement those parts of code in a language that is safer, more productive, and "efficient enough" -- and leave the core engine to more-experienced programmers using C++.
There still exists a certain inertia among game developers that "all code is performance-critical" and for a certain type of developer -- say, those pushing the limits of AAA console gaming, it's not entirely untrue. However, this notion that this is true of all games is something that dogs some in the industry, and far too many of those aspiring to be in it.
Objectively, yes, performance matters (you can measure it it, therefore you can rank it), and 300 frames per second is "better" than 270 frames per second -- but subjectively, no one's going to notice whether your game runs at "only" 80 or so frames per second. In the end, all that matters to the consumer is "does this run well enough on my hardware?" and the number of consumers you want to reach is defined by "what hardware can I make this thing run well on?"
#6 Staff - Reputation: 8878
Posted 09 April 2012 - 07:26 PM
- Faster/easier iteration when testing new ideas (because you don't need to recompile).
- Allows for non-programmers to take an increased role in development.
- Can protect the programmer from some mistakes that can occur in lower level programming languages.
- Can easily allow players to mod the game.
So far I only see one disadvantage listed though: code written in a scripting language has a run-time overhead and may execute slower than lower level code. As already mentioned, this isn't a big problem the majority of the time, and the benefits above are usually well worth a slight hit to performance -- it is something to be aware of though, and depending on your needs means that you might not want to use scripting for everything.
Another disadvantage I wanted to list is that you need to spend a small amount of development time initially setting up your scripting language so that it works. In a great many cases the advantages listed above will outweigh this small investment in time and make it well worth the additional effort, but if you are creating a particularly small and simple game it might be worth considering.
Overall I personally think the inclusion and usage of a scripting language (Lua, Python, JavaScript, etc.) is well worth it for most projects above a certain (very simple) complexity, and is well worth considering. As a beginner who is just learning however, you might want to put it aside as something to look at more after you've spent more time learning your chosen lower-level language as well as programming in general.
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer
#7 Members - Reputation: 767
Posted 09 April 2012 - 10:04 PM
There are other languages that can be used as scripting languages, such as Python and JavaScript. One thing I like especially about Lua, though, is that it works well for data description, which can be nice if you're into a more data-driven approach.
#8 Members - Reputation: 80
Posted 10 April 2012 - 11:34 AM
lua is great as once it is setup and going, it is wonderful, you can modify your game as it plays, not having to recompile and get to the state that you were testing
lua is horrible because setting it up can drive you insane. Well, at least me. Oh, and the documentation isn't always that helpful, for instance, lua_pcall(L, NumArgs, numRet, 0) when I first started using it I had my numArgs being the number of arguments the function needed, the documentation didn't specify specifically that the function call was also an argument, so it was failing on me. The documentation wasn't wrong, it just wasn't helpful enough for an impatient tiered student as of myself find understand it how it was meant to be.
I would recomend that you look into luabind... It can be hard to set up due to the lack of examples to follow and it can be made even harder if you can get impatient.
but once you have it implimented it can be really useful, I am currently working on my own luabinding, yes, it is driving me nuts, but the sheer flexibility it offers is what keeps me going at it.
#10 Members - Reputation: 120
Posted 10 April 2012 - 07:12 PM
Take no notice of this, Lua's documentation is excellent.Oh, and the documentation isn't always that helpful, for instance, lua_pcall(L, NumArgs, numRet, 0) when I first started using it I had my numArgs being the number of arguments the function needed, the documentation didn't specify specifically that the function call was also an argument, so it was failing on me. The documentation wasn't wrong, it just wasn't helpful enough for an impatient tiered student as of myself find understand it how it was meant to be.
falconmick maybe you should read the documentation next time it clearly tells you the protocol as lua_pcall links to lua_call
As people are mentioning the speed of Lua compared to C and C++, if this does become a problem you can always you use the excellent and blazingly fast LuaJIT which supports quite a lot of platforms now with speed being the same or close to C code.
edit: I just can not let it go
#11 Members - Reputation: 80
Posted 10 April 2012 - 09:28 PM
the downvote button is for not agreeing with someones opinion. That is all it was, I gave a first hand experience of how I have experienced LUA (:3) and even given a description of myself so they can understand why I would say what Ive said
lua needs time to be build in correctly, it is somthing that should be planned and implemented in segments.
#12 Members - Reputation: 120
Posted 11 April 2012 - 04:53 AM
the downvote button is for not agreeing with someones opinion.
Congratulations, you have earned the award of being downvoted by me again.
Grow up, I sent the private message to explain the reason and to tell you it was me that downvoted you please do not use private messages to insult me.
#13 Staff - Reputation: 8878
Posted 12 April 2012 - 01:11 AM
dmail: "falconmick" was reasonably clear that he is inexperienced and that he was just sharing his own experience with Lua, and I don't think his intention was to mislead anyone. We are in the "For Beginners" forum here, and correcting a beginner's mistake or taking a moment to highlight the fact that not everyone shares a particular opinion is great, but having been shown the contents of your PM I would suggest that you could be a lot more tactful in future.
falconmick: In future, please try not to lash out at other members; if you feel the contents of a private message are abusive or insulting you can use the "report" link at the bottom-right of the message to have a moderator review the situation for you.
Any further off-topic replies will be deleted. You have been warned.
Edited by jbadams, 12 April 2012 - 01:31 AM.
Added personalised feedback to each user after having been shown the contents of the private message in question.
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer






