SquareWorld 0.8

Show off your games, demos and other (playable) creations.
User avatar
Luke100000
Party member
Posts: 232
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

SquareWorld 0.8

Post by Luke100000 »

Hey,
Finally I can showcase my newest game, SquareWorld, a 2D sandbox game. It is the biggest game I've ever made and I am quite proud of it, even if the performance made a lot of trouble (previous text moved into a quote on the bottom).
It might become the first game I try to sell (on itch.io), so it must be further improved. But since I use an own launcher and downloader, a lot of complex shaders and an extreme VRAM intensive rendering sytem I am sure it will crash on some systems. So I want to ask you, if you could take a look on SquareWorld and tell me, if the a) game launches b) water is displayed and c) if the game crashes at some point.
If a error occurs somewhat like "Out of VRAM" or the game just quits, try to decrease settings in the main-menu options. Thanks for reading this :)

Controls: WASD movement, mouse to dig/build, E inventory, R recipe book, T achievements/tutorial tree, Q throw item away
To prevent dying, hide instantly after spawning.
If you spawn in the earth, press CTRL + 9 and then T to teleport (it will open the achievement tree too, will be fixed soon)

Download the installer here (Windows only, for now) (extract the zip and launch Lovum.exe, create yourself an account, select SquareWorld on the left and press Install)
https://www.dropbox.com/s/cdlnlsaaybxi8 ... m.zip?dl=0

Universal .love installer is causing trouble, see last post for more info.
screenshot 3.JPG
screenshot 3.JPG (77.23 KiB) Viewed 8536 times
Screenshot 2.JPG
Screenshot 2.JPG (67.75 KiB) Viewed 8536 times
Screenshot 1.JPG
Screenshot 1.JPG (86.82 KiB) Viewed 8536 times
Old topic:
Squareworld is a 2D sandbox game in a very early alpha phase. And it has a very big problem: it is slow. The rendering is mainly based on canvases and shaders (to transfer material data between canvases) which gives the game a huge range of graphical possibilities (reflections, bloom, leaves waving, different surfaces when smoothing the edges of blocks, ...), but also decreases it's performamce dramatically. Sadly I programmed the game on my mid-end PC, where the game works fine and then tested it on different PCs. The result: out of VRAM, lags, not supported canvas format and more. I will need to recreate the entirely drawing-section of my game, but before I start removing everything which is not important I want to ask you, how I should do the drawing of the scene? Currently I render everything once per chunk (64² tiles) on a few canvases (different layers + materials) which leads to intensive canvases usage. Is it a good idea to mainly use canvases? Are there other ways, like spritebatches? Have you experience with similar games? I attached the latest version of the game and a screenshot to show what results I want (EDIT: removed screenshot since the case is fixed). The game may crash.
https://www.dropbox.com/s/t2eqbah85jcia ... .love?dl=0
Last edited by Luke100000 on Mon May 08, 2017 3:51 pm, edited 6 times in total.
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: SquareWorld

Post by 4aiman »

Code: Select all

Error

states/load/loadClient.lua:16: module 'libs/LibCompress' not found:
no field package.preload['libs/LibCompress']
no 'libs/LibCompress' in LOVE game directories.
no file 'libs/LibCompress.so' in LOVE paths.
no file './libs/LibCompress.lua'
no file '/usr/local/share/luajit-2.1.0-beta2/libs/LibCompress.lua'
no file '/usr/local/share/lua/5.1/libs/LibCompress.lua'
no file '/usr/local/share/lua/5.1/libs/LibCompress/init.lua'
no file './libs/LibCompress.so'
no file '/usr/local/lib/lua/5.1/libs/LibCompress.so'
no file '/usr/local/lib/lua/5.1/loadall.so'


Traceback

[C]: in function 'require'
states/load/loadClient.lua:16: in main chunk
[C]: in function 'require'
main.lua:5: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
Are you on Windows?
Please, pay attention to the case of filenames. That is important.
User avatar
Luke100000
Party member
Posts: 232
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: SquareWorld

Post by Luke100000 »

4aiman wrote: Fri Feb 17, 2017 6:42 pm

Code: Select all

Error

