Grid based lighting/field of view

Discussion and feedback on Construct 2

Post » Sun Sep 18, 2011 11:41 pm

Thanks cowtrix! To optimise further I was thinking of working through every grid position and calculating the fov then keeping this information to refer to. Will test this idea eventually unless something better comes along! Considering the above example uses events it works quite fast!
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sun Sep 18, 2011 11:41 pm

sounds awesome good luck!
B
31
S
6
G
7
Posts: 140
Reputation: 5,983

Post » Mon Sep 19, 2011 12:12 am

If you were to have a plugin, you could always have a "calculate FOV" event. Also, when a tilemap plugin gets released, this could tie into that quite nicely.
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Mon Sep 19, 2011 12:31 am

Yeah I already have an idea how to implement. Can't wait for tile maps and especially families!! Thinking maybe having a FOV plugin then a light source behavior attached to any object then you can have multiple light sources! Will have to see how it goes...
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Mon Sep 19, 2011 3:50 am

great work so far sir,

i love roguelikes myself.

please carry on.
B
50
S
17
G
15
Posts: 1,029
Reputation: 26,289

Post » Mon Sep 19, 2011 4:07 am

Excellent work !!! An "capx" with example is it possible ?
"keep calm we have giant robots!"
B
21
S
5
G
4
Posts: 94
Reputation: 3,155

Post » Mon Sep 19, 2011 7:15 am

No capx yet
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Mon Sep 19, 2011 7:18 am

[QUOTE=harrio] great work so far sir,

i love roguelikes myself.

please carry on.[/QUOTE]

Thanks harrio!
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Mon Sep 19, 2011 10:45 pm

I've edited my first post to include a demo of the field of view plugin which uses pre-calculation. Needs more work still but getting there!
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Mon Sep 19, 2011 11:56 pm

[QUOTE=00Rez]EDIT: Here is a quick implementation of the plugin version using pre-calculated light/sight arrays. Left click to create a "House" which blocks sight. PLEASE NOTE: The slow down is caused by the number of black blocks, not related to the plugin! This is just a simple example to show the speed difference so nothing fancy![/QUOTE]
And what a difference it makes!
The event driven demo runs with 4 to 26 fps on my pc, the plugin version runs with 58 to 65 fps (slowing down to 26 as soon as the black blocks are drawn).

But I must say the event driven demo reminds me more on some topdown minecraft thingy :D
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Mirlas and 2 guests