Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What kind of material-based creatures should be a priority to add?

Wooden golems (just made of wood)
- 2 (2%)
Tree creatures (supernaturally living, replacing hair and such with leaves)
- 32 (31.7%)
Other plant creatures
- 6 (5.9%)
Metallic golems (allowing all metals)
- 16 (15.8%)
Stone golems
- 8 (7.9%)
Glass golems
- 2 (2%)
Flesh/organ golems
- 15 (14.9%)
Blood/alcohol golems
- 11 (10.9%)
Magma creatures
- 9 (8.9%)

Total Members Voted: 101


Pages: 1 ... 8 9 [10] 11 12

Author Topic: [0.47.0X] [Python 2.7+] Random Raw Scripts - The stay frosty update  (Read 98344 times)

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #135 on: January 30, 2017, 04:47:45 pm »

Question, how do you go about choosing names for your random creatures? I am trying to generate names for my random creature generator but I either get too many that are close together, or ones that are just weird.
The names are pretty much the first thing generated. The scripts choose an adjective (which can be almost every word in the DF languages) and a creature noun (except in the entity script, where it can be an adjective plus a suffix), combines them in a few ways with the potential of a striking feature that gets added to the adjective (such as -wing or the way-too-common -eye) and the potential to translate one part of the name into an in-game language. In a later step, there are a few adjustments or randomizations based on creature types and such (one-eyed giants becoming cyclopes, fiends being diversified into demons, devils, brutes...).

I know that eye striking feature is annoyingly common and often makes little sense, paddleeye, dooreye, boateye, etc...  It's also pretty cool sometimes though crimsoneye, bloodeye...

Anyway,

I've got a personal solution for it that sort of filters out combos that don't make sense and if you can tell me the type of names bothering you I'm willing to try make an edit for you too.
Yeah, eye is way too common, partly because pretty much everything has eyes. A function that filters out certain symbols/words would be good.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

Roses

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #136 on: January 30, 2017, 04:55:34 pm »

Question, how do you go about choosing names for your random creatures? I am trying to generate names for my random creature generator but I either get too many that are close together, or ones that are just weird.

You could just rename them yourself in the raws, that would take a long time for a lot of creatures. Name generation is dealt with in the sphal.py script if you want to try to change generation yourself.

What's exactly your problem with the names? I know that eye striking feature is annoyingly common and often makes little sense, paddleeye, dooreye, boateye, etc...  It's also pretty cool sometimes though crimsoneye, bloodeye...

Anyway,

I've got a personal solution for it that sort of filters out combos that don't make sense and if you can tell me the type of names bothering you I'm willing to try make an edit for you too.

It's actually for a different program that I have written for creature generation. Right now I create names based on user input (actually all the creatures are created based on input, which is why it is different than Knight Otu's), I was just wondering if there was a fancy way to get names that I hadn't thought of. I'm on my phone right now, I will check out that script when I am able.
Logged

LCastillo

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #137 on: January 30, 2017, 05:55:52 pm »

It's actually for a different program that I have written for creature generation. Right now I create names based on user input (actually all the creatures are created based on input, which is why it is different than Knight Otu's), I was just wondering if there was a fancy way to get names that I hadn't thought of. I'm on my phone right now, I will check out that script when I am able.

Well, Knight's (and Sphal's script on which it is based) pulls from the language file from DF which has over two thousand nouns and adjectives. Which I think is a great resource to get words without having to find and add them yourself (Well I guess Toady One did).

There's only one problem with the approach, which is that the descriptors have no context or meaning unless it's coded in, which has to be done manually.

Having spent a significant amount of time doing this over the past week I can personally attest that this is a very confusing and laborious process.

I am almost done however, so if you'd like to see a couple thousand words organized into mostly-fitting categories that could reasonably have traits coded for them, feel free to take a look when I'm done. It might give you a couple ideas you want to incorporate.


Yeah, eye is way too common, partly because pretty much everything has eyes. A function that filters out certain symbols/words would be good.


The change actually only requires adding a couple lines of code, I'll include it and a relevant whitelist (So only eye names that make sense are allowed) when I upload my Sphal.py with updated adjective categories.

Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #138 on: January 31, 2017, 05:06:58 am »

