Sunrise Samurai - sounds PASSED

Here i will list the apprentices and their learning tasks, so others also can follow how it goes.
Please DONT POST HERE any solutions on the given task earlier than the apprentice, you can ask questions from him tough.
Post Reply
Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Sunrise Samurai - sounds PASSED

Post by Stratego (dev) » Sat Sep 23, 2017 6:55 pm

In AOW there are no sounds implemented yet in json, so
task 1: put in this sound to json form:

the defaultSoundUh means "unit_selected_small4.ogg" file, and its weight is given by its number of occurence - never ask why was it :)

Code: Select all

		

 int defaultSoundUh = SoundsDef.addSound("unit_selected_small4.ogg");

SoundsDef.packs.append(SOUND_PACK_UNIT_SELECT_RU_BLD, 
				new int[] { 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh, 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh, 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				SoundsDef.addSound("unit_selected_us_yes.ogg"),
				SoundsDef.addSound("unit_selected_us_yes_sir.ogg"),
				SoundsDef.addSound("unit_selected_us_your_orders.ogg"),				
				}

			);
		
		SoundsDef.packs.append(SOUND_PACK_UNIT_SELECT_JP_BLD, 
				new int[] { 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh, 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh, 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				SoundsDef.addSound("unit_selected_us_yes.ogg"),
				SoundsDef.addSound("unit_selected_us_yes_sir.ogg"),
				SoundsDef.addSound("unit_selected_us_your_orders.ogg"),				
				}

			);
		// -----------------------
		// UNIT AFFIRM SOUNDS
		// -----------------------
		SoundsDef.packs.append(SOUND_PACK_UNIT_MOVE_TANK, 
				new int[] { 
				SoundsDef.addSound("unit_move_tank.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_MOVE_VEHICLE, 
				new int[] { 
				SoundsDef.addSound("unit_move_tank.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_MOVE_SHIP, 
				new int[] { 
				SoundsDef.addSound("unit_move_tank.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_MOVE_PLANE, 
				new int[] { 
				SoundsDef.addSound("unit_move_tank.ogg"),
				}
		); 
		SoundsDef.packs.append(SOUND_PACK_UNIT_MOVE_INF, 
				new int[] { 
				SoundsDef.addSound("unit_move_inf.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_MOVE_FIXED, 
				new int[] { 
				SoundsDef.addSound("unit_move_tank.ogg"),
				}
		);

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Sat Sep 23, 2017 10:24 pm

Going to have to examine a couple of the sound JSONs to make sense of this. It looks completely different from the unit JSONs. Doesn't help that I never played with the sound on, so I barely know what it's supposed to do :?

By the way, why is the weight given by it's number of occurrence? Had to ask, just because you said not to :P
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Sat Sep 23, 2017 10:25 pm

because it was a lame approach there, that is why i made a better in jsons. :)

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Tue Sep 26, 2017 2:23 am

Nowhere near done, but am I at least on the right track? Also trying a different program to edit, and I want to be sure it's going to work before I go further with it.

Also, what weights should I give? I don't play with the sound on, except for very rare occasions, so I have no clue how frequent you want them.
Attachments
sounds.json
(225 Bytes) Downloaded 192 times
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Tue Sep 26, 2017 4:20 am

we have to edit it manually so we might need easy reading textfiles, beutifiers will help but they do not know what is better in one line - if u find one that is configurable - please tell me


so a simple beautifier is the minimum to use like this(https://codebeautify.org/jsonviewer) :

Code: Select all


[
	{
		"packIDString": "SOUND_PACK_UNIT_SELECT_RU_BLD",
		"items": [
			{
				"fileName": "unit_selected_us_yes.ogg",
				"weight": 1
			},
			{
				"fileName": "unit_selected_us_yes_sir.ogg",
				"weight": 1
			},
			{
				"fileName": "unit_selected_us_your_orders.ogg",
				"weight": 1
			}
		]
	}
]
but the best is this (removing unnecessary line breaks and better look tru if it is like this):

Code: Select all

[{
	"packIDString": "SOUND_PACK_UNIT_SELECT_RU_BLD",
	"items": [
		{"fileName": "unit_selected_us_yes.ogg",			  "weight": 1},
		{"fileName": "unit_selected_us_yes_sir.ogg",		 "weight": 1},
		{"fileName": "unit_selected_us_your_orders.ogg",	"weight": 1}
	]
}]

other tha that it seems ok!

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Tue Sep 26, 2017 10:07 am

If you want to try it out, the app is called "json genie." It is editable, allowing you to edit everything, copy roots, properties, etc. to do similar items, easily locate things, etc. Only problem is it tries to organize alphabetically when you save if you don't uncheck the box. It also allows directly editing the text if preferred.
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Tue Sep 26, 2017 8:10 pm

will chk. thx

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Wed Sep 27, 2017 1:58 am

Here it is. Not exactly indented like the rest, but it checks out as valid. That's the only problem making a json on this program. It flattens everything. If you need me to redo it for appearance sake I can.

Everything look good?
Attachments
sounds.json
(1.11 KiB) Downloaded 50 times
Currently residing at the local ninja academy. I'm still watching though.

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Wed Sep 27, 2017 2:38 am

Edit: nevermind. I figured out how to make it indent. Here's the indented copy. Easier to read by far.
Attachments
sounds.json
(1.92 KiB) Downloaded 48 times
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Wed Sep 27, 2017 4:40 am

yes, this is the drawback of using json editor (8 lines and weights can not be scanned tru easily):

Code: Select all

         {
            "fileName": "unit_selected_us_yes.ogg",
            "weight": 1
         },
         {
            "fileName": "unit_selected_us_yes_sir.ogg",
            "weight": 1
         },
instead of (2 lines):

Code: Select all

         {"fileName": "unit_selected_us_yes.ogg",       "weight": 1},
         {"fileName": "unit_selected_us_yes_sir.ogg",   "weight": 1},
if you can do it with the json genie than ok - tell me how :)
othervise please make them this form (one line is about one sound file) - much more easier to look tru.

Also:
- you have not set weight for the "unit_selected_small4.ogg", or you did not even put it in :)
- you made the buildings speak like "yes sir" :)

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Fri Oct 06, 2017 6:05 am

How is it going?

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Mon Oct 09, 2017 5:47 pm

Hi, are are you about finish this lecture?

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Tue Oct 10, 2017 8:28 pm

Sorry, I honestly haven't done anything since my last post. Real life got in the way for a while. I'm getting back into it later today. See if a fresh perspective helps :D

Again, sorry to be away from it for so long. Though it looks like we all slowed down at the same time :lol:
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Tue Oct 10, 2017 8:40 pm

yes, no problem, i only ask to sign me if u see you will get away from the lectures for a while,
so i will not ask these questions and will not check those topics daily - that takes my time :)

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Wed Oct 11, 2017 12:49 am

Okay, where should I put the small 4 sound? You didn't have it in a sound pack like the rest. And I must ask, what should the buildings say if not "yes sir" I wonder?

We all know buildings can talk. How else could we have an argument with a wall? :lol:
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Wed Oct 11, 2017 6:03 am

Sunrise Samurai wrote:Okay, where should I put the small 4 sound? You didn't have it in a sound pack like the rest. And I must ask, what should the buildings say if not "yes sir" I wonder?

We all know buildings can talk. How else could we have an argument with a wall? :lol:

where you see the "defaultSoundUh" that is that.

building: yes :) it is currently wrong now in my sample, simply put there the small4 for 100% probability.

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Wed Oct 11, 2017 11:35 am

So everywhere you have default sound uh, put small 4? Should it be in so many times, or a high probability instead?
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Thu Oct 12, 2017 5:39 pm

it will be alone so it can be any probabaility, put there 100 for instance.

User avatar
Sunrise Samurai
Posts: 2650
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai » Mon Oct 16, 2017 1:26 am

I'm sorry. I'm having trouble getting back into this. Sooner or later I'll post on it, but I'll email you if I need a fast response.
Currently residing at the local ninja academy. I'm still watching though.

Stratego (dev)
Site Admin
Posts: 9929
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) » Sat Jan 27, 2018 12:27 pm

ok, but now i want to speed up aow, so i will do it then

Post Reply

Return to “Under the Hood studies”