Friday, September 29, 2006

GP2X dev : Fonts

Created a smaller font. Was not really happy with how much text I could get onto the 320x240 screen size for gp2x size devices… This font is only a little bit smaller but it adds up to a few more characters per row/lines.

Cleaned up the lua startup code too making it smaller and more manageable…

I will probably have very little time this weekend to work on it but if I do I want to get the character generation out of the way and onto the main map.. tadaaa!

Posted by Stu on 09/29 at 07:49 AM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Monday, September 25, 2006

Fishguts I : Character Creation

So I have the main menu up and going, host separation started. The PC for now, uses WASD in place of GP2X’s AB/XY buttons. s=x, w=y, a=a, d=b.

Character generation is a one off process but I will need some reusable routines, so right now I’m trying to determine if its better to have a lua call just do all the CGen or if I should do the CGen in lua.

either way I need someway to present a list of options on a small screen. I wanted to avoid having to write ‘scrolling window’ widgets and other stuff.

Most of the CG has taken the easy way out, instead of having a list of skills and points to spend on them, you get a generic fighter/ranger/thief/etc which has a preset list of skills appointed to it.

The user can create three characters to form the adventuring party and can hire a fourth or so at points in the game. Like Pool of Radiance, if you hire someone there will be a cost per day deal, and if you cant afford them, they will leave.

Its hard to present textual information on a small screen when you can only get so may letters per line with a few lines per screen.

I’m still debating if I will make a smaller font for 320x200 devices. I think the font is fine for psp (since its widescreen). so the small font might be relegated to where I have the big font now, and replace the small font with a smaller font… (you follow? smile )

Also need to add a story() routine, you know those things that present pages of text that is a clickfest to get rid off since nobody reads them? wink yeah, one of those.

Need to make outdoor ‘fighting’ tilese too tonight. (which is just replicating some outdoor map tiles and adding a couple of new ones.

Posted by Stu on 09/25 at 09:48 AM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Saturday, September 23, 2006

GP2X dev : Fonts

I have a fixed with font printing nicely. I have two fonts, a 20x28 and a 15x20.

For small screen devices (gp32, gp2x, xgp kids, xgp mini) it loads the 15x20.

For larger screen devices (xgp, psp, pc) it loads the 20x28

I also have registration working very nicely too!

The thought on registration would be that Id ship the entire game in full 100% winnable state (nothing planned at this stage to be locked out), but if someone dropped $5 or more via paypal I’d send them a registration data patch that would do something like change the reagents title to yours.

Right now, there is a Raegent of the castle (your starting point) (who is me), and if you register your appreciation (!) you can change it from Reagent Stu to say Queen Camilla or King Joseph etc.. whatever you like to King/Queen INSERT NAME HERE…

Thats the thought at the moment..

I have no intention of doing shareware crap or locking it down or making any part of it crippled.

Posted by Stu on 09/23 at 02:59 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Tuesday, September 19, 2006

GP2X dev : Fishguts I

So I have my Main() running from lua, detect the host platform (pc,psp,gp2x) and loading the different title screen, intialising builtin variables and flags etc…

ran into my first big annoyance with Lua smile

"a" b() + "c"

does not work, but;

"a" .. b() .. "c"

works just fine! Lua co-erces things to string and number everywhere else but wont ‘add’ them together with a function in the middle.. you must ‘concat’ them (the double dots).

AARGH!

Posted by Stu on 09/19 at 08:21 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

GP2X dev : Fishguts I : booting the game

goals to this week…

- integrate the modified lua engine running packed scripts
- flesh out the embedded lua support functions for the engine
- have main menu up and going
- start new game
- load / save game
- refactor + dehack the code I added last night (from it works to it works properly state).

Load and Save will be a piece of cake, as game state is very simple. We have some bitflags and some gamevars, so saved games will be very tiny.

Start new game will be the hardest, since it has to go through the whole cycle of creating a party of 3 characters… That brings in… naming them… which would require a popup keyboard.. which I dont want..

I could go the Magic Candle I route which predefined your player names. I think to get them up and working they will be predefined (or from a list of random names).

The lua engine is already integrated I just need to have it load the Main() script and ‘boot’ the game (currently the equivalent is hard coded).

Posted by Stu on 09/19 at 02:33 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Monday, September 18, 2006

GP2X dev

aiiee! 20 minutes of hacking and the Title screen now loads. woot!

Posted by Stu on 09/18 at 09:53 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Sunday, September 17, 2006

GP2X dev : Fishguts I

Well its sunday night and my goal was to have some visual display up....

I ended up spending the afternoon making two deck gates to keep our 100 pound akita on the porch… Did some minor work on the game tonight.

Managed to migrate my build system from cygwin to mingw and have a full rant build system working generating all my data and my game exe and so forth. It initiates the screen and closes.

This week I’ll aim to get the front end up + overland map working.

Takes longer to build the data files than it does to compile the game executable.

Posted by Stu on 09/17 at 09:58 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

GP2X dev

got the zonemap outputting the overworld in 32x32 chunks. It takes 9 chunks in memory at once but the good thing is it only users 9k (1k per chunk).. You need 9 chunks for smooth scrolling. If there is a perceptable delay in loading chunks into memory (there shouldnt be) then I can sacrifice back to only the immediate chunk.

- Might have just the current chunk in memory and depending on which border you get close to, load the corresponding chunk… but then if you go to the corner, thats 3 chunks to load. Still much better than 9 at any given time.

Posted by Stu on 09/17 at 11:28 AM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Thursday, September 14, 2006

GP2X dev : Fishguts I : zonemapping

I’ve zonemapped the overland, with areas that can be sailable, walkable and neither and combined this into the map tile indexes. I just need to cut it into chunks rather than one big map chunk. (its not that big but if I want to go bigger.. I want it managable).

Based on how many tiles I can get on screen at once, I can figure our a nice value per ‘segment’ for width x height. Right now I’ll probably break it down into 16 chunks x 16 chunks, which will cut down on some memory usage (the entire map only runs to 64k).

This weekend I hope to have the overworld map up and working so I can get a sense of world size vs screen size (ie: how long to transition from one side of the map to the other).

Posted by Stu on 09/14 at 10:17 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Tuesday, September 12, 2006

GP2X dev : Fishguts I

GP2X GameDev Blog #1 : FishGuts I

Ive been itching to get a GP2X for a long time. Right now the hardware has stabalised at the MK2 design. So I’ve decided to write a game while i save up some spare cash for it.

I’m going to write a simple/basic CRPG along the lines of my fav Ultima III and Magic Candle. There will be elements of Questron II and other classic RPG’s as well.

Random Design Notes
Were dealing with a small screen, so any text needs to be readable. Based on this Ive dropped lowercase letters from my display font.

Must be navigable using the systems default buttons (two shoulders, 4 firing buttons and the directional pad).

We have a limited amount of memory to play with. No caching of huge lists and unrequired graphic data etc.

Other Stuff
Got lua 5.1.1 built to use int/long instead of double, which will help with speed since GP2X doesnt have an fpu, and lua’s default is double. Ditched the math library which I dont need.

Need to remove the other stuff, oslib etc. All I really need is the string library, table library and base.
Added special 5.1.1 arm patches for speedup

Cant decouple the built in compiler, its too integrated into lua to remove and just rely on precompiled bytecode.

Can now load compressed bytecode, decompress it into a buffer and attach it to a Lua State. Its a PITA, since Lua only has functions to read from disk or read an uncompiled string. grr.. Had to write a Lua memory Reader.

NPCs
There will be lots of NPC’s like Ultima III to talk to. This means I need to create an efficient conversation tree routine (done in lua). This will require NPC memory across the game but should only nesecitate several bitflags per npc which is fine.. Game state will so far be very minimal which is nice (as far as save / load go)..

Graphics
I’ve decided to use 24x24 tiles which gives me 312x240. I’ve decided that 312x240 as 24x24 tiles will be nicer on a 3.5” screen than tiny 16x16 tiles. 24x24 gives me 13x10.

Most base tiles are single 24x24 tiles, some like mountains and forest Ive done 48x48 (2x2) tile arrangements to break it out for bigger things.

Most tiles are backed by black, which might change, since I wanted to keep this game simple, I’m not doing fringe tiles in this engine (planed for the sequel)..

Need to work on the indoor tileset and monster tileset.

I’m debating right now if dungeon exploration will have a 3d feel or if it will remain topdown. I’m hopeing to go for basic 3d fixed 90 degree angles. Simple pre-cacled single texture would be fine, but would nescesitate new monster graphics different than the tilesets…

Overworld map has been created.

Story + Mechanics
No real story, just some vague ideas and quests right now. Some mechanics also thought out. Teleport stones that use a destination rune stone (key). Like a cross between Ultima III moongates and the Stargate. Touch the teleportal with the destinatin rune stone to go there.

There will be skills (not many) and gold will be scares in the game. I dont want gold to unbalace the skills later in the game. eg: hunting vs buying food obsoleting the hunting skill.

Advancement in the game will be different from standard crpg’s. Opportunity to increase hitpoints will be limited (but possible). Survival will depend on better gear and weaponry and magic.

Magic will revolve around Fire / Water / Iron / Earth. I might replace Iron with Spirit but will see how the spell lists balance out.

I’m undecided about religion in the game. It will be in the game, but ‘clerics’ and worship and things.. I need to think about it more and its impact on balance and gameplay. It would kinda obsolete spirit, which means I can leave in Iron....

Saving will be automatic when you enter/exit a town, change map segment, dungeon level etc.  There will be no explicit saving.

I’m going to need a popup keyboard to enter players names.. I was hoping to do without that kind of thing.

Combat / Party
I want a party of 3 or 4 characters. Combat will be tactical turn based like Magic Candle I, Ultima III, Gold Box games.

I like the idea of hiring another character to the party.

There are lots of other areas I need to work on before I lay much code down..

Posted by Stu on 09/12 at 07:40 PM Permalink to this post.
Filed Under : ComputersDevelopmentFishguts
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Sunday, September 10, 2006

Lua :: Executing a file already in memory

Been messing about with embedding lua into one of my games.

The first big hurdle turned out that Lua had no functions for loading a file into its ‘state’ that was already in memory. It has functions to compile a string into memory, and one to load a file from disk but nothing that would take an existing memory chunk and put it into state…

After much faffing about, I found you need to replicate a Lua_Reader and call lua_load.

I based the code off LoadF/GetF and luaL_loadfile

typedef struct LoadM
{
    unsigned char 
*ibuff;
    
long idx;
    
long maxlen;

    
char buff[LUAL_BUFFERSIZE];
} LoadM;


static const 
char *getM (lua_State *Lvoid *udsize_t *size)
{
    size_t lsize
;
    
size_t msize;

    
LoadM *mf = (LoadM *)ud;

    if(
mf->idx >= mf->maxlen)
        return 
NULL;

    
lsize mf->maxlen mf->idx;

    if(
lsize LUAL_BUFFERSIZE)
        
lsize LUAL_BUFFERSIZE;

    
memmove(mf->buffmf->ibuff mf->idxlsize);
    
mf->idx += lsize;

    *
size lsize;

    return (*
size 0) ? mf->buff NULL;
}

LUALIB_API int luaL_loadmem
(lua_State *Lchar *filenameunsigned char *bufflong idxlong maxlen)
{
    LoadM mf
;
    
int status;
    
int fnameindex;

    
fnameindex lua_gettop(L) + 1;  /* index of filename on the stack */

    
lua_pushfstring(L"@%s"filename);

    
mf.ibuff buff;
    
mf.idx idx;
    
mf.maxlen maxlen;

    
status lua_load(LgetM, &mflua_tostring(L, -1));

    
lua_remove(Lfnameindex);

    return 
status;
}

Posted by Stu on 09/10 at 05:08 PM Permalink to this post.
Filed Under : Development
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Page 1 of 1 pages