Jump to content

Language performance :


YouGroove
 Share

Recommended Posts

Well, i'm for now in LeadWorks level making (textures,normal maps etc ...) , i have left for now the programming side !

 

Does anyone would have some ideas on the following points :

- Lua it interpretde i think, how fast it is compared to C++ (2 * less more fast, 3 , 4 ??)

- How many people go full Lua to make a game ? it is possible to do manage all the available functions of LeadWerks with it ?

 

- For C# , a language i use a lot actually how does it run compared to C++, because C# is not compiled ? it uses the CLR from Microsoft ?

- Same thing it is people using C# to make big projects ?

 

Well there are just general questions for me to find the best language adapeted for me to go simple and fast programming.

Stop toying and make games

Link to comment
Share on other sites

When you only look at engine commands, every language is the same speed, because they all call the same commands from the engine.dll.

 

In general i would sort the languages like that: C++ (fast), C# (almost as fast as C++), LUA (not quite as fast as C++)

So you see it's pretty much a choice of programming taste :P

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

For "simple" and "fast" programming (if you're not a programmer) I would suggest C# (well may be also LUA but I like C# much more). I was making a MMORPG (that I had to put aside because of my very few spare time) and it was so fast that I decided to not switch to C++ because there wasn't enough FPS difference to make it worth.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Thanks guys !

 

So i think to go for C#, a language i used heavily , i used TV3 engine also and created tools, but i do lot more 3D art now than programming :P

For Lua is the difference that big like 50% speed ?

I'll see if i can avoid too much commands , i'll go for Lua, but if game management requires lot of code i think the better will be C# ot not loose too mcuh frame rate !

I've seen a game made of Lua entirely today in Showcase , that what made me considering this language also !

Stop toying and make games

Link to comment
Share on other sites

There is no simple answer to that question. My approach is to not be stubborn about using one language only. I use them all as needed.

 

C#

Most code. Its a very nice language to work with and you will be well prepared for other platforms. The C# will probably be enough for most situations

 

C++

Things that need to be very fast or things that is better suited for some things than C# are.

In fact there has not been to much of such situations, but there is some speed to gain with

clever coding here. I then compile the code into a DLL and use it as a component in C#

 

LUA

A great scripting language, very fast compared to many others. This is a must when working with objects in the Editor.

Great for making specialized code of object that you need to tamper with in the editor.

 

 

Of course this is just my personal approach and others may find other ways to go. It all depends on the individual and what the needs are.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

As Roland says, not a straight forward answer. These is what I personally do most of the time:

- LUA (or another scripting language) for very basic things, like for example environment related stuff like a rotating windmill.

- C# for tooling (GUI tooling is just very strong) and for prototypes. C# is RAD, you work fast, and the .NET library gives you to power you often need where you need it.

- C++ for final games.

 

Some may ask why I don't stay to C# after a prototype for example, and there are a couple of reasons:

- C# has a performance impact. You will not or hardly notice this on your developer machine, but remark most people don't have specific game tweaked setups. The biggest issue would be the garbage collector, but with some neat tricks you can work around them.

- C# performance impact is a bottleneck on mobile devices.

- C# isn't supported on all platform, where C++ almost always is.

- C++ is just fast and cross platform, but is the hardest to do and tweak. In more complex situations C++ gives you the power to win just that kind of performance to get your game running smoothly.

 

So it all comes down on what you want to do. You want a MMORPG, I would say go for C++. Going more small levels, indie style 2D game or something like that I strongly suggest C#.

Anyhow, your first step is a prototype. You focus on one level for example with basic or complete gameplay depending the amount of work. Test the performance, send it over to friends and family with a home and kitchen desktop. Make a decision afterwards.

Link to comment
Share on other sites

I would use C++, Lua and Fortran, and not touch C# even with a long stick.

 

Fortran is the fastest for math routines, but the headers are not ready yet, because I was sick for a week.

 

C++ is the most popular language, and has the best support. It's generally the fastest language, especially when using STL containers.

 

Lua is fast enough for setting up models, and doing some simple animations. It's possible to write a complete game in Lua too, but you might need to add some new commands with BlitzMax or C++.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

It works fine, and is supported with regular updates. It was designed to be as close to assembler as possible, even closer than C, and that purpose is quite good for games too.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

No, it was designed by IBM for scientific and engineering purposes: http://en.wikipedia.org/wiki/Fortran

I don't see the added value for games, and can't honestly image people using it...

No, it was designed to be the fastest language, because they could not write enough code with pure assembler.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Theologic, read all information about Fortran, and not only the Wiki page. Every language had a first version, and every language which is still being developed, matches the requirements for today's needs, including 3D simulations and game programming:

http://www.fortran2008.com

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

In fact C++ and .Net in terms of simple use like variables, methods, classes are not so so far from each other !

C# just made like Java , just took the best and avoided the complicated things !

 

Just by curiosity, how is performing BLitzMax also with the engine ?

Is it more comparable to Lua or to C#, or it is between the two in terms of performance ? it's a compiled language ?

Stop toying and make games

Link to comment
Share on other sites

C# can be faster than BlitzMax, but BlitzMax can be also faster than C#, it depends what you are doing.

It seems that with memory allocations C# is faster, while with raw math calcs and iterations BlitzMax is faster:

C# (release):

SIEVE OF ERATOSTHENES - 10000 iterations

10000 iterations took 2.26205904 seconds.

Primes: 1899

 

BMX (release):

SIEVE OF ERATOSTHENES - 10000 iterations

10000 iterations took 1.59899998 seconds.

Primes: 1899

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I have no idea about BlitzMax performance, but as I understand it LE3 will be completely C++ which may or may not give a hint on where things are going. Just my personal guessing though without actually having any facts.

 

I also have to defend Metadron here a little although I'm not always agree with everything. The subject of this discussion is in fact "Language Performance" so I can't see anything wrong with him argument for his believes.

 

However I guess the thread starter are asking about officially supported languages and then the answer is simple. C++ is the fastest. However those differences are often not the bottleneck. I think in the its all about making good meshes, think a bit on materials etc...

 

There are many BlitzMax users here so perhaps they could give some idea of the BM performance.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Generally BlitzMax users have a speed benefit with LE2, because they can skip the DLL function calls, because they can access the engine commands directly.

However, since the bottleneck is usually on heavy math routines, like A* calculations, then the C++ or Fortran users would benefit again even more, but BlitzMax would still be faster than C# because it has both direct engine access AND faster math calculations.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Thanks !

Great thing to know.

 

Does BLitzMax have OO like classes ?

And it is more or less easy to make tools for exampel with all GUI stuf in BLitzmax compared to C# ?

(Caus BlitzMax is not windows native like C# ?)

 

But Blitzmax means also buying and learning a new tool and language :)

Stop toying and make games

Link to comment
Share on other sites

Josh still uses BlitzMax to make GUIs for Windows, Mac and Linux, because it has the easiest and most functional GUI library. That's why the Editor in LE3 is still written in BlitzMax.

 

BlitzMax has a fully implemented OO model also, and it's like Visual Basic in the syntax, so it's very easy for computer newbies to learn.

 

It has even modules, like Fortran, which makes it a bit better than C++ in that sense. Modules are a bit similar like using libraries in C++, but you don't need to make a seperate project for each module, as each module can be part of the main project, and it still creates seperate module binaries, which don't need to be compiled each time when you compile the main program.

 

BlitzMax and Fortran are indeed quite similar in many aspects, but BlitzMax is dead, because it has been replaced by Monkey, while Fortran is actively developed and supported. Monkey is also a good language for LE2, but I still need to finish the headers for it. First I will finish the Fortran headers though. One thing at a time.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

On a recent side note, I've implemented A* in Lua on a pretty small grid (8x8) and haven't seen any slowdown when it's finding the path. I'm moving about 6 units at a time and it runs smooth at that scale. Not saying it'll work great at higher scales but Lua seems to be working pretty good. It's so flexible, but that can come at a price if you aren't careful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...