Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (868)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 3 4 [5] 6 7 ... 9
  ignore  |  Print  
  Vangard  (Read 194855 times)
0 Members and 1 Guest are viewing this topic.
Offline J0
« Reply #120 - Posted 2015-11-12 10:18:14 »

I think I will cheat and also use this map as a guide to placing wild creatures. They will spawn in the less controlled areas and migrate away from areas with strong human influence.
In what way is that cheating?

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #121 - Posted 2015-11-12 11:12:40 »

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).

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #122 - Posted 2015-11-13 11:18:18 »

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                         
...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #123 - Posted 2015-11-16 11:03:48 »

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

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #124 - Posted 2015-11-17 11:51:34 »

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 Smiley

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...

Offline SwampChicken
« Reply #125 - Posted 2015-11-18 09:17:41 »

ags1, just out of curiousity, have you seen or played the game 'Banished' ?
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #126 - Posted 2015-11-18 11:28:28 »

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.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #127 - Posted 2015-11-20 11:28:03 »

I've been testing and prototyping the combat system... Here's some pseudocode. Random numbers are expressed in D&D convention Smiley

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
//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

Offline ShadedVertex
« Reply #128 - Posted 2015-11-21 09:56:18 »

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

etc...


Out of curiosity, how does the algorithm work?
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #129 - Posted 2015-11-21 16:00:30 »

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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ShadedVertex
« Reply #130 - Posted 2015-11-22 10:55:02 »

But how are the shapes generated?
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #131 - Posted 2015-11-22 20:17:16 »

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.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #132 - Posted 2015-11-27 11:32:55 »

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).

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #133 - Posted 2015-11-28 12:46:08 »

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 Smiley

Offline ShadedVertex
« Reply #134 - Posted 2015-11-28 12:52:06 »

I find making to-do lists helpful. Take it easy  Grin.
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #135 - Posted 2015-11-28 13:26:25 »

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.

Offline philfrei
« Reply #136 - Posted 2015-12-04 19:48:04 »

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.  Tongue

music and music apps: http://adonax.com
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #137 - Posted 2015-12-05 00:20:41 »

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.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #138 - Posted 2015-12-05 12:15:32 »

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

http://www.java-gaming.org/topics/benchmark-this-jar-yes-a-vangard-demo/36890/view.html

Enjoy the bugs Smiley

Offline KaiHH

JGO Kernel


Medals: 796



« Reply #139 - Posted 2015-12-05 12:19:14 »

Enjoy the bugs Smiley
I did. Smiley 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.
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #140 - Posted 2015-12-05 12:24:32 »

Darn! I thought i had replaced all of those. Gimme five mins to upload the fixed version.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #141 - Posted 2015-12-05 12:42:17 »

Uploaded a fixed one. Sorry  Emo

Phased has it running so I seem to have cleared up my sloppy code.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #142 - Posted 2015-12-06 23:00:40 »

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.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #143 - Posted 2015-12-10 23:00:31 »

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:

1  
2  
3  
4  
5  
6  
    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.

Offline Longarmx
« Reply #144 - Posted 2015-12-10 23:09:37 »

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 Wink

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)

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #145 - Posted 2015-12-10 23:16:54 »

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....

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #146 - Posted 2015-12-18 21:35:53 »

Inching forward...! I ripped out the old GotoBehavior and put in a new simpler one today. Things seem to be working again.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #147 - Posted 2015-12-20 18:30:22 »

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.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #148 - Posted 2015-12-21 22:00:41 »

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 Smiley 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 Smiley

I'm having a lot of fun with this project. Maybe one day it will be playable.

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #149 - Posted 2015-12-22 23:48:57 »

Added turbo mode: game speed increases to 20x speed. The sim whizzes along nicely at that pace!

Pages: 1 ... 3 4 [5] 6 7 ... 9
  ignore  |  Print  
 
 

 
Riven (580 views)
2019-09-04 15:33:17

hadezbladez (5505 views)
2018-11-16 13:46:03

hadezbladez (2398 views)
2018-11-16 13:41:33

hadezbladez (5767 views)
2018-11-16 13:35:35

hadezbladez (1222 views)
2018-11-16 13:32:03

EgonOlsen (4660 views)
2018-06-10 19:43:48

EgonOlsen (5681 views)
2018-06-10 19:43:44

EgonOlsen (3196 views)
2018-06-10 19:43:20

DesertCoockie (4094 views)
2018-05-13 18:23:11

nelsongames (5114 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!