Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Game News Frontiers Released on Steam Early Access

tuluse

Arcane
Joined
Jul 20, 2008
Messages
11,400
Serpent in the Staglands Divinity: Original Sin Project: Eternity Torment: Tides of Numenera Shadorwun: Hong Kong
Hmm, I was actually surprised to hear there is a significant performance difference between python and lua. So I googled a bit, found this, http://flux242.blogspot.com/2013/05/python-vs-perl-vs-lua-speed-comparison.html

Turn out Lua is pretty good at floating point math. However, you're still looking at a 5x increase in speed going to C. (Also, you can wrap python around C functions).
 

Metro

Arcane
Beg Auditor
Joined
Aug 27, 2009
Messages
27,792
...with the relaxing tempo and simplicity of a point-and-click adventure.

I look forward to picking this up... in the $1 tier of an indie bundle.
 

potatojohn

Arcane
Joined
Jan 2, 2012
Messages
2,646

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,092
Hmm, I was actually surprised to hear there is a significant performance difference between python and lua. So I googled a bit, found this, http://flux242.blogspot.com/2013/05/python-vs-perl-vs-lua-speed-comparison.html

Turn out Lua is pretty good at floating point math. However, you're still looking at a 5x increase in speed going to C. (Also, you can wrap python around C functions).

Try 50x and you'll be closer

Also, Lua fucking sucks
What would you use for an interpreter then? We know they are slower than full native, but interpreters are not meant for critical functionality.

My reason for using LuaJ rather than Jython or similar is that it's self contained and it just runs nice on Android and RoboVM.
 
Last edited:

potatojohn

Arcane
Joined
Jan 2, 2012
Messages
2,646
What would you use for an interpreter then? We know they are slower than full native, but interpreters are not meant for critical functionality.

My reason for using LuaJ rather than Jython or similar is that it's self contained and it just runs nice on Android and RoboVM.
Why do you need an interpreted language?
 

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,092
What would you use for an interpreter then? We know they are slower than full native, but interpreters are not meant for critical functionality.

My reason for using LuaJ rather than Jython or similar is that it's self contained and it just runs nice on Android and RoboVM.
Why do you need an interpreted language?
Data driven applications where configuration comes from external files and functionality has to be loaded at runtime. It's also helpful when codebases take minutes to hours to build and you are only doing small gameplay iterations (speed +0.5, damage +2, etc...)

Actual industry examples: case A being Hearthstone, Civilization IV or Crusader Kings 2, case B being GTA IV, any Unreal Engine game. Most modern engines have their own scripting system on top of the tinkering bits, expressing business logic is faster in higher level languages and the performance loss is acceptable because it's not on critical processes. And that's a fact.

Here's a 2014 talk about "Why C++ Is Awesome", skip to 21:55

 
Last edited:

potatojohn

Arcane
Joined
Jan 2, 2012
Messages
2,646
Data driven applications where configuration comes from external files and functionality has to be loaded at runtime. It's also helpful when codebases take minutes to hours to build and you are only doing small gameplay iterations (speed +0.5, damage +2, etc...)

Why do you need a programming language for this? A data format like JSON should suffice. As for loading external code, you can use shared objects

Actual industry examples: case A being Hearthstone, Civilization IV or Crusader Kings 2, case B being GTA IV, any Unreal Engine game.

Counter-example, KSP is written in C# and modded in C#. the Quake games are written in C++ and modded in C++, etc

Most modern engines have their own scripting system on top of the tinkering bits, expressing business logic is faster in higher level languages and the performance loss is acceptable because it's not on critical processes. And that's a fact.

If you've written a game in C++ in a sane way, you already have a high-level language, namely the "DSL" in your C++ code
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
This looks very good, but at the end of the day he still needs to make a game.

What interests me is that is the idea of a first person survival game in a rpg setting (I always wanted such a game), as a pure rpg it does not sound that interesting to me.
 
Last edited:

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,092
Data driven applications where configuration comes from external files and functionality has to be loaded at runtime. It's also helpful when codebases take minutes to hours to build and you are only doing small gameplay iterations (speed +0.5, damage +2, etc...)

Why do you need a programming language for this? A data format like JSON should suffice. As for loading external code, you can use shared objects

Actual industry examples: case A being Hearthstone, Civilization IV or Crusader Kings 2, case B being GTA IV, any Unreal Engine game.

