Help implementing game logic from fish fillets

General discussion about LÖVE, Lua, game development, puns, and unicorns.
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

State of development:

There is a website: https://glitchapp.github.io/luasokweb/

- The game is playable till level 12!

- Level menu created: You can select level and options without the keyboard.
levelselection.png
levelselection.png (29.31 KiB) Viewed 5351 times
- Options menu created: Many options can be selected now with mouse or touch screens:

- Shaders can be enabled and disabled individualy
- Dialogs can be enabled or disabled
- Language can be selected
- Touch controls can be enabled or disabled.

- The game is playable on touch and low power devices (raspberry pi, tablets, mobile phones): Almost every option can be selected with touch controls:
options.png
options.png (3.13 KiB) Viewed 5351 times
There is a special repository for touch and low power devices because the full featured game features a 3d engine that does not work on android and many other files are unused and unnecessary. The size of lighter version of the game is just 410kb, 7,14% of the full game which is at this time 5,6Mb.

Bugs solved:
Second shader can be turn on and off now.

What is not finished:

Function that detect that the level is solved (you can select and change the level by yourself by now)
15% of the levels are done (12 out of 80)
Dialogs
Game rules:
Small fish die when standing under heavy objects
Objects can't be pushed if nothing supports them on next position
Objects with an exit flag that once touched sets fish free and function that check if level is solved and save it.

Assets:

Graphics:
There are almost no assets for the game yet excepting the touch controls and the fish.
The full featured game will have 3d graphics, therefore both 2d and 3d assets can be submitted. I will select the best ones once received.

What kind of assets I‘m looking for?

I would like to have assets to recreate the backgrounds in 3d. The backgrounds contains many underwater elements like flora and fauna but there’s also many objects and arquitecture in it.

Please check this two amazing artworks as an amazing example of beautiful 3d underwater scenes full of flora and fauna:

https://blenderartists.org/t/underwater-castle/1355024
https://blenderartists.org/t/underwater ... on/1356511

I would like assets for every object in the game (I‘m creating an inventory of every object in the game) aswell as every background.

I’m not only interested in complete / finished work but I’m also looking forward for sketches,assets and post processing tips and ideas. If you can give me tips on what is the best way to recreate old 2d artwork into 3d, create underwater caustic effects in blender or through dynamic post processing shaders in realtime (like godsray effect, fog etc)

The developer of the 3d engine is working on a caustics effects for the engine. Together with green/blue fog and a bit of distortion an underwater effect should be possible and look convincing.
This is the 3d engine: https://github.com/3dreamengine/3DreamEngine

I also tested succesfully the render of the tiles with 3d objects so the tiles can also be made in 3d:
3dtiles.png
3dtiles.png (71.52 KiB) Viewed 5346 times
Sound and music:
There is also no sound assets and no music yet.

What I would like to have regarding the sounds:

I would like to resolve the following problem:

Creating a characteristic and recognizable sound for every object when being pushed and falling down considering the following attributes:

- material
- weight
- floor material (for friction when pushing, for impact when falling)
- amount of cells falling

Considering that everything is underwater the sounds needs to be filtered to be convincing.

Music:

Extracting the songs to midi or any format that can be used to improve the instruments, arrangements or compose over it.
If there are no sources for the songs create them with properly software (for example with sonic visualizer)
Create new tracks


Does this sounds too ambitious? I know! I‘m just pointing to the moon to see if I even manage to get half of the way and do half of the things I want to do with the game. Even if none of that is achieved the game is currently playable on desktops and mobiles so I‘m currently happy with that!

Thanks for reading!
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

I just wanted to show what the 3d engine is capable of, the assets are not mine, are free assets from sketchfab and the textures are not even properly loaded so the results should be even better once done right:
testgif.gif
testgif.gif (1.76 MiB) Viewed 5310 times
testgif2.gif
testgif2.gif (652.47 KiB) Viewed 5310 times
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

Hello, I hope I'm not annoying anyone with so much posts but development is moving so fast and I'm changing so many things that I think it worth posting and informing about it.

First the game can be now played with 3d and 2d graphics just as I wanted and planned from the beginning, that's the biggest milestone till now.

