Aller au contenu

Photo

Module Work-in-Progress: Reversal of Fortunes


  • Veuillez vous connecter pour répondre
79 réponses à ce sujet

#1
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Moving selected things from the old Bio boards over to here. For those who want to see the original posts, you can find them here (for now): Click Here

===============================================================================

In the spirit of others that have been posting to this section of the forums I'm finally going to do this write up of my module that I'm working on. It's working title is "Reversal of Fortunes." This has a lot of the features that came from SoZ, so if you hated that game, you may not like this module either. To each their own. Also, since I currently sort of stink at creating areas, many community prefabs have been used so far.

RoF is a single-player module that is part action, part story, part hack & slash, and part strategy. Here's a quick paragraph about it:

" (Unnamed Kingdom) is a land nestled down the grand valley running between two large mountain ranges. Recently the local goblinoids, long a minor nuisance, have begun attacking outlaying towns in earnest. A bounty was put on the head of all goblinoids. It’s the type of thing that could make a young adventurer wealthy and many have rushed to make good and fill their pockets. The only problem is, you’re the goblin…"

This module is done from the opposite point of view - in it you play the role of the goblinoids and seek to take control of the human country (hence "Reversal of Fortunes"). It incorporates the use of an SoZ style Overland map for adventuring around in and a OC style Worldmap that I have altered to use as a "War Map."

At the start of the campaign, you will be allowed to create a single player character. This PC must be of the Goblin race (it will be the only one available). You will have the opportunity to select a "sub-race" as well. While the sub-race is not a true sub-race (they are all goblins), it serves to give a little distinction between the various base life-types of goblins (a strong one, a dexterous one, etc.). Alignment choices have been restricted to not allow any "Good" alignment type, and, due to this, no class that requires a "good" alignment will be available as a choice. In a similar fashion, the "good" aligned deities/gods have been removed as an applicable choice.

There are a number of potential allies that can be gained throughout the campaign. The method of gaining their cooperation varies with the individual group, but on the average requires you as the PC to do something for them first. Some of these, upon getting them to join your cause, will unlock the ability to create a new PC (as per the SoZ party creation system) of their represented race. You can have a maximum of 4 player made PCs in your group (the original goblin PC plus up to 3 others). It is up to the player as to how they want to make up their party based on the currently available options and their personal tastes. Nothing says the player has to use more than their original PC, so they can solo if they want. When a new PC is first created and added to the party (and enters the game), they will be given experience points (XP) equal to that currently had by the main/goblin PC and the player can then level them up as they wish. This only happens when they are first created. If they are later removed from, and then added back to the party, they will remain at whatever experience total they had before leaving the party. They do not increase in XP while out of the party, nor do they get XP added when they rejoin the party.

The main story objective is to gather together an army and lead them against the "incursion" of those damnable humans and their allies. Throughout the campaign, you will have the opportunity to gather troops and deploy them for Battle in a strategy game fashion. You can have different types of troops (from various goblinoid races) that are either warriors, clerics (shamans) or mages (witch-doctors). Occasionally you will have access to "special" allies that you can call on for a set period of time before they are no longer available (one or more battles). The game is "won" when you successfully capture and occupy the enemy capital city.

The battles themselves are done through the use of Nytir's "Battle System" scripts which has large scale battles that potentially incorporate dozens of creatures all battling each other at the same time. I have used those as a base and altered it so that it is used through custom GUIs instead of it's original conversation driven options. The scripts were altered to dynamically load the percentages based off your troop deployments. So, for example, if you deploy 100 total troops, 27 of type A, 33 of type B, and 40 of type C, once the Battle starts, your type A troops will have a 27% chance of spawning into the fight (33% for B, and 40% for C). These percentages will change as troops die off (see the guide that comes with Nytir’s "Battle System" to get an explanation of this).

