Tag Archives: progress

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.

Latest Happenings

Hey, I missed last week’s update. Things have been busy for me! Lots of work, real life events and Diablo 3 have all been keeping me occupied. Fortunately all of these are wrapping up for me – just one last wedding this upcoming weekend. I still have managed to get some work on Crea done and soon much more.

Tiles changed from 24×24 to 16×16. This is a fairly large gameplay change but it is a good one as it will give players more creative freedom. Along with this change, Kelley remade and cleaned up the various tile types. Before too long we’ll put up a screenshot of them in game. For now this small sample will have to do!

In other news, we have been refining the character customizations and ensuring that they are implemented 100%. This includes things like adding armor to the character and what not. We still have some work left but it is coming together.

Kelley has also been working on some animations. Here is the walking animation. These are the base graphics we use for the character. Everything in game can be swapped out for other images and/or recolored.

The character and clothing are about 20 small images put together using Spriter. We also have a running, walking, jumping, falling, and swinging animations. All of which you will be seeing in good time.

David has been putting together a mockup of the final UI. Nothing about it has been finalized yet but just the mockup gives the game a much more polished look. Once we get something a little more final then I will be sure to post it.

Things are starting to come together!

Building Menus

The majority of my Crea time was spent working on the character creation menu. Once I got that fully functional, I moved onto designing and developing the character selection. In the middle of that I realized that my hacked together menu system finally needed to be upgraded. After some designing, I have come up with a much more manageable menu system, which means cranking out the world select and creation should be a breeze. That is once I get to those. In the meantime I am back on the character selection menu screen, which I should be finishing up tomorrow.

I would like to show screenshots of the character creation but I have left the UI extremely messy for David to come through and clean it up.Once he gets a chance to do that then I’ll be sure to post some screenshots.

In other news, Kelley will be finishing up her school semester this week and will be able to put much more focus into Crea so expect to see lots of visual goodies over the next few weeks. I know I’m looking forward to it!

Back from Vacation

Over the last week and a half we have been on vacation. We went to the East Coast and had a great time with some friends. During the trip I did my best to sneak in Crea development whenever possible. I got two big things did get done during vacation with the help of a friend.

First of all, the blog is finally being hosted at siegegames.com. I have owned this domain for over a year now but never got my own hosting – even now it is a friend hosting it! All that remains is to finish setting the site up.

The other news is that the item toolbar is fully functional. It displays how many you have of each item and the currently selected items for your left/right click. You can change the selected items with the number keys. Moving items around is simple – just click on an item to grab it and then click another item or empty space to drop the grabbed item. The UI needs some work, such as the item’s icon position, but it is good enough for an initial version.

I’ll be returning to my posting schedule starting Monday. So more updates are on their way!

Development Update – Lighting and Saving

I am doing my best to avoid reinventing the wheel. This is quite obvious with my extensive use of third party libraries to help with nearly all aspects of the game engine – from rendering using SFML to randomly generating worlds using ANL. This backfired on me this past week.

At first I set out to work on the world lighting. After doing some research I stumbled upon Let There Be Light (LTBL), which helps with basic lighting and shadows. I began incorporating it into my game engine and quickly found that it had some fundamental bugs. I posted to the linked forum post above in hopes that the developer would fix these issues. I was pleasantly surprised at how quickly the developer fixed the issues. Not long after resuming I once again got caught up on something and had to wait for the developer’s response. The developer was great about replying and I’m really appreciative about it but I do doubt that this was the right path.

I know what I want for the game’s lighting. LBTL gets me about 70% of the way there with minimal effort but I have to tweak and bend the code to my design. This is going to take a great deal of time and in the end it may have been faster to just throw together my own lighting system. I may still do this using LTBL as an example.

There was progress made for lighting though. I setup a light and hull (shadow casting) components. This means that entities can have a light source attached to them and/or have a shadow casting convex hull attached to them. Here is an example with a hull attached to the player, which needs much work.

During my downtimes between the lighting, I would work on the world saving. I am using boost for much of my game engine and decided to use the boost serialization library to do all saving/loading. This library has some really cool features but these features come with a heavy cost in code complexity. Before too long I realized that I did not need these features and so I was back to square one. I decided to do my own and within no time I had the basics working.

I started doing some testing. First I tried a small world of 100×100 tiles was saved to a 73kb file; this worried me. I want to have huge 8000×2000 worlds at least. So I tried a world at this size… 120MB! Additionally it took about 4-5 seconds to save. This is good for a first run but it is unacceptable and needs some serious optimization.

First I’m going to do compression on the data before saving it to disk. Fortunately this data is very compressible given that it is extremely repetitive. I tested this by zipping the small world save file. It went from 73kb to 1kb. This is promising! This helps with disk size but it is going to hurt the time. My plans for fixing the time is to reduce saving data that hasn’t changed. Right now the entire world is saved every time but the reality is that only a small portion of the world is going to change in a minute. One of the cheapest ways to do this is the same way Minecraft does it – split the world up into separate files.

This week I’m going to work on finishing up the saving/loading, which is going to take a little longer than I initially thought. What doesn’t though? If things go well then I will get back to working on the lighting. Before too long I’ll be able to have some visual to show off!

Development Update – Take One

As promised, here is my first development update on Crea. We’ve made tremendous progress over the past month but to keep things short I’ll just cover what I worked on this last week. The majority of my time was spent working on water simulation. At first I was not sure what the best approach was, but after some research I discovered the joys of cellular automata. For research I found these articles to be quite useful: Gamasutra articleCompressing Space and Time and Cellular Automata for Physical Modelling.

Simulating fluids with cellular automata is reasonably cheap, which is needed with worlds as large as the ones in Crea. A bonus to implementing a cellular automata system is that it can be used to simulate other things – fire! I am rather pleased with what I have written thus far and would eventually like to write a more technical blog post about it, but that will have to wait. It is time to break up my wall of text posts with some actual content. So without further ado, here is the first look at the game and its water simulation.

In other news, while I was watching last week’s Indie Chatter, he mentioned a website that he uses for project management, Pivotal Tracker. I looked into this and it has some cool features such as automatically calculating what tasks you will be able to complete over the next iteration (typically a week). The thing that really stuck out to me is that projects can be public, which means that anyone can see what is currently being developed along with when releases are set and basically everything else.

Last week I said I want to try to be as transparent as possible, well here is the Crea Pivotal Tracker. It is a little bare at the moment because I just started it up on Friday, but I will be doing my best to keep it updated and filled with all of the stuff I am working on. Perhaps I will even be able to convince Aaron and Kelley to join in on it.

Quick Development Update

Since the release of the flash prototype, I have been working hard at getting a game engine up and running in C++. I wont go into much details about how this engine works, but I will say that it is seeing some great progress thanks to some open source projects such as SFML and box2d. Here is a small video preview of what the engine is capable of so far. In it you will see some boxes being created and interacting with each other. Yay! Physics!

Before too long I will have some gameplay to show off, but there is still a long ways to go for a playable game.

http://screenr.com/qY4s

Valiant Return

Over the past month I have given myself a semi-vacation from Crea. It was needed after working on Crea nonstop for about a year. I am ready to get back into the fight.

I did not completely halt development. I did make some vital progress and just now was able to step through an entire round in a match. I was at this before minus being able to use cards. Next few items on the list are all about making the game actually playable (i.e. giving the player feedback).

More posts should be coming before too long!