Purchases

Posted in general with tags , on June 18, 2009 by Tau

Today I bought a Wacom tablet. It’s my first venture into the world of tablets but I’ve been thinking of buying one for a long time – using a mouse to draw things is a pathetic way of doing things. I’ve only bought low-spec model, to get used to things and see if it’s something I want to take on seriously. However, upon installation I’ve encountered a problem.

I use GIMP for my graphics and run OSX 10.4 on my Mac. As GIMP uses X11, it needs to get the tablet information through X11, and the latest version of X11 available for OSX 10.4 does not support the full features of tablets. In fact, it treats them as a regular mouse. It would seem that one requires Leopard to get the full features from X11 and hence GIMP. I cannot therefore use my new tablet with GIMP, and as that is all I have, not at all, really. It looks like I’ll have to purchase something, as long as its cheaper than upgrading to Leopard (which I had not intention of upgrading to, being perfectly happy with Tiger).

I’ll try and see if I can find some way around it, but I don’t know.

Compromises

Posted in story with tags , , , on May 25, 2009 by Tau

I’ve decided to (possibly temporarily, possibly permanently) move away from an isometric view to a top down view. This is because of the dramatic increase in data filed entries, and the time to write them, that it would take for the isometric images. For a rectangular image, it’s a simple affair to decide whether a point (eg. the player) lies within a region which may be solid. If this region becomes a triangle of arbitrary shape and size, as it would be in an isometric case, the points of all of the triangles which make up the region must be stored, and deciding if a point lies with them becomes much more complicated.

This isn’t an unsurmountable problem, just one I feel is not worth tackling at the moment, especially when more efficient advances can be made. With the current code, and assuming a grid like layout of the maps, everything is ready for designing multiple linked maps. Along with the message and conversation classes, a simple, static demo could be written.

So that’s my plan, maybe finishing off the automation classes, and also writing something to make non-player characters move around the map. Then I can have something to show for my work.

Automating Game Events

Posted in code with tags , , , , on May 19, 2009 by Tau

One of the major things that’s been bothering me about the code as I look it over is the amount of hardcoded strings, and the requirement for data files to have a certain format. Previously, the events listed in the maps had to have two arguments because when the list of events was created in memory, both arg1 and arg2 had to be set (there would be an error that the input array was out of range without them) which lead to lots of NULLs in the map files.

I’ve altered this. Now the arguments for game events are filled into an array, rather than private variables, so that any number of arguments may be given. This is also advantageous as future event classes may need more than two arguments.

This being an RPG, there’s going to be a need to automate events; those wonderful parts of the game where the story runs off and the player has to do nothing but press ‘continue’ when they’ve finished reading. So I’ve started a class to manage this. All it does is execute an event, and then wait a given time before executing the next one. This is done with the pygame.time.delay() function. Something like:

for i in range(len(events)):
execute(event[i])
pygame.time.delay(times[i])

Although, it’s not finished yet. All the current events have player cancelling built in (like a conversation won’t end until you press ‘q’) which I’ll keep for the time being. Some people read slower than others..

I expect some form of this will be used for the non-player movement on screen eg. village people wandering around. That may be the next area of work for me, although I have started to think about the battle handling. Clearly though, an intensive graphics session is needed.

Isometric Solid Objects – Part 2

Posted in graphics with tags , , , , , on May 5, 2009 by Tau

Returning to the task of making the objects in the map semi-solid. The problem is that I want to draw the sprites as a whole, but define only certain regions as solid. This means I either have to make lots of sub-sprites and combine them, or define a list of regions that are and aren’t solid within each sprite/map object.

More text files to read in, or at least, longer ones.

Each Map Object now references another file which is the image file, this contains a link to the sprite and a list of co-ordinates which are the solid regions within the local co-ordinate system of the map object. These are then scaled to the global (screen) co-ordinates.

So far, all this is read in and the objects created, although they currently aren’t called in anyway. I haven’t gotten my head around how one decides if a given point (i.e the character) lies within a triangular region of undefined shape. Yes, it really shouldn’t be that difficult, I just haven’t got the envelope out to do it yet.

Story Ideas

Posted in Characters, story with tags , , , , on February 21, 2009 by Tau

I’ve been keeping my thoughts on story and characters at the back of my mind for some time, reluctant to write anything down through fear of trivialising the ideas, and because coding is a risk free alternative, which is to say, I can see then and there whether or not my code works; creative attempts can be judged much more subjectively, and can lead to disappointment.

I’ve been thinking about the protagonist, who will, of course, undergo some journey without a defined end, and be forced through trials along the way. Such is the RPG I intended¬† to make. Why does he/she do all this? It can be Fate, which is an easy way out, or coincidence, that they have some relationship with the events unfolding.

I like the idea that our protagonist is as much like a regular person as can be within the context of the game. They simply get swept along, and are incapable, whether physical or through conscience, to back out.

It is my intention to set the game against the backdrop of a political war between two human nations, a religious war between factions of the main character’s race, and further smaller conflicts. The other playable characters won’t be constant – they will come and go as they follow their own stories, which may themselves be occasionally playable.

Yet, I don’t want to think out loud too much here..

Returning to Work

Posted in graphics with tags , , , , on February 15, 2009 by Tau

Well,¬† I’ve said a few times over the past couple months that I would be working on this again after a hiatus, and I hope that this time it’s for real. I think the best place to start is to sum up what I’ve done so far (for my own benefit as much as anything else) and post some screenshots of all the features I’ve coded.

Below is how the program starts up after typing python nsf.py into the command line. Yeah, I know, extremely bland. I’m sure I’d feel better about myself if I added some grass or something.

Opening Screen as of 15/02/09

Opening Screen as of 15/02/09

And how the dialogue prints out. I think the 1st thing to do is make that ugly blue box, well, not. Something with a border I think.

Sample of dialogue printing as of 15/02/09

Sample of dialogue printing as of 15/02/09

The basic message printing. Actually looks better than the dialogue, but still needs a proper border. I’ll use the same one for both I think.

Message Printing as of 15/02/09

Message Printing as of 15/02/09

That’s about it that you can see. I should work on some sprites, for morale as much as anything.. hope I can find the time.

Screen Messages

Posted in code with tags , , , , , on December 21, 2008 by Tau

I’ve just finished the classes for printing messages onto the screen. It’s basically the same as the dialogue classes, but requiring fewer variables: the text is read in from a file given as the argument of the event type “message” and blitted to screen.

Coming back to the code after quite a while has made me realise how much I shouldve commented the first time around. I’m going to go through all the files and properly document them, drawing up a diagram of where all the classes and functions lead.

Follow

Get every new post delivered to your Inbox.