.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Scenarios, Maps and Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=146)
-   -   Mod: UnitGen - Random nations with procedural sprites! (http://forum.shrapnelgames.com/showthread.php?t=48341)

elmokki April 9th, 2012 03:37 AM

Re: UnitGen - Random nations with procedural sprites!
 
Newest possible. Though I believe 6 should be new enough for UnitGen.

Ragnarok-X April 9th, 2012 04:43 AM

Re: UnitGen - Random nations with procedural sprites!
 
I tried this some more and came up with the following suggestions. I hope you can include them.

Most nations made are too generic. I think 6 or 7 times (out of 8) i got a nation with 4 normal infantry w/ mace, spear, axe, falchion, then heavy variants of these 4 guys, sometime 1 rider, always 1 (interesting!) sacred.
Commanders were mostly 1 spy, 2 commanders w/ different weapons, 1 priest and 3 mages + 1 high priest.
I think you need to add more diversity.
For example, i believe most nations should NOT get a melee variant for *each* weapon chassis.
Maybe give it a 100 % chance for a combination of 2/2 infantry/heavy infantry variants, i.e. spear/axe or spear/mace or mace/ace with a 100 % offchance for the same heavy variant.
Then, a 35 % chance to add in a third melee guy with new weapon (i.e. 35 % a nation with spear/axe gets mace) and then anohter 35 % to get the fourth melee variant. Maybe a 20 % base-chance for a dualwielder of a random weapon.
In addition, a %-based chance to get 2 sacreds and/or light/heavy variant of a sacred.

Regarding commanders, they need better naming. The nations i made all had 2 commanders, which unfortunally were named "Commander" too.
I wish you had randomness to the naming, i.e. even chance for name "Commander", "Lord", "General", "Warchief".
Then, instead of giving 2 alternate commanders w/ different weapon, make the nation have 2 REALLY different commanders (i.e. 40 leader vs 80 leader /w standard). For Example, Commander and High Commander, Lord and Great Lord, Warchief and Seasoned Warchief.

In addition, give the nation a small chance to get the commander-class a magic pick (i.e. the tool creates a high commander that has 1 magic pick with a 10 % chance -> NOT 10 % per recruit, but a 10 % chance to get a 100 % m1 commander in nation creation).

Same goes for holy mages, i.e. some nations get H1 on their lesser/higher commander).

Lastly, maybe you could introduce a .ini file for this. The value aboves (%-chances) are defined using a .ini file, and everyone could alter their .ini file to get the programm to create nations like they want.

I applaude your work and hope you consider my suggestions.
The coolest race i got had serpent cataphracts and the sacred was a spider rider + h3 high priest. And i got hoburgs that got a sacred poison spearman.

elmokki April 9th, 2012 10:42 AM

Re: UnitGen - Random nations with procedural sprites!
 
Well, normal troops are right now generated so that nation gets 3 or 4 different weapons and 2 or 3 different armors and every single combination is generated for infantry. For archers 1-2 weapons are generated and two armor variants for each weapon are generated. Cavalry is a bit different, nations get 1-3 mounts and then they get: lance cavalry or onehanded cavalry depending on a dice roll, two handed cavalry if possible (basically only if there's a great axe available actually), and a light lance cavalry. The program tries to generate cav versions for each armor, but it also depends on the available mounts. If there isn't a heavy mount then there just simply isn't a full plate cavalry unit. Obviously when a race just doesn't get some role, it won't be generated. Abysians don't get ranged, chariots or cavalry, lizards don't get cavalry and flying races don't get cavalry or chariots.

So basically you're looking at potentially like 20-24 units we're thinning the herd down from. The thinning algorithm first decides the roster size in all different areas (cav/chariot/ranged/infantry) and then starts thinning the units. Generally it always tries removing a whole tier of armor from that role first, if that is too much it tries removing one weapon type and if everything else fails it removes a random single unit. I do agree that I should probably make it chance based so that it at least sometimes - actually might be a good idea to have it do it pretty often - prioritizes removing a random unit.

I would, however, like to note that troop rosters in the game are relatively monotonous already. Many nations get very similiar units with minor changes, and it's okay. It's obvious people won't in general recruit more than 3 or 4 different unit types at most. Even then in some cases it allows a tactical choice (naginata vs katana vs no-dashi is at the very least tougher than mace vs spear vs broad sword), even though that choice is an once per choice and varies between players, not between turns in a single game (or well, naginata is 4 more damage than katana, but the pricinple stays).

The commander generation in all it's simplicity right now is picking existing troops so that all the special tags (like flying, stealthy, amphibious, 50% chance of sacred to be guaranteed to be a com) are filled if possible. I agree it could use some 80 leadership commanders, more diverse naming - especially the sacred commander version of let's say Death Templar should probably be something like Death Lord - and both commanders and priests should have magic occasionally. It isn't exactly a high priority though since unless a commander (I'm mostly looking at sacred commanders) is thugworthy or has an useful special trait (flying for that hoburg hawk cavalry or stealthy for stealthy troops) it just won't be recruited almost at all.

You can already change many of the probabilities for the program. You can't influence mage setups (1, 2 or 3 primary mages) or the path patterns they get (one path at 3, one path at 2 and one random is more common than let's say two paths at 2 and 2 linked randoms). You also can't influence the cav-chariot-archer-infantry ratio. What you can, however, influence is the probability of appearance for different sorts of magic weapons for sacreds, different sorts of special features for mages, sacreds and priests, and different sorts of gear for every single unit generated. Oh yeah, also general nation traits (both stuff shared by all units of primary race and stuff like blood sacrifice) and the probability of different pretender chassises appearing are modifiable.

Ragnarok-X April 9th, 2012 11:27 AM

Re: UnitGen - Random nations with procedural sprites!
 
