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: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Sunrise Samurai - sounds PASSED

Post by Stratego (dev) »

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: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

because it was a lame approach there, that is why i made a better in jsons. :)
User avatar
Sunrise Samurai
Posts: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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 272 times
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

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: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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.
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

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

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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 120 times
The glorious sun rises again
User avatar
Sunrise Samurai
Posts: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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 118 times
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

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: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

How is it going?
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

Hi, are are you about finish this lecture?
User avatar
Sunrise Samurai
Posts: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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:
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

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: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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:
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

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: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

So everywhere you have default sound uh, put small 4? Should it be in so many times, or a high probability instead?
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

it will be alone so it can be any probabaility, put there 100 for instance.
User avatar
Sunrise Samurai
Posts: 2678
Joined: Thu Jun 18, 2015 11:21 pm
Location: Florida, U.S.

Re: Sunrise Samurai - sounds

Post by Sunrise Samurai »

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.
The glorious sun rises again
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Sunrise Samurai - sounds

Post by Stratego (dev) »

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

Return to “Under the Hood studies”