Tag Archives: indie game

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!

Chat and Item Placement

Time for the weekly update! This last week was another productive week but it took an unexpected turn. At the start I was planning to get chat, item placement and some other feature done. I breezed through chat as I suspected, and once I started digging into item placement I realized there was much more potential (and work!) than I had originally anticipated.

Item placement is the feature the enables a player to take an item from their inventory and place it into the world.

I knew right away that I needed item placement to be dynamic and any item could provide a placement component to enable it to be placed into the world. Another thing I knew is that items should be able to define how it can be placed (known as the axis) – on the ceiling, floor, wall, and/or backwall. One last thing that entered my mind before I started programming is that some items should be able to be placed on top of other items – such as a candle can be placed on a table. Once I got the basics implemented and began looking into items supporting other items I had an epiphany.

Items can provide a list of different axes it can be supported on (think ceiling, floor, wall) and for each axis it defines the area the item takes up in the real world and also a list of supports that the axis provides. These supports can specify the side the support is at (top, bottom, left, right) and where the support is at on the item’s side. This basically boils down to one word: Awesomeness.

I will admit that it is a confusing without seeing it in action so here is a quick peek with more to come soon. This is a poor man shrine my friend David threw together.

The tables and shrines are all dynamically placed on a pixel basis and this is why I am truly excited about this feature. Later in the week I plan to write a more thorough write-up on how easy it is to create items with a placement component. I may even include a video of it in action!

Building anything just got personal.

Crafting in Crea

When I first started brainstorming Crea and how I would do things differently from current sandbox games, crafting was the second thing that came to mind (after modding of course). The positional crafting system in Minecraft is an interesting approach but it, like other crafting systems, share a common problem: The player has no idea what can be crafted and/or what materials are needed for an item. Nearly everyone (if not everyone), loads up Minecraft, plays around a little bit and then opens up a wiki to find what items to craft and what is needed. The same goes for Terraria for the most part. In the end, players become wiki dependent and consequently the game does as well. This stops in Crea.

A player must first aquire the recipe for an item before being able to craft it.There are several means to acquiring recipes: monster loot; treasure chests; quests; and, most importantly, the Researcher NPC.

The Researcher is specifically for discovering new recipes. First you provide the researcher with materials. Upon returning to him after some time, you gain any recipes his research turned up. We are also considering a hint system that will help steer players into being able to discover more recipes.

This should help give new players direction and also keep them in the game. Basically, crafting will feel like a natural and intuitive aspect of the game rather than a mystery that requires switching in between the game and a wiki. Another exciting aspect of this crafting system is that it lends itself to the ever-expanding content Crea will see.

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!

Stargazing

I have mentioned Terraria on several occasions here. One thing I have neglected to mention is that a month ago Redigit, one of the developers, announced that Terraria’s development has ceased. The other developer of Terraria, Tiy, has gone on to work on a spiritual successor to Terraria, Starbound.  One the surface Starbound looks familiar to Terraria, but once you start digging it becomes apparent that the design direction is quite different. Nearly everything is going to be procedurally generated as hinted at in this indiegamemag.com article. In Terraria only the world is generated and all other content is predefined. In Starbound, weapons, monsters, worlds and I’m sure basically everything else is going to be generated on the fly.

I wonder if monsters attacks will be randomly generated. One attack would be the creeper attack, which is a Minecraft monster that gets next to you and explodes. Just imagine you’re walking through a forest and then you spot a deer-like creature grazing. You really want to pet it so you slowly walk up behind it. Just as you extend your hand to touch its side, it turns its head toward you, glares for a second and then begins to flash. BOOM! The deer explodes and leaves a nice crater in it’s place. I’d buy that.

Starbound Arctic Planet

This design approach is not all too surprising. Sandbox games lend themselves quite well to generated content. I think this is mostly because sandbox games are all about exploration of the world and your imagination. When the world is generated with lots of parameters the sheer number of possibilities becomes nearly limitless.

There is one problem with this though. Because Starbound is putting so much focus into the randomly generated content it limits the exploration of your imagination. I am of course talking about modding. It does sound like there will be some support for mods but it seems to be more of an afterthought. Regardless, this game is going to be legendary.