Noname 2.5 Shooter (Open source)

Have spent a lot of time on thinking about game and it features and start writing concept doc of game. Also, made some fixes and implement some features.

Trying to work on game every day. I do not have a lot of time because of work, but i think if i will do a lot of small steps every day, sometime game will be done.

Bought two new monitors. So now I can run ide and defold editor in different monitors. x1.5 to productivity :grinning:

Changelog:
1)Culling for pickup sprite.(sprite is destroyed if go is invisible)
2)Remove invisible wall sides when parse level. When walls stay near there are some sides than player can’t see, so game do not need to draw them
3)Fixed bullet ignore walls. You can kill enemy throw wall,forget to add obstacle mask to bullets :grinning:
4)Add simple level selection scene
5)Add simple game_over modal. Can restart or go to main menu
6)Add simple pause modal. Can resume or go to main menu
7)Fixed weapon raycast. Raycast is nil if player in inside enemy collider. So in close range raycast was nil, and shot was missed.
8)Add more tests.(pathfinding, parser)
9)Flash enemy when it takes damage
10)Add camera shaking when player receive damage. Like here https://www.youtube.com/watch?v=tu-Qe66AvtY
11)Try make weapons. I do not like how I made them, so it will be refactor =)
12)Add test blood particles for enemies.
13)Code cleanup, refactoring and simple fixes=)
14)Change tilesets parsing. Now tilesets in level map can be in any order.(Tiled use global id for tile, that id depends on tilesets add order to map.)
15)Wall textures can be any size. So I can change wall texture to bigger texture in any moment.Also, I can use 64 and 128 sized walls is one level.
16)Add thin wall(only visual no collisions)
17)Add keys and doors.
18)Add travis(CI). Only start with it. I want to run test and made bundles in ci. For now, it downloads bob. And make headless(for test) and html bundles.
https://forum.defold.com/uploads/default/original/3X/8/d/8d635f070a65d4f9092c0cb36a72d07080d28faa.mp4

9 Likes

I am return to that project=).
Half a year I did nothing on the project =).
I switched to another project, but now back again.

2.5 weeks it took:
1)To remember how it works and what happened inside
2) Updating libraries.
3)Replace old scene manager with new version(prev was made 2 years ago, and contains a lot of strange things,and hotfixes)
4) A refactoring of the walls render (so that they can be easily modified during the game, for example, for animated walls).I use ecs pattern. And in prev version walls was not a entity, it was separate object.Now wall is entity.
5) I threw out the built-in physics. Now I use https://github.com/DanielChappuis/reactphysics3d and for now everything is ok. Also added debug render for it.
6) Add debug panel.
7) Game was downgraded. Threw everything except walls, characters and walk. I will return all of it=).

4 Likes

Yay!

Why?

2 Likes

Current physics is ok, and i can do all things that i need with it, but it was not comfortable for me.
I want to have more control on physics bodies. When create it and in runtime.

1)It need a script for object to handle physics collisions. But i prefer to use lua modules instead of script. I only have one script for every scene(scene controller), all other logic in lua modules.
2)Limit for 1024 scripts. If i add physics script for every wall, 1024 was to small for me. So i add script only for player, and enemy. But if i need more object, for example boxes that can be moved, bullets that ricochet from walls like grenades or lazers, it will be very easy to break that limit.
3)I want to change mask and group in runtime.
4)Problems with scale.When i want to change size in runtime.
5)Problems with scale.When create from factory. Not remember what it was. Mb it was not scaled when create from factory, or mb i can’t use different scale for different direction. 1 for y and 10 for x to make rectangle instead of cube.
6)I received one more collision_responce after physics was removed. All my pickups was handled two times=).
7)If player rect, inside enemy rect i do not get that collision in raycast response.
8)Can’t make raycast that give me all object in line.
9)Physics updated in next frame. I can’t move object then check that everything worked.
10)I am not sure how physics will be worked for big speeds and small walls. Will be bullet ignore walls or not. In custom physics, i can update it few times per frame, to fix it.

3 Likes

32765

As I see it was not fixed. Max_instances is effectively capped at 1025 (DEF-3780)

Thank you for clarifying your reasoning!

2 Likes

1)Add voxels model in game for test. It worked good=)
2)Fixed wall was not rendered if rotate fast. (Wall was created in current frame, but start render only on next frame)
3)tile for walls, and floor can be flipped and rotated.

8 Likes

This week made experiments with lights. It need more work. But first simple version is done

I can change color of tile in light map layer of tile, to emulate light.But it wasn’t enough.

I want to light be more dynamic. For example some light sources with red danger signal that pulse in game, or turn on/off light in a room.

