Saturday, 1 October 2011

Evolution of the code #3

Time for another update. Since I've felt a bit tired over the week (and this is a hobby project) i will probably update the blog in weekends (and sometimes during the week) from now on.

Implementing SPECIAL (or simple)
I decided it was time for the early stages of the character creation implementation. Ive started reading the manual of the fallout pnp and let me tell you, its a lot more complex than i thought. As I am trying to go for maximum moddability i was thinking of doing all of the formulas in one big lua script that applies to all the npc's. The problem is that - as i see it - every instance of a character class would open an unnecessary instance of the same lua file. That would be a resource hog; I could also do a static version and hold all the formulas needed in a lua script and the entity logic(if it exists) in another - but again that would mean extra unnecessary resources used.

I am thinking of abandoning the plan and simply code the formulas in C#. Thus one would have to recompile the solution if he would try to mod the game. Still thinking about this and i really wish i knew someone that is experienced enough with lua implementation and code optimization.

Ive also added all of the stats, skills and traits into a dictionary class rather than an array and i think it will remain that way since its easier to access data even from lua.

Unarmed attacks - from hard coded to items

Initially when i started working on the item system i hard coded the unarmed attacks with two simple options. I didnt like the idea and got to the conclusion that these need to be recoded as items. The system is simple - Check the active item and see if the slot associated to it returns an item class. If not create the corresponding melee items. Indeed, Ive taken measures to prevent these "items" to be traded or seen in the inventory (imagine how funny it would be to barter your punch or kick skill with someone).

I really like this system as, in theory, it would be possible to control 3 or more characters - each with his own unarmed skills. This also made me update the item action system with requirements. For example you cannot perform a haymaker attack without Unarmed 75%, Agility 6, Strength 5, level 6 and thus it does not appear in the action modes while selecting through them.

Thats about all for now so i must get back to work. And ponies.

No comments:

Post a Comment