[FE8U] Stan's ASM Stuff

:wave:

I have here a thing I made for a potential april fools thing that didn’t end up getting very far (it was supposed to be a hack mimicking berwick saga mechanics).


Lazberian Mercenaries

(browsable source here).

This hack allows some units to cost money to deploy… like Berwick Saga mercenaries! Hence the lazberian part of the name (however, this is much simpler than what that game would offer (no permanent recruitment mechanics or things like that)).

Even if this was kind of made in a rush, I’m fairly happy with the result which is why I am releasing this here.

HACK-12

how2:

  • A Unit with CAttribute (Class/Character Attributes/Abilities, this field goes by many names) CA_LM_MERCENARY (defined by default as 0x40000000, which is bit 30) will be considered as a mercenary, and will require to be hired to be deployable.
  • On the prep screen unit selection screen, mercenaries are marked with a blinking coin icon. You can hire mercenaries on that screen by attempting to deploy them.
    • Feel free to edit the coin graphics, restrictions are 8x8 pixels 15 colors. You may want to change the insertion method.
  • This hack changes auto-deploy to only deploy force-deployed units (this is because I was lazy and didn’t feel like changing the thing to deploy units that specifically aren’t mercenaries).
  • Force-deployed mercenaries don’t need to be hired.
  • You will be silently refunded any mercenary you hired but didn’t end up deploying upon starting the chapter.
  • A Mercenary’s cost is computed by one simple function. This is the only function provided as pure ASM (GetUnitDeployCost.s) to allow its modification to perhaps be more accessible.

/!\ This requires a save unit expansion that saves the entirety of the unit state bits:

  • The latest github version of the skill system comes with a EMS (see previous post for details) setup that includes such expansion. It is, however, disabled by default (reasoning behind it is: it will break existing saves), you need to enable it by defining USE_SAVE_EXPANSION in Custom Definitions (or somewhere else included early in the build).
  • FEBuilder ships that very same EMS-based save unit expansion as a standalone patch under the ExModularSave name (I think).

If you don’t have such expansion installed, the hired status of units will be lost on chapter restart (and your money won’t come back!).


I said that I was happy enough with this to release it here, but there’s also a bunch of other things that I was a bit less satisfied with. I’m not releasing them here but sources are nevertheless available in my CHAX repository (look for LazberianBattleFlow and LazberianWeaponry specifically).

Lazberian Turn Flow (see a few posts above) also got a small bugfix update (fixing some relatively minor AI related issues).

Report bugs or request features by submitting an issue on CHAX, or by contacting me directly here or on discord.

21 Likes

Langrisser time?

3 Likes

This is an extremely cool concept/implementation. Gave me a few ideas to consider.

can we just praise Stan

1 Like

Daily PSA: Play Berwick Saga

1 Like

:wave:

It’s time for my bi-yealry dump of random half-rushed-and-barely-tested stuff. Lot’s of AI stuff this time for some reason.


Fixed Autolevels

This is an absurdly trivial hack that makes autoleveled stats non-random (it makes it a static (growth * level + 50) / 100 instead). I didn’t plan on making a proper release of it like that ever but I was told that it might be of use to other people. So here it is.

This is not compatible with Zeta’s AutolevelTweaker it seems.


Ferry AI

(You’ll need both of these hacks to be installed at once, in that order).

This is a custom AI I made for the communist blitz (yes) that allows you to set AI units to “ferry” units from a rescuer to a drop point.

The AiPerfromExtension hack allows hacks to add in “ai perform” actions (or just Ai actions). It’s only really interesting to other wizards but tl;dr FerryAi uses it to allow AI to Take and Drop.

This hack uses 2 perform ids, one AI1 id and one trap id (the trap is used to store locations of drop points); all of which can be configured through definitions before including the installer (see installer for details).

Using FerryAi mostly consists of setting the Ai1 of the ferry units to FERRY_AI1 and using ASMCs to setup drop points:

  • ASMC_AddFerryDropTile will add drop point at coords in sB
  • ASMC_AddFerryDropTiles will add drop points based on null-terminated list of short pairs pointed to by s2.

FerryAi also comes with a helper ASMC that allows you to load a unit rescued by another:

  • ASMC_LoadRescued: loads UNIT pointed to by s1 (it’s coords and REDA doesn’t matter, doesn’t need to be preceded by UNIT) and makes the unit corresponding to character in s2 rescue it. Returns 0 in sC if it fails, otherwise 1.

See CommBlitz Ch10 events for example usage.

Both of those hacks also come with (and use) AiScrDefinitions.event, which fulfils the same role as Extensions/AI Assembly.txt, but is more complete and also not broken (but FE8 only).


Talk AI

This is also custom AI I also made for the communist blitz (also yes). Well, it’s not that custom, as it is mostly just a port of the functionality from FE6 and FE7 that allows AI-controlled characters to seek talking to specific units.

This defines a single macro, AiTryTalkToCharacter, which is basically an entire AI script.

Example:

ALIGN 4
DanAi:
	AiTryTalkToCharacter(Eirika)

	InjectAi2(CH10_DAN_AI2, DanAi) // Use whatever macro you use to inject AIs

This would make anyone with Ai2 CH10_DAN_AI2 seek talking to Eirika. Note that they will seek talk even if they cannot talk to the target character, which will result in a freeze when they try.


AI doesn’t attack if it can’t do damage

This is something I made this morning at like 1AM “yesterday” on a whim after the fact that this feature exists in FE4/5 was mentioned in VC.

It just checks whether attack - target_defense is lesser or equal to 0 and if so sets target weight to 0 (making it not attack). This means that it may not take into account stuff like pierce procs and whatnot.


LTF Update

Lazberian Turn Flow is not a new hack as you know of course but I updated it to include a cool new featurey thing:

turn-waterturn

I hope you’re all jealous of my quality art (read: If anybody wants to make something that doesn’t look like garbage I will gladly include it as default).

Guide to changing the graphics

Starting at line 268 (currently) of LazberianTurnFlow.event is this:

ALIGN 4
gLTFTurnSwitchSheetImg:
	#incbin "Data/TurnSwitchSheet.4bpp.lz"

ALIGN 4
gLTFTurnSwitchSheetPal:
	#incbin "Data/TurnSwitchSheet.gbapal"

This is where the graphics are getting included. If you so wish you can change those to incexts like so:

ALIGN 4
gLTFTurnSwitchSheetImg:
	#incext Png2Dmp "Data/TurnSwitchSheet.png" --lz77

ALIGN 4
gLTFTurnSwitchSheetPal:
	#incext Png2Dmp "Data/TurnSwitchSheet.png" --palette-only

Edit the Data/TurnSwitchSheet.png file and rebuild using EA.

The LTF update also probably includes some other minor fixes and changes, as I’ve been occasionally adding small polish bits to the thing.

The download a couple of posts above has been updated to include this.


Also LolStats has been updated to not make autoleveled generics stats turbo wack (hopefully) (which in turn makes it also incompatible with both the above Fixed Autolevel and Zeta’s AutolevelTweaker).


That’s it for now! As always, all up-to-date sources and more are in my FE-CHAX repository.

Ask questions and report bugs here blah blah blah (nobody ever does that there anyway) or hit me here or on the discord.

:evaw:

12 Likes

:wave:

LTF Update (again)

It’s been like 5 minutes since I last posted but for the first time in its year+ of existence I got some feedback on LTF (Lazberian Turn Flow, see the original post), which got me to fix and change and add a few notable things:

  • LTF is now toggleable. It’s on a per-chapter basis by default, but that can be changed if you don’t mind a bit of asm (see main installer for details). You can now mix in chapters using LTF with chapters using traditional turn flow in your hack (or enable LTF as a different mode, whatever floats your boat). The default installer enables it for only the prologue by default (for demonstration purposes).
  • Fixed turn count when using LTF (it used to start at 0 instead of 1). Sorry about that.
  • The turn switching thing updates the turn order display properly. Also map sprites stay gray for a bit longer. It’s just a visual change, but also something that was pointed out as being weird.

There. Download link was updated in the original post. Please report any issues thank (there probably still are some).

5 Likes

:wave:

Classic RNG

image
There you go @L95 =)

This hack replaces the random number generator with one that accurately (hopefully) replicates the one from FE1-3. This is a joke hack (that RNG is hilariously bad).

This only changes the core Random Number Generator, it does not remove 2RN or whatnot.

Installer for FE8U, contains offset for FE6 commented out. Install using Event Assembler.


Thanks to @oziphanto for confirming that C04E in FE1 is indeed the random number generator. Check out his fix for the RNG in FE1, as well as his video explaining how the FE1 RNG works and why it sucks! check out my wip fe1 disassembly while you’re at it

13 Likes

What have I done

7 Likes

I did and it is amazing.

Oh,also…what actually is so bad about the old RNG? I only know from the linked recources that the FE1 version is an abomination.

what’s “the old RNG” if it’s not FE1’s RNG?

FE2 and 3? FE1-3 is listed.

I understood from oziphanto’s stuff that they are the same

FE2 and FE3 have the same garbage RNG as FE1. Even on the SNES version when a programmer had to port the code to SNES and and make it ‘rtl’ safe. IT STILL ADDS A SINGLE NUMBER IN A LOOP MULTIPLE TIMES GAHHHHHHHHHHHHHHHHHHHHH

However 1 has the extra bad notion of not scaling things properly, which was fixed in 2 and 3.

To make my first play-through of FE6 more interesting/hopefully entertaining for viewers; I was thinking of giving it “Classic” 1RN and No weapon triangle. I’ve been pulling FE7 apart a lot, but if anybody has the offsets/patch already for FE6, love to know.

1 Like

YES, YES, YES BERWICK STUFF IN FE 8 HACKS, I’m going to put that stuff in whatever future project, I’m shoving in.

Heya, in FE8U, when a unit uses a ballista, the ActionData+0x12 (equipped slot) is set to 8. The action rework seems to interpret this as an inventory slot when checking for Nightmare. As a result a unit’s weapon rank in light and dark are interpreted as an item ID + uses short. I doubt that’s intentional.

This happens in ApplyAction.s Here’s a screenie of this happening in No$GBA.

Edit: It seems vanilla does this as well in ActionCombat 0x322B0. I’m not sure if I’m missing something here.

Edit2: Maybe that’s because in vanilla a unit that uses a ballista won’t have a weapon rank in light magic, so it won’t ever be 0xA6, Nightmare. It might’ve gone unnoticed.

2 Likes

How do I display “All” with the range display hack?

can I get some help in implementing the ltf event?

:wave:

Nothing new that’s particularly interesting wizardry-wise, but I was asked about whether my stuff was free to use just today so I figured maybe I’ll make a statement about this.

So here we go.

All of the stuff in this thread of which I am the author can be considered as having been released under CC0, unless explicitly specified otherwise; which means it’s free to use, modify, redistribute for any purpose with or without credit.

This also applies to anything contained in the following GitHub repositories:

I will probably add notices to some of those if I end up adding anything to them.

Now, while this does mean that you can do whatever with most of my stuff; if you want to be on good terms with me I would still like to informally request the following of you when you use my stuff (or anybody else’s):

  1. Do credit authors; if not up front at the very least do so properly when asked.
  2. If you distribute any modified open source hack (for example: as part of a playable patch), redistribute the modified source along with it and specify that it has been modified.

If you’re still looking for new wizardry check out StanHash/fe7-stuff as I’ve recently been adding some things in there (mostly because I had to make/fix some stuff for Bloodlines).

11 Likes

(Lazberian Turn Flow)
Less of a bug and moreso an observstion, but the menus are covered slightly when displayed on the right.

I installed it via buildfile, it’s the only engine hack added currently.

FE_Hack_01
FE_Hack_02

I don’t have a screenshot for this, but holding R to check gray units doesn’t work well when a unit is selected.

Doing so while hovering over any unit pulls up their stat screen (it works as intended on empty tiles). Doing it once your commands show up activates the help bubble. Keeping the R button held after cancelling these actions still allows you to check units, though.

That said, I haven’t looked in the files yet to see where to change the button input, so not a big deal, just some oddities with the default.

1 Like