Wednesday, September 21, 2011

Done

Whee,

Im done with the saving/loading.. for now, until I add something else but even in that case its trivial to update the saving/loading functions. I made a little shortcut on Effects class tho. Effects are such a huge and complex system that for now I only save template name of the effect into file and load it back by calling effect creation function with that template name. It's not as good as it should be maybe but for now it will do.

Next thing I need to add is to give control of saving and loading to GameDirector. Currently saving and loading is done "manually" without any kind of control. This works at the moment since there is only Astacia terrain which needs to be saved and loaded ( along with its objects/npcs and such ) but when I add more places I need to be able to save all of the places not just the one the player is in. Only thing keeping eye on that is the GameDirector so I think its logical that I make the GameDirector CEO of the saving&loading CO.

On a side note.. When you save Player class I made a debug messages which shows how deep it actually goes in class hierarchy. If the deepness is calculated from going down on hieracrhy and taking account when class holds object which needs to be saved too then the deepness of player class atm goes down to 20

Player -> Living -> Inventory -> Item -> Effect -> etc etc

Persisting objects ( cont. )

Hey,

Im still working on persisting objects, aka saving/loading the game data. And I gotta say, its getting pretty fucking complex.. :p

I have had loads of school/work/family stuff also so coding has been on low priority. I am hoping to change that soon tho. Once I finish the save/load and add one more place into game I'll be releasing it for public testing..

Sunday, September 18, 2011

Persisting objects

Hey..

It's time to take better look at my object serialization. When I designed the structure for the game I made serialization interface for every object I wanted to load and save. The interface is mearly few virtual functions which have to be implemented in every class which inherits this interface. I wish making persisting objects would be as easy as just: file.write( reinterpret_cast<char *>(&x), sizeof (x) ); where x is something we wanna save. But it's not. You could do that for chars, ints and such but when there's pointers involve and objects within objects, reconstructing the object from file would be impossible.

Therefore I had to do this interface for serialization. In my code I have  serialize and deserialize. In serialize I save every variable separatly into file and in deserialize I load the variables one by one in same order I saved them. That doesn't sound too bad, and it's not, but one must be really really careful not to make mistakes since when objects serialize themselves within other objects, finding mistakes can be really really hard. Even more difficult in my case since I use gzip to compress the data.

well I gotta get to work.. its gonna be a pain but it has to be done to get saving/loading working again...

Saturday, September 17, 2011

Menu and options

Hey,

Was trying to get stuff done to ARRP but I just haven't had time ( work and family ) anyway I got my menu screen and options panel done. Options panel works completely but menu still lacks functionality of restoring saved game.

Here are few screenshots( there is descriptions about them on media pages )



Thursday, September 15, 2011

Effects

Hey

I have actually managed to do quite a lot of work today on RoA. The feature I have been working on is Effect. In my mind that is one of the crossroads or nots which ties lines together and reveals if things work as they should in the game. The Effect class is vital part of game in gameplay point of view. With it I am able to add extensive amount of different kind of armors, weapons, skills, spells, items and so on. And that is why it actually shows when implemented and tested if different parts of engine ( game ) works as intended.

Actually everything what differs stats or affects character/npcs somehow is done using effect class.. for example weapons and armors, which increases attributes, holds effects which boosts those attributes. Upon player creation player is affected with hunger and thirsty effects which are set as DOT types ( damage over time ). Undead monster have paralyze skill which uses effect  class to delivery paralyzing condition to player and player has icebolt spell which slows monsters heartbeat and walkspeed down.

Currently there are three types of effects. Single shot type which is used for potions and scrolls. It affects the player once and thats it. Then there is sustained, boost/drain, type which is used to add magical powers to weapons, armors, items and magical auras. It is affecting the player as long as that item or whatever is used, for example effect is on when player wield a sword and the effect wears off when sword is unwielded. The last type is dot, damage over time, type. It doesn't mean it has to do damage but it's something that was burned into my brain by WoW :/. Basically dot in RoA means that anything what is intended to take longer than one turn is considered as dot. For example a poison and paralyze can be dots; poison damages player every turn; paralyze lasts for 5 turns. Or  for example player calls for blessing from the spider queen and gets a boost to stats for 1000 turns.

Ah yes the spider queen.. thats more of content tho but I have to say a word or two about that lady.. I have made some designs about classes of RoA and one which I am certain of adding is followers of spider queen. These fellows don't really know anything cool stuff about magic nor any special martial arts. But what they do know is how to please ( read: do stuff of pain and agony ) spider queen and get a hold of her minions, spider demons, as a reward. Followers of spider queen has means to conjure these demons to our plane of existence and to control them. When player controls a spider demon it intrudes into players mind and alters the players body and mind towards demons own mind and body, giving player new form and new and enhanced abilities along the way. Every demon is different and power of the demon depends on how big of sacrifices you have made and how pleased the spider queen is.

A bit of topic but now that I had time....

Wednesday, September 14, 2011

Messages and language

Hey

Finally here are few screenshots I promised. It's nothing too fancy but I think its clear enough for player to use it and it gets the job done

Messagelog extended to full size, it can be scrolled
up and down currently. In this shot player knows
drow language 100%

Same as previous but player knows the language 75%

This is how the player sees the log by default

Tuesday, September 13, 2011

Message log

When I tried to do those language screenshots I noticed a bug in the message log. I got it fixed and I even improved it a bit, it can be now minimized and maximized and on maximized mode it can be scrolled so that player can go back to earlier messages. I also made some visual improvements. Ill put a screenshots on media page when I get home from work :)

On a side note, I also noticed a weird bug on my monster talking. The talk generator and "word-confusor" works perfectly but for some reason the output is a little off.. The way it works is that I send a string of what monster is saying to function which converts it depending how well player understands that languag. After the conversion it returns the converted string. Now in the function I make new char talk2[ str.size() ] which means that talk2 should be as big as str itself.. then i just copy the str content into talk2 ( and convert it if thats nessecery ). However when i print the talk2 which comes from the function it sometimes ( not everytime ) has some odd numbers and stuff after the actual string..

for examaple, str = "what is this stuff" and after conversion when i call PRINT( str ) it contains "what is this stuff\234%#\d" or something like that. I checked that sizes do match and the generator don't add those extra marks there.. im kinda puzzled..


Right, I fixed it.. There seems to be some sort of overflow in std::string class, it got fixed when I changed std::string into QString..