I understand your reasoning, and obviously its your tool. I just posted what i would be looking for in a programm should i use it. Of course i already do use it for SP, but i think the suggestions i made would make it even better. I think most dom 3 players love flavour, variance and decision-making, as such, adding more unique/diversity would add a lot.
Im looking forward to newer revisions, especially if you enable (...) even more user-customization.
thank you.

I forgot to mention, the spider-mount sacred i got, they even had enchanted maces. Good times.

elmokki April 10th, 2012 08:18 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/elmokki/dom3/un...en_11_4_12.zip

SpriteGen shows a 2x zoom version along with the normal image. UnitGen may have something new, not sure if I've touched it.

Ragnarok-X April 11th, 2012 05:51 AM

Re: UnitGen - Random nations with procedural sprites!
 
I have a small bug report and a suggestion.

Firstly, in the last 2 days i created a lot of nations and played them for 2 or 3 turns. About 30 or so.
I had many occasions, where units had the sprite of holding a flail, but they were actually equipped with a mace. You might check that, im pretty sure there is art mixup there.

I have to say something about balance yet again. I suppose all these nations are made with middle era in mind. However, i found that there is really strong bias towards heavy protection in the nations made. Out of 30 nations, i would say about 20 had protection 14+, many even protection 16+. Many nations felt like you were playing Ulm. I didnt matter if i got lizards, hoburgs or humans, heavy protection nations were certainly favoured among nation creation. I believe you might want to check that, maybe lower the bance chance for heavy armor and stuff. Nations similar to Miclan (i.e. low protection in general or sacred heavy) nations seem to be impossible atm, maybe you can add a modifier which grants + sacreds or disabled heavy armor to increase variance.
In addition to the different mounts, i would love if you would add the tien chi tiger or miclan jaguar as base mount arts. Maybe even add pegasus or griffin knight wings as a sprite so there can be flying boards, lizards, tigers. That would be awesome.


Regarding sacred creation, i got a bunch of nations that got a sacred with crossbow and heavy melee weapon, which is rather unfortunate. Maybe decrease the chance for that. Ranged and dagger or melee and jav or poision pipes is fine, but many times i got stuff like long spear and crossbow or enchanted mace and arbalest, which seems unlikely and less useful.

Lastly, one thing in particular i did not like is how ranged stock units are created. Several times i got crossbow or arbalest infantry, of course with 2 variations, normal and heavy. In these cases, the heavy variants had heavy armor (obviously) and ressource cost went from ~ 15 to 25/30. I think this is rather useless. I never found myself in the situation where i wanted to buy heavy armor ranged infantry especially considering the increased ressource cost. I think you should definitly disable the routine that automaticly creates a heavy armor variant, at least for xbow/arbalest shooters.
Im so looking forward to further tinkering with unitgen and hope for updates and more features. Thanks for including the sprite-zoom in spritegen.


edit: lastly, would it be possible to create a logfile with each nations created ? I would like to the reason for nation creation, i.e. the exact rolls that resulted in certain units being created.

elmokki April 11th, 2012 11:38 AM

Re: UnitGen - Random nations with procedural sprites!
 
Quote:

Originally Posted by Ragnarok-X (Post 801281)
I have a small bug report and a suggestion.

Firstly, in the last 2 days i created a lot of nations and played them for 2 or 3 turns. About 30 or so.
I had many occasions, where units had the sprite of holding a flail, but they were actually equipped with a mace. You might check that, im pretty sure there is art mixup there.

I need the races of these units to look at it. There's no way it can happen on all races since Tengu and Hoburgs don't even get flails and Abysians have a different sprite for it than the other nations.

Quote:

I have to say something about balance yet again. I suppose all these nations are made with middle era in mind. However, i found that there is really strong bias towards heavy protection in the nations made. Out of 30 nations, i would say about 20 had protection 14+, many even protection 16+. Many nations felt like you were playing Ulm. I didnt matter if i got lizards, hoburgs or humans, heavy protection nations were certainly favoured among nation creation. I believe you might want to check that, maybe lower the bance chance for heavy armor and stuff. Nations similar to Miclan (i.e. low protection in general or sacred heavy) nations seem to be impossible atm, maybe you can add a modifier which grants + sacreds or disabled heavy armor to increase variance.
It can be tweaked pretty easily. I'll also probably need to look into nation tag generation since some nations did at some point occasionally get tagged "primitive" and those nations generally were in leather and some ring mail.

Quote:

In addition to the different mounts, i would love if you would add the tien chi tiger or miclan jaguar as base mount arts. Maybe even add pegasus or griffin knight wings as a sprite so there can be flying boards, lizards, tigers. That would be awesome.
Flying whatevers is actually a pretty neat idea and can definitely be implemented. Mounts (and helmets, weapons and shields) are very easy to add in general, but my policy is that I don't really take requests on graphics as the whole program is designed so that pretty much anyone can define new stuff in so I don't have to do all the graphics (that said like 95%+ are made by me currently and the rest is by kianduatha)

Quote:

Regarding sacred creation, i got a bunch of nations that got a sacred with crossbow and heavy melee weapon, which is rather unfortunate. Maybe decrease the chance for that. Ranged and dagger or melee and jav or poision pipes is fine, but many times i got stuff like long spear and crossbow or enchanted mace and arbalest, which seems unlikely and less useful.
Not all sacreds need to be useful, but I do agree that at the very least the primarily ranged sacreds should have a reduced chance of getting a magical melee weapon.

Quote:

Lastly, one thing in particular i did not like is how ranged stock units are created. Several times i got crossbow or arbalest infantry, of course with 2 variations, normal and heavy. In these cases, the heavy variants had heavy armor (obviously) and ressource cost went from ~ 15 to 25/30. I think this is rather useless. I never found myself in the situation where i wanted to buy heavy armor ranged infantry especially considering the increased ressource cost. I think you should definitly disable the routine that automaticly creates a heavy armor variant, at least for xbow/arbalest shooters.
Take a look at base game ranged units. Yes, the only units people tend to use are the lightest ones possible, but there still are plenty of needlessly heavy crossbowmen (as an extreme, Agarthan full chain crossbowmen, but nations like MA Ulm get a fairly heavy crossbowman already). Not all the units need to be useful, which is the case in all categories. That said the heavy armor on ranged might be too common right now, so it could probably get some weighing towards lighter armor (this is also something absolutely anyone can do)

