ivalentin
запушил(а) feature/battle_module в ivalentin/V-Gears
adc1e71f56 Battle spell effects from the original assets, floating numbers
Spell effects now come from the data in magic.lgp, extracted by the
installer and recreated in Lua, instead of generic particles.
Installer
- LGP archives read the folder table, so files with the same name in
different folders (fire_1.p, thund_3.p, ice_1.p...) are no longer
overwritten. FileEntry has a folder field.
- New install steps EFFECT_MODELS_INIT/CONVERT export effect meshes to
models/battle/effects/<folder>_<name>.mesh, convert their textures,
and write gamedata/effects.lua.
- Sprite sheets (.s files) are parsed into gamedata/effect_sprites.lua
and their textures go to images/battle_fx.
Engine
- BattleManager: add_effect_model / remove_effect_model.
- Entity: set_scale, set_model_rotation, set_blend (normal, additive,
alpha), set_alpha. EntityModel clones materials per entity and
releases them on removal.
- UiWidget/UiSprite: image sub-regions and additive blending.
- UiTextArea::Render refreshes the layout when the widget changed
after the UI update. Battle scripts run after it, so text that was
moved or changed every frame was never drawn.
Battle (Lua)
- Effects by attack id (Regen, Barrier, MBarrier, Reflect, Wall, Slow,
Stop, DeBarrier, Death) and by element (Fire, Ice, Bolt), plus Cure
with the original sprites. The generic particles, flashes and caster
sparks are removed; only the battle-start flash stays.
- Floating damage, heal, MP and status numbers over the targets.
- Fix: the party models were missing in battle after loading a save,
because load_game did not export the party. It now calls
export_party_members().
Sizes, timing and orientation of the effects are first guesses and
have been tested in game only for Fire, Ice, Bolt, Cure and the
numbers. Haste, summons and most status spells have no effect yet.
69c3de913f Merge branch 'feature/data' into develop
56a76f64b0 Save and load settings, fix loading, and read controls through game events
Settings in the savemap
- The savemap saves the config menu settings by name (<Settings> in the
XML) and the scripts decide which ones there are. New savemap_manager
functions: set_setting, is_slot_setting_set, get_slot_setting and
get_slot_window_colour. Remove the unused Settings struct and the stub
numeric settings.
- save_game and load_game use ConfigMenu:save_settings and load_settings.
Loading applies the volumes, the movement and the window colours, keeps
the current settings if the game was saved before they existed, and
clamps damaged values.
- Fix the XML loader of the window colours: the bottom-left corner was
never loaded (typo) and the maximum value of 255 was rejected.
- Savemap::Write creates the save folder if it is missing and logs an
error if it can't write, instead of silently not saving.
Loading games
- Rewrite load_game as the inverse of save_game. Inventory, materia and key
items are 1-based in the game and 0-based in the savemap, the character
materia used wrong arguments and a binding that doesn't exist, limit
levels were off by one, and the characters are now updated in place.
- Fix recalculate_stats crashing with armor materia in a slot where the
weapon has none (it looked in the weapon).
Stats
- Equipment and materia bonuses were never applied: they were walked with
ipairs although the stats are keyed by name. Use pairs, and read the
accessory bonuses from the accessory instead of the armor.
- The installer wrote the stat ID instead of the bonus amount for weapons,
armor and accessories.
Controls
- New InputManager::IsGameEventPressed, to poll the controls through the
game events and honor the keys chosen in the controller settings.
- is_key_on translates the pad masks to game events instead of fixed keys.
Menu, Extra, Select, Start, L2 and R2 are now mapped as well.
- The world map moves with the walk events and leaves a vehicle with
CANCEL.
- Only letters and the space bar reach the scripts as raw keys. The name
menu uses Config.CONTROLS, and a letter that is also the OK key types
instead of confirming.
- While the name menu is not enabled (NameMenu.enabled), the characters
get their default names and the game goes on.
57f8cc72f1 Menu overhaul: shared menu library, new menus, settings, and fixes
Menu framework
- New menu_lib.lua with Cursor, ListCursor and a Menu state machine that
replace the nested current_menu/current_submenu ladders. Shared helpers:
grid_buttons, set_bar, set_limit_bar, exp_progress, cursor_memory. A menu
that gives the control back runs the on_resume hook of the receiver, so
the main menu refreshes after its submenus close.
- Pause, begin, save and main menus use the framework.
- Maximum HP and MP shown in menus now include equipment and materia.
New menus
- Status: three pages (stats and equipment, elemental, status effects).
Character effects come from the new character_effects.lua.
- Order: toggles the row of a character and moves its portrait.
- Limit: Set and Check modes, per-level technique lists and a confirmation
to change the level. The installer now reads the limit technique names and
descriptions (attack IDs 128+) from the kernel.
- Quit: confirmation window that closes the game.
- PHS: swap characters between the party and the reserve. Locked
characters can't move, the party must be complete, and the reserve keeps
the places of the portraits. The field opcodes MMBUD, MMBLK and MMBUK are
now decompiled to set_character_enable and set_party_lock.
- Magic: magic (one row per materia), summons and enemy skills in a grid with
descriptions, MP cost and uses. Cure and Life spells can be cast on a party
member from the menu. New character_abilities.lua computes the abilities
from the equipped materia.
- Config: window color, sound, controller, cursor, ATB, battle speed and
messages, movement, camera angle and magic order.
- Window color: four corners with RGB sliders, applied to every window.
The engine marks window backgrounds (window_background) and exposes
ui_manager:set_window_colours and widget:set_colours.
- Sound: music and effects volume (0-4), applied at once through
audio_manager:set_music_volume and set_sound_volume. The music volume
also controls the audio of the movies.
- Controller: the player can assign a key to each action, including the
directions. Changes are applied and saved in controls.cfg, which the game
runs after config.cfg, when the window is closed and the keys are valid.
New input_manager functions to set, get and capture keys, the console
command set_game_event_keys, and the menu directions are now game events.
- Cursor memory (menus and battle), ATB modes in battle, and walk or run by
default (entity_manager:set_player_default_run) are working. Camera angle
is stored only, as the battle camera doesn't move yet.
Fixes
- Item menu: wrong item selected and crash on the first item.
- Equip menu: list off-by-one, and weapons lost after one swap.
- Materia saving: character IDs were stored as materia IDs, and armor
materia used the weapon data.
- Savemap: fix the XML loader (materia indexed by materia ID, enemy skill
read into AP), saving the stash and enemy skill elements, and the copy of
the window colours. The maximum colour is now 255.
- Fix the text colour of the options of the config menu, set_party and the
party add and remove functions, and the field names of the character
enable and lock.
- Accessory elements now keep their mode, like armor.
Cleanup
- Remove the dead prototype and unused data and texts.
Known gaps: the settings are not saved in the savemap yet, Added-Ability is
always "Nothing.", and the controller can't remap the keys of other modules
that read raw keys.
3b6d55ed8c Video playback, movie cameras, and audio fixes.
Videos
- The installer converts every FF7 movie with ffmpeg to a folder of JPEG
frames, an ogg with the sound, and movie.xml. It runs after extracting
the videos from a game disk and in the normal install.
- It also copies the camera of each movie from moviecam.lgp (camera.cam).
- New MoviePlayer and MovieState draw the frames at 15 fps behind the models
and follow game speed. A movie with a camera takes the place of the
background tiles; the models are drawn over it with the camera of each frame
and hidden in frames without one. A movie without a camera covers the field.
- The movie opcodes PMVIE, MOVIE and MVIEF generate movie_player:set(name,
scale), play() and get_frame(). The movie names come from FF7.EXE. play()
waits for the end of the movie in the script that calls it.
- The sound plays in its own audio channel.
Audio
- Fix a crash and music stutter: a stopped player kept the id of a source
that OpenAL could give to another player, so it freed its decoder twice and
consumed the buffers of the other one.
- Просмотр сравнение для этих 9 коммитов »
5 часов назад