Author Topic: dim3 v24 Release  (Read 20296 times)

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #45 on: February 24, 2016, 08:26:39 AM »
Hey Brian could I possibly request a feature??  8)

Being able to check the location of a sound.  For example, using the watch event you can currently identify what sound you heard.  Wouldn't it be cool if you could also find out where the sound played so an enemy could wonder in that direction to investigate  ;D

It's kind of already possible in that I could get the script making the sound to call the game script with it's current location and save it to a variable, then get the listening script to call the game script to ask for the location of the sound...that's pretty clunky tho

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 205
    • View Profile
    • Klink! Software
Re: dim3 v24 Release
« Reply #46 on: February 26, 2016, 07:58:01 AM »
If the object that got the watch event was "obj", then:

obj.watchPosition (x,y,z) should be the position of the sound.  You can also get the object that made the sound (obj.watch.objectId) and then look up the object to track it.

[>] Brian

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #47 on: February 28, 2016, 04:37:13 AM »
Oooooh didn't see that, ace  ;D thanks Brian!!

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 205
    • View Profile
    • Klink! Software
Re: dim3 v24 Release
« Reply #48 on: March 03, 2016, 10:47:26 AM »
More FYI (and a topic that is way off base now!)

My stuff now has a dynamic sound system, with dynamically generated sounds.  Sadly, the web audio API has the ability to do spatial panning, but the spec has changed so much (and just deprecated and replaced a couple weeks ago!!) that nobody has it implemented the same.  It'll shake out and I'll use it, but for now I'm going to have to go with a static inverse distance volume change only on the sounds.

[>] Brian

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #49 on: April 25, 2016, 12:57:01 PM »
Request a feature time!  Again, sorry  8) Would't it be super cool if you could do a check for the intensity of light an object is illuminated by?  Something like obj.model.illumination=float.  It could then be added to sight check routines so that something in sight but in the dark won't be noticed whereas if you're under a light then you're visible!

I could potentially do a clunky workaround with invisible beacons near every light then run a script that checks the distance to said beacon - if close enough it'll assume you're in the light whereas if you're too far it'll assume you're in the darkness.  But if you've got a way to bake something like this into the engine that'd be ace!

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 205
    • View Profile
    • Klink! Software
Re: dim3 v24 Release
« Reply #50 on: April 26, 2016, 06:07:19 AM »
Request a feature time!  Again, sorry  8) Would't it be super cool if you could do a check for the intensity of light an object is illuminated by?  Something like obj.model.illumination=float.  It could then be added to sight check routines so that something in sight but in the dark won't be noticed whereas if you're under a light then you're visible!

I could potentially do a clunky workaround with invisible beacons near every light then run a script that checks the distance to said beacon - if close enough it'll assume you're in the light whereas if you're too far it'll assume you're in the darkness.  But if you've got a way to bake something like this into the engine that'd be ace!

You have obj.model.bone.getBrightness(poseName,boneName);   You can just give it any pose name (or whatever pose you are in, the model won't change that much for it to be a big impact) and then the name of a bone (probably a torso or head bone) and that'll return a float from 0.0-1.0 telling how illuminated that bone's current position is.  So 1.0 means it's high lighted and 0.0 means it's completely in the dark.

[>] Brian

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #51 on: April 26, 2016, 01:03:22 PM »
Amazing thanks for that Brian!  Never noticed that one

I'll just make a function in the player script that returns the bone illumination factor and get enemies to call it before they run their sight check routine. Thanks again  ;D

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #52 on: May 23, 2016, 07:56:38 AM »
I think I worked out a bug Brian, please let me know if I'm wrong.  I had an issue with enemies occasionally springing back to life after they died, and I never quite got why because I stopped all chains/waits/timers in my enemy's death function.  But I realised I had the commands for stopping all chains/waits/timers in the enemy's parent script and simply called them from the enemy script.

What I think this means is if I call on the parent script to stop chains/waits/timers, it'll stop them only for the parent script and not for the child script that's calling.  Is that how it's supposed to work?  If so that's cool, I can easily work around that

`teh1

  • OOK Dev
  • Global Moderator
  • Full Member
  • *****
  • Posts: 46
  • Behold(Eventually): OOK
    • AOL Instant Messenger - flagoworld
    • View Profile
    • Spiral Nebula Development
    • Email
Re: dim3 v24 Release
« Reply #53 on: May 23, 2016, 08:04:22 AM »
That doesn't sound like bad behavior to me, and might be intentional. If you create it, you should destroy it. Similarly with child scripts.
~Ryan

http://spiralnebuladev.com/ || Visit Spiral Nebula Development

Oddity007 wrote:
`teh1: 1) I must go get my chicken wings, like all men with african ancestry 2) I shall blog about dat.

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #54 on: May 23, 2016, 08:47:10 AM »
It's not a bad behaviour at all, I guess I've probably just misunderstood the role of a parent script.  I've been using them to put identical chunks of code used by different scripts into a common parent so scripting the children involves less copying and pasting, and child scripts are easier to interpret/follow.  Strange thing is all other commands seem to work normally in the child script when I call them from the parent; it's just these 3 event commands that appear to apply to the parent but not the child.  Anyway it's easy to work with - I've just moved a few lines back from the parent to the child and it works ok now

`teh1

  • OOK Dev
  • Global Moderator
  • Full Member
  • *****
  • Posts: 46
  • Behold(Eventually): OOK
    • AOL Instant Messenger - flagoworld
    • View Profile
    • Spiral Nebula Development
    • Email
Re: dim3 v24 Release
« Reply #55 on: May 23, 2016, 01:59:32 PM »
Yeah but even with subclasses in, say, C++, the subclass is responsible for destroying any data it created that the superclass does not know about...
~Ryan

http://spiralnebuladev.com/ || Visit Spiral Nebula Development

Oddity007 wrote:
`teh1: 1) I must go get my chicken wings, like all men with african ancestry 2) I shall blog about dat.

ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 205
    • View Profile
    • Klink! Software
Re: dim3 v24 Release
« Reply #56 on: May 23, 2016, 06:33:49 PM »
I think I worked out a bug Brian, please let me know if I'm wrong.  I had an issue with enemies occasionally springing back to life after they died, and I never quite got why because I stopped all chains/waits/timers in my enemy's death function.  But I realised I had the commands for stopping all chains/waits/timers in the enemy's parent script and simply called them from the enemy script.

What I think this means is if I call on the parent script to stop chains/waits/timers, it'll stop them only for the parent script and not for the child script that's calling.  Is that how it's supposed to work?  If so that's cool, I can easily work around that

Yeah, chains/waits/etc are attached to a single running script instance, so that's the behavior.

[>] Brian

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #57 on: May 24, 2016, 09:58:54 AM »
Cool thanks, makes sense  8)

Galavant Garde

  • Full Member
  • ***
  • Posts: 146
  • Cayelan Mendoza
    • View Profile
    • Galavant Garde - Dark Electro Disco Pop
    • Email
Re: dim3 v24 Release
« Reply #58 on: June 28, 2016, 07:38:08 AM »
Me again Brian, how plausible would it be to make lighting cones instead of only spheres/hemispheres?  I don't mean like live ray tracing lights like what you did with your RT engine (that'd be too much) just the ability to focus directional lights to less than 180.

Reason being I've gotten by over the years with cheap tricks like making an array of lights that progressively get smaller to make a cone of sorts, but now that I've (finally) moved on from matte textures and N64-grade graphics, I'm finding that using shadows and bump/specular maps makes a right old mess of things when I string lights together like this.

It'd also be useful in alleyway/hallway scenarios so the light can beam down without shining too far through the walls into other areas of the map.  I know that light maps should get rid of the 'appearance' of light shining through walls, but...say when you step into the sphere/hemisphere of light that's on the other side of a wall, you don't see the light thanks to the light map, but you notice shadows start misbehaving and models start glowing when they're supposed to be in darkness etc.

I made a graphic to explain what I mean  8)


ggadwa

  • Administrator
  • Full Member
  • *****
  • Posts: 205
    • View Profile
    • Klink! Software
Re: dim3 v24 Release
« Reply #59 on: June 29, 2016, 06:15:02 AM »
That'd be a light cone, it'd basically have to be another couple settings on the lights, some more data passed to the shaders, and more calculations on the shaders.  I was always running into shader limits on earlier video cards, though, so not sure what changes something like that would make.

[>] Brian