You can dictate the exact troop makeup that you want to deploy for attack on an enemy target as well as the make up of those forces stationed at a location you have taken control of. There are various ways of gaining additional troops assets and for gaining "Command Points" which can be spent by the player to improve the efficiency of their deployable or stationed forces. Before making an attack, you can opt to send a scout for recon of the enemy defenses. Also, the player can go there themselves beforehand and stage the battle grounds to give themselves an advantage (things like simply seeing the area layout, to setting traps and sabotaging the enemy Siege Weapons before an upcoming Battle – providing you can remain undetected by the enemy).

Then again, the wars are not the only thing going on. Players will have the opportunity to adventure in the more traditional style via the Overland map and finish story line type quests. Some of these relate to the ability of gathering allies or military assets, while some are totally unrelated to that.

Of course this is all taking a massive amount of scripting work to get it to all function as I want it to. So far it's going ok. My latest script work revolves around the enemy AI as far as them deploying their own forces to reinforce their positions and attack player held ones.

Here are a couple pics of the War Map (work-in-progress):

Click Here
Click Here
Click Here

Modifié par _Knightmare_, 17 juillet 2010 - 05:06 .


#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
I think I've finished up the enemy reinforce/attack AI. It's run on an area heartbeat script for the Overland map (OLM) area. Enemy held locations are chosen to deploy/transfer forces who then get represented as a single NPC on the OLM. Their soldier make-up is saved as a local variable on that NPC. They travel along the map to their destination. If the destination is an enemy controlled area, they simply add their numbers to those already stationed there (and there numbers were subtracted from the forces stationed at their originating location when they spawned). If the destination is an ally (player controlled) location, they will begin to attack the city/location. In this case an ally defender will spawn into the map and a 1-on-1 battle will begin between the attacker and defender NPCs (so areas are defended even with the PC not being there). It is possible for the enemy to send multiple armies against a single allied location and the battle becomes 1-on-2, 1-on-3, etc.

In both cases (attacker and defender) bonus HPs are added to the NPC to make their total/final HPs equal to the number of troops that make up that individual army. Also, a damage bonus is added to their weapons and damage reduction is added to their armor again based on the number of soldiers in the specific army. All this of course is to represent the idea that the more soldiers there are in an army, the stronger the force is.

When each side takes damage in their combat, that amount of damage is divided up among the various troop types (based on percentages of the troop make-up) and those troops are "killed off." When one side or the other reaches 0 HPs, their army has been wiped out and the location is successfully defended or taken.

The ally defender has its own heartbeat script that will check to see if it is still in combat and if not, destroy itself. This way, when it is again spawned due to an attack on its location, the above metioned bonuses will be reapplied based off the new (presumeablly lowered unless the player stationed more troops there in the meantime) troop count.

If the originating area has a low troop count, they will not spawn an enemy NPC (so as not to deplete their forces and leave an area unguarded) and will instead add troops to their stationed forces. This is to represent additional troops from recruiment, militia and perhaps general adventurers signing on to help defeat the goblinoid threat.

#3
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
I have finished adding in where the player can use their PC party to attack a traveling enemy army. If they are lucky and happen to kill off all the enemy soldiers then when they return to the OLM that army will no longer be there.

If the player has just killed off a portion of the enemy soldiers, the representative enemy army NPC on the OLM will have all of his bonuses (as described in a previous post) reset to be calculated off the new enemy troop count for that specific army. This allows the player to make tactical "hit-and-run" attacks against an enemy army and try to whittle down their forces before the army arrives at its destination. This will lower the amount and strength of additional troops to a location if the army is heading to one of its own controlled locations, or have less/lower strength soldiers when it arrives to attack a player controlled location.

Modifié par _Knightmare_, 17 juillet 2010 - 01:10 .


#4
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
For any who are interested, here's some in-game screenshots of me leading my goblinoid army forces in a siege against a human held castle. (Using my test PC here not a goblin race PC like would be in the final module.)

Click Here
Click Here
Click Here
Click Here
Click Here
Click Here
Click Here
Click Here

