Jump to content

Language performance :


YouGroove
 Share

Recommended Posts

For Lua i'm curious about how far a game can be done with it , and what is the limits in terms of lines of code, entities to manage in the level ?

(i mean entities AI , GUI inventory system, particles , game management ... well all tsuf that is running in a satndard 3D game)

Stop toying and make games

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.

 

8X8 on your development machine. Try a more realistic setting like 128X128 and 30 characters and test again.

But again it depends on what you are doing. If 8X8 is required by your game, I should say go for it. If on the other hand you're making a RTS I would suggest C++.

Link to comment
Share on other sites

8X8 on your development machine. Try a more realistic setting like 128X128 and 30 characters and test again.

But again it depends on what you are doing. If 8X8 is required by your game, I should say go for it. If on the other hand you're making a RTS I would suggest C++.

 

8x8 is my game requirement. A realistic setting would highly depend on the game itself as you have stated. Normally I would have used C++ or C# for this but Josh had a Lua requirement that I'm sticking to. Just reporting my results so far though, not fighting one way or the other.

 

For Lua i'm curious about how far a game can be done with it , and what is the limits in terms of lines of code, entities to manage in the level ?

 

No one has really done it with LE yet for a RTS or FPS so it's hard to say.

Link to comment
Share on other sites

It should be quite possible to code pretty much a whole game using Lua so long as any intensive routines are done in a faster language, C being the obvious one as it interfaces directly into Lua. If it's a simple game then I'd say there is probably little risk.

 

There is however a lot to be said for using the faster languages, and in particular C++

 

  • Whether people like it or not it is still the “de facto” language for game development and as such will stand you in good stead within the gaming industry.
  • You are unlikely to run into speed problems as a result of the language itself (poor design is more likely to be the issue) but development will be slower.
  • You will have easier access to more professional tools and libraries using C++ then any other language, which may well speed up development.
  • Its cross platform nature

C# and BlitzMax are both very capable languages though and represent good choices for anything but the most demanding of games.

 

Out of interest, I've had A* pathfinding running on a 200x200 grid (40,000 nodes) with 30 NPCs in C++ with an average max path find time of around 2mS but generally much less. That would obviously rise on a slower machine! I would hate to run that in Lua though! Putting it onto the gpu would conciderably speed that up too ... to probably sub millisecond! I seem to recollect Naughty Alien doing just that using cuda or OpenCL.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

8x8 is my game requirement. A realistic setting would highly depend on the game itself as you have stated. Normally I would have used C++ or C# for this but Josh had a Lua requirement that I'm sticking to. Just reporting my results so far though, not fighting one way or the other.

 

Sorry if it sounded like that. The second part of my message was way more important :). The bottom line here is it all depends on what you are creating for game...

Link to comment
Share on other sites

Out of interest, I've had A* pathfinding running on a 200x200 grid (40,000 nodes) with 30 NPCs in C++ with an average max path find time of around 2mS but generally much less. That would obviously rise on a slower machine! I would hate to run that in Lua though!

 

I should give this a try just to see how it works in Lua. Putting it on the GPU would be sweet and pretty much negate any language speed talk I would assume. I'll play around with the 200x200 thing in Lua if I get some time tonight. Should be easy enough to setup the example as just data with no visuals and test the time just so we don't all guess at this kind of stuff and it keeps coming up again and again.

Link to comment
Share on other sites

I think a grid based pathfinding is cheating, and has nothing to do with AI. I would rather let the computer have the same challenge as the player, so when he needs to turn left or right, because there is an obstacle over which he cannot jump or climb, then he would choose the direction based on some fuzzy logic, which can include also randomness, because sometimes logic is not complete, or it's intuitive.

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 think a grid based pathfinding is cheating, and has nothing to do with AI.

 

 

Well, Pathfinding is just the bus the NPC's catch to get to a fight.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Well, Pathfinding is just the bus the NPC's catch to get to a fight.

Well, to make it not cheating, then the grid should be visible to the player, so that he could destroy it with his Great Sword of Truth, piece by piece. Or the player could drag grid nodes to a lava pit or over a cliff.

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

Not sure why you call it cheating ... the whole idea behind game AI, is to create an illusion.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

I can create an AI which is not an illusion, but works the same way as a human does, just much more simplified. Actually I've done that a few days ago in the Guess A Number game.

 