Quote:

edit: lastly, would it be possible to create a logfile with each nations created ? I would like to the reason for nation creation, i.e. the exact rolls that resulted in certain units being created.
I'll take that to mind for if/when I bother to rewrite some systems to be more user accessible.

Ragnarok-X April 11th, 2012 12:40 PM

Re: UnitGen - Random nations with procedural sprites!
 
hey,

i realize most my sugggestions (like chances for armor, weapons, equipment) can be modified using the existing files. However, i have one huge problem with that. Currently im already using several modded files, i.e. i added more description variables for sacreds, more tri-path mage-class names suffix and prefixes but at some point i realized all of my altered files will be gone for good if i download a new revision and replace all the files. Since i already dont know which files i tinkered with, (and thus cant save) i decided to stop modding them alltogether until you realize a "breakthrough" revision which then will be more durable.

If i do sprite parts for tiger/jaguar (more maybe) will you incorporate them in offical revisions ?

elmokki April 11th, 2012 01:01 PM

Re: UnitGen - Random nations with procedural sprites!
 
Quote:

Originally Posted by Ragnarok-X (Post 801327)
hey,

i realize most my sugggestions (like chances for armor, weapons, equipment) can be modified using the existing files. However, i have one huge problem with that. Currently im already using several modded files, i.e. i added more description variables for sacreds, more tri-path mage-class names suffix and prefixes but at some point i realized all of my altered files will be gone for good if i download a new revision and replace all the files. Since i already dont know which files i tinkered with, (and thus cant save) i decided to stop modding them alltogether until you realize a "breakthrough" revision which then will be more durable.

When you do changes submitting stuff to for example this thread is a pretty good idea.

Quote:

If i do sprite parts for tiger/jaguar (more maybe) will you incorporate them in offical revisions ?
Pretty much anything that looks decent will be added in. I do hope though that instead of just graphics people will also do the text based parts of item additions, since in some cases that's like half the work.

Ragnarok-X April 11th, 2012 02:35 PM

Re: UnitGen - Random nations with procedural sprites!
 
If possible (please) could you alter the routines so that not every race gets an heavy armed variant of each infantry ? Something like a 50 % chance to spawn a heavy variant would be great (for me). In additionn, please alter the amount of base types so that not each race gets 4 melee weapon variants. If you dont feel like altering it in general, would you kindly explain to me where these values are stored ?

Regarding the mace/flail thingy, i was mistaken. It was not a mace, it was a morning star. I.e. many races had units with a flail artwork but a morning star equipment. I will run another 10 nations today evening and if i spot anything, i will post it.

Here are the mods i was able to find.




magicweapons
-- 64: decay
#unitname "prefix warped"
#unitname "suffix 'of warp'"

-- 216: Fire
#unitname "prefix charring"
#unitname "suffix 'of char'"

-- raising
#unitname "prefix soulbound"
#unitname "suffix 'of reanimation'"


sacredarmdesc
"answering their gods call, %unitname% armed with both faith and %weapons%, they are staying true to their believe"
"recruited into service, %unitname% are now leaving their holy ground, bringing justice in their gods name"
"wilding %weapons% blessed by faith, %unitname% is now forcing everyone to acknowledge the one true god"

majormagicdesc
"The %unitname% of %nation% long studies make them knowledgeable in %magics%"
"The %unitname% of %nation% are born with an affinity in %magics%"
"The %unitname% of %nation% have reached expertise in %magics% due to long training"

adjectives
planar 3 astral earth death
maelstrom 3 fire death nature
putrid 2 death nature
gorgonic 2 death nature
Acashic 3 astral

sacredparts
-- Generic
#define
#name "divine"
#tag "notsuffix"
#basechance 1
#end

#define
#name "just"
#tag "notsuffix"
#basechance 1
#end

-- Nature
#define
#name "firstborn"
#basechance 0
#chanceinc "magic nature 1"
#tag "notsuffix"
#end

#define
#name "primordial"
#basechance 0
#chanceinc "magic nature 1"
#tag "notsuffix"
#end

-- Crosspath
#define
#name "hellbent"
#basechance 0
#tag "notsuffix"
#chanceinc "magic earth fire 2"
#end

#define
#name "radiant"
#basechance 0
#tag "notsuffix"
#chanceinc "magic fire astral 2"
#end

#define
#name "devouring"
#basechance 0
#tag "notsuffix"
#chanceinc "magic earth nature 2"
#end

elmokki April 11th, 2012 02:51 PM

Re: UnitGen - Random nations with procedural sprites!
 
Quote:

Originally Posted by Ragnarok-X (Post 801339)
Regarding the mace/flail thingy, i was mistaken. It was not a mace, it was a morning star. I.e. many races had units with a flail artwork but a morning star equipment. I will run another 10 nations today evening and if i spot anything, i will post it.

Morningstar is graphically pretty much a flail with just one ball-in-chain and one hand length shaft. While I personally consider both the Dominions 3 long two handed flail and the graphic for morningstar flails and morningstar a spiked ball on a shaft without a chain, Dominions 3 base graphics have morningstar drawn as one handed flail so it's the same in UnitGen.

Ragnarok-X April 11th, 2012 04:51 PM

Re: UnitGen - Random nations with procedural sprites!
 
Well, that wasnt too hard. Since i cant add new basesprites into spritegen, i just created tiger and named it like the boar mount. Selected boarmount in the tool, preview showed the tiger, saved and it worked.

