Tag Archives: sandbox game

Feature – Equipment

Overview

All equipment in Crea is randomly generated to some degree. Each piece of equipment is made up of attributes. These attributes can be either positive or negative effects such as stat increase/decrease, increased health regeneration, or vampiric hit. The human race has a large assortment of equipment slots: Head, Body, Hands, Legs, Feet, Ring, and Neck. All but the last two will change your character’s appearance.

The majority of equipment found in Crea will have some constant attributes as well as some random ones. Such as all Copper Greaves will always have a DEF +5 attribute and will randomly be assigned 0-2 of the following attributes: ATK +(1 to 2), MDEF +(2 to 4), and AGI +1. (This is just an example).

Modding

All aspects of equipment are completely moddable. Not only can you create new pieces of equipment, it is very possible to create entirely new attributes and even add new equipment slots.

Creating a new piece of equipment is reasonably simple. In addition to creating a normal item entity (Render, Item, Craft components), add an equipment component to an item. An Equipment component has a list of image substitutions and a function (onCreate) called when a new piece of that equipment is created. Inside of the onCreate function is where attributes are added to the equipment component.

equipment = Equipment('chest')
#These are image substitutions similar to what is discussed in Character Customization
equipment.addSub('customizations/shirt_front.png', 'mods/base/item/armor/chest/silver_breastplate/torso.png', Vectorf(2, 0))
equipment.addSub('customizations/sleeve_lower_0.png', 'mods/base/item/armor/chest/silver_breastplate/arm_lower_0.png')
equipment.addSub('customizations/sleeve_upper_0.png', 'mods/base/item/armor/chest/silver_breastplate/arm_upper_0.png')
#... and more substitutions

def createSilverChestplate(component):
    component.addAttribute(ChangeStatAttribute('HP', 5))
    component.addAttribute(ChangeStatAttribute('Attack', 3))

equipment.onCreate = createSilverChestplate
add(equipment)

Creating a new type of attribute involves a new python class that implements an interface. Here is an example with a brief description is provided with each method.

class ChangeStatAttribute(object):
    name = "ChangeStat"
    def __init__(self, stat='', value=0):
        self.stat = stat
        self.value = value
        self.changed = 0

    def alignment(self):
        #Called to determine if this is a positive or negative attribute
        return self.value >= 0

    def quality(self):
        #Reports the quality of this attribute. The quality of an equipment piece is the sum of its attributes.
        return self.value * statWeights[self.stat]

    def onEquip(self, args):
        #Called when this attribute is being equipped
        player = args['player']
        stat = player.stats.get(self.stat)
        if stat.hasMax():
            self.changed = stat.adjustMax(self.value)
        else:
            self.changed = stat.adjust(self.value)

    def onUnequip(self, args):
        #Called when this attribute is being unequipped
        player = args['player']
        stat = player.stats.get(self.stat)
        if stat.hasMax():
            stat.adjustMax(-self.changed)
        else:
            stat.adjust(-self.changed)
        self.changed = 0

    def save(self, stream):
        stream.saveString(self.stat)
        stream.saveInt32(self.value)
        stream.saveInt32(self.changed)

    def load(self, stream):
        self.stat = stream.loadString()
        self.value = stream.loadInt32()
        self.changed = stream.loadInt32()

When creating a new piece of equipment you must specify which equipment slot the new item is compatible with. In order to create a new equipment slot it only requires adding the slot to the character body script (see Character Customization). After this is done any new equipment can use the new equipment slot.

#Define which gear slots this body supports
#These show up in the character equipment UI in game
body.gear = Gear()
body.gear.slots.append(GearSlot("head", "mods/base/body/hm/gear/head.png"))
body.gear.slots.append(GearSlot("chest", "mods/base/body/hm/gear/chest.png"))
body.gear.slots.append(GearSlot("hand", "mods/base/body/hm/gear/hand.png"))
body.gear.slots.append(GearSlot("leg", "mods/base/body/hm/gear/leg.png"))
body.gear.slots.append(GearSlot("feet", "mods/base/body/hm/gear/feet.png"))

Links

Crea’s Vision Part 3 – Worlds

In my last two posts I have been covering our vision for Crea. The first was on Crea and the community. The second post I talked about gameplay in Crea. In this final part I will be sharing our vision for the worlds in Crea.

Worlds in Crea will be randomly generated. Worlds will be constructed out of many different “biomes,” which can be true biomes (such as a tundra) or constructed areas (such as the aforementioned casino). We want players to be able to have complete control over the world generation and are planning advanced options that will allow players to pick which biomes the world will consist of and their frequency.

World generation is just the beginning. We are working towards having Crea worlds be organic. Plants have complete freedom in how they can grow and spread. At first weather will be purely for looks, but eventually we want weather to actually affect the world – for example, a forest could get caught in a lightning storm and burn to the ground. (Dynamic weather will be a post-release feature.)

In addition to being organic, Crea worlds will be dynamic. Events will happen randomly or after certain conditions have been met. Such as new NPCs appearing, monster swarms attacking, and bosses emerging. Possible quests will come and go and can affect the world on a more permanent level.

The last thing I’ll mention is connecting worlds together. At the moment each world is self-contained. Eventually I would love to make it possible to connect worlds together making it possible for players to go between them. This could be used to make instanced dungeons or lots of small worlds that could act like zones (towns and dungeons) in standard RPGs.

I hope you enjoyed reading this series of posts. It feels good to get this all out. I should have done it sooner!

Crea’s Vision Part 2 – Gameplay

Yesterday I relayed our vision for Crea and the community. If you have not read this yet, then I recommend you do! Today I will divulge our vision for Crea’s gameplay. We may not be able to include all of these features in the initial release, but they will be added later in the form of free updates.

Our primary focus with gameplay is to give players a true sandbox; one that enables them to play how they want. I believe there are two playstyle extremes, creative oriented and action oriented. Most players will fall somewhere in the middle of the two, but Crea will support the full gamut of personal gameplay styles.

For those that enjoy crafting, building, and tinkering with things, monster spawning has been designed in such a way that they won’t be obnoxiously attacking you while you’re doing your thang. You will be able to adjust the frequency that monsters spawn. For players who are solely interested in creating worlds, we are also planning a build mode that will make this much easier.

The action oriented players will be pleased to find that we are planning an involved combat system where skills and timing matter. Monster spawning will be an entire system involving fighting back monsters as they attempt to expand their territory. Crea will also feature several bosses that will test both your strength and skills.

There will be lots of content that fills the gap between these two extremes. We have several large biomes planned and are dreaming up other “biome” type areas such as battle arenas or casinos. There will be hundreds of items with many being interactive, automatons (self-operating machines), or generators (items that create other items). These will make it possible to set up intricate systems for collecting resources or traps to kill enemies. I am a huge sucker for these!

In the past we have mentioned several systems such as crafting, leveling and quests. As we say in our video, we love sandbox games for being so open-ended, but we also love RPGs. Crea will have HP, leveling, NPCs with quests, bosses and other goals to strive for. You will always have something to do in Crea.

Modding, which truly touches every single aspect of Crea, acts as a multiplier to the gameplay. Everything can be enhanced or expanded upon through mods. This is easily the thing I am most excited about; seeing what the community comes up with.

Ah! Wall of text! There’s so much to Crea’s gameplay that it’s impossible to explain it all in one post. Much more in depth blog posts are on the horizon! If there’s any particular aspect of Crea that you’d like to know more about, then be sure to leave a comment. Tomorrow, in my final part of Crea’s vision, I will share with you what we have in mind for the worlds in Crea.

Crea’s Vision Part 1 – Community

Since the launch of our Kickstarter campaign we have been asked about the different aspects of Crea many times. We have been accused of being a “Terraria Clone” even more often than that. When I (Jasson) started Crea, I made it one of my development goals to be open with the community. Keeping true to that, I want to share with you our vision for Crea. I have decided to split it up over three parts to keep the wall of text to a minimum.

First and foremost, we are about the community. We don’t want to be isolated in some ivory tower of development. Instead, we want to be actively engaged with the community on as many levels as possible, updating the game according to feedback from players. I plan to continue to provide development updates on the blog at least once per week. To add to that, we will soon be launching forums, a wiki after that, and we are always listening to the community for other suggestions.

I want to ensure that Crea is fully accessible to everyone. That is why we are pushing hard to release on Windows, Mac and Linux platforms. We have already implemented localization support, which makes it easy for anyone to create a translation of Crea. As we get closer to release it would be great to work with the community to create some official translations.

After Crea is released, we’ll be working hard to fix any bugs players stumble upon. After that, we’d like to give players a chance to vote on what new features they’d like us to develop. I also want to assist modders who are creating interesting and original mods for Crea. We’ll be regularly participating in the forums to answer questions and provide assistance to players.

But before we can have a community, we first need a solid game. Tomorrow, in part 2, I will cover our vision for the gameplay in Crea. Thanks for reading and feel free to ask any questions.

Modding Video and Development Update

I forgot to post the modding video I put together the other day. It only covers some very simple modding but it really shows just how easy it is to mod Crea. I have another video planned that I will be putting together within the next few days (maybe even today!). This follow up video will have showcase some advanced modding.

Aside from putting together videos and keeping up with the Kickstarter campaign, I have been doing my best to keep pushing forward with development. Lately I have been implementing the real inventory system. Once I finish it and get some screenshots I will go over the details. I will say that it will be a lot less like Terraria and Minecraft and more like Torchlight.

Progress Overview

We have been working on Crea heads down for the last few months and have made great progress. Now we are beginning to share Crea with others and are getting some attention. Many new people are coming here and likely are wondering a few things such as “What is Crea?”, “What platforms will it be on?” or “When will it be released?” See the Crea, FAQ and Team pages for answers to these questions and more.

One thing these pages do not cover is our current progress on Crea. Here is a quick summary of what we have accomplished thus far and what features are coming up soon. Links are to the related blog posts.

Implemented:

Coming Soon:
  • Lighting
    • Not much to be said here. Lighting to add to the atmosphere and exploration.
  • Leveling
    • Unique proficiency leveling system where you gain experience according to your actions
  • Equipment
    • Equipment system that can have consistent stats or randomly assigned stats.
  • Monsters
    • Monsters are spawned from monster spawners that will spread if not destroyed.
  • NPCs
    • Start with basic NPC interactions such as dialog and item trading (for stores and the likes). More involved NPCs will come a little later – such as quests.
  • We have many more features we will implement but these are the highest priority features at the moment. If you want to see our timeline be sure to check out the project plan.

We will be continuing to update regularly. Be sure not to miss any and subscribe to the blog!

Kickstarter Coming Soon!

We are currently crafting an awesome Kickstarter campaign, but it is missing something! Momentum. We need to build some juicy momentum over the next week in order to launch with a BANG. This is where you come in.

First of all, go to kick.siegegames.com and sign up to receive word the moment our Kickstarter launches. Once you have signed up you can share your referral link with your friends. The more you share the more we’ll reciprocate the love.

Several updates will be coming over the next week as we prepare for our launch and even more once we launch. Exciting times are ahead!

Plants Update

I wrote this last week put forgot to post it.

Got a large update today. The last week I have been in the zone and have gotten a great deal done. First off, we reworked our website a little. In my last update I said I was working on implementing plants. At that point I was still in the designing phase for them. Since then I have finished implementing them and much more.

For every feature my mantra is easily moddable but lots of control. All of the supported content up to this point has had one form of communication – engine asking for the entities components which are returned in component definition form. I struggled quite a bit while attempting to fit the plants into this format. I finally came to my senses and realized what I had to do.

All of the plant logic resides inside of python. How the plant grows, how it visually looks, how it is harvested, and even how it is planted. With this solution, any modder has unlimited control. As for the “easily” part of my mantra, I am wrapping the core plant concepts up into nice little python classes which are extremely simple to use. I have included the code below for those interested in its awesomeness.

Because of this approach I have had to go through my entire game engine and expose it to python. This is something I have been putting off because I wasn’t sure of the requirements, boost python is a little scary and I knew it was going to be quite an undertaking. With this beast finally slain, creating new content will be much easier and have even more freedom.

Here are some screenshots featuring the plants that can grow overtime and be interacted with. There is also an early version of the grass. Right now the grass just grows on soil and is destroyed when the tile underneath it is removed. Later today I plan to make grass occasionally spread to nearby areas as if seeds were dispersed.

You can harvest the trees too!

This is the Zebra tree script that most people will see and have to worry about. I hope most of this is self explanatory. We are adding the different components to the zebra tree entity and the ZebraTree class is used to override the default properties of the tree (which can be seen below). We can add bases, trunks crowns and saplings images and they will be randomly used in the appropriate places. We can also override many other properties such as the seed it produces how tall it can grow, and how fast it can grow.

name = "Zebra Tree"

add(ModularRender())

interactable = Interactable()
add(interactable)

class ZebraTree(Tree):
trunks = [TreeImage("mods/base/plant/tree/zebra/trunk1.png", 2, 28), 
TreeImage("mods/base/plant/tree/zebra/trunk2.png", 2, 28), 
TreeImage("mods/base/plant/tree/zebra/trunk3.png", 23, 28)]
crowns = [TreeImage("mods/base/plant/tree/zebra/crown1.png", 34, 101), 
TreeImage("mods/base/plant/tree/zebra/crown2.png", 31, 98)]
saplings = [TreeImage("mods/base/plant/tree/zebra/sapling.png", 8, 33)]
seed = "mods/base/plant/tree/zebra/seed.ce"

def __init__(self, entity, organic):
super(ZebraTree, self).__init__(entity, organic)
def createZebraTree(entity, organic):
return ZebraTree(entity, organic)

add(Organic(createZebraTree))

Here is the Zebra seed script which is really simple. As with all content entity scripts we add the needed components, this time a Render, Item and Interactable components. The important part here is that we add an interaction “use” and provide the “useSeed” function which is defined in the tree script just below this one. To make this function reusable the plant the seed creates needs to be bound to the function provided – in this case we provide the path to the zebra tree.

import functools

name = 'Zebra Seed'
render = Render('mods/base/plant/tree/zebra/seed.png')
add(render)
item = Item()
item.stack = 999
item.delay = 200
add(item)

interactable = Interactable()
interactable.add("use", functools.partial(useSeed, "mods/base/plant/tree/zebra/zebra.ce"))
add(interactable)

Now for the meat of the tree logic. Here is the tree script which contains the Tree class and useSeed function that are used in the above scripts. As with everything this is still in the works but is most of the way there. I’m not going to go into detail in this now since there is so much going on but if you understand it then awesome. Once things start becoming finalized we’ll write some official documentation on these sorts of things. I put this in a pastebin because it is somewhat large.

Tree script

Lastly, I wanted to throw in the grass code which I’m happy about because I was able to write it without making any engine code changes. There is still in the works but I have the basics down. I will likely do the same for the grass that I did for the tree and have a base Grass class and allow for inheriting and changing the properties without having to worry about the logic. Pastebin link for the same reason as above.

Grass script

Thanks for reading through all of this! I know it is a lot. I’m interested to hear what you think of this.

Alpha Feature Video

Over the last two months we have added in a great deal of new features. This video shows off a number of these alpha features: item placement, modular composite animations, crafting and a few other small things. Keep in mind that this is a work in progress.

In addition, Kelley has been working hard on character animations, new items and most importantly – llamas!