I'm actually thinking a blacklist of symbols (and words) would be better in general, with the option of whitelisting a few words from those symbols if they fit the striking feature. I'm investigating that angle.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

LCastillo

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #139 on: January 31, 2017, 02:28:10 pm »

I'm actually thinking a blacklist of symbols (and words) would be better in general, with the option of whitelisting a few words from those symbols if they fit the striking feature. I'm investigating that angle.

Striking feature names are generated in two different spots using these lines of code:

Code: [Select]
                    if len(striking_feature_list) > 0:
                                for feature in striking_feature_list:
                                    name_sing = self.words_adj[self.creature_adjective][0]+feature.lower()+' '+prelim_sing
                                    name_plur = self.words_adj[self.creature_adjective][0]+feature.lower()+' '+prelim_plur
    possible_names[name_sing+':'+name_plur+':'+name_sing] = feature

Commenting it out stops their generation completely and I found adding a line here allows you to decide which names to accept as possible names:

Code: [Select]
                        if len(striking_feature_list) > 0:
                            for feature in striking_feature_list:
                                name_sing = self.words_nouns[self.creature_adjective][0]+feature.lower()+' '+prelim_sing
                                name_plur = self.words_nouns[self.creature_adjective][0]+feature.lower()+' '+prelim_plur                                                               
                                if feature not in ['EYE']:   #This line right here
  possible_names[name_sing+':'+name_plur+':'+name_sing] = feature

In the above case this line of code prevents eye features from being generated entirely, this can be easily modified to:

Code: [Select]
                        if len(striking_feature_list) > 0:
                            for feature in striking_feature_list:
                                name_sing = self.words_nouns[self.creature_adjective][0]+feature.lower()+' '+prelim_sing
                                name_plur = self.words_nouns[self.creature_adjective][0]+feature.lower()+' '+prelim_plur                                                               
                                if (feature not in ['EYE']) or self.creature_adjective in eye_striking_allowed_adjectives:  #This line right here
  possible_names[name_sing+':'+name_plur+':'+name_sing] = feature

This would then allow through any names included in the created adjective category that could be filled with all words that make sense when next to eye.

Having looked at over 1700 of them I don't think that the vast majority of words make sense in conjunction with striking features (especially eye), I think a whitelist would end up a lot shorter than a blacklist but I think a blacklist could be implemented with:

Code: [Select]
                        if len(striking_feature_list) > 0:
                            for feature in striking_feature_list:
                                name_sing = self.words_nouns[self.creature_adjective][0]+feature.lower()+' '+prelim_sing
                                name_plur = self.words_nouns[self.creature_adjective][0]+feature.lower()+' '+prelim_plur                                                               
                                if (feature not in ['EYE']) or not in self.creature_adjective in eye_striking_disallowed_adjectives:  #This line right here
  possible_names[name_sing+':'+name_plur+':'+name_sing] = feature

Obviously this works with any other striking feature type as well.
« Last Edit: January 31, 2017, 03:21:32 pm by LCastillo »
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #140 on: January 31, 2017, 03:22:56 pm »

I'd get rid of the unfitting striking features earlier than that, in these lines:

Code: [Select]
            #Now we build up a list of possible commong names, and then pick one randomly
            striking_feature_list = striking_feature_lists[self.creature_class][self.creature_type]
            possible_names = dict()
            if self.creature_adjective in striking_feature_list:
                striking_feature_list.remove(self.creature_adjective)
(eecch, gotta get rid of that typo)

That way, the names aren't generated in the first place.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

LCastillo

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #141 on: January 31, 2017, 05:17:52 pm »

I'd get rid of the unfitting striking features earlier than that, in these lines:

Code: [Select]
            #Now we build up a list of possible commong names, and then pick one randomly
            striking_feature_list = striking_feature_lists[self.creature_class][self.creature_type]
            possible_names = dict()
            if self.creature_adjective in striking_feature_list:
                striking_feature_list.remove(self.creature_adjective)
(eecch, gotta get rid of that typo)

That way, the names aren't generated in the first place.

