Atavism Blog

Atavism Blog

Here you will find Blog posts about atavism

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.
  • Team Blogs
    Team Blogs Find your favorite team blogs here.
  • Login
    Login Login form
Subscribe to this list via RSS Blog posts tagged in atavism MMO
Creating and Accessing Properties Part I

Every player character and mob in Atavism uses properties to keep track of appearance, combat and other game progression information. Properties are generally given to the player/mob on creation and accessed and updated as events happen in the game.

Properties can only be created and updated by the server (to prevent synchronisation issues and cheating), and are sent down to the client as the player comes within range of another player or mob.  The client (Unity) can listen for property changes and/or grab a property value from a player/mob and use it to display information in various ways (such as numbers/text in the user interface or the visual appearance of the player).

In Part I of this two part blog how to create properties for your players and mobs is explained below. Part II next week will cover how to access that data in Unity and set up listeners. Part II will also be accompanied by a tutorial to add a Title property to your characters which will be displayed beside their name.


Creating Properties for Players

Player properties can be added in different ways depending on the property type. Stat properties for combat (such as health, strength etc.) are added using the Stat plugin in the Atavism Editor (see more here: <insert page>). Other properties, such as appearance or general game progression properties, can be added either in the Character Creation scripts in Unity, or in the Character Template in the AGIS code on the server.

Adding Properties in Unity

Adding properties to the character creation in Unity is done by adding in a new entry to the properties map that is sent to the NetworkHelper.CreateCharacter() function. In the standard Atavism setup this is located in the LoginUI.cs file, in the DrawCharacterCreateUI() function, and in the UMA setup it is in the CharacterSelectionCreation.cs file, in the CreateCharacter() function.

Any new properties added in to via the Unity method need to have “custom:” at the start so the server knows not to confuse it with the standard properties. For example, an age property to be given to player characters upon creation:

properties.Add ("custom:age", 27);

Note: An example of a few properties are provided in the LoginUI file, commented out among the rest of the property setting code in the character creation.

Adding Properties in AGIS

Adding properties in the AGIS code is done by modifying the file found in the objects package. New properties need to be added to the template for a character which is setup in the createCharacter() function. Adding the properties in the AGIS code comes with the added complexity of deciding which Namespace the property should be added to (Namespaces relate to different areas of the server such as combat, inventory, world). Properties relating to combat should be added to the CombatClient.NAMESPACE, inventory related ones to InventoryClient.NAMESPACE, and most others to the WorldManagerClient.NAMESPACE. Other Namespaces exist, but I won’t go into detail here about what it all means as it is another topic in itself.

Note: All custom properties from Unity are added to the WorldManagerClient.NAMESPACE.

As an example, if I wanted to add the age property directly on the server rather than through Unity, I could add:

player.put(WorldManagerClient.NAMESPACE, "age", 27);


Creating Properties for Mobs

New Properties for mobs can only be done in the AGIS code, by editing the loadMobTemplates() function in the file located in the database package. Mobs use the same template system as the CharacterTemplate setup listed above. For example, mobs could be given an age property as well by adding:

tmpl.put(WorldManagerClient.NAMESPACE, "age ", 27);

to the loadMobTemplates function.


Final Notes

It is important to note that any new properties will only exist for newly created characters. You can always wipe all existing characters in your game by re-sourcing the install.sql file if needed.

All properties of your character, or of the player/mob you have targeted can be viewed by typing /props into the chat box when in game. It is a good idea to try this after creating a new property to make sure it is coming up as expected.






Tagged in: atavism MMO properties
Hits: 3549

Posted by on in Uncategorized
Vitality Stats

For all those who have wanted hunger, warmth and other survival stats in their games, Atavism now provides a new type of stat known as Vitality Stats. These stats allow a change in the value over time (known as a shift) with actions that can be set upon reaching the minimum or maximum value (such as the player/mob dying).

For example, a hunger stat can be set with a max of 100, and a min of 0. The stat can be set to increase by 2 every 6 seconds, with death occurring when hunger reaches 100. If the player doesn’t eat some food (or have some effect applied) that decreases their hunger, they will die in 300 seconds (5 minutes).

There are 3 steps in setting up a Vitality stat: Creating the max stat, creating the vitality stat, and setting the stat on the character template.

Creating the Max Stat

A max-stat needs to be set up to control the maximum value of the vitality stat. Open the Stat plugin in the Atavism Editor and create a new stat with type Base Stat. I generally put the word “max” in the max-stat name to help identify it. Leave Stat Function as none and ignore the Mob Values.

Example max stat:


Creating the Vitality Stat

The vitality stat setup involves setting the shift data (how much the stat changes by itself over time), the requirements for the shift to occur, and what happens when the min/max values are reached.

To create a vitality stat, open the stat plugin in the Atavism Editor and set its type to Vitality Stat. Set the minimum value you want (generally 0) and set the Max Stat to the stat created in the step above. If the stat should only effect players then tick the Player Only check box (most Vitality stats will be player only, otherwise you will have random mobs and NPC's dying). Set the Shift value to how much the stat will change each update, and if the stat can be reversed (such as breath going back up when you are out of water) then set the Reverse Value. Now set the Shift Interval to how often (in seconds) you want the stat to update.

Note: Reverse mode is not functional yet and will be included in the next update.

Set the On Min Hit and/or On Max Hit to what should happen when the stat reaches either its minimum or maximum. By default the only option at the moment is death. The system is designed for more options to be added in the future.

The last part for the Vitality Stat setup is the requirements. Requirements can be set so stats only update when certain states are true for the player, such as the player being alive, or not in combat. The current version provides only these two options with support for new requirements to be added in. If the stat update is to run all the time, add no requirements. Click Save Data and the only task left is setting up the stat for your character templates.

Example vitality stat:


Explanation: The hunger stat goes up by 2 every 10 seconds and when it reaches the max value (which is 100) they will die.


Setting the Stat on the Character Template

The stat now needs to be set on each character template that has been created in the Player Character Setup plugin.

Open the Player Character Setup Plugin and for each template scroll down to the new stats and set their values. Be careful when setting the base value for the vitality stat on the character as it can result in instant death (and character creation issues) if it triggers the onMin or onMax events (for example, if the onMax action is death and the starting value for the vitality stat is equal to the max value).

Example stat values on my character template:



Other ideas

From here you may want to offer ways for players to prevent their death from a vitality stat such as adding items that can be consumed that decrease the stat, or giving them abilities they can activate. These ideas can be achieved using Stat Effects that modify the value of the vitality stat.

As Atavism development continues the plan is to add many new states and onMin/onMax actions to provide better gameplay. One example is warmth that can be increased while near certain objects (fires) and decreases when outside and based on the weather. Any adventurous programmers should be able to achieve results like this already using the base that has been programmed in.

Hits: 2296

Posted by on in Uncategorized
Creating a Damage over Time Effect

This week I’m going to explain how to create a Damage over Time effect (DoT) along with setting up the ability, the skill and giving it to players. For any who aren’t familiar with the term, DoTs are used for bleed, poison, burn or curse (or other) style abilities where the target continues to take damage for a period of time.

For this blog I am going to create an ability called Lacerate which causes a DoT called Bleed. The ability will be part of the Knife Style skill. There are 4 parts to cover: Creating the Skill, creating the Effect, creating the Ability and giving the Skill to a player.

Creating the Skill

Open the Skills plugin in the Atavism Online Editor and create a new Skill called Knife Style. Make sure Automatically Learn is checked and hit Save Data. The rest of the settings don't matter for this example.

Creating the Effect

Open the Effects plugin in the Atavism Online editor. I have set the properties as below:

Name: Bleed

Effect Type: Damage (as this effect will be dealing damage).

Damage Effect Type: Physical Dot (Bleed effects generally use physical stats for their damage calculations. By default the physical stats are strength (physical power) and dexterity (physical accuracy)).

Damage Property: health (the target will be losing health from this effect).

Damage Type: I have chosen slash, but it could be any.

Damage amount: 30 (this is the full amount that will be dealt by the DoT before other modifiers).

Damage modifier: 1 (leaving this as default)

Transfer Rate: 0 (I don’t want the caster getting any health from this)

Bonus Damage Effect: None (I’ll cover this at the end of the Blog)

Bonus Damage Amount: 0 (if there is no bonus damage effect, there’s no need to set an amount)

Is Buff: False (buffs are for positive effects, damage effects are negative)

Is Passive: False (this effect is activated by an ability)

Skill Type: Knife Style (the skill I setup in the first step)

Skill Mod: 1 (Add 1 damage for every level the caster has of the Knife Style skill)

Stack Limit: 3 (The caster can stack the ability 3 times on the target allowing it to deal up to 3 times the damage).

Allow Multiple: True (multiple casters can all put this effect on the target at the same time)

Duration: 15 (the effect stays on the target for 15 seconds)

Num Pulses: 5 (the damage from the effect will be applied 5 times)

Effect Particle: None

Tooltip: You are bleeding! You will lose health every few seconds. (if the UI is setup to display effects on the player, this message will show up when they have this effect).

The main settings to look at here are Damage Amount, Duration and Num Pulses. The Damage amount is split up by the number of pulses. In this example the 30 damage is split between 5 pulses resulting in 6 damage per pulse. There are 5 pulses over 15 seconds, so each pulse happens 3 seconds apart, the first one occurring after 3 seconds.

Once the settings are as wanted, hit Save Data. With the effect created, an Ability now needs to be setup to apply the effect.

Creating the Ability

Open the Abilities plugin and set the properties as specified below (anything not mentioned can be left as default):

Name: Lacerate

Ability Type: CombatMeleeAbility

Skill: Knife Style (the Skill made for this example – this skill can be increased by using this ability)

Target Type: Enemy (can only be used on enemy targets)

Cooldown Type: LACERATE (I made a custom cooldown so this ability can only be used every 5 seconds)

Duration: 5

Act Target1: target (we want the effect applied to the target of the ability)

Act Effect1: Bleed (the effect made in the step above)

The Ability now needs to be added to the Knife Style skill. Open the Skills Plugin again and click on the Edit button and choose the Knife Style Skill. Under the Skill Abilities section set Ability 1 to the Lacerate ability created in the step above. Make sure Level is still set to 0 and click Save.

Giving the skill to a Player

Open the Player Character Setup plugin and go into Edit mode. Choose the template you want to edit and head down to Starting Skills. Click the Add Skill button and choose the Knife Style skill. This will give the skill to any new characters made that match the Race/Class combination for this template.

Give the server a restart and everything is ready to go. Make a new character and they will have a new Lacerate ability in their action bar. Now it's just a matter of finding an enemy to attack and trying the ability out on them. You should see them take some damage every few seconds after using the ability.

Images have been added below to show how my Effect and Abilities screens looked when I was finished.





Hits: 4406



S5 Box

Sign On