http://prntscr.com/80h8s

Can you add functionality to add new sprites for users ?

elmokki April 12th, 2012 02:10 AM

Re: UnitGen - Random nations with procedural sprites!
 
You can add sprites. You just need to define them as mounts for a race.

Like for example humans, you'll probably want to go to /races/human/human_mounted/humanmounts_low.txt (humanmounts.txt is horses, the difference is the positioning of the leg: it's "shorter" in the non-horse poses)

There you'll just add like
Code:

#newitem
--- Pretty much any name an another mount doesn't already have
#name "tiger"
--- Only matters for for items that the game considers items, ie armor, shields and weapons.
#gameid -1
--- Replace with your tiger sprite:
#sprite /graphics/mounts/standard/serpent1.png
--- Doesn't matter if this really exists or not since it's just for indicating some #gameid is armor instead of weapon
#armor
--- Since it's a mount these mean the actual rider will be 7 pixels left from the normal position and 14 pixels below the normal position. You'll probably want to ignore these at first and then adjust them once you see your sprite in SpriteGen.
#offsetx -7
#offsety 14
--- mountedoverlay.txt in the same folder defines an overlay named "6" (yes, terrible name) which is pasted on top of everything after everything else is drawn. This is basically the mount's head and most visible on spider where it makes the leg look decent.
#needs overlay 6
--- #define commands define what stats the item should affect
#define "#size 3"
#define "#mapmove 2"
#define "#ap 18"
#define "#mounted"
#define "#weapon 19 --- Bite"
--- This is a bit different. You can just give it a number, but if you want the mount to be sacred/not sacred depending on the rider you'll need to go play with /nations/secondshapes.
#define "#secondtmpshape serpent1"
--- The +35 is there to indicate it increases gold cost, the other stuff don't have + or - so they just set the value to that.
#define "#gcost +35"
#define "#ressize 2"
#define "#enc 3"
--- The "animal serpent" #theme line is pretty important for summaries and generating somewhat coherent lineups
#theme "animal serpent"
#theme "light"
--- Guaranteed (it's a bit bugged so it isn't) prefix for units, ie most cavalry with this mount are "Serpent Cavalry"
#tag "guaranteedprefix serpent"
--- Maximum chest armor prot this mount can carry, minprot is the opposite. If you plan to make a mount with 0 to 100 armor, you probably want to split it to 0 to 12 and 13 to 100 versions with different gold cost increases.
#tag "maxprot 13"
#enditem

The reason I'm not very happy with just graphics is that writing those things to right places is actually usually more work than some weapon or mount or similiar.

Ragnarok-X April 12th, 2012 01:21 PM

Re: UnitGen - Random nations with procedural sprites!
 
Ok, i see. Its actually a lot of work to implement sprites if you want to associate them with values.
Assuming i add the tiger like you described, it will not only show up in spritegen, but from then on it will as well be used in nation gen ? I dont think so, right. Can you write a tutorial about getting it to show up in unitgen, i.e. where to set base chance and stuff ?
Once i have a full tutorial, i could begin adding real units.

Ragnarok-X April 12th, 2012 01:25 PM

Re: UnitGen - Random nations with procedural sprites!
 
Code:

#newitem
#name "tiger"
#gameid -1
#sprite /graphics/mounts/standard/tiger.png
#armor
#offsetx -4
#offsety 4
#define "#size 3"
#define "#mapmove 2"
#define "#ap 18"
#define "#mounted"
#define "#weapon 19 --- Bite"
#define "#gcost +35"
#define "#ressize 2"
#define "#enc 3"
#define "#rcost +5"
#theme "animal serpent"
#theme "light"
#tag "guaranteedprefix serpent"
#tag "maxprot 13"
#enditem

This is what i added.
I then did put a barechest guy with spear on top of it.
the unit def turned out like this>

Code:

--- Unnamed, Gold: 40, Resources: 9
#newmonster 0
#name "Unnamed"
#spr1 ".unit_0_a.tga"
#spr2 ".unit_0_b.tga"
#descr "No description"
#gcost 40
#ap 18
#mapmove 2
#mor 10
#mr 10
#hp 10
#str 10
#att 10
#def 10
#prec 10
#enc 3
#size 3
#mounted
#weapon 352
#ressize 2
#rcost 5
#armor 118 --- Half Helmet
#weapon 1 --- Spear
#end

Now, i think this is wrong. Its missing the bite attack and a potential stat increase for being mounted. What am i missing _
thanks

Ragnarok-X April 12th, 2012 04:23 PM

Re: UnitGen - Random nations with procedural sprites!
 
1 Attachment(s)
I added tiger, jaguar and wyvern.
Unfortunally the wyvern sprite doesnt show the FACE of the base human.
why not ? I aligned the sprite of the wyvern on top of the pegasus rider, so the offset is correct.

Will you include the edits from earlier (where i posted in code) in the next build ?
Because if not, i wont bother to post all the stuff in this thread, thanks.
If you, i can upload the sprites and altered .txts entirely or just in code-tags like earlier.
In addition, do you want my "help" / posting in here or on the dom3mods ?


dont mind with the attachments, i forgot to add weapon with the nostrength tag to the mounts. But you can check the problem witht he wyvern if you would.
The files in general work, i just got a tiger rider to spawn in a nation.

elmokki April 12th, 2012 05:29 PM

Re: UnitGen - Random nations with procedural sprites!
 
The wyvern problem is not because of you, apparently it's because of a bug that affected the hoburg hawk riders earlier too. I fixed it any from next version on it should look fine. The wyvern, however, probably needs an overlay to not look silly (you'll probably see once it's fixed and use big shield and big weapon). If you really want to get this fixed quick, go to races/human/poses.txt and add the line:

#renderorder "shadow cloakb mount basesprite shirt legs armor cloakf bonusweapon weapon offhandw hands hair helmet offhanda overlay"

to both mounted poses, ie after the #newpose line obviously.

In general, good job. They look good and seem to be positioned correctly too. Your item definition code looks good and it DOES add the bite attack when I tested it. Your unit has #weapon 352 which is the boar #nostr gore attack, so maybe you did some mistake? The unit price is lower than supposed probably because it's naked and gets the -30% cost reduction and is rounded to closest 5 afterwards.

Code:

#newmonster 0
#name "Unnamed"
#spr1 ".unit_0_a.tga"
#spr2 ".unit_0_b.tga"
#descr "No description"
#gcost 30
#ap 18
#mapmove 2
#mor 10
#mr 10
#hp 10
#str 10
#att 10
#def 10
#prec 10
#enc 3
#size 3
#mounted
#weapon 322
#ressize 2
#end

This is also adding these items to unitgen. With your files occasionally it would indeed generate units with those mounts. I forgot to mention that at the moment you can use #skipchance 0-100 to make mounts rarer. #skipchance 100 means it will never be generated, #skipchance 50 makes it a 50% chance to skip over the mount. This system will change eventually if I can be arsed to code though, since everything else uses a system where you write the chances differently and it's a better system.

You'll also probably want to use the #theme "animal serpent" correctly (and pretty much all the possible minimum and maximum armor things too), ie #theme "animal tiger" for tiger, otherwise you'd see tigers bundled with serpents very often. You'll also probably want to add a claw attack to the tigers since I think they have both claw and bite in Dom3.

I don't care which forum you post on, but I do prefer code tags instead of whole files since that way I can just copy paste the new stuff without worrying it replaces something I've changed recently.

Ragnarok-X April 13th, 2012 12:04 PM

Re: UnitGen - Random nations with procedural sprites!
 
Thanks for the update.
Regarding #skipchance, thanks for letting me know. However, i dont plan on using it anytime soon since i actually had to create 4 batches of 10 nations until the tiger showed up. If at all, i need a way to increase the spawn.
I asumme i can set the tiger to "animal tiger" and use "preferredmount tiger" in the nation files, or do new pref-mounts dont work, i.e. is it hardcoded for serpent, horse, boar and stuff ?

Regarding min/max protection, am i right in assuming its referring to the base units prot values ? i.e. using only maxprot 15 will force the game to ONLY spawn this mount if the mounted unit has a prot no higher than 15 ?
If so, what will it do if the mounted unit has a prot outside the mounts specified value ?

Lastly, can you elaborate on the "naked unit" thingy again ? What exactly is wrong with it ? Do you mean the units price is too low and i need to add a certain to the mount ?

Then, what is your stance on secondshape ?
Horse units, when killed, dont spawn the horse. Lizards and snakes however create the animal unit once the rider is killed.
How do YOU want it to be with tigers, jaguars, wyvern (and im going to add bears and nightmares later) ? Should they have a secondshape on death or not ?


Can you be found in IRC or some messenger more regulary than on this forum ?
Can you release a new version of spritegen with the fixed wyvern bug so i can continue adding things on a updated version ?

kianduatha April 13th, 2012 01:28 PM

Re: UnitGen - Random nations with procedural sprites!
 
Quote:

Originally Posted by Ragnarok-X (Post 801566)
Thanks for the update.
Regarding #skipchance, thanks for letting me know. However, i dont plan on using it anytime soon since i actually had to create 4 batches of 10 nations until the tiger showed up. If at all, i need a way to increase the spawn.
I asumme i can set the tiger to "animal tiger" and use "preferredmount tiger" in the nation files, or do new pref-mounts dont work, i.e. is it hardcoded for serpent, horse, boar and stuff ?

Regarding min/max protection, am i right in assuming its referring to the base units prot values ? i.e. using only maxprot 15 will force the game to ONLY spawn this mount if the mounted unit has a prot no higher than 15 ?
If so, what will it do if the mounted unit has a prot outside the mounts specified value ?

Lastly, can you elaborate on the "naked unit" thingy again ? What exactly is wrong with it ? Do you mean the units price is too low and i need to add a certain to the mount ?

Then, what is your stance on secondshape ?
Horse units, when killed, dont spawn the horse. Lizards and snakes however create the animal unit once the rider is killed.
How do YOU want it to be with tigers, jaguars, wyvern (and im going to add bears and nightmares later) ? Should they have a secondshape on death or not ?


Can you be found in IRC or some messenger more regulary than on this forum ?
Can you release a new version of spritegen with the fixed wyvern bug so i can continue adding things on a updated version ?

Elmokki can be found most of the time on IRC, the standard gamesurge #dominions channel.

I am fairly confident that whatever you prefer in terms of hte secondshape will be fine; if it turns out to be unbalanceable it'll be changed.

Naked/very lightly armored units get up to a 30% price decrease automatically because that rough idea is also present in baseline dom3. Light cav therefore automatically costs less than heavy cav and so on.

Max/minprot are there so you can say that naked people shouldn't be riding heavily barded horses--currently horse cav is split up into light cav(unarmored horses) medium(like light cataphracts etc) and heavy, each with even their own equipment sets(to prevent 'naked guy with a lance' etc. Protection values generally conform to the actual protection, i.e. after base prot and armor have been taken into account.

elmokki April 13th, 2012 04:06 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/elmokki/dom3/un...en_13_4_12.zip

I'll probably forget something but:
- SpriteGen gets a x/y sliders for mount offsets. This is purely cosmetical and meant to help getting mount sprites to correct places. Won't happen for other items for now because that's slightly more problematic.
- UnitGen accepts seeds. It should theoretically generate the same set of nations if you create a mod with same amount of nations and
- Item #skipchances have been replaced with the #basechance commands which work like filters, ie if you don't specify anything item's weigth for randomizing is 1, if you specify something, that is used. And item has chance of weight/(all weights) to be chosen.
- Tweaks. Bonus weapons seemed somewhat broken so I fixed them. Also gave Abysians a special feature which should make bonus weapons on them more common even with a bit heavier armor.
- Only tengu commanders and sacreds get the lightning strike. This is a special racial command too and customizable
- Added settings.txt where you can edit some settings. More editable stuff will probably come eventually.
- Added a pile of mounts for humans by Ragnarok-X
EDIT: Sacred commanders should also be able to get H1 occasionally.

It crashes occasionally (but is very usable anyway since it isn't that common) on generation, gonna fix it later.

elmokki April 14th, 2012 12:16 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...en_14_4_12.zip

Raiel had the awesome notion of giving a possibility of generating each nation with a separate seed. This was a brilliant idea, since now we have a concept for one more cheat preventing multiplayer method: allow players generate nations until they find one they like and then just make a mod with all the seeds players have submitted. Alternatively you could use the old semi-blind selection but just generate like 200 nations and then build a new mod on their seeds. This feature is disabled by default but the .dm file will always contain randomly chosen nation seeds if you wish to reproduce your random nations later. You can enable this and some other new interface related stuff at settings.txt

Changelog roughly:
- More awesome new mounts for humans and hoburgs by Ragnarok-X, including for example ozelotl (the flying tiger), beast bat, amphithetre and moose.
- Some name/description stuff by Ragnarok-X
- Normal/sacred commanders sometimes (relatively often) get higher maximum leadership
- Mounted hoburgs can't get tower shields (such a huge change!)
- Settings.txt contains some stuff that may or may not make life easier
- You can generate mods with each nation having a different seed (see the above small wall of text)

elmokki April 14th, 2012 03:48 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...14_4_12-v2.zip

Earlier version broke ranged naming, it's fixed now along with some other very minor fixes.

elmokki April 14th, 2012 07:58 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...en_15_4_12.zip

Balanced the mounts a bit, sacred weapons get potentially a slightly smaller stat increase when they do (from 2 to 6 to 1 to 4 for melee) and tweaked sacred cap only chances (settings.txt!)

jimbojones1971 April 16th, 2012 10:17 PM

Re: UnitGen - Random nations with procedural sprites!
 
A few of questions:

1) How do I tweak it to get it to only generate nations for a particular race? I tried two things:
- setting the #basechance values in races.txt to 0.0 for nation's I didn't want (and either leaving the #basechance value for the nation I want as-is, or also increasing it to 1.0).
- removing all nations I don't want from the races.txt file, leaving only the one I want

Neither of these worked - both resulted in the game hanging in the "generating nations" step. Help! :-)

2) Are there any command line switches?

3) Is there any chance of getting a look at the source, to satisfy my curiousity about what you are doing and how you are doing it? How about if I beg?

elmokki April 17th, 2012 05:28 AM

Re: UnitGen - Random nations with procedural sprites!
 
Quote:

Originally Posted by jimbojones1971 (Post 801866)
A few of questions:

1) How do I tweak it to get it to only generate nations for a particular race? I tried two things:
- setting the #basechance values in races.txt to 0.0 for nation's I didn't want (and either leaving the #basechance value for the nation I want as-is, or also increasing it to 1.0).
- removing all nations I don't want from the races.txt file, leaving only the one I want

Neither of these worked - both resulted in the game hanging in the "generating nations" step. Help! :-)

2) Are there any command line switches?

3) Is there any chance of getting a look at the source, to satisfy my curiousity about what you are doing and how you are doing it? How about if I beg?

1) Not possible. It generates secondary and tertiary race for each nation just in case it's needed so the program will die without at least three races. Methods you tried are in principle okay though. It wouldn't be a too big change to make the secondary and tertiary races generated only if they are required and if they exist though.

2) No, editing files and especially settings.txt are supposed to do what command line arguments would do

3) http://koti.kapsi.fi/elmokki/dom3/un...7_4_12-src.zip
As I keep saying, the quality of code ranges from horrible to somewhat decent and it's largely uncommented. That said it's not so complicated program that it's impossible to make sense of at least most of it anyway.

The biggest issue is that there has been like no planning ahead so there's pointless copy paste code that could've been avoided all over the place. In terms of readability it would benefit a lot from a major rewrite :D

Oh well, if you find something you think should be changed, do tell.

jimbojones1971 April 17th, 2012 05:42 AM

Re: UnitGen - Random nations with procedural sprites!
 
Thanks elmokki, you are a legend! :-)

It sounds like the program needs at least three races. Could I in theory (without attempting to tweak the code) just past in three versions of the same race in races.txt, to achieve the same effect? (e.g. blue hoburgs, black hoburgs, and pink hoburgs for example).

elmokki April 17th, 2012 01:07 PM

Re: UnitGen - Random nations with procedural sprites!
 
Quote:

Originally Posted by jimbojones1971 (Post 801883)
Thanks elmokki, you are a legend! :-)

It sounds like the program needs at least three races. Could I in theory (without attempting to tweak the code) just past in three versions of the same race in races.txt, to achieve the same effect? (e.g. blue hoburgs, black hoburgs, and pink hoburgs for example).

Yeah, that should work. They can probably have the exact same name too. The nation summaries may be a bit skewed (like, Hoburgs, some Hoburgs, Hoburg auxillaries) in some cases though.

elmokki April 20th, 2012 06:44 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...en-21-4-12.zip

Tweaks and spritegen allows shifting any item to find suitable offsets.

elmokki April 29th, 2012 09:12 AM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...en_29_4_12.zip

A while since the last update but:
- A change on how same role poses are generated, more explanation below.
- Tengus not generating as a primary race, more explanation below as well.
- Oriental humans added as a race, though they still lack a mounted pose (and I forgot to give them the correct nametype)
- Atlantians by RagnarokX are partially in. They don't generate yet though since they aren't ready enough.

The same role pose generation used to require all poses of a certain role sharing the same armor. This happened with all existing things since it made no sense to have the two hander pose have less armor options than the onehand/polearm pose. Atlantians (and Caelians, just not implemented yet) however probably want to have some ice armor and whatnot stuff that generates only as a whole and RagnarokX wanted Atlantians to have shamblers in their race with yet different armors. This may still be somewhat glitchy, but by using command #tag "replacement itemname" you can make the software think some item is an another. As an example if I defined the full plate item on onehander pose of humans with #tag "replacement leatherhauberk" any twohander the program tried to generate with full plate would have leather hauberk instead. Since this inevitably would lead to duplicate units in some cases, I also added a sort of a failsafe that diversifies weapons a bit in these cases.

Tengus did lose their lightning strike from non-sacred non-commander troops a while ago, but at 15g I think they still are pretty good. Sure, size 3, but the stats are rather high and their gear in general was quite good thanks to consisting mostly of Jomonese super weapons. Currently no tengu nations will be generated, but nations of other races may get some tengus in their lineups at 20g base price. In the future I guess a nations mages might be swapped to tengus too in some cases. I would gladly make tengus a normal race in terms of generation again, but I will only do that if I get enough convincing opinions on how to make them balanced without making them non-tenguish (for example they are definitely katana/nodachi/naginata/yari/wakisazi wielding in most cases)

elmokki May 3rd, 2012 02:57 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...gen_3_5_12.zip

Boring bugfixes.

jimbojones1971 May 4th, 2012 04:00 AM

Re: UnitGen - Random nations with procedural sprites!
 
Thanks Elmokki. I will grab this now and have another play, in anticipation of City of Bronze being replaced with a new game in the near future :-)

elmokki May 4th, 2012 01:24 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...gen_4_5_12.zip

- Some mages and/or sacreds might be different race than your other units!
- Some nations might get some magic paths a bit more often!

elmokki May 4th, 2012 04:20 PM

Re: UnitGen - Random nations with procedural sprites!
 
Trolol Raiel found a bug

http://koti.kapsi.fi/elmokki/dom3/un..._4_5_12-v2.zip

elmokki May 5th, 2012 07:53 AM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/elmokki/dom3/un...gen_5_5_12.zip

- Terrible seed related bugs were fixed for the MP game.
- Custom weapons are possible to define. Just set #weapon command or item #gameid to refrence to the name of one. See the caveman mount and /nations/customweapons.txt for an example.
- Sacred chariots are quite rare but should sometimes appear.

elmokki May 5th, 2012 09:33 AM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/elmokki/dom3/unitgen/caveman.png
Hoburg Cave Knight!

elmokki May 6th, 2012 06:22 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...gen_7_5_12.zip

This is a fairly big update thanks to the mp game.

- Huge loads of item / secondshape / filter / code tweaks thanks to feedback on bugs and terrible design decisions.
- Settings.txt toggle to read seeds from seeds.txt and generating nations based on that.
- Custom armor is possible
- Custom weapons can (probably) be used as magic weapon effects.
- Restructuring of custom item code.
- Slight restructuring of separateSeeds toggle (comes earlier on instead of interrupting nation generation)
- Probably plenty of stuff I don't remember.

elmokki May 8th, 2012 04:09 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...gen_8_5_12.zip

New infantry generation and probably all sorts of tweaks I can't remember.

EDIT: Oh yeah, random castles.

elmokki May 9th, 2012 12:40 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...gen_9_5_12.zip

Apparently a small tweak broke a multitude of things and the new infantry generation had some fairly serious flaws too. These should be fixed now and the new infantry generation should be slightly better from my point of view!