Modifié par _Knightmare_, 17 juillet 2010 - 01:22 .


#5
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Added a few things:



Traveling army NPCs on the OM will fight each other if they happen to pass by an enemy army group. At the conclusion of this battle, their various bonus statistics will be recalculated and reapplied (for the victor, the defeated army has been wiped out). They will then continue on to their destination.



The player can now try to take an enemy held location using only thier own party, instead of fighting along side deployed army troops. Took a little bit of scripting for it to work, but it seems functional so far. Enemy soldiers will still get sent into battle as per the normal Battle System scripts.



I also added a selection GUI screen where the player can choose thier army's insignia from (currently) about 2 dozen different ones. Army NPCs, as they travel across the OM, will have a VFX of that insignia floating over their heads (both Ally and Enemy armies). This is more so the player can tell the difference between a NPC that represents a whole army and one that doesn't.



Last, added in an Admin Options screen where the player can set some options to thier liking, currently there is: Turning on/off the above mentioned NPC insignia VFX, setting the difficulty of large scale battles, changing thier chosen army insignia and seting the number of troops that will spawn per side in large scale battles (to help with framerates and such). Will add more options to this as needed.

#6
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
I just finished another little addition. Your army NPCs on the OM can be set to try and flee from enemy armys. Settings are in the Admin options screen. They can be set to "Always" flee, "Never" flee, or "Enemy > X" flee (where they will only flee if the enemy army is a certain percentage larger than their own, 10%, 25%, 50% or 75%). This will allow the player to stop suicidal type attacks if their meager little 20 strong army runs across an enemy army numbering in the hundreds. They will run away, wait for the enemy army to pass, then continue on to their target. It is not definite that they will be able to get away, the enemy may chase and catch them, forcing your army to fight. And of course this only applies to "automated" armys where he player has chosen to not personally lead that group into battle. If they are leading, they can make their choice when it comes.

#7
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
My latest addition:



Sometimes things just don't go the way you have them planned. In this case the best option may be a "strategic retreat." And so, that option is now available. If the player is personally fighting enemy troops in a large scale battle, they can call a retreat. Currently all they have to do is just exit the area back out into the OM and the option will present itself. Now that I have the scripts working I'll add in a custom Horn item. Blow the horn to sound the retreat.

#8
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Added a couple more things:



Added in the "Retreat Horn" mentioned in my last post.



Put in some safeguard checks against ending up with a negative count of soldiers. Had to do this due to some uneven math using floats and ints.



Your ally Overland NPC army reps (both attackers and defenders) will now change their appearance and soundset when they spawn. The appearance/sound type they get is based off the largest race number deployed/stationed within that army.



After fighting a battle and successfully taking an enemy position, either via the automated OM or by leading the attack youself, your soldiers that are left alive after the battle will be automatically set to station/occupy that location. You can add to or subtract from those numbers via the War Map.



The enemy (ie. computer AI) will try to retake areas you have conquered. While I already had it set that they will try this against your (automated) allied positions on the OM, they will now try to take it even when the PC is in that area. For example, if you take the Human Castle, wait there long enough and the enemy will attack trying to regain it for themselves. Your "lookouts" will give you a warning shortly before the attack begins. It's currently set to 10 seconds real time before the fight begins - might change this setting. Of course, any soldiers stationed there will automatically rush to the defense of your area. IMHO, it was cooler to defend the area than it was to take it in the first place lol.

#9
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
My latest additions:



Players can now post guards wherever they choose within an area as long as they control the location. Want a couple big, ugly trolls or ogres standing outside your castle gates? Or maybe you want to post some archers along that ridge over there? Just use the player item I made and one will come over and stand guard at that spot.



In a similar fashion, players can build barricades, as long as you have the appropriate materials available to do so. Works great to funnel the enemy down a tight pathway when needed, or to just stop their advance in the first place. Enemy soldiers will try to destroy them when faced with the situation.

#10
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Couple screenshots of the stuff I mentioned in my last post.