I've grown attached to some of the typos though (I've actually been ctrl-f'ing commong to skip to this part of the code), like the consistent "Humanoid puch". (Though there may be a reason for this I'm not advanced enough to understand)

The spot you highlighted is certainly a better spot to make a change, I honestly had no idea what it did when I was first trying to fix striking feature names though.

Now that you point it out though it seems clear:

Code: [Select]
            #Now we build up a list of possible commong names, and then pick one randomly
            striking_feature_list = striking_feature_lists[self.creature_class][self.creature_type]
            possible_names = dict()
            if self.creature_adjective in striking_feature_list:
                striking_feature_list.remove(self.creature_adjective)
            if (self.creature_adjective not in eye_striking_allowed_adjectives) and 'EYE' in striking_feature_list:
                    striking_feature_list.remove('EYE')

Although, I will admit it took me an embarrassingly long time to figure out the syntax I needed to use to add more categories to properly test it.
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #142 on: February 01, 2017, 03:13:13 pm »

Oy. At least it's consistent, or the punchers would be in trouble. :'( I can the Englishs, I swears.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

LCastillo

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #143 on: February 05, 2017, 07:15:06 pm »

I've finally finished sorting all those words. Every word in the dictionary is now in a category in sphal.py.

Some of them are a bit of a stretch, or might fit better in other categories but I didn't want to spend too much time agonizing over details, when there were over two-thousand words to sort.

I've also added coding for a couple other features, like making mammals with bird, or "nest" words in their name lay eggs, or milk/cheese adjective animals milkable, and making sure eye-names are only generated when they make sense.

The biggest change is I finished adding some natural attacks and parts for animals with "axe" names like we discussed, I've tested everything and integrated it so it doesn't break anything, (I hope so anyway).

I also plan on doing "sabre" and other weapon types but I know you were mainly interested in the updated word list so I didn't want to delay uploading it.

https://drive.google.com/drive/folders/0ByVsQCh9_uAMbHBfVzNHTE1aQkU
« Last Edit: February 05, 2017, 07:46:07 pm by LCastillo »
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #144 on: February 06, 2017, 10:55:26 am »

Cool, thanks. I've taken a quick look with Meld. Looks very throughout, though I guess there'll be a few things I won't take along for my version, a few duplicates, and from the added comment, there's some problem with the spheres - is that on my end?
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

LCastillo

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #145 on: February 06, 2017, 02:53:27 pm »

Oh, the sphere's comment was a reminder of when I accidentally put a period instead of a comma somewhere and it wouldn't compile and I needed to narrow down where so I could fix it.

I've got a question for you, I'm trying to generate an output file to assign creatures tiles from a tileset. Do you you have any thoughts on the best way to do this?
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #146 on: February 07, 2017, 01:01:06 pm »

Not as such, no. It shouldn't be too difficult if you have the graphics files at hand and add the coordinates to the constants file though. (I've entertained the pipe dream that the script might create a graphics file, but I really don't have the expertise for that yet.)
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

Vitor_Goatman

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #147 on: February 07, 2017, 03:23:21 pm »

Are the random entities sentient or can be playable via adv mode or fort mode?
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #148 on: February 07, 2017, 04:42:53 pm »

The entity creatures are sapient, and most are playable in adventure mode (those that live in cities, forest retreats, and mountain homes as standard adventurers, and cave dwellers as outsiders). Those that live in dark fortresses can't be played as due to the status of the sites at the time - they can be a pain to navigate without fast travel (though if some settle with playable civs, they can be played as members of those civs). They aren't playable in fortress mode without modding because of how the game currently handles multiple playable entities, but I'm planning to add an option to make certain entities fortress-playable.
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

LCastillo

  • Bay Watcher
    • View Profile
Re: [0.43.05] Random Raw Scripts - Random entities
« Reply #149 on: February 07, 2017, 08:00:17 pm »

Not as such, no. It shouldn't be too difficult if you have the graphics files at hand and add the coordinates to the constants file though. (I've entertained the pipe dream that the script might create a graphics file, but I really don't have the expertise for that yet.)

It remains a pipe dream no longer my friend. I've figured out how to do it. It even retains the colors assigned to them by the script. :)
Logged
Pages: 1 ... 8 9 [10] 11 12