performance too LOW!

General discussion about LÖVE, Lua, game development, puns, and unicorns.
zzz654321
Prole
Posts: 4
Joined: Thu Jul 31, 2014 9:28 am

performance too LOW!

Post by zzz654321 »

love2s VS cocos2dx-lua, performance is too low!

What method can solve this problem?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: performance too LOW!

Post by kikito »

Without looking at your code, it is impossible to tell.
When I write def I mean function.
User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: performance too LOW!

Post by arampl »

Hmph. I even don't bother. If I'm after performance only, I'd use machine codes.

"For each Colonel there's General".
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: performance too LOW!

Post by T-Bone »

Löve's performance really depends on what you're trying to do. My experience is that Löve is fast enough to run more or less any 2D game even on crappy netbooks, as long as you code it right. It sounds to me like you're doing something stupid that's destroying your performance.

Or maybe you're running it on a Windows machine with poor OpenGL drivers?
zzz654321
Prole
Posts: 4
Joined: Thu Jul 31, 2014 9:28 am

Re: performance too LOW!

Post by zzz654321 »

I under android and windows 2003

love2d project: 5000 triangle, ontimer move all triangle
cocos2dx-lua 2.2.5 project: 5000 polygon, animation.

love2d FPS is low.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: performance too LOW!

Post by micha »

Some time ago, I read an article about a performance comparison of LÖVE with some other game frameworks, and LÖVE performed slowest among the tested ones. Unfortunately, I don't have the link to the article at hand.

But the important question is: Is the performance only lower than in other frameworks, or it is "too low"? Have you actually tried to make a game and failed because of LÖVE's performance? Or did you just do a test and find that the framerate is lower and in Cocos2d? Because, if LÖVE is slower than other, but still fast enough, then there is no problem.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: performance too LOW!

Post by kikito »

zzz654321 wrote:I under android and windows 2003

love2d project: 5000 triangle, ontimer move all triangle
cocos2dx-lua 2.2.5 project: 5000 polygon, animation.

love2d FPS is low.
Do you need that many polygons in your game? Can we see the code you used?
When I write def I mean function.
zzz654321
Prole
Posts: 4
Joined: Thu Jul 31, 2014 9:28 am

Re: performance too LOW!

Post by zzz654321 »

function love.mousereleased(x, y, btn )
for i= 1, 1000 do
--设置 x, y, 角度
table.insert(env_.items, { env_.width* math.random(),
env_.height* math.random(),
2* math.pi* math.random(),
} )
end
env_.MAX_ITEM= env_.MAX_ITEM+ 1000
end



function love.draw() -- GPU 计算
-- 2 关闭shader,矩形为默认效果
local w_= env_.width- env_.border* 2
local h_= (env_.height- env_.border* 3 )/ 2

love.graphics.setShader()
love.graphics.setColor(255, 255, 255 )
env_.xy(env_.border, env_.border )
love.graphics.rectangle('fill', 0, 0, w_, h_ )
love.graphics.pop()

-- 2 加载effect shader,矩形效果绚丽
if env_.effect then love.graphics.setShader(env_.effect ) end
env_.xy(env_.border, h_+ env_.border* 2 )
love.graphics.rectangle('fill', 0, 0, w_, h_ )
love.graphics.pop()

love.graphics.setShader() local j local strZH_CN_t1= ""
for i= 1, env_.MAX_ITEM do
env_.xy(env_.items[1 ], env_.items[2 ] )
j= env_.items[3 ] love.graphics.rotate(j )
j= 256* j/ (2* math.pi )
love.graphics.translate(env_.t* 16, 0 )
love.graphics.setColor(j, 256- j, env_.tick )
love.graphics.polygon("fill", env_.polygon )
love.graphics.pop()
end

if canvas then
love.graphics.setBlendMode('premultiplied' )
love.graphics.draw(canvas )
love.graphics.setBlendMode('alpha' )
end

if iconv then strZH_CN_t1= iconv("\n唉唉唉" ) end

env_.font28:setLineHeight(0.7 )
love.graphics.setFont(env_.font28 )
love.graphics.setColor(255, 0, 0 )
love.graphics.printf(string.format("%06d\n[%s]%s",
env_.tick, out_t1(), strZH_CN_t1 ),
220, 120, 300, nil, 0, 1 ) -- env_.t, 2 ) --
--love.graphics.setFont(env_.font28 )
--love.graphics.setColor(0, env_.tick, 0 )
--love.graphics.printf(
--string.format("%06d%s%s", env_.tick, strZH_CN_t1 ),
--220, 180, 200, nil, env_.t, 1 )

end
Attachments
cocos2dx-lua-2.2.5-benchmark.zip
(223.18 KiB) Downloaded 320 times
testProj.zip
(12.18 KiB) Downloaded 300 times
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: performance too LOW!

Post by I~=Spam »

kikito wrote:Do you need that many polygons in your game?
Yeah... exactly my same thoughts... real world tests are a better way to test any program. Unless you really need to render a few thousand triangles for your game... What features do you need to be fast?
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: performance too LOW!

Post by adrix89 »

The answer is probably spritebatches.
I use Workflowy but you can check out Dynalist as its the better offer.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests