Optimization Stuff

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: Optimization Stuff

Post by Xii »

pgimeno wrote: Sun Dec 27, 2020 11:06 pm Well, I admit it may depend on the type of game, but then you're limiting yourself to games that don't need anything beyond constant strings.
Some of your examples are more trivial than others, but yes I'm starting to see what you mean; a lot of work sidestepping a non-issue. Fair enough. I count myself lucky that I need none of the functionalities listed in my games' designs (yet!) :awesome:
User avatar
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

Re: Optimization Stuff

Post by 4vZEROv »

Xii wrote: Sun Dec 27, 2020 7:29 pm I'm new to the community; could you link me to one you think fits that description to study?

I note that you downgraded your adjective from "giant" to "reasonably-scaled"...
https://github.com/a327ex/BYTEPATH
This game is made with love2d, is reasonably-scaled and use garbage collection.

Lua is slow because it's a scripting langage, if you want speed and manually manage memory you should use C.
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: Optimization Stuff

Post by Xii »

4vZEROv wrote: Sat Jan 02, 2021 5:08 am This game is made with love2d, is reasonably-scaled and use garbage collection.
I do not consider Asteroids (or any clone thereof) to be of any reasonable scale. It is, quite literally, one of the simplest games ever made.
User avatar
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

Re: Optimization Stuff

Post by 4vZEROv »

Xii wrote: Sat Jan 02, 2021 5:52 am
4vZEROv wrote: Sat Jan 02, 2021 5:08 am This game is made with love2d, is reasonably-scaled and use garbage collection.
I do not consider Asteroids (or any clone thereof) to be of any reasonable scale. It is, quite literally, one of the simplest games ever made.
You didn't understand my message, it's a reasonable scale love2d game.
Lua is a scripting language, it's slow by design, if you want something more powerfull use Unity or directly C / C++.

For you what is an example of a reasonably scaled game ?
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

Re: Optimization Stuff

Post by MrFariator »

Perhaps it's splitting hairs, but I wouldn't consider lua to be slow by design, but rather by its implementation. You could write a C compiler that outputs very inefficient stuff, or even just gauge the difference between vanilla (5.1) lua and luajit.
User avatar
Imagic
Prole
Posts: 44
Joined: Mon Sep 30, 2019 8:20 am
Contact:

Re: Optimization Stuff

Post by Imagic »

We can't just say that "Lua is slow by design" or "C is fast by design". There is a lot of work involved to make something fast, from the highest to lowest levels, from compiler developers to game developers. And being fast is not the only relevant thing; in fact, most of the code written has probably no interest in being fast (or faster, everything is relative). Also, although the language in itself leads the implementation, only the last is actually doing something and can be fast or slow (edit: beaten by the previous post).

A large scale game is first a complexity issue, not necessarily a performance issue. Lua will probably make things an order of magnitude easier in that regard. Furthermore, it's not about using Lua or C/C++, we can use both; the level of interoperability that Lua has with C (especially with LuaJIT) allows to implement in lower level languages the things that require low-level optimizations.

Using only C as the basis to make anything just because of performance concerns is probably nothing more than an irrelevant optimization. There are probably more advantages in using only C because of its ubiquity and proximity to the machine/OS, e.g. the Linux kernel.
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: Optimization Stuff

Post by Xii »

4vZEROv wrote: Sat Jan 02, 2021 11:06 am For you what is an example of a reasonably scaled game ?
Something with multiple entities pathfinding on a large map, for example. Complex computation being done continuously. I guess Pacman is the minimal example to qualify, but even that's stretching.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Optimization Stuff

Post by zorg »

Xii wrote: Sun Jan 03, 2021 2:27 am
4vZEROv wrote: Sat Jan 02, 2021 11:06 am For you what is an example of a reasonably scaled game ?
Something with multiple entities pathfinding on a large map, for example. Complex computation being done continuously. I guess Pacman is the minimal example to qualify, but even that's stretching.
By that metric, Valve's Portal is not a reasonably (large) scale(d) game :3 Unless you start including graphical transforms and shaders, which Bytepath does do as well, regardless of the "core gameplay" being an asteroids clone.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Nelvin
Party member
Posts: 124
Joined: Mon Sep 12, 2016 7:52 am
Location: Germany

Re: Optimization Stuff

Post by Nelvin »

Xii wrote: Sun Jan 03, 2021 2:27 am
4vZEROv wrote: Sat Jan 02, 2021 11:06 am For you what is an example of a reasonably scaled game ?
Something with multiple entities pathfinding on a large map, for example. Complex computation being done continuously. I guess Pacman is the minimal example to qualify, but even that's stretching.
I'm working on a city builder in the style of the impressions classics (Pharaoh, Caesar ...), I can support reasonably big maps and have hundreds, maybe thousands of active objects already. I implement optimized code from the get go where I know it's going to be mandatory anyway but I also have some ridiculously unoptimzied and still heavily used code like the rendering of every single image (sprite, tile, text glyph etc.) which I know I can easily make twice as fast as it is - I just haven't decided on a final rendering system.
The game is still single threaded, I have the jit compiler turned off and yet it works surprisingly good on my system with a CPU that's almost a decade old. I don't create a lot of unneeded garbage, but I also don't stop the collector.

Todays systems are just crazy fast, you have a hard time wasting all that power with simple games done 35 years ago on homecomputers 3-5 orders of magnitudes less powerful than what we use today. Heck I'd say, given the general required skills and content production capacity as available, you should be able to make a game like Skyrim with Löve these days.
User avatar
Xii
Party member
Posts: 137
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: Optimization Stuff

Post by Xii »

Nelvin wrote: Sun Jan 03, 2021 9:57 am I'm working on a city builder in the style of the impressions classics (Pharaoh, Caesar ...), I can support reasonably big maps and have hundreds, maybe thousands of active objects already.
Sounds promising. Can you say exactly how big your maps are, in terms of tiles/cells? Are you maintaining a solid 60 fps?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 49 guests