Friday, October 7, 2016

A fantasy game THRAGOS - still 1120 errors

I found a way to generate the Prolog rules I need with Perl. First I made a draft Wlodkowic specification for a simple fantasy game ("Thragos"). There are following actions there:
  • escape
  • attack_with_bare_hands
  • attack_with_weapon
  • attack_with_magic
  • learn_magic
  • practice_to_become_stronger
  • make_a_weapon
  • estimate_whether_he_is_a_wizard
  • estimate_whether_he_has_a_weapon
  • estimate_whether_he_is_stronger
After putting all the "unimportant" rules into the specification there are 444 states. This (along with the 10 actions) makes the "test();" command to produce 4440 errors (444*10). The amount of set instructions in the model should be 1971360 (444*10*444), but some (most) of them will contain zeros.

I will show you the diagram I produced for the current rules generated by my Perl script:



You can see that still about 25% errors are remaining (precisely 1120 errors). Initially I tried to write the Prolog rules manually, but I gave it up.

I imagine I would write a simple game based on Wlodkowic where the characters would try to optimize their situation fighting against each other, learning magic, producing weapons and so on. They would also communicate with each other for example to estimate whether someone is a wizard or whether he has a weapon.

The Wlodkowic variables for this project are:

variables
{
    input variable reward:{none,false,true};
    input variable test_result:{none,false,true};
    input variable i_am_a_wizard:{false,true};
    input variable i_have_a_weapon:{false,true};
    input variable i_can_see_him:{false,true};
    input variable he_has_used_a_weapon:{false,true};
    input variable he_has_used_magic:{false,true};

    hidden variable he_is_a_wizard:{false,true};
    hidden variable he_has_a_weapon:{false,true};
    hidden variable he_is_stronger_than_me:{false,true};
   
    output variable action:{escape,attack_with_bare_hands, attack_with_weapon, attack_with_magic,
        learn_magic, practice_to_become_stronger, make_a_weapon,
        estimate_whether_he_is_a_wizard,
        estimate_whether_he_has_a_weapon,
        estimate_whether_he_is_stronger};
}


No comments:

Post a Comment