.(JavaScript must be enabled to view this email address)
Stu's Rusty Bucket
About
Stu is just another crazy Australian who happens to live in the Blue Ridge mountains of the USA where he can hike, bike and kayak with his wife and kids.
This blog is mostly a software development blog of his little homebrew projects.
I’ve mostly fleshed out my spell list, so I can finish up the last chunk of code in the combat engine.
Magic will imply either a +/- affect to life points / mana, or it will apply a +/- to some particular stat that last will N rounds or to the end of combat.
Complicating things is that I will have about 50 odd spells spread across 4 types (spirit, elemental, nature, body), and about 5 of those are designated combat/map, meaning you can cast them outside of combat. That leaves me with a bit of a dilemma, do I really want the trouble/complexity of doing spells outside of combat when you only have the ability to cast 5 or so spells? These spells come in the form of healing spells, cure poison or things to reduce the wear and tear on your weapons and armour.
I want to be able to cast cure poison whenever I like, not just in combat… The old gold box games got around this by having an encamp menu, and I really don’t want one of those.
Been doing a little work on the game today, and instead of flying through my testing and ignoring character creation I fully immersed myself in the process. Immediatly I hit a ‘what does that mean’ on my stats, and the longer I pondered what purpose a particular stat meant, the greater reason it was to remove it.
So we are one stat down again (Energy), but its ok, since it was a derived stat that was not really used anywhere.
I’m pretty sure this will be the last time I pare down the stats, everything left has a very logical use and is used quite liberally throughout the game.
I’ve also gone and redone a bunch of graphics for the release name (no, I’m not near release yet…), since Fishguts was just the codename (each device, gp32,gp2x,pc,psp etc had its own graphic/code name), and I’ve pretty much updated all the titles and keys for removal of the development name through the source tree where needed.
Rebalancing the amount points you get to start has also been on my agenda, as the points you dont spend on your stat buy, carry over to your skill buy, and there is a cap on how uch you can spend on one skill to start with but if you have extra points, it tends to overflow into other skills just to use them up…
What I want to avoid is people creating a do-everything-good-at-nothing kind of character.. the best strategy is to buy into a certain kind of build (fighter, thief, type etc) than an even spread… but its up to the player essentially so…. mm.
After much faffing about, I realised I was doing a lot of fgetc calls when decompressing, hmmmm… so I read the entire compressed chunk into a buffer and decompressed it from there… insta speed up and my problems mostly gone, the ingame data caching system also helps too…
still, this didnt happen in the olden days of my psp development.
I thought I’d bust out a test version for the PSP, as it had been a while since the last hardware test… and the last test was fine..
Well, something has changed and I cant figure out what. My logs show no errors but the game runs like a dog, specifically the IO feels like its doing something ... well.. else..
To read a 10 byte file, the memstick light goes mental and the it takes a good 20 seconds, as if its doing a single byte read then pausing for a bit then doing another byte read.
I may git bisect my way back in time somewhat to see if its something I did or if its something in the psp sdk.
No problems show up in my logs and the pc version plays fine. I should probably test the GP2X version tonight and see if its afflicted with the same bug.
One nice thing is that the PSP, GP2X and PC are all little endian. All my resources load and decode just fine so its something in the IO subsystem.
I’ve just realised I have been doing all I can to avoid having some form of variation on the Gold Box ‘Camp’ menu, tho I wonder how long I can avoid it for. Camping was a good way to heal up when you needed to (if you were able to rest that is).
This post is a collection of random thoughts going on in my head right now;
I’ve been thinking about trade skills and other non-combat facets of my game. Trade skills would be really cool. In Ultima you could make bread if you wanted, and they took that further in Ultima Online. Magic Candle let you work in the gem shop etc to make money.
Then I thought, what good is it really, when your part of an overarching storyline where you travel between continents and overcome so much, your part of this huge epic… What part does ‘tailor’ or ‘baker’ really play? Aside from being some kind of money making thing, what impact will having Artisan Pastry Maker level 10 be as opposed to Swordfighting level 10?
RPGS are for better or worse, tilted toward combat. Some more, some less.
I won’t deny combat will be major, its going to be half or more of my game code. Its a tactical combat engine.
I had a brief fleeting thought, that it would really cool to be able to go through the game without fighting and using the diplomacy skills.
The bar on player power only gets raised so much. The player will never attain godlike stuff, raising skills just equates to hitting more often and missing less, but dragons are still dragons and a player with maxed stats should still have a problem fighting them. I don’t want to get into the AD&D situation of power escalation where suddenly players go from average level 7 to being level 15 (We saw what happened in the progression from Pool of Radiance to Azure Bonds to the lamentable Secret of Silver Blades where the beginning game has you fighting red dragons and baby dragonlings!).
One thing I don’t think I have written much, if any of, is about the magic system. More specifically the way it works for the PC.
I had mulled over the idea of doing it like AD&D style, you can learn N 1st level spells and M 2nd level spells etc… But that is too blah, and constrictive and just.. awefull and it forces that whole ‘fix’ situation for healing.
Instead I’ve refined the way in which I tend to implement it in my roguelikes. Every character has mana points, similar to hit points but for magic, and will be combined with a skill for a type of magic (you can have one or more of the primary magic skills), and it will be transferable at half penalty (using a spell for a magic skill you dont have incurs 1/3rd extra mana cost and all results are halved).
The only way to cast spells will be from wands (any of the primary magic skills required), invoked from figurines, read from a scroll or from an imbued item.
The primary way will be from imbuing an item, say a staff. A generic sorcerers staff may hold 5 different kinds of spells, so you will pop in to your local wizards guild or whatnot and hand over the scrolls you want to embed into the staff.
Mana is recouped from wearing the goold old wizards hat. More specifically items are tagged with a mana regen attribute so the wizards hat, robes, rings, etc, will allow you to stack the regeneration buffs. This also means if you have a good mana regen ring or good combination, you can still wear plate armour and carry a shield and wield that wand. Figurines will primarily be used for summoned monsters for combat only (I dont want to have to mess around with dealing with a non humanoid pc in the party, by that i mean say a panther who cant carry gear, speak, read etc, makes code much more complex to deal with it). There will also be vials and potions and such to give us a nice big item list (taking queues from the Bards Tale and Demon’s Winter here). “You see a clay figurine shaped like a wolf with the word ‘INWO’ on it”.
I’ve also been playing with my spell list, and I am trying to come up with some diverse spells like;
mirror shield - defensive spell you can cast on any part member, and an enemy target. When player is hit, the target takes 1/2 damage of the attack (kind of like a selective version of the classical wizard shield spell).
stone wall - Summon a temporary wall up for defense (I think I got this idea from seeing it in action diablo with bone wall/bone prison).
I did a quick demo for the combat engine using gtk-recorddesktop. YouTube did a good job and compressing it to illegibility… ohwell.. You can barely see the arrows flying across the screen :(
The combat is fixed, mostly everyone hits and everyone does the same amount of damage for some quick testing
Did some cleanup last night messing with the combat code. For some reason (read serious brain fart), I had at one point created a whole bunch of short-range weaponry, things like glaives and polearms that are long, I marked these for attack distance of two squares, The problem was it looked funny to attack someone when you had a square of grass between you, and I couldnt contain the attack drawing properly. Icons have two states, ready and post attack. It just didnt quite work right or look right, it really needed some kind of intermediate animation of a weapon crossing the gap between player and enemy,
So the upshot was all shortrange weaponry is now converted to melee range weaponry and the skill itself is also gone.
One last equation is left on basic ranged combat and that is projectile counts. A sling uses stones, which you can buy in a quantity. Bows vis arrows. But I also have ranged weapons like chakram, boomerangs etc, oddball stuff so its not just bows that are ranged.
So, how many boomerangs are enough? A bomerang returns if it doesn’t hit, but does it return if it does hit? hmmmmm… Just for sheer act of fairness I think those kinds of weapons will always ‘return’ hit or no hit.
I need to remove things like ropedart since a ropedart is held at one end by the player, thus would need some separate funky animation to keep a line attached to the player, which is a no go.
I think I need to go over all my item data and stats again.
So ranged combat is now a go! Arrows fly across the screen with a twaaang (ok there is no sound effects yet). The problem now is, I have 8 icons for the arrows, but I need to do a proper calculation on which one to use. Right now I have a threshold, if it is 5 spaces from either the N/S or E/W line its uses a NW/NE/SE/SW facing icon, otherwise it uses one of the 4 cardinals. The problem lies in the fact that you dont want to use an intermediate directional icon when its too close to the cardinal, but that line is… fuzzy.. Unless it looks like the arrow is travelling on a 45° or close either side of it, you want to use a cardinal icon.
Once the arrows point the right way, its time to move on to… FIREBAAAAAAALL!
or maybe
“I cast magic missile!”
or stinking cloud…
Maybe stinking cloud as that has environmental effects that linger on the map for a set time period.
I guess I didnt expand on the difficulty values...
What happens is, when a script has its OnLoad event triggered it puts into memory where locked doors are.
The problem lies in two separate lua states needing the data, the easy solution is a simple data structure in C that both can talk to without needing to shoehorn data in and out of separate states
The below code takes a set of co-ordinates and optionally a difficulty value. It tests if the part has recorded unlocking a door at said co-ords, and if not, puts a locked door tile there, otherwise the tile that is passed in is stored. This way when the pick lock function or open door function is called from the master script (global functions like use of skills are separate from the map), they can interact without passing data between in a messy way.
(note RSS readers wont nesecarily show the correct colours below<)
The SetDifficulty routine will apply to any tile, since you cant stack locked chests on top of locked doors etc this is not a problem to share the data structure.
It would be much simpler if the global script could call into the map script and for things like strings or integers that is easy, but when it comes to passing anything else between two lua states it becomes a nightmare or nearly impossible with more complex data types that live in different universes (separate Lua states).
I did some work on adding unopposed skill checks yesterday. This properly works the stat+skill+roll vs difficulty value into play. Now you can pick the lock on a door without having the required quest key if your stat + skill level is high enough (in this case your DEX and your LOCK PICKING are good enough.
To pick a lock you need to hit a difficulty value (DV) of Competent which is 18. A good dice roll wil hit you this even if you have a zero DEX and zero LOCK PICKING skill… This is where I debate using a flat d20 roll or using a bell curve 3d6 roll… A flat d20 roll increases the odds of hitting that 18 with no skill in Lock Picking, but a bell curve 3d6 greatly lessens those odds but… I just don’t like the bell curve statistics making everything average.
In the midst of this I saw one stat error that needs to be fixed, I’m internally debating of merging reflexes/dexterity… its an age old fuzion wart…
The player can now flee the map. It is not arbitrary like in the gold box games, if you reach the flee zone, you escape. Fast monsters wont stop you from flee’ing combat (I never liked that idea).
Also worked on my ranged combat, now long ranged weapon users will move closer to target to make use of their weapons.. Now I just have to animate the dang arrow flying across the screen…
Its been a busy few weeks. I’ve procrastinated on Fishguts.
Im working on a 7 Day Rogue Like entry that must be completed by midnight this Friday so that is what I am concentrating on.
Prior to that I was working on a new secret project (oooh) that’s nothing fantastic, its called Another Linux File Commander. Its a two pane Norton Commander clone.
I had previously been trying to modify the source to DeCo, because it would refuse to use any screen space but an 80x25… Well there are so many constants and magic numbers it was a nightmare, I fixed some and broke others. Its kind of VI like, its fully scriptable (lua) with right now, a basic api but it works. Its nearing its first release.
But before that I need to get back on the Fishguts horse (or is that fish?).
My 7DRL entry forced me to cut down on a lot of things, and one of the first things to be super cut down was my stats… Oh yeah you know where this is going…
Right now I have 9 base statistics and 5 derived statistics.
I believe Intelligence and Willpower can be combined into one stat. They are as different as they are the same, in the end I opted to simplify.
Technique can be thrown out and so too can the Body stat.
That cuts me down to 6 core stats, and each one has specific uses and more than one use. No more ambiguities. All derived stat formulas have been changed as well as all supporting code. phew.
Fixed a few bugs in the astar pathing that was sending players off into negative coordinate land. Now to work on the ranged combat….
LOS is now recalculated for the entire map from the current characters position, this will allow me to use the FOV map for targetting.
This week’s todo that I hope to achieve…..
[ ] * Free shots by everyone when a player moves away from you
[ ] * Free shots if you walk past someone
[ ] * Fleeing the map
[ ] * Aim (monster auto target selection)
[ ] * Manual Aim (any square)
[X] * LOS
LOS is done.. Fleeing the map will probably be next.
The free shots deal is going to be a pain to implement, mostly because it will require changes to the astar pathing code, to make a route past players more expensive than a route that avoids players… but at the same time makes maximum use of your movement points… THAT is going to be a huge problem or not, and have everyone run the gauntlet.
To Do List as of last night (got a sick baby boy so did not do a lot of work on it).
[ ] * Sweep attacks at higher levels
[ ] * Double hits
[ ] * Free shots by everyone when a player moves away from you
[ ] * Free shots if you walk past someone
[ ] * Backstab
[ ] * Fleeing the map
[ ] * Aim (monster auto target selection)
[ ] * Manual Aim (any square)
[X] * LOS
Yep completed LOS and found an interesting corner case where the screen shows an even amount of lines, say 10, the lines 1-5 above the player, player on line 6, and 7-10 below…
That 5 clear above, 4 clear below yields an oddity, since we are doing rectangular LOS… Here is an example of casting to the top row and bottom row.
******* ***** *** @ *** X*****X
Where the two X’s are squares that not visible when they should be because to hit those we have to cast to the line below the screen. To hit those X’s on this graph would be to compress the LOS which could give you artifacts and other oddities.
Anyway, this corner case is a bit moot as I will be doing LOS for the entire combat map, as the player can target/cast spells outside of the immediate area, and so I need to have all the LOS information, not just what is drawn to the screen…