So i make a light object. :grinning:
1)That object find near cells(for now all, in future only that can be touched by light).
2)Change brightness depends on distance(not implement for now)
3)Blend with light from other light sources. Problem place.:exploding_head:
My first idea was to use hsv colors. But i do not find way to make blend for hsv colors. Now i use rgb additive blend. It worked good when lights white or have same colors. But in other situation it produce strange results=)
I do not know the best way to make blend for different light colors.I think i will avoid that situations in game.:grinning:

9 Likes

This week was also focus on light.
1)Refactor raycasting camera.
It cast rays and find visible cells.In prev version i can have only one main camera. Now i can make new cameras. For example camera for light source to find cell that need light from it.
2)Add ability to change light color in runtime
3)Add rotation_speed component

11 Likes

Very nice!

2 Likes

Spent a lot of time thinking about game concept.

The game will be a dynamic fast shooter, about robot cleaner from boston dynamic.
People throw a lot of trash, and also beat robot. So robot is angry and will revange

Try to stream a develop on twitch in russian language.It was fun and productive=)

Changes:
1)Reduce player velocity, when hit a wall.
2)Add tag component.And method for find entity by tag
3)Add test light patters(sin,tween,perlin noise).Pattern changed light color and bright. Patten can be configured in tiled.
4)Add pickups.Draw and collisions.
5)Add test particles in 3d.It work but have some problems.I will try fixed them later, when start to use particles in game.
6)Add animated tiles for wall.
7)Add raycasting to physics
8)Add doors and keys.

11 Likes

this is insane. Well done for your hard work.

2 Likes

Make some small changes=)
Focus on gui.Also start add weapons

Changes:
1)Add hp bar
2)Add ammo panel.
3)Add minimap view.(it is gui, so later it can be more beautiful)
4)Add sight
5)Add base for weapons.(it can’t shoot, but you can change it)
6)Refactor rendercam.Remove messages and scripts. My rendercam is lua module. =)
It make easy to use multiple cameras in renderscript.(i do it for another project, but also migrate this project)

15 Likes

It looks really cool! Good job!

3 Likes

that is right. it is cool :sunglasses:

3 Likes

It looks awesome! How is the lighting calculated? It would be really cool to add a normal map to the weapon and do the same evaluation there, so it blends a bit better with the game. Anyway, good job!

4 Likes

Thanks.
Good idea.:+1:
It looks better with tinted weapon.
I use current tile color for that tint.
But when i move it change colors, to fast and blink.
I will try add some interpolation or add near cell colors, to tint calculation.

Light calculation is simple.
It is a tile based light.

Color consist of two parts, static and dynamic.
Tile always have a static base color from level editor.
Also tile have a array with dynamic lights from light sources.


(Here you can see static colors)
Light sources use rays to find tile, that needs color.
Also the light brightness depends on distance to tile.

To get tile result color, all colors is mixed with additive blend.
Then i draw that lights colors, to texture.
And in shader mixed sprite color with that light color

This map have a very dark static color.
There is a light map texture, on the left
Also light map texture, updated only for visible cell.

7 Likes

I started looking through the source to see what you did with rendercam, and wow, it looks like you’ve done a ton of work on this to bypass Defold’s built-in systems, controlling your own update order…a different physics engine via Native Extension, etc…pretty cool. ‘go.get_position()’ is only used three times in the whole project :smile: (twice in rendercam & 1 other time). I never would have considered doing all this. It seems like your own engine built on top of Defold.

7 Likes

Trying to add particles in 3d.

But particles can’t blend with each other.(depth test problem)
If i disabled depth test for particles. It blend with each other ok. But
have problems with other objects.
Any ideas, how to fix?
render script

function Render:render_3d()
	if (not self.targets.light_map) then return end
	local camera = CAMERAS.current

	render.set_viewport(camera.viewport.x, camera.viewport.y, camera.viewport.width, camera.viewport.height)
	render.set_view(camera:get_view())
	render.set_projection(camera:get_proj())

	render.enable_state(render.STATE_DEPTH_TEST)
	render.set_depth_func(render.COMPARE_FUNC_LEQUAL)

	render.enable_texture(1, self.targets.light_map, render.BUFFER_COLOR_BIT)

	render.set_depth_mask(true)
        --no transparent
	render.draw(self.predicates.wall, self.constants_buffers.light_map)

	render.enable_state(render.STATE_BLEND)
	render.set_blend_func(render.BLEND_SRC_ALPHA, render.BLEND_ONE_MINUS_SRC_ALPHA)

	render.disable_state(render.STATE_CULL_FACE)
        --all objects with transparent. Walls,enemies,objects, particles.
	render.draw(self.predicates.transparent3d, self.constants_buffers.light_map)

	if CONSTANTS.DEBUG.draw_physics then render.draw(self.predicates.debug_physics) end
	render.draw_debug3d()

	render.disable_state(render.STATE_DEPTH_TEST)
	render.enable_state(render.STATE_CULL_FACE)
	render.set_depth_mask(false)
	render.disable_texture(1)
end
5 Likes