states/load/loadClient.lua:16: module 'libs/LibCompress' not found:
no field package.preload['libs/LibCompress']
no 'libs/LibCompress' in LOVE game directories.
no file 'libs/LibCompress.so' in LOVE paths.
no file './libs/LibCompress.lua'
no file '/usr/local/share/luajit-2.1.0-beta2/libs/LibCompress.lua'
no file '/usr/local/share/lua/5.1/libs/LibCompress.lua'
no file '/usr/local/share/lua/5.1/libs/LibCompress/init.lua'
no file './libs/LibCompress.so'
no file '/usr/local/lib/lua/5.1/libs/LibCompress.so'
no file '/usr/local/lib/lua/5.1/loadall.so'


Traceback

[C]: in function 'require'
states/load/loadClient.lua:16: in main chunk
[C]: in function 'require'
main.lua:5: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
Are you on Windows?
Please, pay attention to the case of filenames. That is important.
Sorry for that, it should be fixed now.
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: SquareWorld

Post by 4aiman »

Code: Select all

Error

cannot open generator/generate.lua: No such file or directory


Traceback

[C]: in function 'dofile'
generator/generator.lua:6: in main chunk
[C]: in function 'require'
states/load/loadClient.lua:24: in main chunk
[C]: in function 'require'
main.lua:5: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
User avatar
Luke100000
Party member
Posts: 232
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: SquareWorld

Post by Luke100000 »

4aiman wrote: Fri Feb 17, 2017 7:25 pm

Code: Select all

Error

cannot open generator/generate.lua: No such file or directory


Traceback

[C]: in function 'dofile'
generator/generator.lua:6: in main chunk
[C]: in function 'require'
states/load/loadClient.lua:24: in main chunk
[C]: in function 'require'
main.lua:5: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
Whatever I am trying to do today, it fails :(
https://www.dropbox.com/s/t2eqbah85jcia ... .love?dl=0
Thanks for helping me.
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: SquareWorld

Post by 4aiman »

You're welcome ^_^

Code: Select all

Error

Cannot link shader program object:
Fragment info
-------------
Internal error: assembly compile error for fragment shader at offset 1553:
-- error message --
line 46, column 35:  error: invalid local parameter number
line 55, column 35:  error: out of bounds array access
line 56, column 37:  error: out of bounds array access
line 66, column 24:  error: out of bounds array access
line 68, column 15:  error: out of bounds array access
line 74, column 19:  error: out of bounds array access
line 75, column 19:  error: out of bounds array access
line 136, column 25:  error: offset for relative array access outside supported range
line 137, column 15:  error: out of bounds array access
line 139, column 19:  error: out of bounds array access
line 147, column 25:  error: offset for relative array access outside supported range
line 157, column 27:  error: offset for relative array access outside supported range
-- internal assembly text --
!!NVfp5.0
OPTION ARB_draw_buffers;
# cgc version 3.4.0001, build date Jan 13 2016
# command line args: 
#vendor NVIDIA Corporation
#version 3.4.0.1
#profile gp5fp
#program main
#semantic _tex0_
#semantic love_ScreenSize
#semantic love_VideoYChannel
#semantic love_VideoCbChannel
#semantic love_VideoCrChannel
#semantic time
#semantic size
#semantic cx
#semantic liquidRenderLimit
#semantic liquidCanvas
#semantic liquidTextures
#semantic noise
#semantic data_data
#semantic data_colors
#semantic data_animSpeed
#semantic data_texture
#var float4 gl_FragCoord : $vin.WPOS :  : -1 : 0
#var float4 gl_FragData[0] : $vout.COL00 : COL0[0] : -1 : 1
#var float4 VaryingTexCoord : $vin.ATTR0 : ATTR0 : -1 : 1
#var float4 VaryingColor :  :  : -1 : 0
#var sampler2D _tex0_ :  :  : -1 : 0
#var float4 love_ScreenSize :  :  : -1 : 0
#var sampler2D love_VideoYChannel :  :  : -1 : 0
#var sampler2D love_VideoCbChannel :  :  : -1 : 0
#var sampler2D love_VideoCrChannel :  :  : -1 : 0
#var float time :  : c[512] : -1 : 1
#var float size :  : c[513] : -1 : 1
#var int cx :  : c[514] : -1 : 1
#var int liquidRenderLimit :  : c[515] : -1 : 1
#var sampler2D liquidCanvas :  : texunit 0 : -1 : 1
#var sampler2D liquidTextures :  : texunit 2 : -1 : 1
#var sampler2D noise :  : texunit 1 : -1 : 1
#var float4 data_data[0] :  : c[0] : -1 : 1
#var float4 data_colors[0] :  : c[128] : -1 : 1
#var float data_animSpeed[0] :  : c[256] : -1 : 1
#var int data_texture[0] :  : c[384] : -1 : 1
#var <none>4 $kill_0000 : $vout.$kill : $kill : -1 : 0
PARAM c[516] = { program.local[0..515] };
ATTRIB fragment_attrib[] = { fragment.attrib[0..0] };
TEMP R0, R1, R2, R3, R4, R5;
TEMP RC, HC;
OUTPUT result_color0 = result.color;
OUTPUT result_color1 = result.color[1];
TEXTURE texture0 = texture[0];
TEXTURE texture1 = texture[1];
TEXTURE texture2 = texture[2];
MUL.F R3.x, fragment.attrib[0], c[513];
MAD.F R0.x, fragment.attrib[0].y, c[513], {-0.015625, 0, 0, 0};
MOV.F R1, {0, 0, 0, 0}.x;
MOV.F R2, {0, 0, 0, 0}.x;
TRUNC.S R3.y, R3.x;
TRUNC.S R3.z, R0.x;
FRC.F R3.w, R3.x;
FRC.F R4.x, R0;
MOV.F R4.y, {0, 0, 0, 0}.x;
MOV.S R4.z, {0, 0, 0, 0}.x;
REP.S ;
SGE.S.CC HC.x, R4.z, c[515];
BRK   (NE.x);
I2F.S R0.z, c[515].x;
I2F.S R0.x, R3.z;
RCP.F R0.z, R0.z;
I2F.S R0.y, R4.z;
MAD.F R0.y, R0, R0.z, R0.x;
I2F.S R0.x, R3.y;
DIV.F R0.y, R0, c[513].x;
DIV.F R0.x, R0, c[513].x;
TEX.F R0, R0, texture0, 2D;
SEQ.F R4.w, R0.y, {0, 0, 0, 0}.x;
TRUNC.U.CC HC.x, R4.w;
IF    NE.x;
MOV.U.CC RC.x, {1, 0, 0, 0};
BRK   (NE.x);
ELSE;
MUL.F R4.w, R0.y, {2, 0, 0, 0}.x;
FRC.F R4.w, R4;
SGT.F R0.y, R0, {0.5, 0, 0, 0}.x;
TRUNC.U.CC HC.x, R0.y;
MUL.F R4.w, R4, {128, 0, 0, 0}.x;
ADD.F R4.y, R4, R0.x;
TRUNC.S R0.x, R4.w;
ADD.S R4.w, R0.x, -{1, 0, 0, 0}.x;
IF    NE.x;
SEQ.F R0.x, R0.z, {0, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
IF    NE.x;
RSQ.F R0.z, R4.y;
ADD.F R0.y, R4.x, {-0.5, 0, 0, 0}.x;
ADD.F R0.x, R3.w, {-0.5, 0, 0, 0};
MUL.F R0.y, |R0|, {2, 0, 0, 0}.x;
MUL.F R0.x, |R0|, {2, 0, 0, 0};
MAX.F R5.x, R0, R0.y;
RCP.F R0.z, R0.z;
MUL.F R5.y, R4, {0.40000001, 0, 0, 0}.x;
ELSE;
SLE.F R0.x, R0.z, {0.0078125, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
IF    NE.x;
MOV.F R5.x, {0, 0, 0, 0};
MOV.F R0.z, {1, 0, 0, 0}.x;
MOV.F R5.y, {0, 0, 0, 0}.x;
ELSE;
ADD.F R0.x, R3.w, {-0.5, 0, 0, 0};
RSQ.F R0.y, R4.y;
MUL.F R5.x, |R0|, {2, 0, 0, 0};
RCP.F R0.z, R0.y;
MUL.F R5.y, R4, {0.40000001, 0, 0, 0}.x;
ENDIF;
ENDIF;
ELSE;
SGT.F R0.x, R3.w, {0.5, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
ADD.F R5.x, -R4, {1, 0, 0, 0};
MUL.F R5.y, R4, {0.40000001, 0, 0, 0}.x;
IF    NE.x;
MAD.F R0.y, -R3.w, R4, R4;
ADD.F R0.x, R3.w, {-0.5, 0, 0, 0};
MAD.F R0.x, R0.w, R0, R0.y;
MUL.F R0.z, R0.x, {2, 0, 0, 0}.x;
ELSE;
ADD.F R0.x, -R3.w, {0.5, 0, 0, 0};
MUL.F R0.x, R0.z, R0;
MAD.F R0.x, R4.y, R3.w, R0;
MUL.F R0.z, R0.x, {2, 0, 0, 0}.x;
ENDIF;
ENDIF;
MOV.U R0.x, R4.w;
MUL.F R0.y, c[R0.x + 256].x, c[512].x;
I2F.S R0.x, c[514];
MUL.F R0.y, R0, {0.125, 0, 0, 0}.x;
MAD.F R0.x, R0, c[513], R3;
MUL.F R0.xy, R0, {0.015625, 0, 0, 0}.x;
TEX.F R0.x, R0, texture1, 2D;
MAD.F R0.x, -R5.y, R0, R0.z;
SLE.F R0.x, R5, R0;
TRUNC.U.CC HC.x, R0;
IF    NE.x;
MOV.U R2.x, R4.w;
ADD.S R0.x, c[R2.x + 384], -{1, 0, 0, 0};
DIV.S R0.z, R0.x, {4, 0, 0, 0}.x;
I2F.S R0.y, R0.z;
MUL.S R0.z, R0, {4, 0, 0, 0}.x;
I2F.S R0.x, R0;
I2F.S R0.z, R0;
MAD.F R0.x, R3.w, {0.25, 0, 0, 0}, R0;
MAD.F R0.y, R4.x, {0.25, 0, 0, 0}.x, R0;
ADD.F R0.x, R0, -R0.z;
TEX.F R0, R0, texture2, 2D;
MUL.F R1, R0, c[R2.x + 128];
MOV.F R2, c[R2.x];
ENDIF;
ENDIF;
ADD.S R4.z, R4, {1, 0, 0, 0}.x;
ENDREP;
SEQ.F R0.x, R1.w, {0, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
IF    NE.x;
MOV.U.CC RC.x, {1, 0, 0, 0};
KIL   NE.x;
ELSE;
MOV.F result_color0, R1;
MOV.F result_color1, R2;
ENDIF;
END
# 117 instructions, 6 R-regs



Traceback

[C]: in function 'newShader'
states/game/client/client.lua:26: in main chunk
[C]: in function 'require'
main.lua:10: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
Palit GT430 (Nvidia) + latest proprietary drivers + Debian testing x64
User avatar
Luke100000
Party member
Posts: 232
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: SquareWorld

Post by Luke100000 »

4aiman wrote: Fri Feb 17, 2017 10:06 pm You're welcome ^_^

Code: Select all

Error

Cannot link shader program object:
Fragment info
-------------
Internal error: assembly compile error for fragment shader at offset 1553:
-- error message --
line 46, column 35:  error: invalid local parameter number
line 55, column 35:  error: out of bounds array access
line 56, column 37:  error: out of bounds array access
line 66, column 24:  error: out of bounds array access
line 68, column 15:  error: out of bounds array access
line 74, column 19:  error: out of bounds array access
line 75, column 19:  error: out of bounds array access
line 136, column 25:  error: offset for relative array access outside supported range
line 137, column 15:  error: out of bounds array access
line 139, column 19:  error: out of bounds array access
line 147, column 25:  error: offset for relative array access outside supported range
line 157, column 27:  error: offset for relative array access outside supported range
-- internal assembly text --
!!NVfp5.0
OPTION ARB_draw_buffers;
# cgc version 3.4.0001, build date Jan 13 2016
# command line args: 
#vendor NVIDIA Corporation
#version 3.4.0.1
#profile gp5fp
#program main
#semantic _tex0_
#semantic love_ScreenSize
#semantic love_VideoYChannel
#semantic love_VideoCbChannel
#semantic love_VideoCrChannel
#semantic time
#semantic size
#semantic cx
#semantic liquidRenderLimit
#semantic liquidCanvas
#semantic liquidTextures
#semantic noise
#semantic data_data
#semantic data_colors
#semantic data_animSpeed
#semantic data_texture
#var float4 gl_FragCoord : $vin.WPOS :  : -1 : 0
#var float4 gl_FragData[0] : $vout.COL00 : COL0[0] : -1 : 1
#var float4 VaryingTexCoord : $vin.ATTR0 : ATTR0 : -1 : 1
#var float4 VaryingColor :  :  : -1 : 0
#var sampler2D _tex0_ :  :  : -1 : 0
#var float4 love_ScreenSize :  :  : -1 : 0
#var sampler2D love_VideoYChannel :  :  : -1 : 0
#var sampler2D love_VideoCbChannel :  :  : -1 : 0
#var sampler2D love_VideoCrChannel :  :  : -1 : 0
#var float time :  : c[512] : -1 : 1
#var float size :  : c[513] : -1 : 1
#var int cx :  : c[514] : -1 : 1
#var int liquidRenderLimit :  : c[515] : -1 : 1
#var sampler2D liquidCanvas :  : texunit 0 : -1 : 1
#var sampler2D liquidTextures :  : texunit 2 : -1 : 1
#var sampler2D noise :  : texunit 1 : -1 : 1
#var float4 data_data[0] :  : c[0] : -1 : 1
#var float4 data_colors[0] :  : c[128] : -1 : 1
#var float data_animSpeed[0] :  : c[256] : -1 : 1
#var int data_texture[0] :  : c[384] : -1 : 1
#var <none>4 $kill_0000 : $vout.$kill : $kill : -1 : 0
PARAM c[516] = { program.local[0..515] };
ATTRIB fragment_attrib[] = { fragment.attrib[0..0] };
TEMP R0, R1, R2, R3, R4, R5;
TEMP RC, HC;
OUTPUT result_color0 = result.color;
OUTPUT result_color1 = result.color[1];
TEXTURE texture0 = texture[0];
TEXTURE texture1 = texture[1];
TEXTURE texture2 = texture[2];
MUL.F R3.x, fragment.attrib[0], c[513];
MAD.F R0.x, fragment.attrib[0].y, c[513], {-0.015625, 0, 0, 0};
MOV.F R1, {0, 0, 0, 0}.x;
MOV.F R2, {0, 0, 0, 0}.x;
TRUNC.S R3.y, R3.x;
TRUNC.S R3.z, R0.x;
FRC.F R3.w, R3.x;
FRC.F R4.x, R0;
MOV.F R4.y, {0, 0, 0, 0}.x;
MOV.S R4.z, {0, 0, 0, 0}.x;
REP.S ;
SGE.S.CC HC.x, R4.z, c[515];
BRK   (NE.x);
I2F.S R0.z, c[515].x;
I2F.S R0.x, R3.z;
RCP.F R0.z, R0.z;
I2F.S R0.y, R4.z;
MAD.F R0.y, R0, R0.z, R0.x;
I2F.S R0.x, R3.y;
DIV.F R0.y, R0, c[513].x;
DIV.F R0.x, R0, c[513].x;
TEX.F R0, R0, texture0, 2D;
SEQ.F R4.w, R0.y, {0, 0, 0, 0}.x;
TRUNC.U.CC HC.x, R4.w;
IF    NE.x;
MOV.U.CC RC.x, {1, 0, 0, 0};
BRK   (NE.x);
ELSE;
MUL.F R4.w, R0.y, {2, 0, 0, 0}.x;
FRC.F R4.w, R4;
SGT.F R0.y, R0, {0.5, 0, 0, 0}.x;
TRUNC.U.CC HC.x, R0.y;
MUL.F R4.w, R4, {128, 0, 0, 0}.x;
ADD.F R4.y, R4, R0.x;
TRUNC.S R0.x, R4.w;
ADD.S R4.w, R0.x, -{1, 0, 0, 0}.x;
IF    NE.x;
SEQ.F R0.x, R0.z, {0, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
IF    NE.x;
RSQ.F R0.z, R4.y;
ADD.F R0.y, R4.x, {-0.5, 0, 0, 0}.x;
ADD.F R0.x, R3.w, {-0.5, 0, 0, 0};
MUL.F R0.y, |R0|, {2, 0, 0, 0}.x;
MUL.F R0.x, |R0|, {2, 0, 0, 0};
MAX.F R5.x, R0, R0.y;
RCP.F R0.z, R0.z;
MUL.F R5.y, R4, {0.40000001, 0, 0, 0}.x;
ELSE;
SLE.F R0.x, R0.z, {0.0078125, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
IF    NE.x;
MOV.F R5.x, {0, 0, 0, 0};
MOV.F R0.z, {1, 0, 0, 0}.x;
MOV.F R5.y, {0, 0, 0, 0}.x;
ELSE;
ADD.F R0.x, R3.w, {-0.5, 0, 0, 0};
RSQ.F R0.y, R4.y;
MUL.F R5.x, |R0|, {2, 0, 0, 0};
RCP.F R0.z, R0.y;
MUL.F R5.y, R4, {0.40000001, 0, 0, 0}.x;
ENDIF;
ENDIF;
ELSE;
SGT.F R0.x, R3.w, {0.5, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
ADD.F R5.x, -R4, {1, 0, 0, 0};
MUL.F R5.y, R4, {0.40000001, 0, 0, 0}.x;
IF    NE.x;
MAD.F R0.y, -R3.w, R4, R4;
ADD.F R0.x, R3.w, {-0.5, 0, 0, 0};
MAD.F R0.x, R0.w, R0, R0.y;
MUL.F R0.z, R0.x, {2, 0, 0, 0}.x;
ELSE;
ADD.F R0.x, -R3.w, {0.5, 0, 0, 0};
MUL.F R0.x, R0.z, R0;
MAD.F R0.x, R4.y, R3.w, R0;
MUL.F R0.z, R0.x, {2, 0, 0, 0}.x;
ENDIF;
ENDIF;
MOV.U R0.x, R4.w;
MUL.F R0.y, c[R0.x + 256].x, c[512].x;
I2F.S R0.x, c[514];
MUL.F R0.y, R0, {0.125, 0, 0, 0}.x;
MAD.F R0.x, R0, c[513], R3;
MUL.F R0.xy, R0, {0.015625, 0, 0, 0}.x;
TEX.F R0.x, R0, texture1, 2D;
MAD.F R0.x, -R5.y, R0, R0.z;
SLE.F R0.x, R5, R0;
TRUNC.U.CC HC.x, R0;
IF    NE.x;
MOV.U R2.x, R4.w;
ADD.S R0.x, c[R2.x + 384], -{1, 0, 0, 0};
DIV.S R0.z, R0.x, {4, 0, 0, 0}.x;
I2F.S R0.y, R0.z;
MUL.S R0.z, R0, {4, 0, 0, 0}.x;
I2F.S R0.x, R0;
I2F.S R0.z, R0;
MAD.F R0.x, R3.w, {0.25, 0, 0, 0}, R0;
MAD.F R0.y, R4.x, {0.25, 0, 0, 0}.x, R0;
ADD.F R0.x, R0, -R0.z;
TEX.F R0, R0, texture2, 2D;
MUL.F R1, R0, c[R2.x + 128];
MOV.F R2, c[R2.x];
ENDIF;
ENDIF;
ADD.S R4.z, R4, {1, 0, 0, 0}.x;
ENDREP;
SEQ.F R0.x, R1.w, {0, 0, 0, 0};
TRUNC.U.CC HC.x, R0;
IF    NE.x;
MOV.U.CC RC.x, {1, 0, 0, 0};
KIL   NE.x;
ELSE;
MOV.F result_color0, R1;
MOV.F result_color1, R2;
ENDIF;
END
# 117 instructions, 6 R-regs



Traceback

[C]: in function 'newShader'
states/game/client/client.lua:26: in main chunk
[C]: in function 'require'
main.lua:10: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
Palit GT430 (Nvidia) + latest proprietary drivers + Debian testing x64
I am going to simplify a lot of things, including this shader. But the part crashing in it is essential and I do not know why this error happens.
the shader receives a small canvas texture containing several (in future one) pixel per block which describes the liquids in my game (animation, shape, amount). Here is the raw code.

Code: Select all

//final render of liquids
//used in the final render engine

extern float time;
extern float size;
extern int cx;
extern int liquidRenderLimit;

extern Image liquidCanvas;
extern Image liquidTextures;
extern Image noise;

extern vec4 data_data[128]; 
extern vec4 data_colors[128]; 
extern float data_animSpeed[128];
extern int data_texture[128];

void effects(vec4 c, Image tex, vec2 tc, vec2 sc) {
	float rx = tc[0]*size;
	float ry = tc[1]*size - 0.5/32.0;
	int x = int(rx);
	int y = int(ry);
	float fx = fract(rx);
	float fy = fract(ry);
	
	vec4 color = vec4(0, 0, 0, 0);
	vec4 data = vec4(0, 0, 0, 0);
	
	float amount = 0;
	
	for (int i = 0; i < liquidRenderLimit; i++) {
		vec4 liquid = Texel(liquidCanvas, vec2(x/size, (y+float(i)/liquidRenderLimit)/size));
		if (liquid[1] == 0) {
			break;
		} else {
			amount = amount + liquid[0];
			int typ = int(fract(liquid[1]*2)*128)-1;
			float dist;
			float waveSize;
			float waveHeight;
			if (liquid[1] > 0.5) {
				if (liquid[2] == 0) {
					//cube
					dist = max(abs(fx-0.5)*2, abs(fy-0.5)*2);
					waveSize = sqrt(amount);
					waveHeight = amount*0.4;
				} else if (liquid[2] <= 1/128.0) {
					//full cube
					dist = 0;
					waveSize = 1;
					waveHeight = 0;
				} else {
					//waterfall
					dist = abs(fx-0.5)*2;
					waveSize = sqrt(amount);
					waveHeight = amount*0.4;
				}
			} else {
				//simple water
				dist = 1-fy;
				waveSize = amount;
				waveHeight = amount*0.4;
				if (fx > 0.5) {
					waveSize = waveSize * (1-fx)*2 + liquid[3]*(fx-0.5)*2;
				} else {
					waveSize = waveSize * fx*2 + liquid[2]*(0.5-fx)*2;
				}
			}
			if (dist <= waveSize - waveHeight * Texel(noise, vec2(cx*size+rx, time*data_animSpeed[typ]/8)/64).r) {
				int ty = int((data_texture[typ]-1)/4);
				color = Texel(liquidTextures, vec2(fx/4+(data_texture[typ]-1)-ty*4, fy/4+ty)) * data_colors[typ];
				data = data_data[typ];
			}
		}
	}
	
	if (color.a == 0) {
		discard;
	} else {
		love_Canvases[0] = color;
		love_Canvases[1] = data;
	}
}
As much as I know the limit of 128 different types sent via shader:send can't be exceeded.

Furthermore I came to the decision that changing the entirely drawing system is unhelpful and I want to remove as much features as possible, without destroying the base concepts of it. I calculated the minimum amount of needed canvases:
128 of 512*512 canvases
128 of 16*16 canvases
16 of 64*64 canvases
As I saw that some computers can't handle too big amount of canvases I want to ask before I try it: is this a acceptable amount?
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: SquareWorld

Post by 4aiman »

Are you "okay" to show your PC (video card) specs/name?

P.S.
I'm no guru, but changing

Code: Select all

extern vec4 data_data[128]
to

Code: Select all

extern vec4 data_data[124]
worked like a charm for me.
User avatar
Luke100000
Party member
Posts: 232
Joined: Mon Jul 22, 2013 9:17 am
Location: Austria
Contact:

Re: SquareWorld

Post by Luke100000 »

4aiman wrote: Sat Feb 18, 2017 3:30 pm Are you "okay" to show your PC (video card) specs/name?

P.S.
I'm no guru, but changing

Code: Select all

extern vec4 data_data[128]
to

Code: Select all

extern vec4 data_data[124]
worked like a charm for me.
Windows 7 64bit SP1
GPU: Geforce GT 640 Synergy

Changing this value is no problem for me because the limit of 128 different liquids will never be reached, but it is still strange. Is there a limit of variables a shader can contain?
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: SquareWorld

Post by 4aiman »

I think that depends on a driver.
According to this, my very old VCard have only 96 Shader processing units against over 350 in yours. Maybe driver for Linux compensates for some amount (or maybe my VCard is just a downgraded one). I'm no expert in HW.
I'll be able to test the game on Win10 x64 and tell you if it will run there w/o changes.
Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests