Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

Duke Knight's Momentum is up for revision? Which version of the skill would you prefer?

Current one, unchanged.
+4 AS and +5 DMG when moving 4 spaces or more.
+2 AS and +3 DMG on Player Phase, with additional +2 AS and +2 DMG when moving 4 spaces or more.
+1 AS and +1.5 DMG for each space moved up to 4 spaces.
Current one but AS bonus is converted to DR from the end of the Player Phase until the next one.
I don't know but I want to see the results.

Pages: 1 ... 225 226 [227] 228 229 ... 300

Author Topic: The Fire Emblem on Forums Hub! 10 Years of FEF!  (Read 305018 times)

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3390 on: December 05, 2016, 11:50:38 pm »

E: Also, here's a picture of the calculator. I made it using HTML and Javascript. I believe I've shared images and a video of it before:
Spoiler (click to show/hide)

What was challenging about it? It's just a few calculations plus an RNG, right?

...plus four hundred situational special abilities, but still.
The bolded section was the biggest problem I could foresee, since there are a fucking gazillion classes and skills each with their own special modifiers, some of which can't be quantified programmatically and would require check boxes for the player to tick, like Charisma (keep in mind I was making a FEF calculator that did not involve a map, so testing for a nearby character who has Charisma is a test that can't be made without hard input). Not to mention houseruling is a huge thing and if players have skills that aren't in vanilla FEF they would need to be coded and imported into the program.

E: Then there's fucking weapons. No one is going to use this thing if they have to punch in all the weapon stat numbers every single time, and again, people love inventing their own weapons, classes, skills, etc. It's part of the fun. The best solution as figured by BMM42 is some kind of import/export system that lets you upload a file and all the stats pop in for you, but I have no clue how to implement that.


Let me break down how a FEF combat works programmatically:
First you need to test to make sure the person using the calculator actually filled out all the fields.
Then you need to test for the class and sometimes compare it to another class to determine a modifier, like Archer versus Flier bonus.
Now we get to the actual combat test:

Code: [Select]
Check to see if the 1-100 was less than or equal to Character A's weapon's hit minus the opponent's evasion.
    Hit = True: Okay so you hit. You can't just display a message that says you hit unless we want to implement breakpoints so the player can see the results after every step,
    but we're keeping things simple for now so instead we add the "you hit" string to the results variable until we're done doing checks. Now we have to see if you crit or not.
    See if 1-100 is <= CharA's crit minus CharB's dodge.
        Crit = True: You crit. Display a message that says you crit. Now calculate attack given a critical hit scenario and subtract it from the enemy's [i]current [/i]health.
        We're not done yet, we need to see if there was a double attack. Test if CharA's attack skill minus 4 is >= CharB's attack skill.
            Double = True: Do all that stuff you just did again... But wait!
            Don't forget that now when the loop ends you need to test the enemy's [i]current[/i] health against his [i]maximum [/i]health to see if he died or not.
            If he died, add the appropriate string to the results variable.
        Double = False: Test to see if the bad guy's dead and display the appropriate message.
    Crit = False: You didn't crit. Just calculate attack and see if the guy's dead or not, then display the appropriate message.
False: Character A missed, display the appropriate message.

This is what things looked like at first. Then I remembered counterattacks. Fuck. Counterattacks.

So now the above block of code becomes a lot more complicated, because counterattacks can happen at any stage where the first character's test ends.


Code: [Select]
Check for hit
    Hit = True, check for crit
        Crit = True, check for double
            Double = True, END
        Double = False, END
    Crit = False, END
Hit = False, END

There's all kinds of bullshit about turn order that I don't remember because I stopped working on this so long ago but IIRC there are a bunch of different possibilities for the order in which the combat can turn out depending on doubles and counterattacks (A = char A attack test; B = char B attack test):
A
A A
A B
A A B
A B A
A B B
A A B B
A B A B

