Programming and other useless stuff

Sunday, September 07, 2008

Components enhancement

While thinking about the modifiers, I stumbled upon a problem that might not spring into mind when figuring out a game system. I wondered, how I would handle components that should be removed or deactivated? What should happen, when the game is paused?

Imagine a character has attached a buff which gives him ie. +5 Health every 10 seconds. When you pause the game, you might still want to update any graphic animations (ie. idle animation) but you certainly don't want any buff continue it's work. So you might have to put the buff into "pause mode", you'll have to deactivate the buff.

I played around with the components and modifiers (which are components, too) in my mind and finally decided that it was a good idea to have a ComponentContainer. This container would hold any type of component, and could hold a set of flags which ie. activate a component, tell the container, that the component should be removed (ie. during next update) or that the component should not get an update.

I then decided to derive my Component class from the ComponentContainer. The benifit of this is that I automagically have the possibility to attach ie. a modifier to a modifier (remember the timer example from yesterdays blog entry?).

Currently I have 3 flags: IS_ACTIVE, DO_UPDATE and DO_REMOVE.

DO_REMOVE flags a component to be removed during ie. the next update of the parent component (well... in fact, the one that holds the component container should decide when unused components should be removed. A character class ie. would remove them in every game turn, while a component would remove them in the next update.).

IS_ACTIVE and DO_UPDATE mostly come in pair. Only active components can receive updates. You can see that removing the DO_UPDATE flag from component would make them "pause" until you set the flag active again. Disable IS_ACTIVE is useful when ie. the player wants to push things around from the inventory to the character and vice versa. A grapped item (attached to the mouse) would be set inactive (while remaining on the character in a greyed out manner) and thus have no more effect on ie. the characters values (if there was a value modifier attached to the item).

That's my current state of the components. I'm thinking of how to handle those flag changes with small effort and the more I think of this, the more I'm convinced that my SSCXML has found a new place to be :)

Have fun,
Stefan

PS: It's quite possible that I'll have no blog updates in the next two days since I have to travel to some clients on monday and tuesday.

Labels: , , , ,

Friday, September 05, 2008

Migrating domains and SSCXML

Well... I'm currently in the middle of migrating all my domains from a shared hoster to a VSP. In fact, my hoster restricted a lot of things which were fine before. IE. the memory usage of processes is very low. So low, that even tools like image galleries that have been installed through fantastico will not be able to add a simple image.

That and some other considerations led me to search for a VPS. I came across a lot of sites and finally I found a VPS plan that was ok for me: not too expensive while still having enough features for my current needs. I took the lowest plan offered by Geekstorage. I talked with one of my friends who's already set up some VPS and has a lot of experience with Linux. So I spent most of my time today learning about VPS and Linux, httpd setup and all those things.

I must say that I'm happy with the choice I made although I pay like 10 times what I paid before. The support guys of geekstorage replied quickly (max. 2h although I posted my tickets in the middle of the day... in Europe). Not that I had any problem... just questions about setups and how to do things. I'll tell you more once I have more experience with these guys :)

I worked on a new release of SSCXML yesterday. Added some keywords to replace the & and > and < signs. Using those straightforward in condition strings within XML is no valid XML. You'ld have to write "& a m p ;" for an & (Sorry... had to put spaces between letters). So I added keywords which can be used by the users to replace things like &&, <= or >= (keywords are "and", "le" and "ge"). A "(a<5)&&(b>10)" would become "(a lt 5) and (b gt 10)". As readable and easy to retain as C/C++ code :)

So, SSCXML is V1.04 now...

Have fun,
Stefan

Labels: , , , ,

Tuesday, August 05, 2008

Restart

Hi,

although I have this account since 2006, I did not really post any entries. Hopefully this will change since I would like to share some of my experiences I make during the development of my spare time applications and games.

To give you some backstory: I've been in games business since 12 years now. Throughout this time span I was a simple programmer, translator (german->french), senior developer, lead developer, project manager, head of technology and freelance developer. I had the fortune to work with some of the best German game developers and some of the most talented German graphic and sound artists you might encounter. It was (mostly) a pleasure working with them although I managed to upset one person to a point he won't even talk with me anymore (at least one of whom I know).

The game genres I worked on were wide spread: from turn based strategy games through sports games up to casual games. The only thing I never programmed was an FPS.

In the recent years I sometimes turned away from game development to jump into the area which is called "serious applications" by the game developers. In fact, I made some quite interesting experiences there. I had the chance to contribute to the research and development of embedded hardware, wrote (mostly as a sole developer) the voice recognition, client-server based picking solution for one of the biggest spare part warehouses of Europe and contributed and still contribute to the development of a business application for a German music label and the planning and maintenance of an industrial CAD software.

Some month ago I published my own lib called SSCXML which is the first publicly available implementation of the SCXML draft (state chart XML) by the W3C.

In my spare time I started working on a small game called "Prohibition". It'll be a turn-based strategy game where the player must lead a police squad in it's fight against organized crime in the early 20th century. Since I'm working all alone on this project, progress is slow. I also tend to research and experience some programming ideas I have with this project. The game itself will be fully multiplayer targeted. Currently I'm working on the very base of the game: network layer, client-server structure, object management, ...

I think I'll post some of the things I do in this project in this blog :)

Have fun,
Stefan

Labels: , ,