I also added an ability (toggleable from settings.txt, by default it's on) to draw graphical previews of sprites. Stuff is positioned a bit strangely but oh well, it should do it's job for now. The images are generated in .png format to the mod's folder where the descriptions are usually located too.

Oh, and stuff gained from items / race shouldn't show up on mages' and sacreds' descriptions any more, just stuff from filters. It wasn't that awesome that it told specifically that caelians fly or that a tiger cavalry can shift to a tiger.

elmokki May 9th, 2012 04:00 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/elmokki/dom3/un..._9_5_12-v3.zip

- Sacred commanders get more suitable names (an Emerald Knight might be lead by an Emerald Master and so on)
- Fixed bugs that won't show up unless you edit files anyway.

elmokki May 12th, 2012 06:38 PM

Re: UnitGen - Random nations with procedural sprites!
 
Not using unitviewer. Secondshape descriptions should be fine in newer versions.

Anyway:
http://koti.kapsi.fi/~elmokki/dom3/u...en_13_5_12.zip

- Some new unit/item generation code. Not all I want, but it seems to work so hey, why not release.
- Ability to give custom sprites to secondshapes. You need to specify both #spr1 and #spr2, but #spr2 can be "shift" which uses #spr1 and shifts it 5 pixels to left like all the attacksprites in unitgen. Don't use "" for filepath like in Dom3 normal syntax and specify paths relative to unitgen (see the nightmare for example.). If someone makes a good case, I'll add the same code to pretender gods so custom pretenders can be made.
- Secondshapes can inherit some of the abilities their firstshape has. For mounts this is limited to resistances and berserking, but for non-mount secondshapes there are some extra things that work. This stuff is defined at /nations/secondshapeinheritance.txt so take a look if you are interested in specifics.

elmokki May 13th, 2012 05:57 AM

Re: UnitGen - Random nations with procedural sprites!
 
Did you think caveman cavalry was awesome? Well, there's apparently one race that's even more creative with what they ride!

http://koti.kapsi.fi/elmokki/dom3/unitgen/fossilcav.png

kianduatha made some mounts for Abysians! Along with that awesome thing there are scorpions and salamanders.

Strabo May 14th, 2012 06:03 AM

Re: UnitGen - Random nations with procedural sprites!
 
I tried to mod in ichtyid race, but unitgen crashes, when gets to generating nations. What could I do wrong?

Crash Report
Code:

UnitGen nation generation!
Version CAKE of 13.5.2012
--------------------------
How many nations should be generated? (default: 1)
5
What should the mod be named? (default: nation name or randomly generated name)

Invalid value.
What seed (integer) should be used? (default: 1690906354)

Invalid value.
Reading Dom3DB from units.csv... 2107 definitions loaded!
Reading Dom3DB from armor.csv... 251 definitions loaded!
Reading Dom3DB from weapon.csv... 541 definitions loaded!
Loading nation tags... 26 tags loaded!
Loading miscellaneous definitions... 301 definitions loaded!
Loading races...
Race atlantian - 5 poses loaded.
Race human - 9 poses loaded.
Race lizard - 6 poses loaded.
Race black human - 7 poses loaded.
Race hoburg - 4 poses loaded.
Race caelian - 4 poses loaded.
Race tengu - 4 poses loaded.
Race oriental human - 4 poses loaded.
Race abysian - 2 poses loaded.
Race ichtyid - 1 poses loaded.
Race foul spawn - 1 poses loaded.
11 races loaded!
Generating nations...Exception in thread "main" java.lang.NullPointerException
        at unitgen.item.ItemGenerator.generateItemKey(ItemGenerator.java:339)
        at unitgen.item.ItemGenerator.generateArmor(ItemGenerator.java:269)
        at unitgen.item.ItemGenerator.generateItems(ItemGenerator.java:50)
        at unitgen.Nation.generate(Nation.java:336)
        at unitgen.NationGen.<init>(NationGen.java:290)
        at unitgen.NationGen.main(NationGen.java:425)
Press any key to continue . . .


elmokki May 14th, 2012 07:31 AM

Re: UnitGen - Random nations with procedural sprites!
 
First of all: I highly encourage being on IRC or sending me modded files so I can actually check the things instead of trying to guess based on line numbers. Preferably both.

For this specific problem my guess would be that you have no body armors that have protection of 10 or more. This is a silly requirement that along with some other silly requirements should be gone once I bother to finish updating the troop generation code though.

EDIT: Also, mage a pose with "mage priest" as type. Just copy your infantry pose for now, but it _NEEDS_ infantry pose, mage pose and priest pose to succesfully generate anything. You apparently only have 1 pose and anything with 1 pose just won't work (foul spawn are disabled since they were just a test that may be finished at some point when I get bored with Diablo 3)

Oh yeah, also, RagnarokX is making atlantians and those are apparently nearly ready. You may wish to use some of those graphics once they're added to unitgen.

Strabo May 14th, 2012 07:42 AM

Re: UnitGen - Random nations with procedural sprites!
 
1 Attachment(s)
Added an armor with protection 10, but it still crashes, so I'll just upload all new files here. Thanks for the suggestions, I was already using some atlantian graphics and files as examples :)

Here's what I have in races.txt file:
Code:

#newrace
#name "Ichtyid"
#basechance 0.2
#poses /races/ichtyid/poses.txt
#longsyllables /races/ichtyid/longsyllables.txt
#shortsyllables /races/ichtyid/shortsyllables.txt
#suffixes /races/ichtyid/suffixes.txt
#define "#def 8"
#define "#mor 12"
#define "#mr 8"
#define "#gcost 10"
#define "#prec 8"
#define "#enc 3"
#define "#hp 12"
#define "#str 10"
#define "#ap 11"
#define "#amphibious"
#tag "magicaffinity water 0.5"
#endrace

EDIT: Missed a "mage pose" part, will try right now.
EDIT2: Still does not work

elmokki May 14th, 2012 09:09 AM

Re: UnitGen - Random nations with procedural sprites!
 
This time it fails to having only one helmet (two is minimum, but once again, silly stuff like thiss will dissappear in a version I'll release today if I'm productive enough before Diablo 3 is released. Doesn't need tons of code so there's a good chance for it, but in general I do have to note that any race should have at least a few choices for armor and helmets and preferably more than a few for weapons.

Currently it crashes because it needs at least one helmet with 10+ prot and two helmets total, though it may crash with two helmets too unless one is 16+ prot and the other is under 10 prot. Terrible code.

I added two helmets with full helmet id and the "mage priest" pose and it generated at least one nation without crashing.

Strabo May 14th, 2012 09:17 AM

Re: UnitGen - Random nations with procedural sprites!
 
That's great, thank you! Now I can continue doing my stuff.

elmokki May 14th, 2012 11:58 AM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...en_14_5_12.zip

- kianduatha's awesome Abysian cavalry!
- new troop generation code is in place, but needs some tweaks (max/minprot still does not work). This changed how shields/helmets/bonus weapons are generated slightly. If it feels somehow stupid, give me suggestions! This change should remove pretty much all (or most) stupid restrictions on item amounts, but I do still want to emphasize that any list of armor, helmets, weapons or shields with only one item is probably somehow boring and bad.

elmokki May 14th, 2012 05:16 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/u...en_15_5_12.zip

Last version was made in THE OPPOSITE LAND and everything that wasn't supposed to shapeshift back shapeshifted back and vice versa.

elmokki May 16th, 2012 12:50 PM

Re: UnitGen - Random nations with procedural sprites!
 
http://koti.kapsi.fi/~elmokki/dom3/unitgen...gen_16_5_12.zip

Tweaks and atlantians by RagnarokX.

elmokki May 27th, 2012 05:39 AM

Re: UnitGen - Random nations with procedural sprites!
 
I'm a bit dissapointed no-one pointed out earlier that atlantian nations are generated nearly exclusively, but I suppose nearly everyone who uses UnitGen knows it's one line in races.txt that needs a change.

http://koti.kapsi.fi/~elmokki/dom3/u...en_27_5_12.zip

Now it should be better.


All times are GMT -4. The time now is 04:41 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.