Vangard

[quote=“ags1,post:120,topic:55005”]
In what way is that cheating?

Political control is similar to (but not the same as) a map of human habitation. But in practice no-one would notice a difference I think.

EDIT: Actually, it’s probably not cheating. Any differences would be so subtle as to be undetectable, and the differences between the two views would just be a matter of opinion. So it’s not worth the effort and not worth the processing time (to make a second map).

I tweaked and simplified the algorithm to give a less blobby and more naturalistic look to the control areas.

I changed the key too. Uppercase is a settlement. Lowercase is a weakly controlled border area. Underscore is a strongly controlled area (the ownership should be unambiguous). Empty space is wilderness.

Number of settlements: 21 bbbbbbbb_____________bbbbbbbb bbbbbbbb_________________bbbbbbb bbbbbbbb___________________bbbbbb bbbbbbb_____________________bbbbbb a a bbbbbb________________________bbbbb aaaaaaaaa aaaaaaaaa bbbbb_________B_________B______bbbbb aaaaaaaaaaaaa aaaaaaaaaaaaa bbbbbb___________________________bbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb_____________________________bbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbb_____________________________bbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb______________________________bbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbb______________________________bbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbb_______________________________bbbb aaaaaaaaaa_aaaaaaaaaaaaaaaaaaa_aaaaaaaaaa bbbbb_______________________________bbbb aaaaaaaa_____aaaaaaaaaaaaaaa_______aaaaaaabbbbb_______________________________bbbb aaaaaaaa_____aaaaaaaaaaaaaaa________aaaaaabbbbb______________________________bbbbb aaaaaaaa___A___aaaaaaaaaaaaa___A______aaaaaabbbb___B_________B_________B______bbbbb aaaaaaaa_____aaaaaaaaaaaaaaa__________aaaaabbbb_____________________________bbbbb aaaaaaaa_____aaaaaaaaaaaaaaa___________aaaaabbbb___________________________bbbbbb aaaaaaaaaa_aaaaaaaaaaaaaaaaa____________aaaabbbb___________________________bbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaa____________aaaaabbb__________________________bbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaa____________aaaaabbb________________________bbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaa____________aaaaabbb________________________bbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaa____________aaaaabbb______________________bbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaa___________aaaaabbb______________________bbbbbb aaaaaaaaaaaaa aaaaaaaa__________aaaaaabbb____________________bbbbbb aaaaaaaaa aaaaaaa_______A__aaaaabbbb________B_________bbbbb a aaaaaaaa_________aaaaaabbbb________________bbbbbb aaaaaaaaa______aaaaaaabbbbb_____________bbbbbbb aaaaaaaaaaaa_aaaaaaaa bbbbbb_________bbbbbbbb aaaaaaaaaaaaaaaaaaaa bbbbbbbbb_bbbbbbbbbbb aaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb aaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbb ...

I’ve been working through my list…

DONE ManufactureItemBehavior - new simplified behavior
DONE skills - load from career files
DONE refactor#37 - load all characters from career files
spawning - smarter spawning that respects town planning
DONE experience - tweak experience levels
DONE leveling - add simple AI for leveling up, add UI for player controlled leveling up
trader - implement trader career
smith - implement smith career
hunter - implement hunter career
servant - implement servant career
eating - fix eating behavior
alehouse - add alehouse model
feasting - add evening feasts at alehouse
temple - add temple model
cottage - add cottage model
longhouse - add longhouse model
hall - add hall model
combat - integrate combat code; make wild predators hostile
hoards - place initial hoards and guardians on map
tree/rock/frill geometry batching - integrate and benchmark batching code (not dependent on graphics lib)
javafx migration - 'cause I want to use JavaFX
full screen mode - obviously
text/resolution issues - text will be too small on screens with high DPI; make font sizing proportional
Radial menu - add some demo code

I’ve now got the main settlement careers defined to a basic level; that is is, the careers exist and have the default human behaviors like sleeping, getting hungry and eating. Career-specific behaviors are only done for a couple of careers so far.

Settlement careers include chieftain, guard, priest, trader, healer, smith, hunter, woodcutter, peasant, miner and beggar. Woodcutter, miner and peasant are complete (with a few bugs), and I should be able to complete priest, trader, healer and smith quite easily. Hunters are a problem as that needs a working combat system including ranged combat as well as some cleverness to find some edible animals… Chieftains currently do nothing as well, they are waiting for the political aspects of the game.

Larger settlements will support more career types, like warrior, various kinds of magic users, luxury item manufacturers and so on. Also, larger settlements should support a small criminal population of pickpockets and so forth. But for now all settlements are the same size :slight_smile:

Larger buildings will also support more specialized career types, like servants (in larger buildings), archers (in towers and strongholds), temple guards and high priests (in larger temples).

There are also people who live outside of settlements in the wilderness, these will include woodsmen, robbers and hermits…

ags1, just out of curiousity, have you seen or played the game ‘Banished’ ?

No, but thanks for pointing it out. It sounds similar in concept to Civilization and to various city-building games - I recall playing something like Banished made by Ubisoft.

There are similarities to what I am aiming for in Vangard, but my goal is to embed the player in the world, rather than put the player into a god role. You may have a city planning / resource management / warlord role in Vangard, but that is just one of many options.

It means I can’t go into the depth that a game like Banished might because I am trying to open more roles, and I have to have AI to back/fulfill all possible player roles.

I’ve been testing and prototyping the combat system… Here’s some pseudocode. Random numbers are expressed in D&D convention :slight_smile:


//in the absence of heroic achievements, all skills are capped at 7
//roughly 1 blow per 3 sec, depending on a.speed and a.weapon.speed
Attacker a
Defender d
defenceEffectiveness = 1.0
//d has blows coming in too fast, can't defend effectively?
if (now - d.lastBlow < 1500) {
    defenceEffectiveness = 0.5
}
levelAdvantage = (a.level - (d.level * defenceEffectiveness)) / 2;
levelAdvantage = levelAdvantage < -7 ? -7 : levelAdvantage > 7 ? 7 : levelAdvantage
attackRoll = a.attack + d30
defenceRoll = (d.defence + d30) * defenceEffectiveness
hitQuality = attackRoll - defenceRoll + levelAdvantage
a.delay = 0
d.delay = 0
if (hitQuality >= -10) { 
    //d had to defend; less effective against a closely following attack
    d.lastBlow = now
}
if (hitQuality >= 0) {
    dodge = d.dodge + d20 - hitQuality;
	d.delay += 1000
	if (dodge < 0) {
	    d.delay += 1000
	    factor = hitQuality < 10 ? 1.0 : hitQuality < 20 ? 1.5 : 2.0
		//armor effectiveness on sliding scale relative to damage value
		damage = factor * a.weapon.strength * a.strength
		d.applyDamageAfterArmor(damage, a.weapon.penetration)
	}
} else {
    riposteQuality = d.riposte + abs(hitQuality) - d40
	if (riposteQuality >= 0) {
	    d.delay += 1000
		a.delay += 2000
		a.lastBlow = now
	    factor = riposteQuality < 10 ? 1.0 : riposteQuality < 20 ? 1.5 : 2.0
		//armor effectiveness on sliding scale relative to damage value
		damage = factor * d.weapon.strength * d.strength
		a.applyDamageAfterArmor(damage, d.weapon.penetration)
	}
}
a.nextStrike = now + a.delay + a.speed
d.nextStrike += d.delay

Out of curiosity, how does the algorithm work?

I tried various complex formulas but found a simple linearly decreasing level of influence works best; the competing and collaborating influences are summed and the values are assigned to bands.

But how are the shapes generated?

Sectors get a score based on their distance from each settlement. That is, each settlement adds to the score for every sector, and we keep score for each rival nation. The sector is given to the nation with the highest score, and the level of control is based on the winning score less the rival scores. So a sector with a score of 10 or more is strongly controlled by the respective nation. A sector with a score of 3 or more is weakly controlled while anything less is lawless wilderness.

I have been hard at work on the game, building a more complete recipe system (where a recipe can be anything from making a healing salve to chopping up firewood) and making a start on the magic system. At the moment all that exists are the basic magical properties and the concept of a creature’s Power, which is its willpower plus level, plus some other factors. Power is used for magical resistance and controlling magical items, and I may or may not add special abilities to the creatures with highest power in the world (a bit like the Lord of the Rings notion of Powers).

Feel a bit overwhelmed today… there is so much to do. I need to keep my head down and not look at the big picture :slight_smile:

I find making to-do lists helpful. Take it easy ;D.

I’m taking it easy mostly. I haven’t had so many updates lately because I am stuck on adding in the remaining village careers, mostly because I am trying to code slower and better.

I’m curious about the recipe system, how it is going, what the complications are.
Does one specify a series of “actions” or a series of “states”?
When I cook, I rarely follow the recipe in a completely accurate way, for better and often for worse. :stuck_out_tongue:

The AIs just need to consider a lot of factors when selecting and executing a recipe. But now I can see the healers making a variety of potions and tonics as the hours go by.

I’ve put a little demo up to see how bad my performance problems are:

Enjoy the bugs :slight_smile:

I did. :slight_smile: Hint: Don’t put absolute file system path references, like “C:\Users\Ags\IdeaProjects\experiments\src\resource\career\Frill1.pp5” or “C:\Users\Ags\IdeaProjects\experiments\src\resource\career\Mine.pp5” in your code.
Pack your resources as classpath resources inside the jar.