Play sound needs some work. - Page 4

Play sound needs some work.

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

1. I think the global sound list isn't alphabetical after all.
It was alphanumerically sorted in the context of LUA. I would be surprised if it was read merely by string in Spring, but it may have to have been, due to the number of places and odd contexts used by play-sound. At any rate, if we can call it through a simple filename, in an include or just within the body of the script, that would make things nice and simple.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Argh wrote:
1. I think the global sound list isn't alphabetical after all.
It was alphanumerically sorted in the context of LUA. I would be surprised if it was read merely by string in Spring, but it may have to have been, due to the number of places and odd contexts used by play-sound. At any rate, if we can call it through a simple filename, in an include or just within the body of the script, that would make things nice and simple.
As far as I can tell spring has a global array of sounds, and has an array for each script that holds an index for the global array, which gets loaded based on filename. *_*

But it should be relatively simple to use.

The current plan:
GET PLAY_SOUND (coded, half tested)
p1: sound number
p2: volume as a float * 100
p3: 0 = alos, 1 = los, 2 = los or radar, 3 = global, 4 = ally, 5 = team (optional, defaults to alos)
p4: 0 = play at unit location, 1 = play directly (optional, defaults to unit location)

GET PLAY_SOUND_LOCATION (coded)
p1: sound number
p2: volume as a float * 100
p3: XZ coordinates
p4: Y coordinate (optional, defaults to the map/water height)

Add observedsound and worldsound tags to weapons. (todo)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Does GET support more than one parameter yet? Although adding this should be trivial...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

rattle wrote:Does GET support more than one parameter yet? Although adding this should be trivial...
GET has supported upto 4 (iirc) parameters since OTA.

SET only supports 1 parameter.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Finally figured out wtf was causing my grief, the fact that the volume is capped at 1-ish, so passing a big number makes it audible on all the map, but not loud, blah blah blah, I hate directsound. I'll have the get play_sound patch on mantis in a couple hours, with a test build here to play with.

EDIT: latest svn is causing horrible horrible issues with my example mod, bah tomorrow
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Okay, finally got back around to finishing this. Read the link for details:
http://spring.clan-sy.com/mantis/view.php?id=690

Image

Necron Slowpoke :-)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Holy smokes!

This version just keeps getting better! That's a giant Useful Thing, thanks a lot, Lurker! Has this been committed yet?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

No commit yet, I just submitted it.
And here's as good a place as any for me to explicitly state the following (these were in the flankingBonus patch):
You can now do negative damage to units.
You can set a modrules variable, experienceMult, that will be multiplied by all experience a unit gaines. So if you want to have a mod without experience, or want to manage experience yourself, set it to 0.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Don't forget to document that stuff, for the Changelog. This version has a huge number of things in it, we don't want stuff not getting used because it wasn't documented :-)

As for the rest... well, I've already tested flankingShield, which appears to work correctly... I'll have to test those two. Negative Damage might be a big deal in PURE, although I'm a bit worried about filtering... I'll test against Armor Table stuff and see what happens- I don't want to heal enemy Units. And I wonder if negative damage could also create positive geometry on the heightmap...

As for experienceMult, that's something definitely worth testing. Could be useful, for a variety of game-balance purposes...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Argh wrote:Don't forget to document that stuff, for the Changelog. This version has a huge number of things in it, we don't want stuff not getting used because it wasn't documented :-)

As for the rest... well, I've already tested flankingShield, which appears to work correctly... I'll have to test those two. Negative Damage might be a big deal in PURE, although I'm a bit worried about filtering... I'll test against Armor Table stuff and see what happens- I don't want to heal enemy Units. And I wonder if negative damage could also create positive geometry on the heightmap...

As for experienceMult, that's something definitely worth testing. Could be useful, for a variety of game-balance purposes...
Well this only affects the damage to units. You could set the damage to negative before, and it would recharge shields but do 0 damage to units. I'm not sure about craters, but it's the same as before. And are you talking about the dynamic damage code? Because iirc that has its own filter for negative damage.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Craters have always read the default damage values when determining the initial depth. That's what I was getting at- a strong negative damage value in DEFAULT should probably raise ground... could be really useful.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Did this get committed yet? I was gonna put it into PURE tonight... it's the last major detail...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

It has not been committed. I think a campaign of bugging random devs is needed.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Bummer... I was hoping to add the new sound stuff in and get it nailed down before the weekend...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Well the best I can do is give you an svn build with my patch included.
I think it should sync with the normal rev 4944...
http://xta.wolfgame.org/SimBase/spring.exe
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Okay, committed now thanks to KDR_11k.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

What number should PLAY_SOUND be defined as? IOW, I need to add this to my "standard commands" include...

Now that it's committed (and I, erm, have some "free time" for the next two days)... I'd like to get this implemented, it's the last Major Thing...

<edit>

Nevermind, it's 101, folks!
Post Reply

Return to “Engine”