Love2dCS

Discuss any ports of LÖVE to different platforms.
User avatar
endlesstravel
Prole
Posts: 12
Joined: Fri Apr 01, 2016 10:38 am

Re: Love2dCS

Post by endlesstravel » Mon Dec 18, 2017 5:26 am

Remixful wrote:
Mon Dec 11, 2017 4:21 pm
Will it possible to reference external Love2D libraries?
Sorry, I do not quite understand what it means. Can be described in more detail? :death:
- Is life always this hard,or is it just when you're a kid?
- Always like this.

User avatar
Davidobot
Party member
Posts: 1181
Joined: Sat Mar 31, 2012 5:18 am
Location: Cambridge, UK
Contact:

Re: Love2dCS

Post by Davidobot » Thu Jan 02, 2020 9:58 am

Hey! I've just looked up this wrapper again and saw that a lot of progress has been made! Great work - I've been really put off using LÖVE due to Lua but this might actually draw me back.

How's performance look? Are there any benchmarks?
My projects: Raycaster, love.js v11.3 port
itch page: link
My website: link
My library: LovelyMoon

User avatar
churros
Prole
Posts: 11
Joined: Mon Dec 16, 2019 2:28 pm

Re: Love2dCS

Post by churros » Fri Jan 03, 2020 4:20 pm

Is this .NET → SDL with a 'LÖVE-like' API or is it actually .NET → LÖVE → SDL?
I wonder about the performance hit considering the latter option.

Anyway, kudos for the repository, looks well maintained.
English is not my first language, apologies in advance. :oops:

User avatar
endlesstravel
Prole
Posts: 12
Joined: Fri Apr 01, 2016 10:38 am

Re: Love2dCS

Post by endlesstravel » Wed Jan 08, 2020 12:32 pm

Davidobot wrote:
Thu Jan 02, 2020 9:58 am
Hey! I've just looked up this wrapper again and saw that a lot of progress has been made! Great work - I've been really put off using LÖVE due to Lua but this might actually draw me back.

How's performance look? Are there any benchmarks?
Thank you for your appreciation
100k for draw circle, both get 12fps:
C#:

Code: Select all

        for (int i = 0; i < 1000 * 100; i++)
        {
            var  x = Mathf.Random() * 800;
            var  y = Mathf.Random() * 600;
            var  r = Mathf.Random() * 30 + 1;
            var c = Mathf.Random();
            Graphics.SetColor(c, c, c);
            Graphics.Circle(DrawMode.Fill, x, y, r);
        }
  
lua_t.png
lua_t.png (2.63 KiB) Viewed 10708 times
lua:

Code: Select all

    for i=0, 1000 * 100 do
        x = love.math.random() * 800
        y = love.math.random() * 600
        r = love.math.random() * 30 + 1
        c = love.math.random()
        love.graphics.setColor(c, c, c)
        love.graphics.circle("fill", x, y, r)
    end
  
But it's just a simple test, and I'm not sure what happens in other situations.



------ update ----
this optimized version lua code for 15-16 fps:

Code: Select all

    lmr = love.math.random
    lgs = love.graphics.setColor
    lgc = love.graphics.circle
    for i=0, 1000 * 100 do
        x = lmr() * 800
        y = lmr() * 600
        r = lmr() * 30 + 1
        c = lmr()
        lgs(c, c, c)
        lgc("fill", x, y, r)
    end
    
- Is life always this hard,or is it just when you're a kid?
- Always like this.

User avatar
endlesstravel
Prole
Posts: 12
Joined: Fri Apr 01, 2016 10:38 am

Re: Love2dCS

Post by endlesstravel » Wed Jan 08, 2020 12:39 pm

churros wrote:
Fri Jan 03, 2020 4:20 pm
Is this .NET → SDL with a 'LÖVE-like' API or is it actually .NET → LÖVE → SDL?
I wonder about the performance hit considering the latter option.

Anyway, kudos for the repository, looks well maintained.
Thank you for your appreciatio !
it was `.NET → LÖVE → SDL?`
And i agree with you, I think it does have a performance loss
- Is life always this hard,or is it just when you're a kid?
- Always like this.

User avatar
Stifu
Citizen
Posts: 93
Joined: Mon Mar 14, 2016 9:53 am
Contact:

Re: Love2dCS

Post by Stifu » Thu Jan 09, 2020 9:27 pm

If only the .NET → LÖVE part could be done in an AOT fashion, there would be no performance loss. Anyway, nice work.
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com

User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Love2dCS

Post by raidho36 » Sat Jan 18, 2020 1:46 pm

It's not a good benchmark because it basically just tests the rendering engine. To test language performance, you should for example implement a loop that adds together vectors using their class methods. As far as I know, C# doesn't have JIT compiler in it (but there's an ongoing effort) so it will not be nearly as fast as LuaJIT will do.

User avatar
Stifu
Citizen
Posts: 93
Joined: Mon Mar 14, 2016 9:53 am
Contact:

Re: Love2dCS

Post by Stifu » Sat Jan 18, 2020 2:26 pm

raidho36 wrote:
Sat Jan 18, 2020 1:46 pm
As far as I know, C# doesn't have JIT compiler in it (but there's an ongoing effort) so it will not be nearly as fast as LuaJIT will do.
What do you mean? .NET has used JIT since almost the very beginning.
Zabuyaki, our upcoming beat 'em up: https://www.zabuyaki.com

User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Love2dCS

Post by raidho36 » Sun Jan 19, 2020 9:22 am

From what I gather it's not an actual proper JIT (it generates some machine code but for the most part it just does nothing), and the entire AOT thing is just a bytecode generator. CoreRT is an ongoing development of a proper JIT for C# and Unity is working on it's own solution called Burst Compiler, as a part of it's DOTS evolution. In due time we might see C# supercede LuaJIT but I don't hold my breath (even LLVM is very far from beating hand crafted assembly).

Post Reply

Who is online

Users browsing this forum: No registered users and 63 guests