Physics navigation and other questions

General discussion about LÖVE, Lua, game development, puns, and unicorns.
BlackPhoenix
Prole
Posts: 5
Joined: Sun Apr 24, 2011 12:51 pm

Re: Physics navigation and other questions

Post by BlackPhoenix »

hehe. I'm currently working on a nasty bug concerning zoom in/out functionality. Then it's to TLPath integration and then lights and sensors which brings me to my next question: Is there a somewhat efficient AND realistic way to implement visual and aural sensors?
Is there a kind of standard way of doing it? Googling around didn't turn out anything
Right now I'm in the design phase: I made up a somewhat complicated equation about vision that would take into account the Field of View, light conditions, npc light sensitivity (the longer it stays in a particular light condition the more it gets used to it), visual sensitivity zones (motion sensitivity is bigger in our peripheral vision whereas we have strong binocular stationary object vision on a small arc right in front of us) and distance (phew!) and give a chance of detection. All that in a visual detection module. Then it's up to the visual recognition module to figure out what it is that got detected, friend/foe/object. That too is gonna get an aweful lot of complexity, I'm sure. I'm planning of maintaining a model of the world for each NPC, that gets constantly updated through its sensors.
About the visual detection module, I'm thinking of running the whole updateSensors() function once every 5 or more frames because of all that complexity. I'm thinking of drawing direct lines from each npc to all other npcs and player and if an occlusion check is false (no obstacles in the way) then it's up to calculate the big function. There are also a lot of conditions that could simplify the math a lot. What are your opinions/experience on the matter? Am I thinking this the right way or will I have to gut it at the end because of performance?
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Physics navigation and other questions

Post by Taehl »

Is it necessary to be so complex? Would each of those elements have a distinct, gameplay-enhancing effect? If not, I would highly suggest simplifying it. Not only would it be faster, but it'd be less bug-prone. Remember the KISS principle, and look to Boids as an example of simplicity that leads to complex behaviour.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
BlackPhoenix
Prole
Posts: 5
Joined: Sun Apr 24, 2011 12:51 pm

Re: Physics navigation and other questions

Post by BlackPhoenix »

Taehl wrote:Is it necessary to be so complex? Would each of those elements have a distinct, gameplay-enhancing effect? If not, I would highly suggest simplifying it. Not only would it be faster, but it'd be less bug-prone. Remember the KISS principle, and look to Boids as an example of simplicity that leads to complex behaviour.
Here are the gameplay aspects that are presented with this:
- 180 degrees Field of View: npc won't detect stuff behind it
- light conditions: npc won't see as well in the dark
- npc light sensitivity: you have a chance to escape if the npc just entered a dark room, even if you are really close to it
- visual sensitivity zones: npc won't easily detect you if stay put and it doesn't directly look at you
- Distinction between detection and recognition: maybe redundant but allows for interesting scenarios where npc accidentally shoots ally/object because it thinks it's an enemy.

It is true that they would better suit a stealth game, but as you can see they present interesting gameplay. Anyways I'm planning to start off with a much simpler implementation and go on from there
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 62 guests