Wednesday, 12 June 2013

Evolution of the code #13

First companion implemented! As expected, the AI class is a subclass of the standard NPC AI, except that it helps you in combat and follows you around when you command him. To make things more interesting, I also added him a conversation file where you can tell him whether to follow you or not, or to use his best weapon or holster it. So far he is really helpful in combat and for the upcoming demo I doubt it needs any improvements.

Menu and HUD improvements
Remember that small menu that popped up when we wanted to do an action on an object? Well its here and currently has the first interaction buttons. The only difference is that it activates when right-clicking on an object (similar to VB) rather then when holding the left button longer. A clock has been added on the HUD so the player can tell the game time as it passes (I used it to tell whenever the player regeneration rate had passed or not).

Two new controls have been added to the base UI controls. The CommandButton is a simple button that triggers a console command. The PlayerPropertyDisplay class is used, as suggested by the name, to display and update any player property on the HUD. This can be either the Name, Health, WorldClock, the item he currently has in the inventory, etc. I found these controls necessary as I felt the need to add windows or controls on the HUD without changing the actual code in the executable.

Skills and SPECIAL
Skills have been implemented and they are partially working. I say partially because the code to apply a certain skill has not been implemented yet. It is surprisingly easy to add a new skill or delete the existing ones without any changes to the code.

I am planning to add every engine calculation that was done in fallout in lua files, for maximum flexibility. This would mean making changes to the game's basic calculations only in script files. Lua files have been added to player classes which contain a few formulas.

For now, a skill is firstly defined by its button name and the function it does is defined in the player lua file by the same name.

Basically, in order to add a skill the steps would be: add a button to the skill panel containing its name (note that the text formatting can be a problem and may cause errors), go to the player lua file and define a new function which is named as the button in the first step. This will make the button trigger the function in the lua file when needed, provided the names are the same. This may be a problem with localizations later but I'm planning to replace all of these with command buttons so that the actual names will no longer be relevant.

Tuesday, 21 May 2013

Evolution of the code #12

Inventory system bug fixes
Since the inventory system has been remade from scratch, it was bound to have problems which were supposed to be fixed later on. One new feature I added was to make sure that multiple items of the same type stack each other instead of creating new entries into the inventory list. The (sort of) problematic issue here was that, each entry in the list was associated with a certain item in the inventory. So, if multiple items were found, an existing entry was updated with the most recent count of the items.

If the user would drag at least two stacked items of the same type on the primary and secondary slots, then new visual entries pointing to existing instances would have to be created. This was resolved by storing all of the "unreferenced" items in the inventory into a separate list and when needed to create a new entry simply get the first entry of that item type from there.

Combat Manager finally working, some AI tweaks
Indeed it's finally working... I hope :D There was nothing special to do here except create a new entity each time combat was started (so that the combat status could be saved along with everything else in the map) that would freeze everyone in his place and take care of the turn based rules. Weapons are finally working as well (unarmed and the pistol) and don't crash the game anymore. Each weapon now has action modes which are define by entries like the one below:

actionPoints = 4
useText = SINGLE
command = firearms
damage = 6
useDistanceRange = 0 40
playSound = Sounds\weapons\9mm\fire.wav
betweenFireTime = 0.3
actionPoints = 6
useText = BURST
useDistanceRange = 0 35
command = burst
actionPoints = 2
useText = RELOAD
command = reload
playSound = Sounds\weapons\9mm\reload.wav

As it can be noticed, the unarmed attacks have been implemented as weapons as well. This was done for easier implementation of unique characters. For example if we would want a raider to have a very powerful melee attack, we would simply have to add that as default item in his definition file instead of extra scripting.

Since i always avoided having to do AI I am trying to keep it as simple as possible. Right now the opponents have the basic intelligence of attacking, following and switching to better weapons in their inventory if any is available and has ammo in them.

One more change that I felt was necessary was now the characters walks to an object before he interacts with it. Until now picking up a weapon or talking to a person was done without checking the distance between the characters or any other requirement. This was fixed and now the player must walk to the object before interacting with it. (yay!)

Plans for the next updates

  • Separate the interface items such as the log, combat interface, weapon holders, etc for a more modern look
  • Further bug fixing
  • Implementation of SIMPLE rules and character system 
  • Implementation of visual resources; its time to get rid of those placeholder models and make way for something better
  • Next milestone: complete implementation of the Tibbets prison level to act as a demo
Please note that help is still needed. A few people replied but it never went past the email stage.

Sunday, 13 January 2013

Back in action

I have decided to restart working on this project as I would not want all of the work to go to waste. However help is needed as I would prefer not working alone on it as before. If anyone would be interested in helping with ANY of the below areas and has modded games or worked with engines before please feel free to contact me at once at

  • Creation and/or implementation of graphic models and resources into the engine format [Required most of all]
  • Implementation of the character creation and damage probabilities
  • Implementations of the quests and quest order while getting the info from wikipedia or the released design docs [lua scripting knowledge optional] 
  • Any other skill one might help with (creating music or ambiance for the game, helping with code development, helping with putting together design documents, etc)
  • Achievements design and/or implementation while talking into consideration the existing mission designs of VB