How I see it, how a human works, one component is knowledge, one component is flag and counter based logic, which works kinda like a sieve to find the goal. The tree structure of the flag logic can be hardcoded (because it's very similar between all "normal" humans), but it can be made from parameters too. Then there is the mysterious component of creativity, but I don't know yet how I should do that, maybe just a random shuffle of few knowledge items, and if for example 3 or more fit together, it's a creative idea.

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

yada yada .... for a second I forgot who I was talking to :rolleyes:

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

If you are not a programmer already, but you want to learn a simple language, I would recommend VB.Net with Lua.

 

They are very similar and it will get you accustomed to the language syntax that C# uses with less hassle.

Plus, all of the .Net libraries (either unsupported or otherwise) can be used with C# if you wish to convert your program in the future.

Link to comment
Share on other sites

yada yada .... for a second I forgot who I was talking to :rolleyes:

So that means you give up on developing a good AI? It's really quite simple after all, because humans can be just as simple too.

I guess I need to make a seperate AI demo also, to show how it works in practice. Besides I need that for my next project, the mini RTS game also.

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

As I said Mika, "yada yada .... for a second I forgot who I was talking to :rolleyes:"

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

So that means you need a working example to understand it. I think an applied player following logic would be the best example.

 

EDIT: Ah, now I understand what you tried to say: "I know, I know". Yada means "to know" in the ancient Hebrew language: http://www.studylight.org/lex/heb/view.cgi?number=03045

You probably thought that I would speak fluent ancient Hebrew, but I actually know only a few words. I should use that word more often, because I think it makes me look smarter :rolleyes:

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

Just wanted to drop 5 cents (share own experience)... Maybe obvious things, but just in case someone would find it usefull.

As mentioned before, language is almost not playing a role in LE application: 99% of time is engine.dll

 

I spend some hours, trying to resolve some CRT problems (i couldnt build release version), get a lot of additional experiense and... see no differ between debug and release builds in C++

 

The scene is not too high loaded, but there are amount of code already in usage.

Working on LeaFAQ :)

Link to comment
Share on other sites

As mentioned before, language is almost not playing a role in LE application: 99% of time is engine.dll

The problem with this statement is that when you want to do something in the remaining 1% your going to find yourself pushed for time. This is exactly where speed and efficiency comes in and what makes the difference in the end as to whether you can get the performance you want or not. The remaining 99% you can do little about as it's someone else's code :rolleyes:

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

The problem with this statement is that when you want to do something in the remaining 1% your going to find yourself pushed for time. This is exactly where speed and efficiency comes in and what makes the difference in the end as to whether you can get the performance you want or not. The remaining 99% you can do little about as it's someone else's code

bull's eye :rolleyes:

Working on LeaFAQ :)

Link to comment
Share on other sites

Maybe obvious things, but just in case someone would find it usefull.

As mentioned before, language is almost not playing a role in LE application: 99% of time is engine.dll

 

This is not true. For very simple games it may be, but a couple of years ago we created an educational game using LeadWerks and has some performance issues. After profiling, most went indeed to the engine, but in the range 80-90%. LeadWerks is more middleware render engine as game engine, so game logic is just custom. This is the reason I talked to Josh, giving an overview and analyze with profile logs screens, and proposed to move to C++.

The problem is rendering is max 50% (should be to allow complex functionality) of your application, so with LE3 I will evaluate again, do the same analyze and profiling to see where it can actually be faster.

Link to comment
Share on other sites

Thanks TheoLogic.

So yes i'll try more C# or C++ instead of pure scripting language.

I wan the game to play well even on minimum Engine requirements (caus PC field is really made of all sort of PC from very old 3D cars to new ones) !

Stop toying and make games

Link to comment
Share on other sites

@Metatron :

BlitzMax and Fortran are indeed quite similar in many aspects, but BlitzMax is dead, because it has been replaced by Monkey ...

 

Stange after browsing some LE3 Topics i've found this :

BlitzMax and LE3

So it seems BlitzMax will continue to be used for LE3 ?

So why saying it is dead ? if if is finished stable, without critic bugs, and even with no more support,

if it works great , and it is even used on LEE 3 , and also for the coding of the editor ;

i find it a pretty strong other language solution , no ?

 

I would like ot have some input from BlitzMax users like :

BlitzMax It is really used with teh engine ?

It is easy and not too much bugs ?

Stop toying and make games

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...