Having taken the human castle I posted some ogre guards at the gates and set up a series of barricades: Click Here

But of course the front couple rows of barricaeds only lasted until the humans tried to retake the castle and a smart enemy mage decided to blast the barricades away with a well-placed fireball: Click Here

That left the last row intact, so my archers wisely decided to use it as cover to fire from: Click Here

Modifié par _Knightmare_, 17 juillet 2010 - 01:23 .


#11
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
On my current quest to get the Player items up and running, I revived an old item I had and reworked it a little bit. It's a "Spyglass" item that the player can use to... what else... spy on enemy locations. Done through cut-scene type convo and using static cameras. Providing the PC can pass increasingly difficult spot checks (to get a better vantage point) and hide checks (to avoid being spotted by the enemy) they can get successivly better views.

Click Here
Click Here
Click Here
Click Here

I didn't trigger any NPCs to spawn for these pics, they're more for "proof-of-concept."

#12
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
An update on my latest venture:

I'm attempting to try and create dynamic "NPC Adventurers." So far it's going ok. I have it set so that it will spawn a party sized group of NPCs, auto-leveled up to a point based on the level of the player's PC. They will then adventure around in the area and do the things parties do.

So far I have it done where they will be created, leveled and have some random equipment assigned to them based on class. Now I'm moving onto the tougher part, coding a passable "adventuring party" AI. Of course the NPCs will try to attack and kill any creature hostile to them. I only have the Rogue type (mostly) done so far. He will do things like disable traps (after warning his party he spotted one), set his own traps and unlock locked doors.

I have it planned:
- The cleric will heal their party up after a battle (if needed).

- The cleric will raise their dead after a battle if needed and able to do so.

- The warrior type will try to bash open locked doors if the rogue fails to pick it.

- Have party members loot chests and such.

- The party as a group will try to rest in an appropriate spot if they need it.

So question for others: What other sorts of actions (in general or class specific) should your typical adventuring party do?

#13
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
And update on the Adventuring Party AI:



Man this is a lot of work. Coding in all the distinct possibilities and such. But anyway, here's the few things I have working so far:



- As mentioned before, Party will spawn, level up, be assigned and equip class appropriate items

- They will choose a direction to head in.

- Will choose whether to open a door or continue onward.

- Will scan room/areas for lootable placeables (ie. chests) and if found go to them, open them and loot the contents (if any)

- The rogue will warn his friends if he spots a trap on the ground then try to disable it

- The rogue will search for traps on doors and try to disable them if found

- The rogue will try to pick locked doors, failing that a warrior will bash the door

- If the rogue is no longer with the party (because the poor soul died), the warrior will default to trying to bash open locked doors

- When the party has toured the entire area, they will head to the exit and leave



Next is to add in the rogue actions dealing with locked and/or trapped chests. Can probably rehash the code for the doors here so not expecting too much trouble. Been concentrating on the rogue-type actions so far as these seem (to me anyway) to be the most numerous and intricate.


#14
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
The adventurers are just generic right now, randomly spawned, equiped and leveled based off the PCs current level (so that they sort of progress in challenge rating along with the PC). Their final level will be anywhere from 50% to 75% of the PCs level, though I might change that. While the PC may be able to find the adventurers a push-over at half their level, the adventurers will probably do some serious damage to the PCs allies before they get cut down. I'm going to make it so that if the adventurers lose a certain percentage of their group (half?) and can't raise their dead then they will try to leave the area before more are killed off.



As for the cut-scenes, perhaps. The adventurers already talk among themselves when certain situations come up. Right now they are a bunch of one-liner SpeakStrings that are all the same for that specific situation. Later I'll go back and throw in some randomly picked lines to change things up a bit.



Only addition so far to the system is having the party loop back through the area a second time to check doors and such they may have passed by the first time around.

#15
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Couple updates to the APAI (Adventuring Party AI):



- Added in the rogue checks for traps and locks on lootables placeables. If found will try to either disarm or unlock as appropriate.



