# Noname 2.5 Shooter (Open source)

**URL:** <https://forum.defold.com/t/noname-2-5-shooter-open-source/57417>\
**Category:** Dev diaries\
**Created:** [July 12, 2019, 10:45pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417 "2019-07-12T22:45:21Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![dmitriy](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dmitriy/32/18452_2.png) [@dmitriy](https://forum.defold.com/u/dmitriy)\
**Post date:** [March 22, 2020, 11:26pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/21 "2020-03-22T23:26:30Z")

</div>

> [@d954mas](#):
>
> 2)Limit for 1024 scripts.

32765

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [March 22, 2020, 11:30pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/22 "2020-03-22T23:30:58Z")

</div>

As I see it was not fixed. [Max\_instances is effectively capped at 1025 (DEF-3780)](https://forum.defold.com/t/max-instances-is-effectively-capped-at-1025-def-3780/1211)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 23, 2020, 6:04am UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/23 "2020-03-23T06:04:13Z")

</div>

Thank you for clarifying your reasoning!

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [March 29, 2020, 3:19pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/24 "2020-03-29T15:19:02Z")

</div>

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.

 ![2020-03-29_18-11-35](https://forum-defold-uploads.b-cdn.net/original/3X/1/6/16373dfc1a4d44e1145e6ad5f7d58a9eed85353a.png)

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [April 4, 2020, 7:36am UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/25 "2020-04-04T07:36:07Z")

</div>

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. 😀  
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.🤯  
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.😀

[https://forum-defold-uploads.b-cdn.net/original/3X/b/4/b48a1fe4c12120e0917929a5a0d215e0c969e066.mp4](https://forum-defold-uploads.b-cdn.net/original/3X/b/4/b48a1fe4c12120e0917929a5a0d215e0c969e066.mp4)

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [April 11, 2020, 11:03am UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/26 "2020-04-11T11:03:31Z")

</div>

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  
 ![light_pulse](https://defold-forum-bucket.nbg1.your-objectstorage.com/original/3X/c/6/c6bf03f0297e8f7188a2f77557bf06e3462dc42c.gif)

![com-optimize(3)](https://defold-forum-bucket.nbg1.your-objectstorage.com/original/3X/e/6/e679d7b45188874ba23e4479437ab068ddbf6436.gif)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [April 11, 2020, 12:01pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/27 "2020-04-11T12:01:23Z")

</div>

Very nice!

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [May 3, 2020, 6:44pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/28 "2020-05-03T18:44:37Z")

</div>

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.

[https://forum-defold-uploads.b-cdn.net/original/3X/6/1/61fddd0d7a05761b8d709471bc4dfc8029d1ebb1.mp4](https://forum-defold-uploads.b-cdn.net/original/3X/6/1/61fddd0d7a05761b8d709471bc4dfc8029d1ebb1.mp4)

---

<div class="post-metadata">

**Author:** ![88.josh](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/88.josh/32/20137_2.png) [@88.josh](https://forum.defold.com/u/88.josh)\
**Post date:** [May 3, 2020, 8:23pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/29 "2020-05-03T20:23:12Z")

</div>

this is insane. Well done for your hard work.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [May 23, 2020, 6:19pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/30 "2020-05-23T18:19:31Z")

</div>

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)

[https://forum-defold-uploads.b-cdn.net/original/3X/d/0/d06d2c88ea4484db6cc9ddb97c778c9b092253f7.mp4](https://forum-defold-uploads.b-cdn.net/original/3X/d/0/d06d2c88ea4484db6cc9ddb97c778c9b092253f7.mp4)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [May 24, 2020, 8:49am UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/31 "2020-05-24T08:49:25Z")

</div>

It looks really cool! Good job!

---

<div class="post-metadata">

**Author:** ![Grass\_dev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/grass_dev/32/20592_2.png) [@Grass\_dev](https://forum.defold.com/u/Grass_dev)\
**Post date:** [May 24, 2020, 10:49am UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/32 "2020-05-24T10:49:42Z")

</div>

that is right. it is cool 😎

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [May 24, 2020, 11:47am UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/33 "2020-05-24T11:47:39Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [May 24, 2020, 1:52pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/34 "2020-05-24T13:52:13Z")

</div>

Thanks.  
Good idea.👍  
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.

 ![2020-05-24_16-41-34](https://forum-defold-uploads.b-cdn.net/original/3X/4/3/43ae270202ec6f3329947a300e5e6983ee7bd503.png)  
(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.

[https://forum-defold-uploads.b-cdn.net/original/3X/4/8/48e7d601755596637d63a541a04e897ce34021e1.mp4](https://forum-defold-uploads.b-cdn.net/original/3X/4/8/48e7d601755596637d63a541a04e897ce34021e1.mp4)

---

<div class="post-metadata">

**Author:** ![ross.grams](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@ross.grams](https://forum.defold.com/u/ross.grams)\
**Post date:** [May 25, 2020, 8:43pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/35 "2020-05-25T20:43:55Z")

</div>

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 😄 (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.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [May 27, 2020, 6:39pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/36 "2020-05-27T18:39:38Z")

</div>

Trying to add particles in 3d.

[https://forum-defold-uploads.b-cdn.net/original/3X/c/7/c7c06a760148b4d2daef119a7fe0f495db4c9021.mp4](https://forum-defold-uploads.b-cdn.net/original/3X/c/7/c7c06a760148b4d2daef119a7fe0f495db4c9021.mp4)

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

```lua
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

```

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [May 27, 2020, 8:18pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/37 "2020-05-27T20:18:56Z")

</div>

Maybe draw all particles to a render target without depth test, and then depth test with that render target? Or use depth to mask.

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [May 27, 2020, 8:37pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/38 "2020-05-27T20:37:30Z")

</div>

> [@Pkeod](#):
>
> Maybe draw all particles to a render target without depth test

No. In that case every new particleFX will need new render target.

> [@Pkeod](#):
>
> Or use depth to mask.

What is depth to mask?

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [May 27, 2020, 9:16pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/39 "2020-05-27T21:16:05Z")

</div>

> [@d954mas](#):
>
> No. In that case every new particleFX will need new render target.

You could move the particles to a single render predicate / render target, which is then drawn last. I’m not sure on specifics, would need to make a test project, but something like that should be possible.

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [May 27, 2020, 9:44pm UTC](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417/40 "2020-05-27T21:44:02Z")

</div>

> [@d954mas](#):
>
> If i disabled depth test for particles. It blend with each other ok. But  
> have problems with other objects.

What is your desired effect? You could render them last without depth test to overlay them on top of everything else, but I’m guessing you are looking for something specific?

[Previous page](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417.md?page=1)

[Next page](https://forum.defold.com/t/noname-2-5-shooter-open-source/57417.md?page=3)