All of these possibilities need to be nested within each other and I didn't build myself a simple way to test it. The best way probably would have been some preset buttons that input character/weapon stats that I knew would produce each possibility so I could test to make sure what was supposed to happen, did indeed happen.

This shitty mechanic turned a simple test into a big mess of spaghetti code that is really really hard to decipher and even now I still don't like looking at it. So yeah, while the maths are easy, the logic isn't, especially for me, someone who does not play FEF. I needed constant support from frequent players in order to interpret the rules correctly and identify edge cases so I could try and code this thing with future problems in mind so I'd only have to build it once. In hindsight, and due to the rubber duck effect (and also because I'm just a more experienced programmer now), I can think of some ways I could work around these problems. I would've finished it but school started and I no longer had the time.

@Shoruke: No point in starting from scratch, right? How about a collaboration?
« Last Edit: December 06, 2016, 12:37:02 am by GUNINANRUNIN »
Logged

IronyOwl

  • Bay Watcher
  • Nope~
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3391 on: December 06, 2016, 02:39:24 am »

What was challenging about it? It's just a few calculations plus an RNG, right?

...plus four hundred situational special abilities, but still.
The bolded section was the biggest problem I could foresee, since there are a fucking gazillion classes and skills each with their own special modifiers, some of which can't be quantified programmatically and would require check boxes for the player to tick, like Charisma (keep in mind I was making a FEF calculator that did not involve a map, so testing for a nearby character who has Charisma is a test that can't be made without hard input). Not to mention houseruling is a huge thing and if players have skills that aren't in vanilla FEF they would need to be coded and imported into the program.

E: Then there's fucking weapons. No one is going to use this thing if they have to punch in all the weapon stat numbers every single time, and again, people love inventing their own weapons, classes, skills, etc. It's part of the fun. The best solution as figured by BMM42 is some kind of import/export system that lets you upload a file and all the stats pop in for you, but I have no clue how to implement that.
Having thought about and fiddled with this some, I feel like you'd probably want to have a base statline, and then a that-combat statline that goes through a bunch of checks based on values or checkboxes, each of which has its own statline that gets added to the current one if true. So for example, the Heretic: +2 DMG vs Priests skill would be a "Enemy Is Priest" checkbox that, when set, adds the first skill statline to the current combat one, in this case being +2 to Dmg or Mt or whatever and 0 to everything else. Being on the wrong end of a weapon triangle would similarly have a stat line of -15 Hit and -1 Dmg, triggered when... well, there's probably a more elegant method than if sword and enemy lance OR if axe and enemy sword OR if lance and enemy sword OR if anima and enemy dark OR if light and enemy anima OR if dark and enemy light... but it'll do.

I don't think having persistent custom files is avoidable, frankly. You could punch in everyone's stats every time, but at that point it'd probably be more tedious than just rolling it yourself. I'm not familiar with HTML or Javascript, but a cursory glance doesn't inspire confidence that they have any file-reading capability beyond displaying images. You might want to consider shifting languages/to something that sits in a folder on your computer.

Let me break down how a FEF combat works programmatically:
First you need to test to make sure the person using the calculator actually filled out all the fields.
Then you need to test for the class and sometimes compare it to another class to determine a modifier, like Archer versus Flier bonus.
Now we get to the actual combat test:

Code: [Select]
Check to see if the 1-100 was less than or equal to Character A's weapon's hit minus the opponent's evasion.
    Hit = True: Okay so you hit. You can't just display a message that says you hit unless we want to implement breakpoints so the player can see the results after every step,
    but we're keeping things simple for now so instead we add the "you hit" string to the results variable until we're done doing checks. Now we have to see if you crit or not.
    See if 1-100 is <= CharA's crit minus CharB's dodge.
        Crit = True: You crit. Display a message that says you crit. Now calculate attack given a critical hit scenario and subtract it from the enemy's [i]current [/i]health.
        We're not done yet, we need to see if there was a double attack. Test if CharA's attack skill minus 4 is >= CharB's attack skill.
            Double = True: Do all that stuff you just did again... But wait!
            Don't forget that now when the loop ends you need to test the enemy's [i]current[/i] health against his [i]maximum [/i]health to see if he died or not.
            If he died, add the appropriate string to the results variable.
        Double = False: Test to see if the bad guy's dead and display the appropriate message.
    Crit = False: You didn't crit. Just calculate attack and see if the guy's dead or not, then display the appropriate message.
False: Character A missed, display the appropriate message.

This is what things looked like at first. Then I remembered counterattacks. Fuck. Counterattacks.

So now the above block of code becomes a lot more complicated, because counterattacks can happen at any stage where the first character's test ends.


Code: [Select]
Check for hit
    Hit = True, check for crit
        Crit = True, check for double
            Double = True, END
        Double = False, END
    Crit = False, END
Hit = False, END

There's all kinds of bullshit about turn order that I don't remember because I stopped working on this so long ago but IIRC there are a bunch of different possibilities for the order in which the combat can turn out depending on doubles and counterattacks (A = char A attack test; B = char B attack test):
A
A A
A B
A A B
A B A
A B B
A A B B
A B A B

All of these possibilities need to be nested within each other and I didn't build myself a simple way to test it. The best way probably would have been some preset buttons that input character/weapon stats that I knew would produce each possibility so I could test to make sure what was supposed to happen, did indeed happen.
As mentioned, I'm not familiar with the language, so pardon if I suggest something impossible. But successive statlines solve most of this in terms of sphagettiness, if not tedium. If your IsArcher is true and their IsFlyer is true, your damage is multiplied by 3.

For counters and doubling, a number of attacks field sounds convenient, especially since distinguishing between an attack the enemy is able to counter against and a "free" attack is important. Then you just put the attacker attacks defender part first and the defender retaliates second in a loop.

A = your Attacks is 1, theirs is 0; your attack cycle executes, theirs notes that a value of 0 means skip everything, the loop repeats, both attacks have an Attacks of 0 and thus do nothing
AA = your Attacks is 2, so you attack, they try to counter but nothing happens, you attack again, they try to attack again but nothing happens again
AB = both Attacks are at 1, you go then they go

and so on. AABB or countering before an enemy attacks you doesn't happen, does it? That'd be inconvenient if so.

This shitty mechanic turned a simple test into a big mess of spaghetti code that is really really hard to decipher and even now I still don't like looking at it. So yeah, while the maths are easy, the logic isn't, especially for me, someone who does not play FEF. I needed constant support from frequent players in order to interpret the rules correctly and identify edge cases so I could try and code this thing with future problems in mind so I'd only have to build it once. In hindsight, and due to the rubber duck effect (and also because I'm just a more experienced programmer now), I can think of some ways I could work around these problems. I would've finished it but school started and I no longer had the time.

@Shoruke: No point in starting from scratch, right? How about a collaboration?
I could use the practice, count me in too.
Logged
Quote from: Radio Controlled (Discord)
A hand, a hand, my kingdom for a hot hand!
The kitchenette mold free, you move on to the pantry. it's nasty in there. The bacon is grazing on the lettuce. The ham is having an illicit affair with the prime rib, The potatoes see all, know all. A rat in boxer shorts smoking a foul smelling cigar is banging on a cabinet shouting about rent money.

SeriousConcentrate

  • Bay Watcher
  • The Hollow Street Hero
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3392 on: December 06, 2016, 03:43:13 am »

Being this is Bay12, would I be remiss in maybe suggesting basing it off of how Dwarf Fortress handles modding? Say, have a folder titled 'Weapons' and then inside the folder is, say, reiterpallasch.txt. The text file would have numbers like this:

1
E
5
4
80
5
40

Which would represent range, rank, might, weight, hit rate, crit rate, and quality level. Then in the main program you'd have, say, a menu of sort sort where you can load the text file and it applies all the numbers automatically? The GM would still have to manually keep up with quality levels, I suppose, but it's an idea. I have no programming experience beyond messing with RPGMaker 2K a little back when that first came out so if that's a lot harder than I think it sounds, sorry.
Logged
SerCon Shorts: This Is How You Do It - Twenty-three one minute or less videos of random stupidity in AC:U, Bloodborne, DS2:SotFS, Salt & Sanctuary, and The Witcher 3.

Haspen

  • Bay Watcher
  • Cthuwu
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3393 on: December 06, 2016, 04:13:34 am »



No one has ever succeeded in making a FEF calculator!
Logged
SigFlags!
Quote from: Draignean@Spamkingdom+
Truly, we have the most uniquely talented spy network in all existence.
Quote from: mightymushroom@Spamkingdom#
Please tell me the Royal Physician didn't go to the same college as the Spymaster.

GiglameshDespair

  • Bay Watcher
  • Beware! Once I have posted, your thread is doomed!
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3394 on: December 06, 2016, 05:04:57 am »

A = your Attacks is 1, theirs is 0; your attack cycle executes, theirs notes that a value of 0 means skip everything, the loop repeats, both attacks have an Attacks of 0 and thus do nothing
AA = your Attacks is 2, so you attack, they try to counter but nothing happens, you attack again, they try to attack again but nothing happens again
AB = both Attacks are at 1, you go then they go

and so on. AABB or countering before an enemy attacks you doesn't happen, does it? That'd be inconvenient if so.

With the right Character Specific Skill, if B has more spd than A, B can attack before A can, even when A initiates combat.

Fef: it's a silly system.
Logged
Old and cringe account. Disregard.

Solymr

  • Bay Watcher
  • BEEP BOP READ SOLDIERMON
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3395 on: December 06, 2016, 05:34:45 am »

At this point people would need to code their own FE game just to get a few lines of text.
Logged

IronyOwl

  • Bay Watcher
  • Nope~
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3396 on: December 06, 2016, 07:42:26 am »

Being this is Bay12, would I be remiss in maybe suggesting basing it off of how Dwarf Fortress handles modding? Say, have a folder titled 'Weapons' and then inside the folder is, say, reiterpallasch.txt. The text file would have numbers like this:

1
E
5
4
80
5
40

Which would represent range, rank, might, weight, hit rate, crit rate, and quality level. Then in the main program you'd have, say, a menu of sort sort where you can load the text file and it applies all the numbers automatically? The GM would still have to manually keep up with quality levels, I suppose, but it's an idea. I have no programming experience beyond messing with RPGMaker 2K a little back when that first came out so if that's a lot harder than I think it sounds, sorry.
This is more or less what I was thinking, but also how the program would store characters and such so you don't have to re-enter Charles the Cavalier or Mook Bandit A every time you want to use them. And, for that matter, the program could track QL and current/max HP and such.

No one has ever succeeded in making a FEF calculator!
THEN I SHALL BE THE FIRST!!!

With the right Character Specific Skill, if B has more spd than A, B can attack before A can, even when A initiates combat.

Fef: it's a silly system.
Damn it. Fiddly crap like this isn't impossible to code, but it starts to eat into UI readability and lead to weird design choices to handle really rare scenarios.

At this point people would need to code their own FE game just to get a few lines of text.
Depending on how much you use it, that might not be such a bad tradeoff. I'm keenly aware that ease of use is vitally important, though.
Logged
Quote from: Radio Controlled (Discord)
A hand, a hand, my kingdom for a hot hand!
The kitchenette mold free, you move on to the pantry. it's nasty in there. The bacon is grazing on the lettuce. The ham is having an illicit affair with the prime rib, The potatoes see all, know all. A rat in boxer shorts smoking a foul smelling cigar is banging on a cabinet shouting about rent money.

USEC_OFFICER

  • Bay Watcher
  • Pulls the strings and makes them ring.
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3397 on: December 06, 2016, 10:04:32 am »

Damn it. Fiddly crap like this isn't impossible to code, but it starts to eat into UI readability and lead to weird design choices to handle really rare scenarios.

I don't see how it'd eat into UI readability. You'd have the standard stats/whatever shared by all of the different units and then a text field underneath to display their special abilities and a short description of what they do. Given the sheer number of abilities in the game I see it being more effective than any list of checkboxes/whatever.

As for deciding combat order, you pretty much need a Finite State Machine and a bunch of bits to keep track of which abilities just triggered and so on and so forth. Not much we can do about that, unfortunately. At least it'd make calculating the actual combat a breeze once we sort that out since it just gets tacked onto the end.

I have never touched Javascript in my life, but by the sounds of things a FeF Calculator needs to be running as an actual program. A lot of the quality of life features needed to get this working effectively call for abilities that Javascript has trouble implimenting. Though you'd still need to modify the source code what with everyone's desire to modify/create abilities specifically for their game. Such is life.
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3398 on: December 06, 2016, 11:11:41 am »

I found a fiddle showing exactly the function needed for the file upload design goal: https://jsfiddle.net/Ln37kqc0/

So I just need to learn to use JSON.
Logged

Shoruke

  • Bay Watcher
  • There's a Prinny in Fire Emblem, dood!?
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3399 on: December 06, 2016, 04:30:10 pm »

No one has ever succeeded in making a FEF calculator!
Well SOMEONE programmed Fire Emblem, didn't they?

Allow me to address some of the programming concerns that have come up.


I made it using HTML and Javascript.
So I just need to learn to use JSON.
I have never touched Javascript in my life
I'm not familiar with HTML or Javascript,
Javascript (and HTML) are intended for use in webpages, and were designed with that in mind. While GMs will necessarily have an internet browser open to read posted actions and then post turn results, this calculator will work better as an application than a webpage, mostly since web pages aren't great at reading files from disk.
Processing is my usual language of choice, but considering how much I expect to rely on drop boxes and check boxes, I think C# would be a better choice since it natively supports those.


Then I remembered counterattacks. Fuck. Counterattacks.
Turn order in combat is admittedly nontrivial, but it's not so bad. There's no need to nest everything at each step.
- first up, calculate how many attacks each the attacker and defender have by comparing their Attack Skill scores.
- if the defender triggers vantage, they attack first. Otherwise, the attacker attacks first
- the attacker and defender take turns attacking if they have an attack left. When everybody is out, done.
If at any step anyone died, just stop running checks because it's over.
If at any step someone's weapon broke, their remaining number of attacks is set to 0.
For each attack, if that person has a Brave weapon or something that lets them strike twice, they strike twice.



...plus four hundred situational special abilities, but still.
Yeah, that's kinda the big one.
I still think it's possible, with the combined powers of user-created content and... check boxes.
In addition to the skills in the PHB, we'll need to let the user (a.k.a. the GMs) add new skills to the list of All Skills That Exist. (This is how Personal Skills get done.) When you create characters, you can assign them the new skills. Of course, only numerical skills can be added this way. Skills can be defined as conditional or unconditional.
When you go to calculate an exchange of attacks, you pick the attacker and defender, and all of their conditional skills will be listed as check boxes. It'll be up to the GM to know/calculate whether a conditional skill activates or not. (I can probably make it so that you can set an "activation rate" based on stats or flat percentages, too. It'll probably involve a custom mark-up language.)
As for house-ruled skills or custom skills that change game mechanics instead of just numbers, well, sorry, the program isn't designed for that. You'll have to add it as a text-only skill and figure it out manually, just like you would do if the calculator didn't exist at all.
So for example if you wanted to add some skills from Fire Emblem Awakening, you could add Prescience (+10 hit/avoid when defending), but not Lethality (instant death attack).


Being this is Bay12, would I be remiss in maybe suggesting basing it off of how Dwarf Fortress handles modding?
This is more or less what I was thinking, but also how the program would store characters and such so you don't have to re-enter Charles the Cavalier or Mook Bandit A every time you want to use them. And, for that matter, the program could track QL and current/max HP and such.
I don't think having persistent custom files is avoidable, frankly. You could punch in everyone's stats every time, but at that point it'd probably be more tedious than just rolling it yourself.
Reading from and writing to file aren't hard. One file for player characters, one for enemies, one for skills, and one for items/weapons.
It'll probably be .csv files so you can mod it in notepad.exe or a spreadsheet editor if you're so inclined.
EDIT: and yes, you'll be able to quickly copy NPCs.


No point in starting from scratch, right? How about a collaboration?
I could use the practice, count me in too.
With the other stuff I have going on, we're looking at a few weeks minimum before I even really start on this. With that said, I'm okay with working with others, assuming y'all write legible code and lots of comments :P
Although it would mean we'd want to look into the wonderful world of version control. [sarcasm] yay...
« Last Edit: December 07, 2016, 05:23:59 pm by Shoruke »
Logged
The Unforgotten Beast, Shoruke, has come! A pale-skinned human. It has heterochromatic eyes and moves in an unpredictable manner. Beware its rapier wit!

I_Like_Pi

  • Bay Watcher
  • The way of Pi
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3400 on: January 06, 2017, 07:19:59 pm »

Hi, I usually just lurk forums but this fef thing looks interesting since I enjoy fire emblem. But it seems like most of the games are either full or dead or apparently dead (like 3 of them in the first post are dead or haven't been updated since November).
Logged
My Fire Emblem on Forums: Magi Wars OOC | IC
Magi Wars sidestory: Rotting Empire OOC | IC

Twinwolf

  • Bay Watcher
  • Probably hanging around Forum Games and Roleplay
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3401 on: January 06, 2017, 07:22:40 pm »

Well, probably smart to post here. Most people announce new games here, so watching the thread is probably your best bet to get into one if you don't just habitually check the forums all the time.
Logged
Sigtext!
Of course, Twin is neither man nor woman but an unholy eldritch abomination like every other Bay12er. The difference is they hide it better.
Quote from: Caellath on IRC
<Caellath>: Twinwolf, your thirst for blood has been noted.

Haspen

  • Bay Watcher
  • Cthuwu
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3402 on: January 07, 2017, 04:40:49 am »

New FEFs that don't die?

What dreamland do you live in, mister :P
Logged
SigFlags!
Quote from: Draignean@Spamkingdom+
Truly, we have the most uniquely talented spy network in all existence.
Quote from: mightymushroom@Spamkingdom#
Please tell me the Royal Physician didn't go to the same college as the Spymaster.

Twinwolf

  • Bay Watcher
  • Probably hanging around Forum Games and Roleplay
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3403 on: January 07, 2017, 08:21:36 am »

Hey, FEF 1 and 2, and Nature of Humans, and maybe Final Hour if you count long runners that aren't done yet, were once new FEFs :P
Logged
Sigtext!
Of course, Twin is neither man nor woman but an unholy eldritch abomination like every other Bay12er. The difference is they hide it better.
Quote from: Caellath on IRC
<Caellath>: Twinwolf, your thirst for blood has been noted.

Haspen

  • Bay Watcher
  • Cthuwu
    • View Profile
Re: The Fire Emblem on Forums Hub! FEF2 HAS FINISHED!
« Reply #3404 on: January 07, 2017, 08:24:15 am »

:v

v:

You feelin' smart for nitpicking huh how aboot I jinx Alissa's rolls even more huh what aboot then |v
Logged
SigFlags!
Quote from: Draignean@Spamkingdom+
Truly, we have the most uniquely talented spy network in all existence.
Quote from: mightymushroom@Spamkingdom#
Please tell me the Royal Physician didn't go to the same college as the Spymaster.
Pages: 1 ... 225 226 [227] 228 229 ... 300