Secondly, the game has become an experimentation field as I like to do with my games so you have a lot of graphical options now that you can combine to play with fancy effects (who doesn't like tweaking options to see a game differently?) There are so many combinations that I just captured 4 of them to show you:
effectsff.jpg
effectsff.jpg (326.56 KiB) Viewed 5151 times
Feel free to experiment with them, pressing key "h" you'll see all the keys assigned to switch them on and off.

other minor news are : gamepad support, an experimental background and possible level editor, 12 levels currently playable in 2d and 3d, a diorama asset added to enhance effects (external assets see credits for more info)

hopefully there will be caustic effects in the future, that's a cutting edge feature that will be implemented in the 3d engine that would eventually make graphics even more beautiful and immersive.

I hope you like it and feel free to give me feedback on how the game is looking and thanks for reading!
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Help implementing game logic from fish fillets

Post by darkfrei »

Maybe such color scheme will be better.
Attachments
effectsff-a.png
effectsff-a.png (174.25 KiB) Viewed 5143 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

darkfrei wrote: Sun Feb 27, 2022 11:46 am Maybe such color scheme will be better.
Hello Darkfrei! that color scheme is the default one for 2d graphics and remains, what you see above is a kind of "high contrast color scheme" that show graphics like you see on thermal goggles effect in many games... just one extra options to play with it, but don't worry the original colors remain!

well I mean the colors for the cells, if you want send me the colors you used for the objects and I can add an options to play with the palette or select color schemes, I added so much options that I'm going to run out of keys so I will have add them to the options menu in the future.
User avatar
Gunroar:Cannon()
Party member
Posts: 1143
Joined: Thu Dec 10, 2020 1:57 am

Re: Help implementing game logic from fish fillets

Post by Gunroar:Cannon() »

Wow, good progress.Nice work. :)
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

Gunroar:Cannon() wrote: Sun Feb 27, 2022 2:24 pm Wow, good progress.Nice work. :)
Thank you!

Colors, colors, colors!
colorschemes.jpg
colorschemes.jpg (488.42 KiB) Viewed 4950 times
can you identify to which old system those palettes belongs?
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

I'm stucked with this problem:

I'm trying to be able to render the map in 3d, the problem is, it's imposible to write cubes inside the map function below because the following error appears:
error.png
error.png (26.42 KiB) Viewed 4756 times

Code: Select all

function pb:drawMap ()
	local map = self.map
	local tileSize = self.gridSize
	love.graphics.setLineWidth(2)
	
	for y, xs in ipairs (map) do
		for x, value in ipairs (xs) do
			-- value is boolean: true or false
			if value==true then -- map tile
				-- beware of -1
				--love.graphics.setColor(0.5,0.5,0.5)
					if palette==1 then love.graphics.setColor(cs1tile1) 
				elseif palette==2 then love.graphics.setColor(cs2tile1)
				elseif palette==3 then love.graphics.setColor(cs3tile1)
				elseif palette==4 then love.graphics.setColor(cs4tile1)
				elseif palette==5 then love.graphics.setColor(cs5tile1)
				elseif palette==6 then love.graphics.setColor(cs6tile1)
				end
				if palette==7 then love.graphics.setColor(cs7tile1)
					love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
				else
					love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
				end
				
				--love.graphics.setColor(0.6, 0.58, 0.2)
					if palette==1 then love.graphics.setColor(cs1tile2) 
				elseif palette==2 then love.graphics.setColor(cs2tile2)
				elseif palette==3 then love.graphics.setColor(cs3tile2)
				elseif palette==4 then love.graphics.setColor(cs4tile2)
				elseif palette==5 then love.graphics.setColor(cs5tile2)
				elseif palette==6 then love.graphics.setColor(cs6tile2)
				end
				if palette==7 then love.graphics.setColor(cs7tile1)
					love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
				else
					love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
				end
				--love.graphics.setColor(0,0,0)
				
					if debugmode=="yes" then 
					--love.graphics.print("#",(x-1)*tileSize, (y-1)*tileSize) end
					love.graphics.print ((x)..' '..(y), (x-1)*tileSize, (y-1)*tileSize) end
			elseif value=="exit" then -- map tile
			love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)


			--borders
			elseif value=="border" then -- map tile
					if palette==1 then love.graphics.setColor(cs1border1)
                elseif palette==2 then love.graphics.setColor(cs2border1)
                elseif palette==3 then love.graphics.setColor(cs3border1)
                elseif palette==4 then love.graphics.setColor(cs4border1)
                elseif palette==5 then love.graphics.setColor(cs5border1)
                elseif palette==6 then love.graphics.setColor(cs6border1)
                end
                if palette==7 then love.graphics.setColor(cs6border1)
                
					love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)	
                else
					love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
								--dream:draw(cube1,  (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
                end
                						dream:draw(cube1,  1, 1,-60, 10,10,10)
                            
				
					if palette==1 then love.graphics.setColor(cs1border2)
                elseif palette==2 then love.graphics.setColor(cs2border2)
                elseif palette==3 then love.graphics.setColor(cs3border2)
                elseif palette==4 then love.graphics.setColor(cs4border2)
                elseif palette==5 then love.graphics.setColor(cs5border2)
                elseif palette==6 then love.graphics.setColor(cs6border2)
                end
                if palette==7 then love.graphics.setColor(cs6border1)
					love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
				else
					love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
	
					
				end
			end
		end
	end
end
The line that causes the error is this:

Code: Select all

dream:draw(cube1,  1, 1,-60, 10,10,10)
Just to help understand the problem, that lines is a simple call to the 3d engine that writes a simple cube in a position, the same simple call works on any other function that is not pb:drawMap (). Indeed the objects of the levels are currently being drawn succesfuly in this function:

Code: Select all

function pb:drawBlock (block)
	local x, y = block.x, block.y
	local tileSize = self.gridSize
	for i = 1, #block.tiles-1, 2 do
		local dx, dy = block.tiles[i], block.tiles[i+1]
		-- beware of -1
					if palette==1 then love.graphics.setColor(cs1block) 
				elseif palette==2 then love.graphics.setColor(cs2block)
				elseif palette==3 then love.graphics.setColor(cs3block)
				elseif palette==4 then love.graphics.setColor(cs4block)
				elseif palette==5 then love.graphics.setColor(cs5block)
				elseif palette==6 then love.graphics.setColor(cs6block)
				end
				
				if palette==7 then love.graphics.setColor(cs7tile1)
					love.graphics.rectangle ('line', (x+dx-1)*tileSize, (y+dy-1)*tileSize, tileSize, tileSize)
				else
					love.graphics.rectangle ('fill', (x+dx-1)*tileSize, (y+dy-1)*tileSize, tileSize, tileSize)
				end

		dream:draw(cube1, x+dx- threeDcellx+1, -((y+dy)- threeDcelly), threeDcellz,threeDcellwidth-0.5,threeDcellheight-0.5,threeDcelldepth-0.5)
--dream:draw(cube1,  1, 1,-60, 10,10,10)
		
		--dream:draw(cube1, ((x+dx-1)*threeDcellwidth+1) , (y+dy-1)*threeDcellheight, threeDcellz,threeDcellwidth-0.5,threeDcellwidth-0.5,threeDcellwidth-0.5)
	end
end
It doesn't matter if you write a simple cube in a position or write the edges, you can't write 3d inside the pb: map function and I need to do that in order to use the same table used for the 2d graphics, anyone has an idea what's happening?
Why a simple call to the 3d engine works inside any function but not inside function pb:drawMap ()?
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Help implementing game logic from fish fillets

Post by darkfrei »

Please check if the lib dream is available in the lib pb.

What is the id and what it must be?
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

darkfrei wrote: Thu Mar 03, 2022 8:15 am Please check if the lib dream is available in the lib pb.

What is the id and what it must be?
hello darkfrei, thanks for helping again!
The library must be available because I'm writing the objects (chair, table etc) and I can even write the agents in 3d. The only thing I can't do is write the map in 3d... I don't get it, I may have too much global variables because there are so many interconnections that something is interfering on that function but I can't see what it is...

I don't know what that id is either... it is strange because on the function that write the objects it doesn't show any error... well I think I will leave it for now, the map is already being drawn with my own function, the reason why I want to integrate it in your function is to have just one table and function to do the same in 3d and 2d, there are already two functions for that (yours for 2d and mine for 3d) and that adds too much work and confusion and therefore I want to unify everything, but it's not so bad, the game is playable and 3d works.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest