Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized physical NPC traits #74

Merged
merged 5 commits into from
Jul 25, 2020

Conversation

AndyTechGuy
Copy link
Collaborator

This pull request introduces some individual NPC characteristic randomization. When a character spawns, they are now given a name that displays over their head. As well, the characters now vary in size from small to large:

image
Two smaller-sized characters with names in the same house

The character names are generated using an old west preset of Terasology/NameGenerator.

@AndyTechGuy AndyTechGuy changed the title Character personalities Randomized NPC physical traits Jun 28, 2020
@AndyTechGuy AndyTechGuy changed the title Randomized NPC physical traits Randomized physical NPC traits Jun 28, 2020
@AndyTechGuy AndyTechGuy linked an issue Jul 6, 2020 that may be closed by this pull request
4 tasks
Copy link
Collaborator

@mayant15 mayant15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI check that's failing is because this branch is behind the current MR develop, specifically the BaseFlatWorldRasterizer. Sync with that and all tests should pass.

Comment on lines 1 to 15
/*
* Copyright 2020 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the shorter license header 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license header has been changed 👍 The old license header still shows up for me when creating new files in IntelliJ, I have no idea why

/**
* The +- range of possible model scaling differences.
*/
public static final float SCALE_RANGE = 0.1f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a deviation of 0.1 noticable in-game? Nice idea to actually differ them in size, though 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed now since character scale changes are done by multiplying model scale, but this offset range allows for scale differences from 0.15f-0.35f, pretty significant on the small scale of the gooey model

@skaldarnar skaldarnar added the Type: Improvement Request for or addition/enhancement of a feature label Jul 13, 2020
skaldarnar
skaldarnar previously approved these changes Jul 24, 2020
Copy link
Contributor

@skaldarnar skaldarnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment, otherwise looks good to me 👍 please change that little detail and merge yourself (that worked well before 🤓 )

public void onCitizenSpawn(CitizenSpawnedEvent citizenSpawnedEvent, EntityRef target) {
NameTagComponent nameTagComponent = new NameTagComponent();

CreatureNameProvider nameProvider = new CreatureNameProvider(random.nextLong(), CreatureAssetTheme.OLD_WEST);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whould it be better to setup the nameProvider once when initializing the system and then only use that generator for new names? generateName() will generate a new name each time based on the seed of the name provider.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is definitely better, the name provider is now initialized in the postBegin() stage. 👍

@AndyTechGuy AndyTechGuy merged commit b1f6e08 into Terasology:develop Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Request for or addition/enhancement of a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants