Help with my own project.

Help with my own project.

Postby DSJesterXII » Fri Dec 27, 2013 6:10 pm

I'm thinking of making a text game. Using Inform 7. I don't know how to do random encounters, though. Any advice?
DSJesterXII
 
Posts: 2
Joined: Fri Dec 27, 2013 6:04 pm

Re: Help with my own project.

Postby nukuv » Fri Dec 27, 2013 6:59 pm

Well, two basic ways... three basic ways.

Super basic way one, make a pen room and put some critters in there, call them out as needed, put them away when done. Resource heavy, but ultra simple to implement.
Not so basic way, create a critter that is generic and have its properties overwritten by other information on demand when it's summoned in.
Getting ultra fancy, no critter at all! The player only interacts with the encounters through your own code, meaning you have to design everything.
nukuv
Site Admin
 
Posts: 96
Joined: Mon Dec 09, 2013 10:38 am

Re: Help with my own project.

Postby TigerStripes » Fri Dec 27, 2013 7:25 pm

DSJesterXII wrote:I'm thinking of making a text game. Using Inform 7. I don't know how to do random encounters, though. Any advice?

Well, part of it will depend on your overall game design.

For random events:
My first recommendation is to do it similar to FS, but with some changes/tweaks.
- Create a class of things (we use 'situations').
- Assign an adjective property to all of those to indicate whether they're available or not (we use 'resolved').
- If you have (or plan on having) several areas with different event sets, assign a property to indicate that. While we use 'sarea' as a text property, I'd recommend making it numeric or an adjective. Numeric would be fast and easy, though adjectives would give you the option to allow some events to work in multiple areas with little hassle.
- Assign another property to indicate what happens dealing with each situation, which can then be occupied by a say statement. While we use 'instead of' to do this, a direct say subroutine would probably work out better.
- Set up a mechanic to prompt random events to occur. This can be done similar to what we have with the explore/hunt command and trying to move into hunting areas ('dangerous doors'). If you're doing the multiple area method, then you'll want to cross-check the area property you assigned to the random events versus a similar property on the room/door/area the player is occupying or using. Tell Inform to pick a random matching one to your request and process it.
- Once a random event is completed, be sure it's assigned as such.

Review our code for 'hunting' and 'exploring' as well as 'instead of going through a dangerous door', but keep in mind the suggested changes I've outlined when planning your own method.

- For random monster encounters, I'd suggest building them as a special class of person instead of our existing method of using a table.
- Assign them the necessary values you need for combat, any adjectives, properties or other fun stuff to make comparisons.
- If you're going to have multiple areas, as above assign them a property to indicate their location (either by number or by adjective).
- When you want to call upon a random encounter, instruct inform to pick an appropriate random monster (based on level/area/whatever). Once it's picked, declare that to be a special person ('current foe' as a suggestion) and then enter your combat system.
- In your combat system, used values such as the 'level of current foe', 'hp of current foe', 'damage of current foe', etc... so you can read the stats from the current enemy.
- Have text values leading to say statements (if needed) to cover special win/loss scenes. If no such message is needed (basic dungeon crawl), run your generalized win/lose subroutine/message, award rewards if applicable and so on.
User avatar
TigerStripes
 
Posts: 592
Joined: Mon Dec 09, 2013 4:39 pm

Re: Help with my own project.

Postby DSJesterXII » Sat Dec 28, 2013 1:36 pm

Well, see, I'm not doing combat. I'm doing an "escape or get raped" thing when it comes to encounters. It's all based on a d30. What I need to know is how to get a beasty to pop up in random cells. Basically the area is a huge labyrinth full of things that want to corrupt you while you try to escape.

With that in mind, say I have a length of hallway that is five cells long. I want each cell of that hallway to have a chance of spawning a certain beasty, with the probability greatest in the middle cell. How would I go about this?
DSJesterXII
 
Posts: 2
Joined: Fri Dec 27, 2013 6:04 pm

Re: Help with my own project.

Postby TigerStripes » Sat Dec 28, 2013 3:55 pm

DSJesterXII wrote:<random monsters in labyrinth>

If you're not doing combat or random events, that significantly simplifies the matter. In that case, you can either give them stats and run through an escape/rape subroutine, or make an individual scenes with differing methods and requirements for escape. Simply use stepping into each cell with an additional random element as the trigger to activate the random monster selection process. Once one's selected, proceed to your escape/rape subroutine or run their personalized code. As for adjusting the likelihood of a monster appearing based on where the player is in the hallway, I'm sure there's some fancy Inform tricks to do that, but I don't know them and I'd suggest you simply assign a 'danger level' variable to each cell so you can mark some as more dangerous than others as you see fit.
Steps:
- Each cell is an individual room, even if it's part of a hallway.
- Each cell has a number assigned to it (called 'danger level').
- The danger level of a room is usually 0.
- Set the danger level for each cell as you see appropriate.
- Make an 'after moving' action rule to run a check if the player's found by a monster (if a random chance of ( danger level of room ) in 20 succeeds).
- If the check succeeds, select a random monster and have them encounter it. If not, they'll be free to move after that.
User avatar
TigerStripes
 
Posts: 592
Joined: Mon Dec 09, 2013 4:39 pm

Re: Help with my own project.

Postby Firedrive24 » Mon Jan 20, 2014 4:04 pm

actually i could use help with the random encounters myself when it comes down to fighting and stats. i do not have much experience in the fighting mechanics so i'm starting from the basics for my own game. tiger if your still here maybe you can tell me about the code used to actually make combat work. i was looking into the attack extension but i am unsure if thats the type of combat i want. how do you guys do it?
Firedrive24
 
Posts: 6
Joined: Sun Dec 22, 2013 3:23 pm

Re: Help with my own project.

Postby TigerStripes » Mon Jan 20, 2014 7:07 pm

Firedrive24 wrote:actually i could use help with the random encounters myself when it comes down to fighting and stats. i do not have much experience in the fighting mechanics so i'm starting from the basics for my own game. tiger if your still here maybe you can tell me about the code used to actually make combat work. i was looking into the attack extension but i am unsure if thats the type of combat i want. how do you guys do it?

The Alt Attack file now represents how combat is presently handled in FS. That upgrade both compartmentalized a lot of portions of the fight, making it more streamlined and modular, but many of those modules were also expanded with additional features. I do not recommend copying it when creating your own combat system, as it's a complex mess that took several iterations to reach this point.

Originally though, our combat was a d20 method, with the player's attack bonus being determined as ( level + 1/2 dex ) and monster defence similarly ( level + 1/2 dex ). Actually, it was ( level + ( ( dex - 10 ) / 2 ) ), but it works out to be the same in the end, since the resulting 5's cancelled each other out. A d20 was rolled, the player bonus was added and monster defence subtracted. If it beat an 8 (I think), it was considered a hit. Damage was determined as 80-120% of the weapon's damage with an additional bonus for strength (+1 / 2 pts above 10). The monster than got its chance to strike back (if it still had hp). Then it would loop back on itself as long as one side still had hp. Eventually item use and submitting were added, as were children, pets and so on. It was an ok system, but it had some issues. If you want to check it out, you'll just need to dig deep into the code repository's history.

For your game, you'll need to think about how you want combat to feel. Will it be quick and decisive? A drawn-out fencing match? A brutal affair for both winner and loser? Will winning a fight barely phase the player and leave him just as ready for the next one or will he be limping away, sure to lose his next fight if he doesn't heal up? Answers to these and other similar questions will determine what sort of combat system, stating, levelling and so on you'll want.
User avatar
TigerStripes
 
Posts: 592
Joined: Mon Dec 09, 2013 4:39 pm

Re: Help with my own project.

Postby Firedrive24 » Mon Jan 20, 2014 7:56 pm

well thats the thing stripes i do like for the combat to be fast and fluid yet still ehhh challenging so to speak. like a game of speed chess.

the idea is that there will be cannon fodder right the lackeys the easy to go through guys which no doubt would take little to no time to figure out what your suppose to do. i'd even hide a bit of a learning curve inside these lackeys when fast with enemies that poison and do other things to you that would hamper your movements but for it to still be fluid.

to give an example i just think of how fenoxo and you guys do combat, which is in an isolated field of battle and not in the same room like i have seen in other games which do not provide a strict battle menu when playing their games. i want it set up so that you can see your command list and are able to choose right then and there to execute that command and the player character would do said command and inform would compile the rest of the events ie the opponent striking back and what not.

i'd most likely have carry items in the form of hp potions mp potions and food items that restore the player to some degree as well as projectiles possible like firecrackers in earthbound if i can figure out how that works. maybe more or less but i'm getting ahead of myself.

i do believe i have a relatively simple idea that i can use to practice with. a simple Colosseum game that has a no named gladiator (the player) simply going in to fight increasingly difficult opponents and in between each fight returns you to a shop to spend money to purchase weapons armor and potions. if possible i'd like to learn how to make skills that deal damage or heal (or uses a scout like ability like scan for kingdom hearts allied with information on the target).

with this i think i can test and practice random encounters, ie every time the player steps back into the arena, experience points and leveling (i uh don't know of any really good formulas for balancing stats heh...), shopping with the purchase of different weapons armor skills and potions , and npc chatter possibly from the shopkeep giving the gladiator some advice on specific enemy types.

i know a bit long winded but i hope to have answered the idea of pace. i want it to be fast and quick able to get your command off but if the situations change still readable enough that you can see all your current actions so that you can pick the best option for you character build. basically a let the player dictate their own pace system.
Firedrive24
 
Posts: 6
Joined: Sun Dec 22, 2013 3:23 pm

Re: Help with my own project.

Postby TigerStripes » Tue Jan 21, 2014 4:21 am

I don't know much about this on a professional level either. I only have a rough idea of what works for us here at FS. It'll be up to you to pick a system and then test it several times to see if it gives you the feel you want, tweaking as necessary. Try checking out a few other Inform-based games that include combat and see what they do to get some additional ideas.
User avatar
TigerStripes
 
Posts: 592
Joined: Mon Dec 09, 2013 4:39 pm

Re: Help with my own project.

Postby nukuv » Tue Jan 21, 2014 10:08 am

If you make combat challenging, but also required repeatedly, it could become quite trying of a player's patience, so be wary of that. Look for engaging, and not so much challenging.
nukuv
Site Admin
 
Posts: 96
Joined: Mon Dec 09, 2013 10:38 am

Next

Return to Off Topic

Who is online

Users browsing this forum: No registered users and 0 guests