Tag Archives: game mod

Advanced Modding Video

Before getting to the video, someone has created a page on reddit for Crea. Help us spread the word. Thanks! http://redd.it/x22mt

Moving on, this is my follow up video to the modding video I posted last week. This is some advanced modding and consequently is much more involved but don’t worry about that. We will be writing lots of documentation and tutorials which will explain everything in full detail. Enjoy!

Character Progression

Want some details on the “RPG elements” that will be included in Crea? You got it!

One of our major focuses for Crea is adding in character progression and a sense of personal attachment to characters. There are several aspects to character progression – this post is about character leveling.

Characters will have a set of the usual stats: HP, AP (Action Points), Attack, Defense, Magic Attack, Magic Defense, Agility and Dexterity.

Additionally, characters have “proficiencies.” These are skill levels in four different areas: fighting, crafting, exploring, and gathering. Each proficiency has its own experience level and experience points. So, craft items to gain proficiency in crafting. Pick mushrooms and other plants to gain proficiency in gathering, and so on.

As a proficiency levels up the character will unlock new skills. Once a skill is unlocked the character is able to allocate experience from that proficiency to their new skill. Some skills are passive, and always in effect. Subsequent levels in a skill will raise its efficacy.

As usual, all of this is going to be easily moddable. Want to add a “cooking” proficiency? New “Triple Jump” skill for the exploration proficiency? Not a problem! Are there any proficiencies you’d like to see us add to Crea?

Be sure to subscribe to the blog to get the latest updates and details on Crea!

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!

Creating Placement Items

First of all, this builds on top of my previous blog update so you should read that now if you have yet to. This post will go a little more in-depth into what it takes to create an item that can be placed in the world.

Starting out lets say you are an amazing artist or have one on hand – like I do! Said artist has created an ingenious llama statue.

Hello, I am a Llama.

Now you want to place it into the game… but how do you do that? Inside of your item mod directory you need to create a content script so Crea knows about your statue. Here is what the script would look like.

name = 'Llama Statue'

#Render Component
render = Render('mods/base/item/llama_statue.png')
add(render)

#Item Component
item = Item()
item.stack = 999
item.delay = 200
add(item)

#Craft Component
craft = Craft('Home', 'Decoration', '') #Category, Subcategory, Surface
craft.add('mods/base/tile/stone.py', 50) #Materials needed
craft.quantity = 1 #Quantity made from a single craft
add(craft)

#Placement Component
placement = Placement()
placement.addAxis(PlacementAxis(AxisType.AXIS_FLOOR), Vector(5, 32))
add(placement)

I added in some comments for the crafting since I have not covered that before, but what we are really looking at is the placement component at the bottom. Items are composed off a list of possible axes that the item can be placed on.

The item can be placed on any axis but only one at a time. The types are floor, ceiling, left, right, backwall and wall. Backwall is the a tile in the wall layer. Wall is the combination of left and right. In addition to the axis type, each axis has a range, an area, and a list of supports.

The range of an axis defines where and how much support is needed to place the item down. This is the second parameter for PlacementAxis. In this case we have Vector(5, 32), which translates to start at pixel 5 on the bottom of the image (since it is floor) and go for 32 pixels. This will default to starting at 0 and using the entire axis length. The reason for this feature is to enable items to have a skinny base and only require support for the base and not the entire width of the item.

Area for an axis is the game’s physical representation of the item relative to upper left corner of the image. This area is used to reserve space for items in the world. This area defaults to the size of the image.

The last part of an axis is the list of support it can provide. It is defined very similarly to an axis with a support type and a range of where and how much support to provide. The type can be on any one of the four sides; top, bottom, left or right. Here is an example of a table placement with support on the top.

placement = Placement()
floorAxis = PlacementAxis(AxisType.AXIS_FLOOR)
floorAxis.addSupport(PlacementSupport(SupportType.SUPPORT_TOP, Vector(3, 57)))
placement.addAxis(floorAxis)
add(placement)

And now we have a llama standing on a table!

Here are a few cool features about the placement system.

  • Item placement is on a per pixel – not a grid.
  • Item placement is smart and provides some tolerance to moving to unavailable spaces.
  • When you have a placeable item as your active item you will see a semi-transparent hint of where it will be placed.
  • An item can have an animation component added to it with animations named to the different axes. The game will automagically use the correct animation when the item is placed.
  • An axis can have any number of supports, which means that you can do something like a Menorah.

Overall this system is really flexible and provides an extreme amount of power to both modders and world construction. Currently its biggest limitation is that items cannot be placed inside of another item. This limits some items such as a bookcase and placing individual books in it. It is probably still possible – just have to be creative! If the demand is high in the future I may revisit this limitation but for now it is something I am willing to live with.

Feel free to ask any questions or give constructive feedback. This is my first attempt at writing a more in-depth guide to modding.

Quick Update – Creating Characters

This last week I’ve been busy laying the foundation to be able to creating characters. This primarily consists of getting the character’s to be able to dynamically render and animate with customizations (hair, base clothing, etc.) as well as with equipment. We have been contemplating and discussing how we would go about doing this since the beginning and then I found Spriter.

Spriter is a software tool used to create 2D modular animations. This means breaking apart the character into tiny pieces and moving them individually instead of having a static frame. This enables us to create animations with lots of frames and only create the graphics once – making content creation as simple as possible. I will save the remaining details for next week.

Aside from the animations I have begun constructing the UI for actually creating characters. Things are going well and I do not see any reason it wont be finished by next week’s update.

Speaking of UI, my good friend David has officially joined the team. He has been helping out since the beginning and was definitely Crea’s #1 fan. He is a professional web designer/developer and consequently will be focusing on the UI. I’m sure it wont be too long before I am showing off his work here.

Stay tuned!

Productivity Prevails

This last week I have been extremely devoted to working on Crea and lots of progress was made!

First, I have been working on the crafting system with my friend David helping on the UI side. The UI has been designed with expansion in mind. All craftable items have a category and subcategory. In the UI the categories are tabs and the subcategories are collapsible sections. Here is a screenshot of the latest version.

All of the graphics are placeholders for the time being as we iron out the design. Functionality wise it at 100%. Creating a new item with a craftable component will automatically be added to the dialog. The displayed items can be filtered by “only available” items and/or by surface requirement, which is automatically populated as well.

Saturday I implemented a feature David suggested where the active item is now more of an active column and pressing tab will cycle the active item. This will make it easy to clump commonly used items together and quickly tab through them. We are still playing around with it but it is a promising concept.

The last thing I worked on this week was internationalization support. With this in place it is easy to create new a localization. Each mod can provide a list of text translations for any locale. All mods for a given locale are combined to create the final localization. This means that even mods can provide translations for other mods. I am really excited to see what the community does with this.

That’s all for this week as far as updates go. I will write a new in-depth post about one of the features later this week – perhaps the crafting system. Be sure to subscribe to keep up-to-date on the latest news!

Behold the Power of Modding

I have been rambling on about this sandbox project being mod friendly, but I haven’t given any details. How will the mods work? What will they look like? I want to take the time to answer these – please bare with me as this is  more technical than previous posts. Mods will work through the power of Python, a scripting language, and a component-based engine. Each piece of content has its own text file that describes how to create it in game. This file is actually a python script. I will touch on why this is so important soon. The content definition file is very readable and I am doing my best to simplify it. Before digging in too deep lets look at an example – a simple pickaxe.

name = 'Pickaxe'

render = Render('mods/base/item/pickaxe.png', SpriteData("Pickaxe"))
add(render)

item = Item()
#How many of this item can stack in one inventory slot.
item.stack = 1
#How often the item can be used. This is in milliseconds.
item.delay = 200
add(item)

#Adding a craft component enables players to craft the item
craft = Craft('tool')
craft.add('mods/base/tile/stone.py', 2)
craft.add('mods/base/tile/wood.py', 3)
add(craft)

#Tool components makes the item be able to break down compatable tiles
tool = Tool()
#Each tile has a life amount that is decreased by tool's power - once zero the tile breaks
tool.power = 1
#How far can the tool reach - this is in pixels (tiles are 24x24 pixels)
tool.reach = 125
#Which tiles the tool is compatable with. This can list tile groups ("soil") or specific tile names ("stone")
tool.compatable = ['soil', 'stone', 'sand']
add(tool)

Any content created in game is known as an ‘entity’ and each entity is composed of one or more components. Every component has a specific function such as a render component is used to render the entity to the screen and a craft component is used to provide information on how to craft the item. An entity can have any combination of components added or removed from it, which makes the system very modular. At entity creation the content script, such as the above pickaxe script, components are added with the add() function – such as add(render). You’ll see that a pickaxe is composed of a render, item, craft and tool components. Don’t want the pickaxe to be craftable anymore? Simply remove the craft component. Remember how I said that this is a python script? Because of this it opens up all kinds of doors. Some components will provide the power to define custom functions. What this means is that content can have unique logic inside of it. Here is one quick example.

Say you decide you really hate monsters attacking you while you’re trying to mine for some copper. You’re a simple man with simple pleasures. You don’t ask for much. Then suddenly you have an idea – lets make a new piece of equipment that insta-kills any monster that comes in contact with you. This can easily be done by adding in a custom OnHit function to your newly crafted equipment piece. You won’t worry about those monsters anymore as they squirm on the ground in agony at your feet.

If I lost you with my first mention of functions, then don’t worry because as I have previously said, all of the included game content will be a mod. Consequently, there will be plenty of examples to copy from. Also we’ll do our best to provide lots of documentation on modding. This is just one example of the true power of modding.

Upcoming Minecraft Mod API

Considering the humble beginnings of Minecraft, it is no surprise that it does not have mod support. Not to mention who ever knew that there was a desire for it. Without any official mod support, mods for Minecraft have been hacked into the game and eventually communities built up around modding the game. These communities have done their best to build their own mod API but without official support they can only go so far. The community has been begging for some official support for sometime. This is why, when Notch announced plans for the upcoming Minecraft mod API nearly a year ago, the community rejoiced.

Having official mod support for Minecraft will undoubtedly be huge for the community. This will help bring the mod community together. Another huge benefit is that it will enable players to more easily obtain and install mods. Additionally, there will likely be much higher quality mods developed. This is probably only scratching the surface on what benefits we’ll see from an official mod API. However, some of the given information does potentially have some downsides – mainly accessibility.

In order to gain access to this mod API you must signup as a mod developer. It also sounds like mods will go through some submitting process and once accepted will become available to everyone online. If this is the case then there is little place for casual mods. I do hope that Mojang has considered this and provide means for players to easily and casually create mods as well as be able to share with just friends or the entire community.

Since the mod API announcement, Notch has given lead to Jens Bergensten who is continuing to focus efforts on developing this mod API. More recently Mojang absorbed Bukkit, a Minecraft mod team, to help with the mod API. This really shows Mojang’s continued committed to this mod API – not to mention how much this team will help bridge between development and the community.

Back when Bergensten took over Minecraft lead, he had an interview with Gamasutra and from it there is a quote of resounding truth.

“there is no way in hell I will be able to add as much content as the whole internet can” - Jens Bergensten

This quote has stuck with me since I read it and undoubtedly helped set the course for our recently announced sandbox game.

Sandbox Modding

My last post I introduced this idea of building a sandbox game that is mod friendly. What does this “mod friendly” actually mean? Isn’t decompiling the game’s executable and editing the source code considered as supporting mods? Not quite. Decompiling is obviously a way to mod games, as Minecraft and Terraria have proven, but it is still far from being truly mod friendly. To be fair, these games were built by very small teams (1 and 2 people respectively) and being mod friendly can be a lofty goal. To me, mod friendly means to make creating, sharing, and managing mods as simple as possible for the average player.

Creating mods will be simple and fast but still provide much flexibility for those with big plans. Tools will be provided to help perform the more basic tasks such as setting up a mod. Adding content will be as simple as creating a new file, typing in a few lines, saving the file, and then loading it up in the game. No compiling will be required. One goal I have is to make it possible to reload content in game to help streamline the creation process. No restarting necessary!

The provided mod tools will help with packaging up a mod as well. Once packaged a player simply has to drop the mod package into their directory and the game will take care of the rest. We are also considering providing an official hub to upload mods to. Eventually, if the game gets onto Steam, we would love to support Steam Workshop. This is a service provided by Steam that allows players to easily share, search, and subscribe to game mods.

Players will be given the ability to enable/disable mods and even completely remove the mods all in game. The goal is to minimize the amount the player has to manage mods externally. We even have plans to make the multiplayer host (aka server) provide any missing mods to joining players.

The way that we will ensure that this game is truly mod friendly is by dogfooding it. All of the game content will actually be a mod to the game. With this philosophy we will be able to ensure that nothing is hardcoded and nearly every single aspect of the game can be modified. This won’t just include the basics such as items, monsters and tiles. It will include much more such as biomes, NPCs, character customization, and eventually the ability to add entirely new systems to the game.

In my next post I will go into the more technical side of how the game will be made mod friendly.