Counter-example, KSP is written in C# and modded in C#. the Quake games are written in C++ and modded in C++, etc

Most modern engines have their own scripting system on top of the tinkering bits, expressing business logic is faster in higher level languages and the performance loss is acceptable because it's not on critical processes. And that's a fact.

If you've written a game in C++ in a sane way, you already have a high-level language, namely the "DSL" in your C++ code
I made my point, it went woosh, I won't waste more time on a C sperg. Reread my post to a counter for each of your rebuttals.
 
Last edited:

pakoito

Arcane
Patron
Joined
Jun 7, 2012
Messages
3,092
Having to install a multiplatform toolchain to cross-compile a shared object defeats the purpose of fast and easy modding. C++ is infamous for unfriendly not so compatible tooling, slow due to optimizations, leaks are common and errors are fatal. A sandboxed interpreter is safer and faster to iterate.

C# allows runtime compilation of itself, C# can be "scripted". Quake 1 (c.a. 1932) is an old, bad example. It never had the community other easier games had. I wouldn't blame it on C++ but it didn't help either. Most engines, again, run their own DSL on top of them for "designer" stuff. At this point is common practice.

C++ is a high level language, also known for needing a lot of cruft to express anything due to the memory management stuff. You may be the best programmer in the whole world and write perfect code, but the point here is that you can never ever ever spin stuff faster than in languages like Python, Golang or Lua. You can spin 1000 concurrent, multi threaded, safe, network calls + deserialization in less than 10 lines.
 
Last edited:

Spectacle

Arcane
Patron
Joined
May 25, 2006
Messages
8,363
Quake 1 actually had its own QuakeC interpreted scripting language that handled the game logic. The Quake engine itself is of course written in highly optimized C.
 

potatojohn

Arcane
Joined
Jan 2, 2012
Messages
2,646
Having to install a multiplatform toolchain to cross-compile a shared object defeats the purpose of fast and easy modding.
Let's be real. Someone who can't figure out how to install mingw or whatever won't be contributing in any meaningful way anyway

C++ is infamous for unfriendly not so compatible tooling, slow due to optimizations, leaks are common and errors are fatal. A sandboxed interpreter is safer and faster to iterate.
That's nonsense. Lua et al are so loose it's pretty much impossible for the programmer or tools to reason about what's going on. A C/C++ compiler will catch tons of errors at compile time that would just bomb Lua at runtime.

I don't know what "errors are fatal" means. Do you think you can't do error checking in C++? Does lua have magical hampsters running in the background that fill your nil objects with sensible values?

You may be the best programmer in the whole world and write perfect code, but the point here is that you can never ever ever spin stuff faster than in languages like Python, Golang or Lua. You can spin 1000 concurrent, multi threaded, safe, network calls + deserialization in less than 10 lines.
You got me. That'll be really useful when I need when I need to make a web server in my BG2 mod
 

thesheeep

Arcane
Patron
Joined
Mar 16, 2007
Messages
9,956
Location
Tampere, Finland
Codex 2012 Strap Yourselves In Codex Year of the Donut Codex+ Now Streaming! Serpent in the Staglands Dead State Divinity: Original Sin Torment: Tides of Numenera Codex USB, 2014 Shadorwun: Hong Kong Divinity: Original Sin 2 BattleTech Bubbles In Memoria A Beautifully Desolate Campaign Pillars of Eternity 2: Deadfire Pathfinder: Kingmaker Steve gets a Kidney but I don't even get a tag. Pathfinder: Wrath I'm very into cock and ball torture I helped put crap in Monomyth
However, you're still looking at a 5x increase in speed going to C.
Try 50x and you'll be closer.
Nonsense, all of it! Use LuaJIT and you get as close to C speed as possible. Most bigger titles that use Lua most likely actually use LuaJIT. I don't see a reason not to.
What it does is basically compile Lua code (at runtime, of course) instead of interpreting it. Which is much, much faster.

The only real downside of Lua (besides a certain uglyness) is that it lacks tools (like networking, OS functionality support, etc.), which have to be "plugged in" first. Which is painful to do when you embed Lua (calling Lua code from a C/C++ application, which is what most games that use Lua do).

Such an exciting debate.
Programming is serious business! :smug:
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom