Darn! I thought i had replaced all of those. Gimme five mins to upload the fixed version.
Uploaded a fixed one. Sorry :emo:
Phased has it running so I seem to have cleared up my sloppy code.
Today I found a neat way to get reasonable default inventory management for all the Vangardians. I realised they simply need to sell duplicate items, keeping the best quality ones of course. If they are desperate for cash they will sell anything except the items absolutely required for their current career.
Along the way I cleaned up the goto and ownership code.
SellStuffBehavior is working a treat, and I’ve moved onto MoneyManagementBehavior. My Vangardians are going to be very modern and express themselves in their consumerist behavior:
public int targetCoppers = 0;
public int likesBling = World.RANDOM.nextInt(10);
public int likesSaving = World.RANDOM.nextInt(10);
public int likesStatus = World.RANDOM.nextInt(10);
public int likesComfort = World.RANDOM.nextInt(10);
public List<Entity> stashes = new ArrayList<>(1);
The goal of the behavior is to moderate the moneymaking behaviors so that citizens are not always in a frenzy of activity. If they don’t need to put in the overtime, they can goof off and practice playing the lute, or work on the praise poem that will make their name. Or just have a nap under an apple tree.
They’re going to be working quite a bit of overtime if they value all of those things, and living off minimal passive income if they value none of those. Pretty good representation
Will their occupation at all be influenced by these factors? For example: bling, status, and comfort can cause people to congregate into gangs (especially if they hate working)
The world starts with people assigned randomly to careers; given the time period, people would do what their parents did.
But this will influence career mobility. So if entities change careers this should influence their choices.
Not quite sure how to handle the crooked careers yet… I can see that some people might have a sideline as a pickpocket, but I’m not yet sure of the economics and practicalities of robbers in the woods. Too high a rate of predating would cripple the world, too low a rate would starve the robbers, and presumably the robbers have to keep on good terms with some settlements so they have somewhere to barter their ill-gotten gains.
I’m tending to think the robbers do not live like kings. They live in squalor primarily by foraging and scrounging. They do a bit of robbing now and then to make their lives more bearable…
Inching forward…! I ripped out the old GotoBehavior and put in a new simpler one today. Things seem to be working again.
Another inch done… People now go to the market to buy stuff on their wishlist, if the market has the desired items and they have enough coins.
Since changing the implementation of GotoBehavior and wishlists, the number of obvious bugs has bumped up, so this week will be devoted to bug hunting.
Some more incremental progress here. I added a GoHomeBehavior so that citizens who have nothing better to do go back to their houses by default. This for example stops the market from getting clogged with loiterers who need to buy something but have nothing to do immediately after that Down the line I can make it a bit more interesting and have other idle behaviors like VisitFriendBehavior.
I also fixed up and simplified the GuardBehavior so that guards correctly follow the chieftain around, instead of moronically guarding his or her last reported location. Next step will be to allow GoToBehavior to allow moving to the proximity of a target, not immediate adjacency. The newly enthusiastic guards are driving the chieftains mad by crowding them and stopping them from getting anywhere
I’m having a lot of fun with this project. Maybe one day it will be playable.
Added turbo mode: game speed increases to 20x speed. The sim whizzes along nicely at that pace!
It’s amazing project, I hope it will be playable soon
Thanks. The village economy is coming together piece by piece. When that is in place I will add in some more sophisticated player controls and basic adventuring. At that point it will be “playable” but it really needs the layers of more sophisticated AIs and modular story arcs to get it good.
Are you using some sort of library to help with the rendering, like Slick2D or libGDX?
I’m not worrying about graphics at all. To remind me to not fiddle with the graphics or waste my time toying with cool shader effects, I am using Java 2D. I have no dependencies on the graphics code, so it should be easy to move over to LibGDX later this year.
Ohh right, so I guess you’re using Java Graphics fillRect(), fillPolygon() and fillOval() then.
I have started on dialog in a small way. Vangardians are keeping track of their achievements and will be able to pepper their conversations with inconsequential statements (“I ate an apple this morning!”), boastful statements (“I donated 20 gold to the temple!”) or intimidating statements in more edgy situations (“I killed a troll, do you want to meet him?”).
Here is the conversational chatter stored for a healer:
entry : null
key : y000m02d02T0601
val : y000m01d08T0601, st=0,in=0,pe=0,ex=0: I ate a stringOfOnions.
entry : null
key : y000m02d02T0606
val : y000m02d01T0606, st=0,in=0,pe=0,ex=0: I bought 3 food.
entry : null
key : y000m02d02T1336
val : y000m01d08T1336, st=0,in=0,pe=0,ex=0: I made dexterityPotion (1).
entry : null
key : y000m02d02T1801
val : y000m01d08T1801, st=0,in=0,pe=0,ex=0: I ate a potOfHoney.
entry : null
key : y000m02d03T0601
val : y000m01d09T0601, st=0,in=0,pe=0,ex=0: I ate a youngRabbit.
entry : null
key : y000m02d03T1428
val : y000m01d09T1428, st=0,in=0,pe=0,ex=0: I made healingSalve (1).
entry : null
key : y000m02d04T1428
val : y000m01d10T1428, st=0,in=0,pe=0,ex=0: I made constitutionPotion (1).
entry : null
key : y000m02d04T1801
val : y000m01d10T1801, st=0,in=0,pe=0,ex=0: I ate a potOfHoney.
entry : null
key : y000m02d05T0601
val : y000m01d11T0601, st=0,in=0,pe=0,ex=0: I ate a youngRabbit.
entry : null
key : y000m02d05T1549
val : y000m01d11T1549, st=0,in=0,pe=0,ex=0: I made lesserHealingSalve (1).
entry : null
key : y000m02d05T1801
val : y000m01d11T1801, st=0,in=0,pe=0,ex=0: I ate a eggs.
entry : null
key : y000m02d06T1801
val : y000m01d12T1801, st=0,in=0,pe=0,ex=0: I ate a bunchOfBeans.
entry : null
key : y000m02d07T0602
val : y000m01d13T0602, st=0,in=0,pe=0,ex=0: I ate a potOfHoney.
entry : null
key : y000m02d07T1521
val : y000m01d13T1521, st=0,in=0,pe=0,ex=0: I made dexterityPotion (1).
entry : null
key : y000m02d07T1802
val : y000m01d13T1802, st=0,in=0,pe=0,ex=0: I ate a eggs.
entry : null
key : y000m02d08T1802
val : y000m02d01T1802, st=0,in=0,pe=0,ex=0: I ate a potOfHoney.
I apologise for the terrible diet of the Vangardians, currently they are buying and eating food ingredients as there is no-one at the market preparing more suitable and nourishing pies, breads and stews.
Smiths are smithying now. Picks, axes, shovels and hammers are starting to appear in the market. On to the potters and clothesmakers and bakers
After that it is the scary stuff - i have to get hunters working which means I start on integrating the combat system.
Tonight is the big tradespeople night. I am doing the bakers, clothesmakers and potters tonight. I’m starting to build up a reasonable level of content:
Items loaded: 62
Careers loaded: 14
Recipes loaded: 16
Settlements have been increased in size by 25% to account for the extra professions (not just the new tradespeople, but also extra peasants to feed them). The economy is becoming more interwoven, with professions needing goods produced by multiple other professions (the baker can make mushroom pies, which take grain and vegetables from the peasants, as well as wild mushrooms gathered by e.g. the healer when he/she forages in the woods; likewise the healer can make potions with the herbs they gather, but they also need clay phials from the potter to hold the potions).
A problem with the bakers is they are producing higher quality food that costs significantly more than the raw ingredients currently in the market. so I will have to upgrade BuyStuffBehavior to account for this; poorer people will obviously want to choose cheaper items, while richer citizens will like to “treat” themselves to the best items!
Another issue I need to account for: settlements are currently generated fully grown, but it should be possible to start with one hovel and build it up from there. One way to support this (and also to provide easy pickings for the outlaws) is to enable the markets to trade with each other. So a settlement might not have a smith but its market can still stock the necessary items at a higher price.
Another issue I’ve been having is with the crafting of special or magical items. The supply of these items needs to be rationed, but how? I have the idea for an Inspiration item that crafters might get by making offerings to the gods, or by completing certain quests or trials. A perfectly crafted item plus inspiration is required to make a magic sword etc.
One idea that comes to my mind right now is that you could set up very rare events (thunder hitting a tree, a god being summoned personally, a huge hole appearing in the ground, etc) that would trigger the appearing of one magical item that could then be gathered by a high level NPC completing a special quest (perhaps all the NPCs in a given area around the event could start trying to complete the quest). For example, thunder would randomly hit a tree somewhere, then all the smiths around would earn a slightly offbeat behaviour, they could for example decide more often to go explore in the land around and checking trees up… Then when one of the 5% best smiths around would randomly check the tree onto which thunder had fallen, find the Mjölnir Hammer and maybe either keep it or sell it.
That would add some kind of originality in a few settlements, where the player would wonder why the smiths would sometimes abandon their duties to go scratch a few tree trunks… Heheh
But I’m not sure how common you would want these magic items to be, so this idea may be totally displaced :persecutioncomplex:
J0
My idea is that if a smith has crafted a perfect sword (all items come in a range of qualities from 0 to 7), and the smith has a touch of inspiration, then he/she can proceed to make the sword into a magical item. Getting the inspiration is the hard part, and as each item is unique inspiration only works for one item and can’t be reused!