Saturday 7 May 2011

PlanExecutorExploration

Uhm, the first PlanExecutor, for Exploration is a working code now in SVN. Units outside the home populations are moving around, collecting positioning information of other entities/economic units, and making war if in the mood. Basically this will generate all the other political happenings, relationsship changes, spring plans based on positioning and historical memories of those battles/peaceful happenings. So it's time to create the 'Planning brain' code to add more than exploratory tasks to the plan list of entities -- and their respective PlanExecutor implementations. Lot of work to do, so progress isn't gonna be the quickest thing, guarranteed. If those are ready, next stuff is to create an information exchange part and information listing for the player in game, now again including new UI parts. The player should be able to view the position of those pieces of information and plan target places. That would be a point of code readiness where I will consider a new release so you can dig your teeth in exploring entities and their history and plans, how this might look in the later releases.

Saturday 30 April 2011

PlanExecutionHelper, Plan types

Yeah, these two are now under development. Some Plan types were invented, so different events and behavior based impulses of the entities can use those types:
public static final byte PLAN_TYPE_EXPLORATION = 0;
public static final byte PLAN_TYPE_SPYING = 1;
public static final byte PLAN_TYPE_PEACE_MISSION = 2;
public static final byte PLAN_TYPE_ENCOUNTER_TRADE_AND_INFO = 3;
public static final byte PLAN_TYPE_PLUNDER_EASY_PREY = 4;
public static final byte PLAN_TYPE_MASSIVE_ATTACK = 5;
public static final byte PLAN_TYPE_SIEGE_POPULATION = 6;
public static final byte PLAN_TYPE_KILL_PMI = 7;
public static final byte PLAN_TYPE_PACIFY_PMI* = 8;
(*PMI = PersistentMemberInstance aka "Non-Playing-Character")
These will have different Executor implementations used by the PlanExecutionHelper. The helper class is also mapping available units of the entity for the tasks based on priority of the plans and the power level of the units. So these plans gonna be in the InformationContainer of the entities serving as incentive and source of information towards other entities like the player.

I imagine that the EntityInstances (large groups of similar beings) will by default have some Plans like exploration/encounter/plunder easy pray based on their set of Behaviors specified for their 'race' in the HumanoidEntityDescription of the EntityInstance. Those plans will lead to meeting with other Entities and thus relations will start to change leading into alliances and massive attacks/sieges etc.

Monday 25 April 2011

Lesson learnt: Fate of world sealed. plus some AI concept.

Things progressing further: HistoricalEvents stored after won or lost or left battles; more refined decisions can be programmed for Humanoids (of type HumanoidEntityDescription) when they think about choice for encounter (choice: Hide, Attack, Indifference, Encounter (exchange info, commerce)) based on their Behavior patterns, and when they think about how to interpret a relationship level with another group of beings (e.g. based on their Behavior they can be forgetful, raising the relationship level a bit higher) -- these will have a huge impact on the AI vs/pro AI/Player happenings later. Now for test purposes the humanoid races are all quite nasty, attacking each other almost always, downgrading relationships and thus giving more aggressive battles turn after turn, railing down the entity groups around their hometown... Of coures this will receive more care and folks that are peaceful are always going to try to negotiate neutralization, commerce and info exchange with friends etc.

Now to the lesson learned: I had to root out all the HashMap.keySet() or values() method calls for iterating lists of those maps and replace HashMaps with TreeMaps in the encounter/ecology part. Otherwise a random order crawled into the happenings of the historical test application run. EncounterInfo was the culprit, full of HashMaps featuring EncounterUnit as the key, now I use TreeMap instead, and EncounterUnit implementer classes implement the Comparable class as well.

...And randomness was replaced with the Hash based quasi-randomness, and thus the fate of jClassicRPG test worlds had been sealed and unchangeably progressing the same route test run after test run with the same TreeMaps to Eternity. ;P

Friday 22 April 2011

BattleCalculator, InformationContainer, Positioning

Progress is slowly continuing on the matter of '(Artificial) Intelligence -> Information/Dialog/Quest' field. Events are now starting to shape up with the simple decisions of EntityInstances. Aside the UI based combat/encounter involving the player, now AI vs. AI happenings are being tested out with the IntelligenceSystemTest runnable (you can find it in the codebase in SVN if you want to test, and look for your log file under /.jclssicrpg/logs). Firstly BattleCalculator is mostly done that does a simplified, weighted combat calculation with impact of death toll and neutralization (making the enemy give up/surrender). Simple stuff, but for the time being it will suffice and serve well the history creation / plan growing of jcrpg's seed based worlds.
Also first memories are being put into AI information containers, first of all Positining information that mirrors the knowledge of a unit about the location of other entity instances. A lot more to add (like the Historical events that will serve as a backgroundish spice for the conversations, and Plans that will serve as a joining point for the Player to do things related to other entities...in other words do some quests ;))
I can say it's really a tiresome process with a lot of stuff to plan and realize, but it's at the same time rather interesting. A snippet of log for you, as this doesn't involve a screenshot yet:

org.jcrpg.game.logic.ai.BattleCalculator - *INITIATOR MEAN: martial 1.0
org.jcrpg.game.logic.ai.BattleCalculator - #TARGET MEAN: martial 1.0
org.jcrpg.game.logic.ai.BattleCalculator - rollOfInitiator = 961
org.jcrpg.game.logic.ai.BattleCalculator - rollOfTarget = 2500
org.jcrpg.game.logic.ai.BattleCalculator - Absorbing ratio 1 Warthog (4) 0 : 1.0 Impact ratio: 0.0 neutralization: 1.0
org.jcrpg.world.ai.EntityFragments$EntityFragment - AI BATTLE DAMAGE fragment of size 29 - Warthogs 496 = 0.0 / Neut.: 0.0
org.jcrpg.game.logic.ai.BattleCalculator - Absorbing ratio 1 Plant'o'Bite (0) 0 : 1.0 Impact ratio: 2.0 neutralization: 0.0
org.jcrpg.world.ai.EntityFragments$EntityFragment - AI BATTLE DAMAGE fragment of size 7 - Plantoid Horde 495 = Infinity / Neut.: 0.0
org.jcrpg.world.ai.EntityFragments$EntityFragment - Plantoid Horde - decrease relation by 1 level for Warthogs RESULT 0
org.jcrpg.world.ai.EntityInstance - EntityInstance destroyed Plantoid Horde 495

Tuesday 19 April 2011

AI getting care, which is planned to result in dialogs

New things are getting into place, EntityInstances (group of beings) are being beefed up with decision making (based on behavior and additional relation data plus informations later) and quick battle calculus is being created to let things happen in the world/history generation phase and later. A lot of placeholder TODO's are placed, which means it's a much wider task than that I'm currently wanting to implement. I'd like to get to the first test of history flows and AI decision flows as soon as I can, leaving the less crucial (but important) parts for later.
After this first part will get it's first iteration of development finished, next stuff will be to add a capability to beings to flush out information streams to other beings (like the player) based on their relationship level. That stream of information tokens will be converted into meaningful dialog by a layer of 'info types to nice text' engine that needs to be created. Also player should be a source of information stream too, of those information that the player gets hold of while communicating beforehand. So you might be kind of resolving gameplay things by sharing information you got. Most probably player shouldn't be able to resolve a communication without the proper informations in the party's 'information container'. So the choices for dialog will depend on both sides' possesed information tokens and relation ship levels.
At least now we have a plan and some of the codes are already being forged. :)

Monday 18 April 2011

Unified Feed for hardcore jClassicRPG fans

Using yahoo feed pipeing system, I've unified all the available RSS feeds of jClassicRPG. If you're a hardcore fan of the project you can use the following url from now on: http://feeds.feedburner.com/JcrpgPipes This one contains all blog posts, forum posts and trac project management events going on in the project.

Sunday 17 April 2011

RSS forum feeds added. Working on ecology AI.

Global RSS feed and individual ones are now served on forum by Smartfeed phpbb module. Works great so far. Global URL if you want to subcribe in your Reader app: link. READ edit2 part for the really good ATOM/RSS feed choice down below. :)
Continuously working on AI. A test suite is now working, in console mode, spitting out turn by turn, entity by entity what's going on in their decision making. Soon to add more, like a quick combat/impact scenario tool for them, appending of history. Entities can now hold information in their 'container' which are past HistoricalEvents or future Plans. (All these are yet placeholder classes to be filled with real content on the long.) Additional Behavior types were added a bit like those that Civilization I of Sid Meiers had, so these traits can have an effect on how different races/populations act in the turns. So... it's under construction... :)
EDIT: indivudual forum/topic RSS feeds doesn't work yet, I'd need to tweak the CSS/style files more as it turned out.Sorry! Global RSS is working well, so use that for now. Thanks! :)

EDIT2: Oh, just found out that phpBB3.0.7+ has ATOM feed by default. *FACEPALM* Anyway, I've enabled it, and now you can subscribe to virtually any part and subpart of the forum, and to New topics too as a separate feed. phpBB coolnes, kudos! Global phpbb based feed: link

Twitter