- Expanded the NPC spawn scripts. Originally just had it always spawning human males for testing. Now it will randomly choose between races and sexes as well as classes. It can produce some cool or even sort of funny combos (its an Equal Opportunity script!) such as a group of gruff male half-orcs being lead by a female gnome! While not impossible, it's highly unlikely to produce a duplicate party, there's over 442,000 possible combinations for the party make-up. Add in the randomly assigned equipment and the possibilities are in the many multiple millions.



Think I'm about done for the rogue stuff for now (thank the gods, its well over a thousand lines of code). Time to move on to improving the general party AI.

#16
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



- Added in so the NPCs will scan for multiple inventory type placeables (chests and such) in the same room. Had to get them to reliablly find the first before I worried about more than one.



- They will also now scan for (multiple) loot drops, either those that just happen to be there, those from destroyed chests and such, or after combat from killed off enemies (or other NPC party memebers). They will collect their booty when found.



- Started on the party looking after themselves when a battle is over. So far just have them reporting how damaged they are compared to full health. That was the first step.

#17
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



- If the cleric is still alive, he will cast a healing spell on the group member that is the most damaged after a combat. Currently only does this once, but might have it loop back through so that they cast more than one healing spell. Not sure on that yet. Suggestions?



- Again if the cleric is still alive, they will raise fallen party members from the dead (if there are any) and then cast a healing spell on them. This was trickier to get to work than I had hoped for. The NPCs needed to leave lootable corpses for the spells to target, which was fine, but when they recollected their equipment it would destroy the raised NPC when their loot drop vanished. Got around this by making all the NPC equipment not droppable. If the cleric is dead, or unable to raise the dead, then I used a custom function to create a loot bag at the fallen NPCs spot and copied all their equipment into its inventory. That way the player can still collect the loot off the fallen NPCs. Seems to work fine so far. If there are any party members left alive, they will collect the equipment of fallen party members who can't be raised from the dead.

#18
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



Not much huge -



- After a battle the cleric (if alive) will cycle through and try to cure poisoning and diseases on the NPC party. Special thanks to Kaldor Silverwand for providing me a custom function script that allowed this to happen.



- When spellcasters have used a certain percentage of their spells they will report to the others that they are running low on them. This will lead into the party deciding to rest or not. I just have to decide how to get them to decide...

#19
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



- The party will now rest up if they need it and find an appropriate spot. Triggered by the casters running low on spells and them finding a defensible location (ie. a room with a door). They will close and lock the door then NPCs will rest while one of them stands guard at the door. This will occur after they have swept the area for loot/chests and cured any poison/disease.



- If the mage type is still alive, they will cycle through and identify any found items the party may now have so that the items can be used if appropriate. No idea how I might redistribute them to the appropriate NPC though (if I can at all). Maybe by checking the base item type? That's my next investigation...



- Changed the spawn scripts a little bit to include checking for the racial size of the NPC so that size appropriate weapons are given. Was having problems with some of the smaller folk being given large weapons they couldn't actually use.

#20
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



- The NPCs will now trade found items/euipment around between themselves. Its sort of generic for the most part (ie. all armor goes to the warrior type, all shortswords go to the rogue type, etc.) but some things are more specific (ie. potions to who it will serve best, arcane scrolls to the mage type, divine scrolls to the cleric type). I may seperate things a bit to be more specific but just wanted to get a workable system going first. If it is a "slottable" item (ie. head, chest, left ring) the NPC will equip that item if they have an open slot.

#21
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



Ask and you shall recieve... (DNO)



- Armor items will now be distributed as will best fit the different party members. Their current ACs are compared with one another and with the total armor value of the found item to see who should get it. Once they have traded things around they will equip their new armor if it was better than what they currently have. This includes any armor stuff they may have in their inventory from that last trade/re-equip (so some party members may end up with "hand-me-downs"). If it's not useful to anybody it will be given to the Warrior type by default figuring they have the highest strength in the party and can therefore carry the weight.



Hopefully now that I have it working right I should be able to more or less copy it and do the same for weapons.

#22
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



- Similar to armor type items, weapons will now be split up between NPC party members based on who can use it best. First it is decided who can use it in the first place (by weapon type), then it checks if any of the NPCs are specialized in that weapon type. If they are, they are given that weapon. Failing that, it next checks to see if any NPCs have the Weapon Focus feat for that weapon type, again, if so, they will get the weapon. Failing that as well, it will default to seeing who has the worst total attack bonus (feats and ability bonuses included) and that if they are given the weapon will it improve their AB? If so, they get the weapon. So the warrior type (unless specialized or Focused in the weapon) will usually not get many weapons as for the most part they will have the highest AB. That is until the other class party members have upgraded their weapons so their AB is equal to or better than the warrior's. So, in short, the NPC with the least AB in the party gets the weapon (if they can use) with the highest Enchantment/Attack Bonus. The NPCs will then equip the best weapon in their inventory (by damage potential). As with armor, if nobody can make use of the new weapon, it will default to the warrior type to carry it. If the warrior type no longer is with the party, the member who found the item will simply keep it. The exception to all this is the Quarterstaff which will always be given to the mage type (if alive) since magic staves fall under the quarterstaff type weapon.

#23
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
APAI update:



- Items that can have a variety of magical abilities (rings, amulets, belts, boots, cloaks, etc.) will be distributed based on the magical abilities it has and comparing it to what abilities are on the items the NPCs already have. For example, if the warrior type already has an item that makes her immune to poison, she doesn't need another one so the next poison immunity item the NPCs find will go to somebody else. Items that are only really useful to certain classes (ie. Pick Locks +5) will be given directly to that party member (the Rogue in that case) providing they are still alive. Items that have Abilty or Skill bonuses will follow a "fall-through" type effect, where it first checks for that bonus type on the NPC who most uses that stat (ie. STR for Warriors, DEX for Rogues, etc.). If the new item's bonus is less than what they currently have, it will check the next NPC who could use it, then the next, etc. Unlike other stuff, if nobody can make use of it the item will be given to a random party member (to help spread the loot/weight around a bit).



I hope I'm getting close to done with this whole "distribute loot" thing lol. Including the custom functions I had to write to make other custom functions work, this loot thing tops 5500 lines of code!

#24
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Just wanted to give an update as to what I've been doing with this module:



With my scripted systems (mostly) complete I finally returned to actually creating the module itself lol. Still have a few ideas to add into the script systems, but I need to limit scope creep at some point, not to mention I need a change from writing code. My plan has gone half right as I've been implementing quests and such lately. While I am heavilly coding the quests, at least the scripts usually come in under 100 lines. Scope creep has half reared its ugly face as I'm designing the quests to have multiple solutions. Sometimes those different solutions are even on opposite sides of the game world. Some of the player's choices will alter the entire rest of the campaign as well. As far as scripting goes, I'm trying to make the world change a bit depending on what the player does, everything from what NPCs will say to the player or to each other, to how an area looks after some action has been completed. I only have a few quests actually done, but have another couple dozen written out in a doc file. On the average, so far none of the quests are all that short. The shortest one may take at least 30 minutes for the player to complete, while the longest might be an hour or two. I have no idea how long the total campaign will take to complete, but a conservative estimate at this time would be in excess of 30 hours (8 seperate modules make up the campaign so far). The quests/modules are non-linear and for the most part it is up to the player as to the order they are completed. Though, of course, some will only become available after a previous one is completed.



- KM

#25
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Just a general update - I continue to add in some more quests and such. Most are heavily scripted so it takes a bit of time. Here's a couple screens of my latest:

Standing Tall Before The (Tin)Man
Do You Want To Play A Game?
Through The Looking Glass

Area itself is a modified version of seraphimsage1's sweet prefab on the vault: Click Here

- KM