The tech room loop checked that all the lines could fit in the available screen real estate, but it didn't check to see that the number of lines was less than the array capacity. Normally this never happened, but certain mods which use smaller fonts will overflow the limit. This adds a proper bounds check and also increases the bounds so that more of the smaller lines can be used.
The tech room loop checked that all the lines could fit in the available screen real estate, but it didn't check to see that the number of lines was less than the array capacity. Normally this never happened, but certain mods which use smaller fonts will overflow the limit. This adds a proper bounds check and also increases the bounds so that more of the smaller lines can be used.
Follow-up to #3137. I missed two important details in the first implementation: the triggered animation needs to be an "initial position" type, and `model_update_instance` needs to be run on all subobjects, not just turrets.
This should really fix#3123. I still can't see the destroyed collector, but the Rahu no longer flickers when it spins around.
These two situations mostly relied on the obsolete model code which didn't include model instances. Data for submodel positions and for whether a submodel is blown off are now stored exclusively in model instances, not the model itself.
This fixes#3124.
Remove One Source of Client and Server having Different Timing
Multiplayer *must not* have its time affected by being in the background, because their clocks will come out of sync and movement from an out of focus multiplayer instance will appear to move in slow motion. This fixes the timing discrepancy by only doing os_sleep when unfocused when in single player.
The background validation checks are somewhat convoluted, and misleading with multiple backgrounds, so this PR disables the standard main-background check if FRED is running. It then adds a new FRED-specific background check that covers all backgrounds.
Additionally, this PR fixes a bug in an error message in `stars_get_first_valid_background`.
Fixes#3116.
As described in #3079, the old parsing of fvec and uvec used strtod and some POFs rely on this format. This is a quickfix that uses the new parsing method for only `get_user_vec3d_value`.
It appears that live debris is not supposed to have a parent submodel; see the retail NTF Boadicea. This removes the parent from any live debris that might have it.
This should fix#3078.
This is the recommended way to set this up.
Using this technique allows the user to replace the launcher with any
number of combinations of solutions such as
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache:distcc
Supported since CMake 3.4. On previous versions of CMake, it will just
ignore this setting.
For compatibility purposes some mods want alt names to truncate at the hash symbol. But we can't actually do that at mission load,
since we have to save them again in FRED. So this commit processes the names just before the mission starts.
To further complicate things, some mods actually want the hash to be displayed. So this commit introduces the double-hash as an escape sequence for a single hash.
I just tried building 21.0 which is a higher version than the one used
in the test data which broke this test.
This should be a high enough version to not break any time soon...
If SDL completely fails to get its preference path, at least warn the user so that it doesn't crash straight to the desktop without creating a debug build.
In the particle effect code there is a small hack required for getting
some constant pointers in a vector. However, there is another mechanism
where sources are not added to the sources vector if the sources are
currently being iterated through. That is necessary to avoid
accidentally invalidating the iterators.
The issue here was that the vector resizing hack was not applied to the
correct vector when we were currently iterating. This fixes that.
This fixes#2928.
This was 20.1 since I erronously thought that the "current" nightly
version was lower than that. This updates the version to a release that
has not been built yet.
When weapon info flags were changed to the flagset model in #851 (commit 127976cd74), two instances where `WIF2_CAPITAL_PLUS` was either actively desired or passively not prohibited were lost in the transition; this commit restores looking for `Weapon::Info_Flags::Capital_plus` when targeting a big ship, and no longer prohibits capital+ weapons from being selected if a bomber+ weapon is sought and smart secondary weapon selection is enabled.
This works around the Windows only limitation where the standard random
function only returns up to 2^15 which limits how many vertices in the
model can be picked.
Since we already have a function that handles this properly and returns
values in the entire integer range, using that fixes that low limit.
- use correct macro for player_id
- support more subsystems
- optimize size of secondary weapon info
- handle future compatibility issues with secondary ammo
(based on PR 2109 by Cyborg17)
- support compaign descriptions (Mantis 1826)
- allow sending multiple packets to get entire description
- update description of selected game on join screen if needed
- chnage op count data type to short
(can't have more space than that anyway)
- get rid of some loops in favor of plain memcpy()
- fewer magic numbers
- use SEXP_MAX_PACKET_SIZE to fix packet size discrepancy
These macros will grab a known sized block of data without
any manipulation. Should only be used with data which is
serialized/deserialized in another part of the code.
- add bfi_flags
- add proper bank/point data for fighters
- allow for more than 255 subsystems
- add data for targeted subsystem
- add support for TARGETING_COORDS flag
- add support for FLOATING_BEAM flag
- add fire method
- add initial packet support for type F beams
- use standard ADD/GET macros
- better detection of size issues
- support SHRT_MAX ship types
- support SHRT_MAX weapon types
- use MAX_WSS_SLOTS & MAX_SHIP_WEAPONS safely
- support sound indexes higher than 254
- ADD/GET_STRING() will use 1-byte lengths (up to 255 chars)
- ADD/GET_STRING_16() will use 2-byte lengths (up to 65,535 chars)
- ADD/GET_STRING_32() added for compatiblity (game_active packet only!)
* Expose disposing FBO's (with the option to keep the Bitmap Alive) to scripting
* Modernize nullptr
* Moved RenderTarget clearing to own public API
* Fixed Obsolete Comment
* Fix bad deletion of FBOs
* Resolve Memory Leak
* Change FBO cleanup to not reuse old ID's
* FIx oversight
* FIx oversight 2
By only looking at the HEADs of the respective branches, we included
irrelevant changes in the diff passed to clang-tidy-diff so it was
possible to generate irrelevant warnings in a PR.
Since instance-specific fields have been moved to polymodel_instance and submodel_instance, the gun_submodel_rotation field should also be moved. This is also reworked a bit to keeping track of the rotation via the normal submodel instance angles.
This removes an unnecessary look_at field as well.
Since angles are no longer written in three redundant places, the temporary hijacking of the turret angles in `model_make_turret_matrix` was overwriting the turret's proper position. So this PR just saves the angles and restores them when the calculation is done.
Since that function already has full support for UV scaling it makes
sense to unify the behavior in one function instead of having a separate
monochrome function that does weird things.
Also deprecates that function since all its use cases are now covered by
drawImage.
This uses GitHub actions for building Linux and Windows builds for
release tags.
Appveyor is now no longer used for building distribution packages and is
also not used for anything relevant anymore. If this works properly we
can disable that PR check to get better PR scalability.
This makes the workflows easier to manage, makes those build steps
reusable, and allows for easier migration to other CI services should
that be required at some point.
There were null checks for `Player_obj`, but whoever added the `No_pain_flash` flag bypassed them by dereferencing `Player_obj` in the top-level if() block. This caused a crash when self-destructing ships in the F3 lab.
This PR moves the `Player_obj` check to the top-level block (which is also an implicit null check because `ship_objp` is not null by this point) which fixes the crash and also is more efficient.
Also run distribution builds in container. This uses the same container
for building PRs and distribution packages to ensure consistency
between them.
Also tries to fix an issue with a missing environment variable for the
tests.
This just introduces the previously Travis integration and moves it to
GitHub actions.
This also found various issues around our libc++ support so I fixed that
as well.
This will make our builds independent of the underlying system and allow
for more reproducible builds since everything uses the same compilers
and environments.
* Keep ships that we are centered on from moving
This prevents NAN from appearing from obscure vector math somewhere in the depths of fred.
* Also fix movement of centered objects in qtFRED
* Can't simply use the previous fade_out color as the default, because of an edge-case with legacy usage. The refactor would disallow setting the fadout to black.
This is a follow-up to PR #2942. Given that the short-circuiting is now explicitly skipped for node trees containing the special argument, it should no longer be necessary to flush the conditional branch of the sexp tree. (The .cache field is already skipped for special-arg nodes.)
The sexp tree is still explicitly flushed for `every-time` and `every-time-argument`.
It takes a number as a maximum number of arguments that can be evaluated in a single call, but otherwise behaves very similarly to `any-of`; alternatively, if the number is 1, it's like an `in-sequence` that also skips arguments that don't satisfy the condition instead of just invalid ones.
There are some possibilities where we could get an expired pointer when
we create a persistent particle. This adds a check for that to avoid
crashing the engine in those case.
This is related to #2928.
* Should fix some crahes and inaccuracies at high pings
Feeding the wrong index to the rollback struct is a bad idea.... That's late night coding for you.
* Forgot one correction
* Also update the comment.
This is necessary for multi to ensure that music is stopped.
common_select_close() would do this, but it's never inited for
these screens. So we need to manually do it if we aren't
transitioning to a screen with common_music.
* Multiplayer Dumbfire Rollback
This creates a packet that sends the relative position and orientation info for a primary or dumbfire missle shot. The client creates this packet when firing those two types of weapons and sends it to the server. The server goes back to the frame that the client fired the weapon and quicky resimulates all the frames in-between.
This includes collision detection, restoring positions, orientations and veloicties, but not subsystem orientations.
* Address Feedback
* allow clients to send subsystem info
* Check for object number not weapon number
* Readability Adjustment
In commit 3b2af702f7, the hash truncation was changed so that instead of being part of the HUD, it's stored as the class's display name. However, this action was performed before `+Use Template:` was parsed, which would then overwrite the display name and clear the `Has_display_name` flag. I've moved it so that it now happens after the copy operation (and added a check for an existing display name, in case the template defines one). I use a new boolean variable to indicate that default display name creation needs to happen rather than duplicate that code.
Fixes#2834, a bug where non-capital ships did not generate debris pieces from their hull. It turns out this bug was introduced in #2416. If the `DoesNotExpire` flag is substituted for the `lifeleft` variable , it should be done in all locations.
The multilock patch did not handle `Lock_anim` in the best way, and handled `Lock_gauge` in a very bizarre way, despite the fact that they are two simple hud animations. This changes the `lock_info` struct to track the correct `time_elapsed` value for both, and changes the locking code to use the values in the correct way.
Additionally, this properly loops the lock triangles on the FS1 lock indicator. Strangely, even prior to the multilock merge it appears that the triangles wouldn't have animated more than a quarter turn.
Finally, this prevents the FS1 lock indicator from blinking, since in retail FS1 it didn't blink.
Tested with FSPort and no-mods. Fixes#2826.
Code was moved around between 3.8.0 and 19.0.0 which broke the colored backgrounds of paletted HUD gauges.
Palette index 15 is used by the HUD gauge graphics to indicate background area of HUD gauges. When the code to remap palette indexes to alpha values was moved to packunpack.cpp, palette index 15 was mistakenly mapped to the alpha for index 0 (nothing) rather than index 1 (what retail/3.8.0 code maps it to) causing all HUD gauges to be missing their dark transparent backgrounds.
Also: the code maps palette indexes [0, 15] to alpha values [0, 255]. But due to an oversight (palette index 15 not being part of this gradient] alpha value 255 is never used so the range of alpha values for HUD gauges ended up being [0, 238]. Conversion math tweaked to make the alpha range [0, 252] which is very close to 255.
This will make it easier to have a graphics interface without relying on
global objects since the object can be kept alive in the function
object. No other functional changes since the existing syntax is also
valid for function objects.
A follow-up of sorts to #2801, but independent of it. If a directive line is not split, the HUD should handle it properly rather than Asserting and displaying the same line twice.
If you create a kamikaze ship with ship-create, it won't work properly, because the explosion values are not initialized to -1 as expected. This fixes that.
This is basically the tutorial from vulkan-tutorial.com adapted to using
VulkanHpp and with some refactorings that extract some locigally
self-contained code.
Currently only draws a simple colored triangle.
If a message string contained a word that was too long, on its own, for the available screen real estate, the function wouldn't split the string at all. The new behavior is to split the string even if the split location is suboptimal, since it's better to have as much of the message visible as possible.
Quoting from the code:
```
// only update the line break if:
// a) we don't have a line break yet;
// b) we're still within the required real estate
// (basically we want the latest line break that doesn't go off the edge of the screen,
// but if the *first* line break is off the end of the screen, we want that)
```
This was the last thing that was missing for complete support of all
function parameter declarations.
To ensure parameter lists stay valid a unit test was added that will
validate the argument lists and cause the test to fail if they cannot be
parsed.
This one line fix properly specifies which ship to use for ETS managment. The recent merge of `Non-shielded ships manage ETS` had a object reference error, so this rectifies that. Thanks to Axem for finding this!
* Object Update Refactor
1. Keeps the object update packet aligned, even if the ship is dying or has not yet arrived on the client.
2. Properly handles model point shields (yes, that's what was causing multi to crash the most!)
3. Reworks positional interpolation timing and adds rotational interpolation, by sending timing information with every object update packet in a header shared between objects.
4. Saves a lot of bandwidth by only sending data that is changing. (no more sending all subsystems once per second!)
5. Better handles out of order packets (but can still use their information if recent enough!)
6. Builds the basis for Rollback by beginning to record the positions and orientations and velocities of ships for the last 30 frames.
7. Adds subsystem rotation -- Yeah, you saw that right, subsystems will now spin in multi.
8. Waypoint movement is now enabled via sexp, and time to arrival of waypoints is updated on the target info gauge.
* Fix edge case crash and Incorporate feedback
* Clean Up Interpolate Angles Quick
* Restrain the client
* How was this still here???
* Make sure every part of OO uses OOC_INDEX_NULLPTR_SUBSYSTEM define
* Fix Way to Store Return Values
* Ok travis, we get it
* Ok travis.........
* Fix underline length calculation in message scrollback
* Use SCP_string for message source (which allows ships with long display names to work without crashing) and message text
* Upgrade assorted functions to work with SCP_string
Using the `No_shields` flag for ships is common usage in multiple mods, and as it turns out ships with that flag set will not have the AI manage ETS values due to an early return in the `ai_manage_ets` function. This PR adds an AI flag to allow ships with no shields to manage ETS regarding weapons and engines. This flag was tested and works as expected.
Previously, if a script called a function that called another scripting
hook, some hook variables might be removed. This was the case since
after executing the hook the code would remove the set hook variables
again. If these variables had the same name as previously set variables,
they would overwrite and corrupt the state the original script expected.
This was unexpected behavior for script writers so this puts values on a
stack and only adds or removes from the stack instead of overwriting
values. This should make the hook variable state consistent for scripts
even if scripting hooks are called indirectly.
When flags are parsed, they can be reset. This is a problem for flags that are set based on lines elsewhere in the entry, so each table uses its own method to get around it. However, not all flags used this method - particularly the new Has_display_name flag. This brings the flag management up to date.
This is an effort to be able to use the same GLSL code for both Vulkan
and OpenGL. This is done by first compiling the Vulkan GLSL code to
SPIR-V and then using a custom tool (which uses SPIRV-Cross) to convert
that back into GLSL 1.50 compatible code.
The required tool will be downloaded by CMake when glslc is found in the
path. This is included in the Vulkan SDK. To avoid having a hard
dependency on this, the generated files are included in the VCS and are
only regenerated when glslc is found on the system.
The scripted code previously didn't check to see if a weapon bank was valid before firing it, which could have led to memory problems and starting March 15 would actually crash the game. This adds a few safety checks.
This PR adds a table entry that allows modders to specify the damage threshold for when turrents become less accurate due to weapon subsystem damage. A Game table setting is easier to set once and tune, thus this PR allows that efficent exposure to the modder and does not require a large change or complex table entry.
I have been thinking about some shader related techniques for the Vulkan
renderer and for that we will need to add embedded files in a different
environment than they are right now since the actual shader code will
not be needed in the engine.
For this reason, I extracted the "default file" mechanism to be more
generic so that all that is necessary to include a file is to just call
a custom CMake command and the function keeps track of what needs to be
done.
Also, since the "generic" code has worked pretty well so far I see no
reason to keep around two systems which just increases the amount of
code we need to maintain. So, I just removed the windows exclusive
implementation. Now all platforms use the same "generic" way of
embedding files.
The weapon loadout arrays wasted a ton of memory in several ways. First, only friendly fighters and bombers have weapon loadouts; most ship classes do not need this storage. Second, as DahBlount noticed, only 8 bits are needed for the flags, while the fields were using standard 32-bit ints. Third, there are currently 500 weapon types but most loadouts only provide a dozen or so options.
This refactors the loadout storage to keep a short vector of weapon-flag pairs for each bank, and the bank storage is allocated only when needed. The new `allowed_weapon_bank` class provides `operator[]` implementations so that the new API is almost completely compatible with the old one. The only things that require the new API are assignments, since `operator[]` is read-only. (A writable `operator[]` would not be able to tell when a flag value of 0 should be stored or not.)
This gives every document their own environment instead of using the
global environment. Previously it was necessary to store variables in
the global namespace since otherwise they could not be accessed by event
listeners.
This creates a separate environment table for every document so that all
<script> blocks and event handlers share the same "global" environment.
- support sync state before entering mission
- return to briefing for sync and stats saving
- handle campaign progression properly
- initialize net_player state properly (fixes#2560)
When I wrote the original change to a vector instead of an array, I was working on the assumption that this section of code was parsed after some other code that had already made sure that the special_char_indexes vector was at least three entries. Further testing has revealed this is not true, and this fix keeps it from crashing.
This PR adds a scripting hook which triggers when a ship fires a countermeasure. It has two variables, the ship firing the countermeasure and the number of countermeasures remaining. I have tested and it works as expected. This new hook complements the preexistsing `On Secondary Fire` and `On Primary Fire` hooks.
This can be used by script code for reliably storing Lua values without
having to build a custom serialization format.
The C++ code can also be used by other code modules that want to
serialize data. The new classes simply return a byte array with an
unspecified format.
At the moment this uses a plain JSON encoding but could be extended in
the future to include either compression or BSON encoding if necessary.
The format is future compatible by using a simple header to identify
different kinds of formats.
PR #2718 introduced the Has_display_name flag, but for mission parsing, the parse object flags were cleared subsequent to their assignment. This moves the flag reset earlier in the function.
Rampage noticed that the dialog would save a fiction viewer entry in some cases even if there was no story file. This makes the handling a bit more robust.
Also slightly optimizes some of the hooks because the adding/removing of hook variables should be guarded by the same if() block that controls execution.
1. Stores the filename from the table Parser into the font struct so we can lookup fonts via their filename.
2. Allow "+Special Character Font:" to specify the first entry with the same filename's special character index for their own special character index, provide a default if not, and allow the moddert to specify them manually, but do not override already recorded values if the default is picked in order to protect retail behavior.
3. Vectorize Special Character Indexes, so that we don't have a table limit that will randomly crash FSO based on what table you happened to write! Woohoo!
This makes the red-alert SEXP execute properly in multiplayer.
Note, this is just the SEXP. Multi-knowledgeable people will need to evaluate `red_alert_start_mission` and `red_alert_maybe_move_to_next_mission` to make sure those functions will work properly in multiplayer.
The previous version used the wrong function for the map and so values
added later were not written to the map and so not available to Lua.
This fixes that by using the simple array operator.
Fixes 2526 by making the array a vector and also adds a Shockwaves always damage bombs game_setting.tbl setting and a Shockwaves_consistently_apply_damage game_settings.tbl setting. The second one keeps bombs and asteroids from being hit more than once by shockwaves, like ships do!
This is a follow-up to #2100. Don't pause/unpause the audio if we are moving from/to the Control Config or HUD Config screens. We could hit F2 and move around a bit before resuming the game, so we don't want the audio to resume until we're ready.
Collision groups as previously coded were unusable due to Lua 5.1's lack of support for bitwise operators. This fixes that deficiency in two ways:
1) Objects now have the functions `addToCollisionGroup` and `removeFromCollisionGroup`
2) An `evaluateNumericSEXP` function has been added for returning SEXP results as numbers (so that the bitwise SEXP operators can be used)
At least on my system that saved ~25% of the compile time (2:01 to 1:33)
so it appears that this is indeed something that help compile
performance.
Also does some house cleaning by using the new PCH command of CMake if
it is available which reduces our dependencies.
The previous system was kind of hacky and made things a bit inflexible.
This improves that system quite a bit and also adds unit tests for the
hook variable functionality.
With dynamic debris, as soon as the Debris vector was reallocated it invalidated the `prev` and `next` pointers. I figured out how to dispense with the actual list entirely, since we mainly need to know how many hull debris pieces there are and whether an individual piece is on the "list".
This is a follow-up to #2649.
Try and Fix non windows compile errors
Fix Linux complete error(Hopefully)
More Linux fixes
Nearly There
Maybe?
Why were these in the original? They're never used?
Admiral Nelson led me to discover that the HUD gauges expected "right" or no string at all for the gauge alignment. I added basic recognition of LEFT and RIGHT alignment. Someone more familiar with the HUD than me can flesh it out more.
This allows the coder to test for the existence of a hook variable by comparing it to `nil`. The engine will currently error out and crash if you try to access a nonexistent table field, which is useful for catching typos, but has the disadvantage of disallowing a perfectly reasonable Lua coding practice. So this change checks whether the missing field is part of `HookVariables`, and if so, rather than throwing an error, it just prints a message to the log.
This adds full modular table support to mainhall.tbl, allowing subsequent tables to override previous main halls, and enabling use of the +nocreate option.
Several things going on here:
1) refactor `get_display_string()` to `get_display_name()` to be more precise
2) likewise, refactor `alt_name` to `display_name`
3) automatically generate display names when parsing the ship, ship class, and weapon class for the first time
4) remove the on-the-fly truncation of names with hash symbols
Basically this subsumes the `end_string_at_first_hash_symbol` logic into the display name. Rather than truncate the name every time it's displayed, truncate it once when it's parsed. This takes advantage of the previous display name infrastructure, since display names are a superset of the case of truncating the hash symbol.
This also has the benefit of now allowing hash symbols within display names. When updating Destiny of Peace, I noticed that "Lockheed Shuttle #4" would no longer display properly; and it was not previously possible to fix this even with display names.
I could pull out the `get_display_string()` and `alt_name` renaming into a separate PR if desired.
This adds the Vulkan code for choosing a physical device, creating a
logical device from that and then initializing a swap chain.
This also contains code for filling out the graphics API pointers with
stub functions so that the API functions can be developed gradually.
These changes allow FSO to "run" with Vulkan but nothing is rendered
yet.
First, in hudartillery.cpp, change some errors to warnings (actually error_display(1, ...) to error_display(0, ...), but same difference).
Second, change a Warning to an error_display(0, ...), and make it actually name the SSM strike instead of just reporting the name of the weapon it's using.
Third, do the weapon_info_lookup() earlier so we can use error_display() to point to the right line, and tell the modder that an invalid weapon invalidates the entire SSM strike (instead of just silently discarding the whole thing at the end).
Finally, in weapons.cpp, change validate_SSM_entries() to mention if Ssm_info is empty (instead of, say, telling the modder that the index needs to be between 0 and 4294967295—or, rather, -1 expressed as an unsigned 32-bit integer, since Ssm_info.size() - 1 is, indeed, -1 when the vector is empty).
This does two things:
1. Use thin archives which speeds up static library creation by only
storing references to the object files instead of copying them all
2. Allow to use the gold linker with GCC along with an option for
incremental linking. Since this is undesirable for non-development
builds it is disabled by default.
Back in PR #2390, I fixed translation behavior in `lcl_ext_localize_sub` for SCP_string, but neglected to also fix it for `char*`. This PR remedies that.
I also added `!=0` to the string compare to match the `!=0` used with `strcmp`.
Just for sanity's sake. This just displays a Warning without modifying the dockpoint name. I considered an nprintf but figured a Warning was more appropriate.
This can be used for producing even leaner builds for standalone
servers. It also provides a nice architecture verification since now
using internal OpenGL functions will cause a compilation or linking
failure.
These sexps work just like for-counter, supplying arguments for when-argument. They will list all ships that are present in the mission and are of a certain class or type.
This fixes three issues where the Lua stack was not cleaned up properly:
- On hook execution, the return value was left on the stack
- For ADE initialization, the global tables were left on the stack
- In libRocket, a metatable was left on the stack
This allows a script to create its own execution context so that it can
control when a coroutine is valid to play based on custom data.
Also adds a function which causes a coroutine to end in an error.
GCC 10.1.0 complained about the filename overwriting itself in the old version of the code. This was a false positive, but the code wasn't terribly clear, so I cleaned it up a bit.
These variables can be used for changing the behavior of the ade_ API
functions. However, they apply to all the ade_get calls so if there is a
call to ade_get_args from an ade_get_args call then it will reuse the
previously set values and produce incorrect results.
This captures those variables as soon as possible and then resets them
so that subsequent calls start with the default values for those
variables.
This emulates the "scrolling text" effect that is present in briefings.
It is not exactly the same since it just goes pixel wise and not by
character but it looks good enough.
After the multilock PR #2207, ships without secondary weapons will crash the game. This can easily be seen in the very first training mission of the FS2 main campaign, and it is due to an invalid bank access in `ship_stop_secondary_fire`. The `current_secondary_bank` is 0, but there are 0 secondary banks. The Assert catches this, but that's not enough.
This change fixes the crash, as it initializes the current banks to -1 instead of 0. However I'm not familiar with the new multilock way of doing things so I can't say if that is correct in all cases.
The previous API only allowed very limited access to the audio stream
system. These changes add full support for playing all types of audio
streams via a dedicated API.
This allows external libraries to load the Lua API from our executable
even if it is linked statically. This is useful for a Lua debugger which
needs to interact with the Lua API.
This is specifically for OPF_SHIP. Currently if you specify a LuaSEXP with OPF_SHIP, it only works for ships that are present in the mission when the SEXP is called. This is my attempt at a LuaSEXP parameter variant that will return a valid ship name regardless of the ship status. It required a bit of finagling the existing API.
Previously, `ai_link_energy_levels_always` or `ai_link_ammo_levels_maybe` could allow a ship to link weapons even if the `No_primary_linking` flag was setfor that ship. This PR fixes that by added a check for `No_primary_linking` before `ai_link_energy_levels_always` or `ai_link_ammo_levels_maybe` is evaluated.
In most cases you have one group to/from which you are adding or removing several ships, but the existing sexps are designed for one ship and many groups. This adds new sexps designed for one group and many ships.
Leaving the ability to go onto the multi screens will cause undesired behavior and asserts. (like trying to validate the tables when there is no connection in the first place.) Also only sets the game state to multi once we're sure that we're going to enter a multi game.
When I rewrote `strip_comments()` to take quotes into account, I didn't correspondingly update `get_line_num()`. This fixes that. I discovered that a Lua file with a lot of semicolons inside quotes was erroneously getting the past-EOF warning.
Also, in the event that the warning *is* tripped, this exits the loop instead of repeatedly displaying the warning.
Team Leader function was returning 0 instead of 1 when the team captain was messaging AI.
This optimizes, cleans up, and gets rid of edge-case buggy behaviour. Thank you ship_registry!
For older campaigns which used show-subtitle, the eval_num conversion inadvertently changed the rgb to default to 0, instead of 255. This restores the default to 255.
1) Upgrade the pilot file code to correctly save flags whether entries are added *or* removed
2) Make the tech-db/tech-db-multi ship flag handling consistent
3) Add scripting support for intel entries
4) Add scripting support for adding and removing entries from the tech room
5) Minor cleanup
The functions derived from `vm_vec_mag_quick` run *slower* than `vm_vec_mag`, according to @Baezon who did some testing. So this PR makes all calls to the _quick functions use their more accurate counterparts.
1) Write all non-UTF-8 strings to JSON, either by converting or truncating
2) Add `coerce_to_utf8` function
3) Tweak `read_raw_file_text` because the function returns length on success, not 0
This was a fun one. Volition used a bizarre and very poorly named "flag" static variable to track iterations through the `verify_and_fix_arguments` function. I'm not sure how this actually works, but on comparing with the original public source code I see that @asarium didn't quite fix the "declaration masks class variable" compiler warning the right way. This rolls back that 2016 change and fixes it properly.
The effect of this fix is so that FRED will correctly handle arguments when node data types change, such as when the modify-variable argument is changed from a numeric variable to a string variable.
The #2528 fix broke ships destroyed before mission start because their arrival delay was *already* set up (as a bogus timestamp). So this change adds a special exception for that.
Properly whacks all ships that are docked together when any are whacked, makes everything more consistent by calling ship_apply_whack instead of physics_apply_whack, whacking in general now unrotates its hit pos to get a world pos like physics whack was expecting and adds a few matrix helper functions.
Standalones would crash if they had an error dialog pop up because of a nullptr. This just checks for the nullptr and returns early to prevent the crash.
There was an AI class validity check for the pilot, but not for turret weapons. This fixes that.
Also, the p_object parameter to this functino was named `objp`, which is misleading because that's usually used for object. I renamed it p_objp.
This just uses vm_vec_normalize_safe. If two objects spawn on top of each other, the code will now sort them properly without printing a null vec3d warning.
FRED's handling of mission loading and creation is a bit wonky. The `stars_post_level_init()` function should run for each new mission, not just once when FRED is started. That fixes a background editor crash and I also did a bit of other cleanup.
This adds a "clear-debris" SEXP with a new system for declaring SEXPs
outside of sexp.cpp. This makes it easier to keep code modules self
contained since they do not need to export previously private
functionality just for having missiong being able to interface with it.
This is mostly a proof-of-concept which only supports basic parameter
types (booleans and integers).
The ship registry previously stored the ship name as a pointer, but that pointer was reused when subsequent waves of a wing overwrote a p_object from the first wave. So, the name is now copied into an array.
Additionally, subsequent waves of a wing are now "eagerly" stored in the ship registry so that the p_object reference can be stored as well.
For quite some time missions have had the ability to edit more than one background. This was previously used for fallback loading in case the first background's bitmaps were not available, but I realized it would be very handy to allow switching between backgrounds for in-mission jumps.
The FRED background dialog can now add and remove backgrounds from the list. Additionally, a new `change-background` sexp can instantly switch between backgrounds without messing around with bitmap references.
Tracked down another Volition bug, first reported by recead. When messages do not have the ": " substring (which only happens when they are from MSG_SOURCE_NONE), they would calculate the wrong string size. This is because the two-character offset was added to the pointer *before* the pointer was checked for null, and so non-matches were considered matches with strings beginning at memory offset 2.
Volition's arrival code used eager evaluation of arrival cues even before the mission was finished parsing. With the new sexp optimization code, this can fail because the sexps can depend on ships which are not even parsed yet and thus are not in the ship registry. So I moved the arrival_delay initialization and added some comprehensive comments explaining what is going on.
1) Prevent ships from turning in `ai_turn_towards_vector` if they have the `immobile` flag. This was missed because it is a rotation that doesn't originate in `obj_move_call_physics`.
2) Prevent ships from evading shockwaves if they're playing dead.
Also there is a small conversion of an int to a bool.
The cause of the #2512 bug was using the new main hall to look up sounds from the old main hall, which would crash in several cases. The lookup was performed when testing whether or not to truncate a door sound when changing screens or states. Dan Wentz requested that "glowy" sounds not be truncated, so this preserves that check. Rather than test the indexes of the door regions, this tests the indexes of the sounds in sounds.tbl.
Right now the retail sound indexes are hard-coded, but it would be easy to make this configurable from mainhall.tbl if modders wanted that ability.
This fixes#2512.
The ship table value `+Weapon Min Range:` was ever used for turret firing calculations. This PR adds it as part of the cacluation for other instances, but only if the AI flag `Use_actual_primary_range` is used.
Previously a ship's shields and weapon regeneration per second rates were only stored in the ship_info strut, thus they should not be changed during a mission or via scripting (see #2236 and and #2239). There are many precedents for taking a ship_info value ans copying it to a ship_object value so the value can be changed on a per ship basis in mission (auto aim FOV is one of many examples). This PR thus copies the shield and weapon recharge values to the ship_object and exposes those new values to scripting.
1) Something wookieejedi noticed: destroying all turrets didn't trigger the DISARMED mission log event. This is because a code ordering decision intended to accommodate the destroyed check caused the hitpoints to not be correct when they were checked within `do_subobj_destroyed_stuff`. Instead I changed the blow-up check to use the same code for set-strength as for sabotage-strength. This handles destruction properly and also tracks hitpoints properly.
2) Aggregate points were being recalculated for every subsystem operation where they only needed to be recalculated at the end of the sexp, so I moved that.
Many physics values are exposed to scripting, including rotational damp. This PR exposes the linear damp to scripting. Note that in the code the linear damp is called `side_slip_time_const`.
This adds access to the command briefing data parsed from the mission
file to the scripting API so it can be used by the UI scripts for the
high res UI.
Also switches the animation support to using the generic anim to use
streaming to improve performance.
Fix the waypoints-done-delay sexp to work for both ships and wings.
Also, fix the set-object-speed sexp (which is deprecated anyhow) to work for all ships in a wing, not just the wing leader.
Previously, the default distance for determining if a ship had finished a point in a model path was only 5. This worked fine for ships with low damp or no Newtonian physics. However, it did not work well with ships that use higher damps or Newtonian physics, becuase those ships contiunatlly overshoot that 5 meter distance and get stuck flying in a large circle trying to reach that point. This fix allows modders to set an AI flag to specify that the path distance check uses a larger value of 775 for points that are not the last point in the path. If desired I can add a game settings option that allows modders to set this value.
I added a pretty generic container structure for the scripting
documentation when adding JSON output. However, I did not use that new
structure for the HTML output since that was just too much work.
This moves the HTML output over to the new structure so now the
scripting API handling code is independent from how the resulting
documentation is generated. I also moved that code out of the main
scripting code which removes quite a lot of clutter in those files.
This is mostly a straight port of the old code with no significant
changes (except the changes to make it use the new data).
As noticed in issue #2458, intercom sounds did not stop when pausing the game or loading a mission. I fixed this by augmenting `main_hall_stop_ambient()` to also stop the intercom.
Additionally, it turns out that the intercom delays were not being calculated correctly due to a very bizarre random number formula. I overloaded `rand32()` to add a min/max variant and used this instead.
When special arguments are used, the current node cannot be cached because it always contains "<argument>". So this feature adds the ability to forward the caching to the SEXP node that contains the value being referenced. To enable this, the internal argument list now contains both the argument text and the node being referenced. (If there is no node to reference, such as with `for-counter`, the reference will be -1.)
This adds an Antlr grammar for parsing argument lists instead of using a
hand written parser. This allows to write much more complicated syntax
constructs and have all the code being auto-generated. It will also
produce a much more correct parser instead of having all those hacks in
the hand-written one.
This also adds (in addition to supporting the previous syntax) support
for function types along with support for them in HTML and JSON output
formats.
The ANTLR generated parser is included in source form so that it is not
necessary to have an ANTLR installation around if you are not going to
change the grammar. Also includes the necessary runtime code from Antlr.
If a standalone has only one player connected in a dogfight mission it will crash. Not fully sure why this doesn't crash in other circumstances, but this check should just be here, anyway.
This is a follow-up to PR #2373. Tomimaki noticed that the first character was truncated in the cutscene description, and it turned out that the algorithm was slightly wrong.
Retail has a hud_find_target_distance function that returns the distance between the player position and a bounding box. This is useful for the HUD because it shows the distance to the perimeter of an object like a jump node or a large ship. However, this function was re-used for the `distance` SEXP, resulting in the awkward situation where the distance is measured from one ship's center to another ship's bounding box. This can lead to unexpected results and it also means that the SEXP returns a different distance when the arguments are swapped.
This PR deprecates the original SEXP and introduces the new SEXPs `center-distance` and `bbox-distance` which use consistent methods for both ships. It also renames the `distance-ship-subystem` SEXP to `center-distance-subsystem` and adds a new `bbox-distance-subsystem` SEXP.
Another - hopefully bite-size - sexp upgrade stage. This takes the objective SEXPs (those which are primarily concerned with the mission log) and upgrades them to use the ship registry.
This adds a mechanism for running generic operations at specific points
of the frame execution. This can be used by any part of the code an not
just Lua since it simply executes std::functions. It also adds an
"execution context" concept that specifies in which situation an
operation should be executed.
This is then used by the Lua Coroutines code for resuming coroutines at
specific points instead of always when the awaited promise resolves.
This PR upgrades the function, and the sexps that use it, to take advantage of the new sexp caching. It also makes `script_eval_multi` more robust in the face of players who might be respawning.
This adds a simple parser that takes the existing argument
documentations and parses them so that better documentation can be
generated from that information. This should be sufficient for providing
proper documentation generation for the most common and simple cases of
argument lists (type, name, possible default value, and optional
groups).
This will ensure that Lua functions will always be executed in the
correct Lua state. Since we now have multiple threads (which are
different lua_State objects) it is possible that the current code could
execute a Lua function in the main state instead of the thread that is
currently executing. This can lead to weird behavior and probably also
to issues inside Lua.
This can be used by Lua code to trace the runtime of their code in the
same way the engine already is capable of doing for most in-mission and
mission loading code.
Also adds some tracing scopes to the libRocket code
There is a slight discontinuity where ships that are destroyed have their mission log entries added a bit before `ship_cleanup` is called. This addresses that.
This removes `readability-avoid-const-params-in-decls` from the list of things clang checks. Function declarations and headers should be the same, so it makes no sense to warn about `const` in one but not the other.
This also alphabetizes the exceptions for easier reading.
Previosuly, using the script function ArmorClass did not properly display the actual armor class, instead it always displayed -1. This PR fixes that. I have tested these changes and they now proprely display the armor class.
This PR uses `eval_ship` and `eval_wing` to optimize `object_ship_wing_point_team` and `sexp_deal_with_ship_flags`. The API changed a bit, but to ensure compatibility, there are fields and functions to support the old behavior. These are temporary and will be removed when all changes have been merged via PRs.
This PR fixes the logic for setting weapon amounts for both the pilot and subsystems of a ship. Previoisly in #PR 2318 this distinction was not checked, so this PR properly adds that check and distinction.
This makes the necessary campaign room API available to the scripting
API so that it can be implemented using libRocket. Also adds an
engine.sleep function which I needed for making my Lua debugger work
reliably.
This is part of the ongoing sexp overhaul relating to performance and caching. This PR combines functions for several sexps that are very similar, and it also uses the `eval_ship` speedy lookup function. As a bonus, it allows `turret-tagged-only` and `turret-tagged-clear` to run for multiple ships at a time.
The `special_argument_appears_in_sexp_tree` function can run multiple times per event, especially for repeating events, so it's a good idea to cache the result. This avoids the need to iterate through potentially the entire tree, checking every single node.
Awhile back, the get_operator_const and get_operator_index functions were enhanced to cache the result of the operator lookup. But this only works when called on the node itself, not the text. So let's call these functions on the node whenever possible.
If you press a key such as Ctrl the code gets a bitfield with a high bit
set so when the key code is used as an index it produces an out of range
error.
Thank you AddressSanitizer!
This adds a Lua API for representing asynchronous operations and running
coroutines based on those operations comfortably. This is very similar
to features other languages have introduced such as C# or JavaScript. In
fact, the whole "promise" thing is derived from how JavaScript
represents these operations.
This is the initial and very basic system for supporting async
coroutines in Lua. There is no native support for running these
operations at specific points (they run whenever the awaited promise
resolved) or making sure they do not leak through different game states.
In PR #2318, I consolidated the code a little too much. The partial-loadout checks should not have been under the `SUBSYS_STATUS_NO_CHANGE` check, because this would cause partial loadouts to fail if the percentage was adjusted but the actual weapon in the loadout was not changed.
Thanks to @wookieejedi for spotting this bug.
This is a minor follow-up to PR #2390. There are a few minor differences between untranslated strings and the internal strings in strings.tbl; this PR fixes them.
Previously the scripting call `gr.drawOffscreenIndicator` did not properly draw the indicator and/or return coordinates. After some bug hunting it turns out it is because there gauge was not being set to active. This PR adds that line and retores the intended functionality. Tested and works as expected.
If ever there were more than 100 goal targets in a mission, the old version of ai_get_goal_target_name would start corrupting memory. Rather than making a hacky workaround, this just makes it dynamic.
These issues caused the stats packet to keep growing during
every conversion between network and game structs causing
memory issues and data corruption. These bugs were hidden by
the fact that stats packets were discarded by the server due
to another bug.
This code is highly inefficient (find_parent_operator() is O(n) for Num_sexp_nodes, and it runs every frame for all sexps with negative values) and should not actually be necessary. But it is useful as a debug tool, so I added some #ifdef's.
This enables the clang readability checks that I found to be sensible. I
disabled a few that would have caused a lot of unnecessary warnings in
our code.
This PR allows the setting `Guards Attack This` in `objecttype.tbl` to actually work.
Background: there are two instances in the code where AI that is patrolloing/guarding a ship decideds to go attack guardees attacker. One case is if the guardee is hit, and the other case if there are just hostile ships present (ie it scans the mission every so often).
The `Guards Attack This` check was only applied to the scna the mission case, and not the guardee hit case. Thus if the guardee was hit by a ship that had the `Guards Attack This` setting off, the guard would still attack since that check was never being performed for that guard case. By default all object types hae `Guards Attack This` set to `true.` But if a modder didn't want fighters guarding a ship to go off and try to kill a large captial ship then they may think setting this value would be a good way to do that. Unforunately this wouldn't work, for the reasons outlined above.
Chnage: this PR adds the `Guards Attack This` check into the guardee is hit case, estentally making the behavior work as expected by a modder. Given this is a AI behavior change I have added an optional AI flag to toggle this fix on. I have tested this and it works as expected.
Since the original release of FS2, internal strings have been translated to their English entries in strings.tbl but external strings have not been translated to their English entries in tstrings.tbl. It appears that string translation was universal until it was disabled via a hack, probably due to FRED idiosyncrasies (see comment in `fred_init()`), and then not re-enabled for release. PR #2343 re-enabled it, but this turned out to have undesirable side-effects since many mods used incorrect XSTR indexes for external strings.
This PR restores the previous behavior and also cleanly separates localization into translated and untranslated modes. FRED will always run in untranslated mode. FSO will run in translated mode for all languages except English, where it will run in untranslated mode UNLESS the new option `$Use tabled strings for the default language` is enabled in game_settings.tbl.
The ship goals dialog was incorrectly assigning a goal target name for every dockpoint, which could quickly cause the limit to be exceeded if the FREDder browsed a lot of dockpoints.
This also indicates a need to fix the goal target name system as the counter is never decremented. That will be in a subsequent PR.
Having recalled that other SCP folks stated pow shoud not be used to do simple squaring, I figured it might be a good idea to update the two instances I found where that was the case.
This PR adds a scripting hook which triggers when a ship begins it's departure process. It has one variable that is the ship. I have tested and it works as expected. This new hook is very useful for triggering events whenever a ship needs an alteration to it's departure methods. For example, in Fate of the Galaxy we require ships to warp out along a certain vector. This hook allows us to see when the ship is begining that depature and then break the ship's warp, order the ship to instead follow a waypoint path, and then jump out.
This PR adds a scripting hook which triggers when the pain flash is shown. It has one variable that lists what type of flash was shown, shield with `Pain_Type == 0` and hull with `Pain_Type == 1` . I have tested and it works as expected.
The sexps that activate and deactive glowmaps are very useful for ships, though previously the glowmap status was not passed to the ship's cockpit. This PR adds the ability for glowmap status to carry to this ship's cockpit (if it has one).
Previously if a ship's glowmaps were deactivated via sexp, then the glowmaps would reaactivie at the ship's final explosinos. This PR fixes that by carrying that flag into the ship explosion FX code.
This adds the capability to have a Lua script that does not need to use
our table syntax at all but instead defines the hooks by calling API
functions. This also makes it possible to add hook functions at runtime
if the script requires that.
Also clean up some unused debug stuff.
Due to code rot, the support ship hull repair code was a bit more tangled than it should have been, so I tidied it up. I also fixed a bug Sarn noticed where a support ship would think all subsystems were repaired if the hull repair rate was set to 0.
As noticed in Discord, in loop1-2 some of your wingmen have missing weapons, but as the ships are locked it's impossible for the player to modify them. These ships should not be part of the check.
This is a pretty easy fix; sorry it took seven years!
Instead of firing an Int3() when a ship has no arrival paths, just log it and continue. And change the upstream warnings, which should have been more visible, from WarningEx to Warning.
Certain mods provide their own tstrings.tbl, but this runs into trouble when you localize data meant for one mod using a tstrings.tbl meant for another mod. See the Mantis ticket:
http://scp.indiegames.us/mantis/view.php?id=2942
and also the HLP post:
http://www.hard-light.net/forums/index.php?topic=85041.msg1716600#msg1716600
This PR adds an optional flag that will check the untranslated string against the "default language" translated string. The two strings should be identical. If they aren't, the code assumes there is a tstrings.tbl mismatch.
I modified the mission listing code to enable this check when localizing mission info (titles and descriptions), and to avoid adding the mission to the list if there is a mismatch. Fortunately, I think mission listing is the only place where this bug is likely to happen.
Currently `$Closeup_Pos:` and `$Closeup_Zoom:` control the camera zoom and position values for the techroom, briefing and HUD Target Box. Unfortunately, with very large ships this results in an issue, to fit the view of an entire big ship in the HUD Target Box the zoom and position must be set a certain way which results in the ship looking very far away when viewed in the techroom. This PR adds two new fields that control camera postion and zoom but only for the HUD Target Box, thus modders can now set values for both and have the ships look good in both the Techroom and HUD Target Box. The new hud target box values are optional, and if not specifed they default to the values for `$Closeup_Pos:` and `$Closeup_Zoom:` .
From the comments:
// Do some checks to see if we are actually going to play this message at all. These checks have been moved above the
// "if ( Num_messages_playing )" block because we don't want to cancel an existing message if we have nothing to replace it with.
Additionally, by not incrementing `Num_playing_messages` if the code skips to `all_done`, this prevents messages that aren't playing from delaying messages in the queue that are actually valid and should play.
This adds an ai_profiles flag that checks comm systems for non-player ships. If their comm system is damaged, they will not send messages and you will not be able to issue squadmsg orders.
See also:
http://scp.indiegames.us/mantis/view.php?id=1947
This updates #2299 and restores the use of `event_music_level_start(-1)` in `freespace.cpp`. This call was removed in #2299 because it was thought to be redundant but removal of that call resulted in music not playing upon mission restarts. This PR restores that call and fixes that issue.
This is in response to Mantis 1424:
http://scp.indiegames.us/mantis/view.php?id=1424
Since retail, the hotkey lists have been determined based on what attacks the player. Mod makers may want to change this, so this PR adds the following options:
Default - retail behavior
Friendly/Enemy (or Hostile) - display in the specified list regardless of who attacks whom
None - don't display in the hotkey list at all
This PR also slightly cleans up the hotkey list function with a small optimization and a few tweaky fixes for edge cases.
This adds the titular feature, as well as FRED support. There are also some associated minor UI fixes in FRED and some cleanup in missiongoals.cpp. And "Event Flags" are now a thing in case we want to add any other flags in the future.
Ships which do not have the maximum number of primary and secondary banks (3 and 4) will have gaps in the loadout slots, so be sure to only check the weapon slots that the ship class is actually equipped with.
Yet another obscure edge case from Aftermath: Reboot. The FREDder ought not to create this situation in the first place, but if he does, don't enter an endless loop.
In the SEXP parser, zero-length strings are valid, as are zero-length operators. But zero-length numbers are interpreted as missing arguments, since their only syntactic separators are spaces and the parser skips over whitespace. And in any case, zero-length numbers are not semantically valid anyway. This PR adds a sanity check to intercept all zero-length numbers, as well as malformed numbers, and convert them to 0.
This fixes issue #2314.
There is a special function, `hud_find_target_distance`, which is used in most places for target distance. However it wasn't used for jump nodes in this location.
Incidentally, the player's target's distance is cached, and this distance will always be current for the target box, so we can use the cached value and save a function call.
This moves towards defining the hooks in the code module that executes
them. Also provides the API necessary for better documentation of hooks.
This only covers a few hooks as a test and demonstration of the new API.
If no issues are found with this it can be extended in the future.
This is the best way to address Mantis 2715. I took a look at allowing empty banks in the course of working on PR #2318, and it was completely intractable. But in order to prevent certain "funnies" such as violation of bank restrictions, it's a good idea to ensure all banks are populated.
This PR adds a new XSTR for a popup message, and incidentally adds another XSTR to a message that should have had one already but didn't.
If ships have less than their full allocation of weapons, the code is supposed to compact the array so that these weapons all appear at the beginning. This is done for small ships (fighters and bombers), but was not done for capital ships. There was also a lot of code duplication with small ships getting extra error checking than capital ships. This commit removes the duplicate code, makes the error checking more robust, and incidentally fixes the weapon array compacting for capital ships.
Although not used very often, ai_info.target_signature should be set to -1 whenever no target is specified, just like everywhere else to make sure that the code is as predictable as possible.
(Found while trying to figure out why the heck would the Object update packet send this at all??)
This PR refactors the function's name to something more indicative of what it actually does, and removes a call made to it from within freespace.cpp which, due to changes in how the soundtrack system works, is now redundant and doesn't actually do anything anymore.
The sound was passed the data from before the resampling took place so
it though it would be playing a stereo sound and rightly cause an
assertion. This fixes that by refreshing the properties after appliying
the resampling properties.
PR #1514 made this change to avoid having to constantly update fred.rc with new FSO versions, but it was inadvertently reverted in commit 9ac97f24223a7446d4364acfdb451c90697d6577; this also reverts PR #2286, since that's a somewhat more hackish solution to the same problem.
This does some refactoring to make it possible to cimpile and run FSO
without needing to link to FFmpeg. Since that eliminates support for
cutscenes or sound this is mostly useful for running a standalone server
which has no need for this anyway.
This reduces the image size of the standalone Docker image to only 20MB
and also resolves any licensing issues that might have existed.
The standalone did not initialize SDL and so did not receive the quit
signal when it was sent SIGTERM or SIGINT. This fixes that by making the
standalone server just use the normal os initialization code.
Also includes some other code cleanup and some more logging to make it
more apparent in the log what is currently happening at standalone
startup.
This adds a Dockerfile which compiles FSO for the alpine Linux
distribution and then creates a standalone image based on those
binaries. That sidesteps the problem that existed with trying to use the
AppImage binaries on that distribution.
This produces a much smaller image (78MB instead of 230MB) so it should
be a bit more managable. Building can be done like this:
docker build --build-arg build_type=FastDebug -t scpfs2open/fso-standalone -f docker/standalone/Dockerfile .
This mostly meant for special docker standalone server builds where it
might be useful to have full release performance but also have the logs
available if necessary. This now always compiles the log statements but
enables or disables them with a constexpr so they should not appear in
actual release binaries.
This will provide a proper error message when such a function is called
that will mention the name of the function and that it is deprecated and
cannot be used anymore in the targetted engine version.
This will make it easier to get logs from FSO running in a docker
container since logging to stdout is the easiest solution there.
Also includes some other changes that will make this work better in
Docker containers.
If anything less than or equal to 0 was specified it would trigger some
kind of an assert in the standard library since that is not a valid
value for a normal distribution. Now a parse warning is generated and a
safe default value is used.
This fixes#2269.
This adds a new graphics type for the Vulkan graphics API. All this does
is to create a vulkan instance and a presentation surface with the help
of SDL.
The largest new feature is that it is now possible to include other
files into the RML by using the "include" tag. This is useful for making
markup files more modular.
Also added some more options for existing things (e.g. built-in detail
options).
This elimiates all of the remaining "old style" uniforms from our
shaders. This might not be optimal for all situations but I have
confirmed that it is at least not worse at the moment.
This is a generic way to get matrix data to shaders without using
(old-school) uniforms. This is another step towards more compatibility
with how new APIs (Vulkan) do things to increase the odds for a Vulkan
port at some point.
It seems that when RTT for cockpits was added that the scaling of ships in the target box fell through the cracks. Properly specifying the `clip_aspect` fixes the issue. This PR fixes issue #2250.
Weapon names with a `#` should not display text after that `#` in the HUD. For the most part this works, but there were a few cases this didn't (such as primaries using the weapon name). This PR fixes two spots that fell between the cracks.
Previously, Engine Wash Intensity didn't actually do anything in the code. This adds a game table setting that let's modders specify to the game to actually take the intensity value into account when calculating engine wash effects.
For some reason my repro had some critical issues and I was unable to comitt to the PR #2210. I have closed that PR and opened this one given the discussion in #2210. The result of that discussion was `but omit line 594`. That is what this PR does.
Three main changes in this PR:
1) The enums for the "easy settings" launcher options are now clearer and more explicit, and the enum assignments for a lot of graphics options are now fixed, as they were incorrect due to code rot.
2) Some of the command-line flags options have been recategorized: -window, -fullscreen_window, -nomotiondebris and -noscalevid are now Gameplay; and -fps is now HUD.
3) Since post-processing is required for nebula fading, it now defaults to on, and the flag has been changed to -no_post_process.
Persistent buffer mapping is an OpenGL technique where the contents of a
buffer object are mapped to a persistent pointer instead of having to
map and unmap a buffer every time it is modified.
This decreases the overhead for updating data in a uniform buffer object
which now only consists of a memcpy and a flush call.
This is in preparation for using persistently mapped buffers for uniform
buffers. Since that functionality is not available in the OpenGL version
we are targetting I implemented a fall-back which simply uses
glBufferSubData.
I did a benchmark with these changes and there was no change in
performance to the current master version.
error_display shows the line where the error was detected. Warning
itself is pretty useless for parsing related errors so I replaced all
Warnings (where appropriate) with an equivalent error_display.
Does this by refactoring how the timing is calculated. It also removes the Next Arrival Time Array, which does not actually do a good job of calculating it, anyway. We can now rely on the other oo_arrive_time arrays exclusively by subtracting from current time.
Squashed Commits:
1. Use function to pull FrametimeOverall to keep from breaking Fred.
2. Remove unsed parameter from multi_oo_calc_interp_splines
3. And also fix the corresponding declarations and functions calls.
In aiturret.cpp there is a mprintf, `mprintf(("nothing ok to fire\n"));` which greatly pollutes the debug log in missions with turreted ships. I'm not sure what this message helps debug, thus I propose commenting it out.
Previously, using max and min delays resulted in guns firing that were not within the specified range. This PR fixes that while also simplfying the code. `frand_range` is already using in each of those functions so I figured it would be fine to use it and also simplify the code. That, instead of `next_fire_delay = (((float)rand()) / (((float)RAND_MAX + 1.0f) * (winfo_p->max_delay - winfo_p->min_delay + 1.0f) + winfo_p->min_delay))`.
These function have been around since retail. What they were supposed to do was allow the V team to get a baseline of how much data object updating would use without the limiting system.
However, the way that multi_rate_add work, is that they say to the limting system, "The client is getting a lot of data, so limit it some more." And that eventually causes debug build object updates to slow to a crawl.
This PR tidies up the comments in the initial velocity setting, properly sets the player's throttle, and cleans up issues with initial velocity setting and hyperspace warpin types.
Note the removed code block for hyperspace warpin ending was removed becuase it is not needed, as physics calculatios already handles that. Also the calculations that were there did not properly account for initial ship velocity setting.
A few early on descriptions in this file are inconsistent or even plain wrong. This should correct that.
Also, rename vm_vec_imag() to vm_vec_inv_mag_quick() to better describe what it is.
It turns out that the code that set initial ship velocities did not account for local ship rotation changes. This bug is only noticeable when ships are very high speeds, high initial velocities, and have high drift values thus it was never recognized before. This PR fixes that by ensuring that the velocity vectors are set appropriately. As discussed with Goober on Discord, this fixed behaviour is indistingushable when using FS ships and most mods, this the behavipur will be on by default.
This was previously using the wrong direction of the conversion so it
produced wrong values. This should fix that and should hopefully bring
the nebula experience back to how it is supposed to look.
When the `+Max Delay:` and `+Min Delay` for `Fire Wait` were added they were only added to primary firing and not turret firing. Specifically, `turret_set_next_fire_timestamp` uses only `winfo_p->fire_wait` while `ship_fire_primary` uses the delays. Checking with the original author DahBlount they specified it was an oversight, thus this PR fixes that and allows the delays to now work properly with turret firerates.
Overview: This PR restores all expected functionalility of the 3D weapon select flag while also providing modders with a way to use both 3D models and custom weapon icons.
PR #2055 provided a way for modders to use 3D weapons while still using specified weapon icons. Unfortunately that resulted in weapon icons not changing to an image of the 3D model when the 3d weapon selection flag was used. It was requested on the forum that this behaviour be restored. This PR restores that behaviour while still allowing modders to use 3D weapon models and their own weapon icons. Instead of the approach taken in PR #2055, this PR will automatically show a 3D weapon model if there is not weapon animation specified and if a weapon tech model is specified. Thus, if a modder wants to use their custom weapon icon but also have a 3D weapon model shown, they simply do not specify a model animation but do specify a tech model for the weapon (the 3d weapon selection flag does not need to be checked). If the 3d weapon selection flag is checked then the 3D weapon model will of course still be used, but the weapon icons will now show the image of the 3D model instead of any custom weapon icons the modder specified. In other words, the flag acts exactly as expected for the player.
I also tested this for each case and it works as desribed above.
Should fix rare multi crash where reserving net signatures for spawened munitions would cause an ushort overflow, triggering an assert in multi_set_network_signature.
Turns out we can just remove the assert, and just guarantee that signature is going to be in the required range.
Squash history:
1. Improve Assertions (as per Taylor's suggestion) and reconfigure Int3
2. Wording change on last assertion
Any server build created this year will crash any client connected to it because it will send a packet cotaining hull updating information, but accidentally unset the flag for new hull info. The client was therefore unaligned with the packet, causing the local subsystem_update array to go bonkers.
Removes about half of the Int3()'s in multiutil.cpp by making Assertions more robust, changing two functions to void type (because there was no way to get an error value from them, anyway), and adding two Verify()'s in case we ever decide to start using the multi variable change functions.
Squash History:
1) Forgot to change one Assert to Assertion
2) Change Verify to Assertion, because of better argument support.
3) Fix a couple copy paste errors
Just a quick PR to make multiutil slightly more readable by removing one unused function (whose functionality is already in the object update packet), two globals which we only increment and we do nothing with, and some defines that have been commented out because the size returned can actually vary.
several of the bitwise manipulations on signed integers are technically undefined behaviour.
I made the internal variables unsigned and the results are then converted to signed ints as before.
This should not actually change any observable results.
Did some cleanup as well, while I was at it.
This fixes string comparison of ship names in multi. Any respawned ship would be given a default name and would return false for any future name comparison.
The most visible affect of this was being given the default loadout and fighter on respawn instead of the fighter and weapons you selected, but Taylor was spotting a lot of potential other break points as he looked through other unrelated multi issues on mantis.
Squash History:
1) Fix comments and warning to be clearer.
2) Replace NULL with nullptr
Intent probably was to empty the vectors and not check for state empty.
This was most likely a bug, which was called by the no_discard attribute on the function.
Previously deprecated enum for hasViewmode() lua function didn't have a warning. This fixes that.
Also, I am adding a check to ignore it while writing scripting.hmtl.
This PR allows modders/FREDers to actually see what default controls available are in FRED and not the hard coded ones from `Control_config` that may not be relevant for their mod. For example, a mod may disable many controls and change the default key for many controls in the table, but that is not reflected in FRED since FRED simply checks the hard coded ones from `Control_config`.
Example:
Previously, if the modder specifies a default key for, say, `Enter Subspace (End Mission)` as `Enter` instead of `Alt-J` in `Controlconfigdefaults.tbl` then the game will only look for if `Enter` was pressed, whereas the `key-pressed` tree in FRED will not show that and will still show `Alt-J`. Then if the FREDer uses `Alt-J` it won't ever actually trigger in-game since the control table has switched it to `Enter`. This PR would allow FRED to properly show `Enter` instead of `Alt-J` in the sexp tree for `key-pressed`.
Background:
1) Game reads the hardcoded values for each key and saves in `Control_config`
2) Game parses `Controlconfigdefaults.tbl` and updates the default keys in `Control_config` with any that are specified in that table.
3) Now the key defaults have been changed, and when `key-pressed` is called it searches for it's argument in the updated `Control_config` array, but only searches for the default. Thus even if the player changed the key, it will still find it and properly convert it.
All of that works well and as expected. But FRED never goes beyond step 1, so when FREDing I don't use the drop down tree for `key-pressed` since it doesn't actually match what the game will know when it parses `Controlconfigdefaults.tbl` in step 2.
This expands the functionality of the cusotm controls to work with rebindings when using the sexp `key-pressed`. A key default value must be specified in `controlsconfigcommon.cpp` for the sexp `key-pressed` to track key binding changes. This PR adds that functionality by assigning default keys that were not in use (alt shift 1-5).
According to the CreateProcess() documentation, passing NULL in the eighth argument starts a process in the same directory as the original process, which is what we're trying to do.
Please note this is a Windows only solution, and cannot be ported to QTFred
Addresses 1775, already tested on Release and Debug
A quick update that should allow for the FPS gauge to be hidden together with the rest of the HUD. Sounds useful for anyone wanting to take clean screenshots.
Also, thanks @wookiejedi for showing me how to do this.
(Will that even work? that's my first real meeting with GitHub so I'm a bit anxious.)
Many mods and scripts use custom features that are triggered by key press. Currently, those keypresses cannot be changed by the player. I want to add 5 controls that do nothing and thus can be used for scripts/modding purposes. This way the modder could add new features/controls easily and have them show up in the controls menu and be bindable. As opposed to using a script which triggers via a keypress, and that keypress cannot be changed by the player in game (and may be bound to another control).
Also, Axem has expressed he would find this feature and Fate of the Galaxy certainly will.
This PR adds functionality to `Has Xstr:` in `controlconfiguredefaults.tbl`. Previously this value was use as a boolean, 0 or 1 to specify if the string should be used. This PR treats that field as an integer, and thus allows modders to specify which string to use for the control. If the value is 0 (default) then the string is not used, if the value is 1 then the defautl string is used and if the value is greater then 1 the game will use that specified index in strings.tbl.
This allows modders to properly translate all control names. Specifially, six controls overlaped with pre-existing string.tbl indexes adn thus could not be translated properly. These are VIEW_TOPDOWN, VIEW_TRACK_TARGET, AUTO_PILOT_TOGGLE, NAV_CYCLE, TOGGLE_GLIDING, and CYCLE_PRIMARY_WEAPON_SEQUENCE.
This PR will allow modders to now proerly have full control name translations. It also provides a fix for issue #1629.
Fixes the following:
1. Crash from creating an icon from a jumpnode
2. Crash from creating an icon from a waypoint
3. Waypoint would become a jumpnode icon in briefing screen.
This line is the cause:
iconp->ship_class = (int)std::distance(Ship_info.cbegin(), it);
The main purpose of this commit is to change iconp to biconp, like the rest of the function uses.
The other change is how it checks for a jumpnode so that it is only true if there *is* a jumpnode.
Per dicussion on Discord and and Github, `set-object-position` does not work properly and the fix would involve making it act the same way as `ship-maneuver`. With discussions with Goober (who originally made it), we have decided to deprecate the sexp. I have talked with folks who have used it thus I am not removing it from FRED with this PR but I am open to discussion on that point.
If you modified an existing ship type without using +nocreate, it would both modify it and add it to the vector again, leading to (at the very least) wasted memory. I copied over some more standard behavior from other parsing functions to hopefully avoid problems with modular objecttypes.
Previosuly, subsystem brackets in the target ship gauge were not always drawn in the correct location when using RTT with the gauge. This PR fixes that.
First one is to allow MinGW failures since that is unreliable at the
moment. Second one is a fix for the regex used by clang-tidy so that it
doesn't try to analyze CMake files.
Free look will now move in the same directions as ship controls, whether pitch or yaw, and whether using keyboard or mouse/joystick.
Also, remove an inaccurate comment, and add a clarifying one.
The Z coordinate, from negative to positive, means "front to back", so a Z value of 1.0 (with relative playback, which is what 2D sounds use) means "as far back as possible", i.e. the rear speakers. It's hard to know if this was intentional or not, but feedback from an actual user with a surround setup is that the opposite is preferable.
There are now three states for cutscenes: always viewable, where they will appear no matter what; never viewable, where they will never appear; and viewable, which can be modified during the campaign. Currently cutscenes will go from not-viewable to viewable, but organizing the flags this way will allow a future feature to make cutscenes not-viewable, if that is desired.
There's also a small edit to csv_convert to guard against array overflows. Not directly related to the feature but it's in the same place and affects the same code.
Sanity checking for repeat counts shouldn't crash the game, so change from Error to Warning and use a sensible default. Also copy the check (with minor modification) to also check trigger counts.
The `On Goals Cleared` scripting hook would result in FRED not working, thus this PR adds a check for scripting state to the hook and will only run if the scripting state is active. Now FRED will run proprerly.
This adds JSON as an additional scripting documentation output format.
This can be used by external tools to examine the scripting
documentation and generate interface declarations or documentation for
any language. The existing documentation code is left largely in place.
Set-secondary-weapon and set-secondary-ammo have been up to know been allowed to exceed tabled cargo sizes, as long as you didn't put a value for requested_ammo in the sexp.
The limits would be inherited from the last secondary weapon in the slot, definitely not idea behavior.
Now includes matching changes to set-primary-ammo
It turns out that `angles_2_matrix ` would return a pitch value that was not the actual pitch from the 3x3 matrix. The pitch line in the code is uses a modifed `cosp` as the demoninator to calculate the pitch angle. I looked up online what the caclulation should be and found a more accurate way than using the modifed cosp, is to use ( fvec.xyz.x^2 + fvec.xyz.z^2 )^0.5 I tested using the new calculation throughouly and in each test it returned the proper pitch value from the 3x3 orientation matrix.
This is a follow-up to #1450, based on feedback and preference. Instead of always resetting campaign progress, just switch to the campaign. The player can then explore the tech room database or the finished missions if he chooses.
This also fixes a few bugs:
1) Ever since the tech-database-reset feature was introduced in 2003 or so, the game incorrectly checked the campaign being unselected, not the campaign being selected. This is now obsolete since neither the tech database nor the campaign progress are reset.
2) Not all campaign loading failure types were recorded in `mission_load_campaign`.
The default fade argument is `true`, as specified by the sexp help, not false. This probably doesn't matter here as the multi packet should receive all sexp arguments anyway, but better to be consistent.
Adds 'On Goals Cleared' hook variable for scripting system. Previosly there was not scripting or sexp method to determine if a ship had all of it's goals cleared.
Originall the scripting hook `On Waypoints Done` only provided the ship or wing. This PR adds the waypoint path that was completed as an additional hook variable.
We didn't realize that Gauge_load_common had some assumptions about where Origin: and Offset: are, so we accidentally broke custom radars. Moving this section up forces modders to have an odd order for their entries, but based on the way the code was written, there really doesn't seem to be another choice.
This commit disables emissive lighting on objects by default (as the new HDR process makes it unnecessary) and switches the -no-emissive commandline parameter to -emissive; Setting that parameter will restore the old behaviour. The -no-emissive parameter is retained to avoid user-facing error messages.
In addition, this commit sets the default bloom value to 25.
This should fix#1886. I built it and it fixes the immediate problem.
Only two of the documentation files we have in the codebase were actually updated.
Verison name in prebuilt.cmake also needed to be changed due to prebuild SDL version changing during upgrade to the prebuild repository.
Part of modernizing the code base, Travis, at least, prefers defaults to be in the class definition instead of having multiple constructor functions have the same default values.
Allows jump nodes to use instrinsic/dumb rotation again by exposing the jump node class to the model instancing code and adding a check for it in modelread.
Unique pointers need to be constructed in very particular ways, but so did this NGON radar class, so we just had to put the constructor function inside unique pointer constructor.
And to keep that special pointer from going out of scope, we switched to the ternery operator.
Also made these changes:
Change to hypotf()
Fix Shadowing, Zero Vector macro not working at all.
Offset changed to offset_incoming
blip changed to blip_instance
Offset changed to = {} to initialize the struct without a problem.
clampBlip() required an override
Give offset a default initializer.
Switch to <cmath>
(Apparently <math.h> was deprecated and needs to be replaced with <cmath>.)
One last complaint from travis about a redundant default value.
Thank you Travis!
* Modders can specify how many sides the radar can have (as few as 3) with "Ngon Sides:" and can also define an optional twist angle with "Ngon Offset:".
* Also refactors the standard radar code a bit
Covertity is complaining about portions of the verts array being uninitialized, so this is just a quick change to initialize the array first before doing anything else.
These coverity issues are all caused by the same code being copy and pasted in three different places.
There does not seem to be danger of the negative array access, but the changes that "fix" it are also slight optimizations (assuming the compiler hasn't been catching them).
In short, I am basically just moving code around to avoid duiplicate checks and in other places checking for the negative array index explicitly.
Suggested style corrections now included.
This uses clangs LibTooling for parsing the FSO source files to ASTs
which can then be used for extracing the strings used in XSTR calls.
This supports both standard XSTR calls and UI_XSTR definitions and
writes the resulting information in the strings.tbl format to stdout.
It also detects duplicate translation id usages with different text
values.
Although not technically a bug, several mods have been misled by the description of the "$Rearm Rate:" weapons table setting, and specifying an initial ammo value that is less than 100 for ballistic primaries would force the ballistic ammo to be loaded all at once, with "$Rearm Rate:" just specifying how long that one load would take.
This allows modders to use more realistic behavior for things like anti-turret ballistic primaries, where initial ammo could be in the thirties so that any number above zero can be added per load.
Since the Lua state is destroyed before all the object events, this was
causing issues. This should fix that by clearing the events when the lua
state is destroyed.
Since FSO does not support Unicode characters in filesystem paths on
Windows yet, it is necessary to catch these issues early on and display
an appropriate error message. These changes do that by going through the
path with our UTF-8 decoder and detecting any characters that are out of
the ASCII range.
Enhances play-sound-from-file, etc. to allow more than one audio stream to be played at the same time, provided all stream are referenced by audio handles contained in variables.
The intent behind this sort (added in #2094) was to make the order of files returned by the filesystem consistent across platforms; however, the sort occurred not only after the filesystem search, but after the packfile search, which changed the order files load in on all filesystems instead of making it consistent. This moves the sort to be after the filesystem search but before the packfile search, hopefully making load order consistent once more.
When loading a .plr file, HUD_config.rp_dist is loaded and then sanity-checked; if the value is out of bounds, a Warning is generated and RR_INFINITY assigned. HUD_config.rp_dist is also loaded when loading a .csg file, however the sanity check isn't present; this copies the block over so the behavior is identical.
This bug has been around since the original public source code release!
The error message character calculation did not agree with the actual error check. This PR fixes that. Thanks to Novachen on Discord for discovering this.
The grant-medal and was-medal-granted sexps will now translate medal names, in the same way that tech-add-intel-xstr translates intel entries. There is also some minor cleanup and the specifying of correct default -1 numbers for the xstr-capable sexps.
When running a mod on non-windows, that isn't packed into VP files, the
mod can break when loading. On non-windows filesystems, the file
order isn't guaranteed to be alphabetical (but it is on Windows).
As a result, we load tables in an effectively random order.
Lots of mods rely on the filesystem ordering to e.g. implement a very
loose dependency system for their lua scripts.
Referenced on the forum here:
https://www.hard-light.net/forums/index.php?topic=95750.msg1885275#msg1885275
Here's a log from Solaris failing to run:
https://fsnebula.org/log/5d7b4414cb0d332b466b5ee2#True-138
Instead, always sort filesystem listing by name *before* applying the
provided sort order.
I've built a few different versions of this patch, and like this one the
best. The other ones I tried:
1. Adding a `CF_SORT_REVERSE_NAME` and using it everywhere that
`CF_SORT_REVERSE` is used, and replacing all uses of `CF_SORT_NONE` with
`CF_SORT_NAME`. I didn't like this as it was a much larger diff.
2. Adding a `CF_SORT_REVERSE_NAME` to the `scripting.cpp` call for
loading tables. I didn't like this one because this bug can in theory
impact non scripting tables.
Here's a log from Solaris working with the new build:
https://fsnebula.org/log/5d7b4f37cb0d332b3d6b5ed3#True-138
While it might be a reasonable enhancement in the future to build a proper dependency system for lua scripts and tables,
this is a much smaller and easier change, and doesn't require any work from modders.
As per the discussion in https://github.com/scp-fs2open/fs2open.github.com/issues/2092,
if you specify the turn time, these can behave quite weirdly.
Some mods that we don't want to break backwards compatability with use
that mode, but at least we can note the pitfalls in help.
Not sure why we didn't catch this earlier but this should hopefully fix
the crash. The cause was that we constructed an SCP_string from a null
pointer instead of using the empty string as the default.
This will write Mini dumps in the event that the executable causes a
crash. This will allow us to take a closer look at any crashes without
having to reproduce them.
This re-implements the eval_nums function to use C varargs, instead of C++11 template parameter packs. This is necessary because Visual Studio has a bug where template parameter packs corrupt heap memory somehow.
"Cloning" failure was actually being caused by the pilot verification function resetting all pilot info and then not loading controls from the file to replace them.
The Control_Config array would all be set to -1 and then would get written into the file the next time the player was saved, making it seem that the controls were not being copied.
The original and current code would reset controls to defaults when a pilot was created. And it would just let the old controls remain in case of a clone. The above problem would occur just as you hit accept on the bottom of the baracks screen.
Original behavior in Fred was accidentally removed when upgrading the FSO mission parser to keep it from crashing FSO from a bad sexp. But returning false is only necessary in FSO since in FRED, we can fix the error once we know about it.
NaN should propagate through the SEXP tree, but not all SEXPs do this properly. The problem was made worse after I introducted `eval_num()` which silently ignored NaN values. This commit adds new boolean arguments to `eval_num()` to flag NaN results, and changes all calls of `eval_num()` to properly handle the new arguments. Additionally, this adds `eval_nums()` and `eval_array()` functions to more smoothly handle cases where many numbers appear in a row.
Extremely rare bug caused by use of multiple protect from weapon flags. One of the Ai-Turret functions was setting only one of the flags because "else if" was typed instead of "if".
Lab_selected_index must remain unchanged until labviewer_change_model is
called. There the variable is used to determine if a new ship must be
created and updated afterwards.
Coverity spotted this dead code. Looks like the original coder forgot that they had checked for !p already or was a case of mindless copy-pasting code..
Because of
pcode = strchr(p,' ')+1;
it looks like it really is safe to remove.
This allows to mark certain functions or virtvars to be declared as
"deprecated" starting with a specific engine version. What this means is
that a special message will be added to the documentation stating since
when the function is deprecated and can contain an optional message. The
actual enforcement of the deprecation depends on the target version of
the mod so that we can stay backwards compatible.
If the mod supports the version since when the function is deprecated,
it will not be added to the Lua state which means that it doesn't exist
for the calling script. If the targetted version is before the stated
version, the function will still be added to the Lua state.
As the first function to use this feature, I have deprecated
createParticle in the testing library and moved it to the graphics
library with a new name reflecting that it creates a persistent
particle. I also added the corresponding function for adding a
non-persistent particle.
Previously if the 3D_weapon flag was used it would always create a weapon icon and overrride any pre-existing icons the modder would specify. This PR fixes that by adding an extra set of conditionals, which specify if a weapon has an icon file name then it should be used, and if the weapon does not have an `$Anim:` but does have a model then that model should be used if the 3D_weapon flag is enabled.
This PR adds a table entry that allows modders to specify the RGBI values for the damage and emp arc colors (which were previosuly hardcoded).
This option adds the table entry to `Game_settings.tbl` under `#Graphic Settings` with the lines:
```
$EMP Arc Color:
+Primary Color Option 1: rgb
+Primary Color Option 2: rgb
+Secondary Color Option 1: rgb
$Damage Arc Color:
+Primary Color Option 1: rgb
+Primary Color Option 2: rgb
+Secondary Color Option 1: rgb
```
This PR allows modders to set, on a per-ship class basis, the fields for what hull and shiled integrity the AI wingmen send the "Help" message at. One good use case is when ships have low hitpoints, thus now the modder can set AI can call for help sooner then at simply 30% hull.
In single-player, or while running as a server, sexp_deal_with_ship_flag() makes sure that object_flag, ship_flag, and p_object_flag aren't NUM_VALUES (i.e. not set) before trying to call flags.set() with them. However, the client code in multi_sexp_deal_with_ship_flag() had no such security checks, and as such would try to set NUM_VALUES, which is outside the range of valid flags; this led to a crash in Release builds and an Assertion otherwise.
Current the AI always selects capital+ weapons vs big/huge ships. This
makes the AI take shields into accounts, and not use the weapon if
either the shields are still up, or the weapon isn't good vs shields.
I don't greatly like the magic number 1.33 to determine if a weapon is
good vs shields, I'm happy to take alternative suggestions. I have
checked DE, WoD & BP tables and I don't think this change will affect
any of them (picked them because their either use capital+ weapons or
have shielded capships)
There's one DE weapon that the AI won't select anymore while shields
are up; however its fluff says it's bad vs shields and suggests a
paired shield-breaker so think it should be OK.
This PR adds a sexp that returns the integer value of a ship or wing hotkey. No hotkey returns -1, F5 returns 0, F6 returns 1, ... and the sexp takes one arguemnt, the ship or wing name.
This new sexp allows a FREDer to set a hotkey for a ship or wing. The sexp takes 2 or more arguemnts, the integer of the hotkey to set (F5=0, F6=1, ... F12=7) and the names of the ship(s) and/or wing(s).
Implements the feature request from issue #610.
As an aside, this PR also patches the `ship_set_subsystem_strength` function (which is only used by the debug console and in the event you fire at your training instructor) to use the same code as the `set-subystem-strength` sexp. This properly handles submodels blown off, sounds, etc.
Previosuly, flyby sounds were only specified on a per-species basis. This PR allows each ship class to use a specific flyby sound. This will allow modders to set the custom sound in ships.tbl, just like any other per-class sound.
Making wp_list null lets ai_mission_goal_achievable reset the waypoints
list correctly, otherwise it thinks the waypoints are ok when in fact
something has invalidated them
This allows modders to restrict the amount of rotation in a death roll.
It's fairly simple to fit in with the existing code which has a lot of
hard coded constants. The intended use case is to restrict pitch &
heading changes so there's less chance of rapid forward rolls or flat
spins, especially with faster-than-FS2 ships.
I'd almost rather rewrite the entire code to dynamically use ships mass
& velocity except for retail compatibility issues.
Every g3_start_frame must have a matching g3_end_frame. Thus, a return
in the middle of a function after an opening g3_start_frame must make
sure to call g3_end_frame before it leaves to avoid a dangling frame
context.
As described in the bug report at
https://github.com/scp-fs2open/fs2open.github.com/issues/1827
a floating point rounding issue could be the trigger for the problem.
A bit of small cleanups in preparation of larger scale refactoring.
remove unused member heavy_collision_cm_pos of collision info struct,
which was set in several places but never used.
This provides a cleaner fix for the bug where using show ship caused detail_box calculations to incorrectly work on the player's ship.
It also reverts the changes made by PR #2018.
This PR fixes issue #2015, which is a bug where using `show ship` caused detail_box calculations to incorrectly use world coordinates for submodels on the player's ship, rather then the correct local coordinates.
Allows subspace strikes to choose which fireball to use for the warp effect. If absent, FIREBALL_WARP is used as the default (which was the previous hardcoded behavior).
"+WarpEffect:" can be specified as either an index or using the fireball's unique ID.
Add a submodel property that overrides the hard-coded distance
multipliers applied to the distances at which details boxes & spheres
are rendered. The distance multipliers are set by the "model detail"
setting in the options screen. Note that this is different to the LOD
distance multipliers which are not hard-coded.
This allows some more creative uses of detail boxes & spheres, e.g. to
stop models subobjects from being rendered when they're out of player
view. Past testing showed a reasonable performance improvement with
complicated models.
This is a submodel property rather than global, or a ship flag, to allow
flexibility, i.e. a single model could choose this option only for the
submodels that want to use detail boxes/spheres in this fashion, which
other detail boxes/spheres use the conventional approach.
Code & ideas originally from zookeeper, I've just packaged it up for
the PR.
This has been rebased & squashed based on feedback in the PR
Fixes a minor bug that incorrectly draws Rectangles to a scripted HUD gauge. The third and fourht arguments needed to be width and heigth, not x2 and y2.
This adds the following functions to the scripted gauge API: drawCircle, drawRect, and drawLine. Also note that I created an additional function, for HUDGauge:renderCircle_unfilled, becuase the precedent shown by having two functions for `gr_unfilled_circle` and `gr_circle` and adding a fourth argument to `renderCircle` seemed to affect a lot of other functions.
This commit adds new id for existing strings, so that they are translateable through the strings.tbl.
The following is translateable now:
- The 'or' seperator in the Keypress Directive gauge, if one function is bound to two keys.
- The Supernova warning.
- The error message that is displayed prior the pilot selection screen, if something is wrong with the loaded modification.
The new gauge can be accessed by the scripting API with which a function
can be set which will be called when this gauge is rendered. This can be
used for exposing the HUD gauge positioning and RTT options to the
scripting API without a lot of work needed for the script writer.
There is currently only one rendering function implemented since this is
only a proof of concept.
Switch from 3x specific is_arriving functions to a single with params
Change flag names; replace "ndl" with "dock_follower"
Change dock-arrival helpers to not set follower flag on leaders
This PR fixes a bug where an invalid lua font handle would not be properly returned as invalid. An invalid handle is returned properly if the font name is invalid, but not if the index is invalid, thus this PR fixes that.
The only thing a CFILE contained was a version field which isn't used
anymore so that could be removed which basically meant that CFILE was
just an indirection to a Cfile_block which I then just renamed to CFILE.
The CFILE type is an opaque handle now since the contents are not
relevant to a user of Cfile.
Currently, the player is unable to see a RTT hud gauge if in chase view. This adds an option in the hud_gauges.tbl that tells the game whether to draw a gauge based on if chase view is the active view. So for example, a modder using RTT mapped gauges can now make a HUD that displays on the interior of the ship (ie RTT with the cockpit model) and a HUD that displays when the player switches to chase view.
In this block of code, the conditions were checked with a set of four hook variables but then subsequently run with only two. This adds all four previously used variables. More importantly, it adds the hook variables with expected and user-friendly names, since 'self' and 'object' are not necessarily intuitive.
This is a system for storing arbitrary data in the config file and then
easily retrieving it later on. This has full Lua support for exposing
the available options in a custom UI and changing the values of the
options. This ported some of the existing command line options over to
the new system which is opt-in for the moment by using a mod_table flag.
This adds some auto-closing code to the scripting API of the CFile
system. If a file has to be auto-closed then an error will be displayed
to let the the script writer know that something is wrong.
This should not break existing scripts since causing file handle leaks
should never happen and if it does, this will make it easier to find
these issues.
There's a number of issues fixed here:
* Radar blips of docked ships were the wrong colour in stage 1
* You could target docked ships in stage 1
* Docked ships thrusters were visible in stage 1
* Hyperspace warptype ship could initially appear at their
warp-destination, then spring back to the correct location to complete
the rest of their warpin (because a docked ship had higher speed than
the dock leader)
There may also be a number of other subtle bugs with docked warpin;
e.g. I suspect (but haven't tested) that AI turrets could fire on
docked ships during warpin
These should also be fixed
Lastly, fixes issue #1867
We need to build our own curl binary since Homebrew doesn't support
--with-libssh2 anymore.
I've also added caching to both the Linux and macOS code to avoid
rebuilding curl for each nightly.
Currently is-docked always returns true if only a single argument is
supplied. This is probably as designed (except for not erroring on a
single arg) however it's quite easy to update to work for a single
argument and this case is useful for FotG, and might be useful for
others.
Somewhere along the line, "sentry gun" was replaced with "escape pod" in the inverted is_flyable check. This made the game think an escape pod wasn't flyable and therefore things like waypoint orders were not displayed. This PR fixes that.
Additionally, I fixed a potential bug in weapons.cpp where the HUGE flag should really check against HUGE ships. And there's a no-op formatting change in hudtargetbox.cpp.
The core bug fixed here is #1982. After ship_create sets up the ship, parse_object_create_sub does further initialization by copying some values from the parse object. In most cases there are sensible defaults, but a few special cases require some post-processing...
- ship sounds
- the new way of initializing warp effects to allow per-ship customization
- intrinsic-no-shields
- an arrival entry in the mission log
- script hooks
I also took a further look at normal ship creation and tweaked some things...
- initialize ai mode in ai_object_init
- remove redundant assigment of ship name from parse_object_create_sub (it's also done in ship_create)
- remove redundant goal clearing from parse_object_create_sub (it's also done in ai_clear_ship_goals via ship_create)
- avoid overwriting the initial ai mode if the fix-ai-class-bug flag is set
- make the code slightly more efficient by not redundantly setting flags while searching for subsystems
If various functions on l_Control_Info were called while Player was nullptr, FSO would CTD due to a null pointer dereference. This commit adds nullptr checks to avoid the problem.
When setting LUA_ADDITIVE_BUTTON_CONTROL, the setButtonControlMode() function (in l_Base) would return "LUA OVERRIDE BUTTON CONTROL", and when setting LUA_OVERRIDE_BUTTON_CONTROL, "LUA ADDITIVE BUTTON CONTROL" would be returned. This commit simply swaps these back so that the appropriate return value is with the corresponding enum value.
When using a string to define the appropriate control in the useButtonControl() function (in l_Control_Info), the command definition was being divided by 32 when the appropriate mathematical operator was modulo; as a result, the only controls that could actually wind up being referenced are these four: TARGET_NEXT, MAX_THROTTLE, END_MISSION, and MULTI_MESSAGE_HOSTILE. By using the modulo operator, the string lookup now appropriately references the relevant button.
MESSAGE_SOURCE_SPECIAL indicates messages whose sender starts with "#", indicating that it's not a ship; however, the code was looking up the source as a ship name regardless, and if the message had a persona set, failing to find that ship name would result in the message failing to send. Commit f67596bc5e (a.k.a. SVN revision 5383) was supposed to fix this, however it was checking if q->source was MESSAGE_SOURCE_SPECIAL when q->source was one of the HUD_SOURCE_* #defines (specifically, MESSAGE_SOURCE_SPECIAL resulted in HUD_SOURCE_TERRAN_CMD). It turned out there was an unused HUD_SOURCE_* #define which behaves identically to HUD_SOURCE_TERRAN_CMD, namely HUD_SOURCE_IMPORTANT. By making MESSAGE_SOURCE_SPECIAL use HUD_SOURCE_IMPORTANT and changing the conditional to compare q->source to HUD_SOURCE_IMPORTANT, the intent behind the original fix can be carried out with minimal effort.
This also fixes issue #1706, which is basically the same as the original mantis issue.
This allows specifying how many times per second an effect should be
triggered for a particle source instead of triggering the effect every
frame. This will allow modders to achieve more consistent particle
effects regardless of FPS.
This is a follow-up to commit 1614384a6a. `Error` is to be avoided if possible because almost all sexp problems are recoverable, and we don't want to bring the entire game to a halt.
Also add some more information to warnings about sexp operators on strings.
Every time an entry for a ship was parsed (e.g. every time it showed up in a .tbm), the selection effect would be reset to the default. Since it's already set to the default in the ship_info constructor, this was both redundant and would make it extremely difficult to actually use a selection effect other than the default without constantly setting it in every .tbm.
Since FRED and FS2 load mission data slightly differently, the warp effect loading code had to be slightly reorganized in order for the warp effects to not be based on invalid data. Additionally, the warp effects had to be initialized a little bit later so that it could accommodate a new set of warp parameters from the parse object. As a bonnus, this PR also handles warp effects being reassigned in change_ship_class.
In commit 9e4c6df219 (PR #1265), the model_render_params::set_replacement_textures() override that accepts a vector of texture replacements was added, which includes allocating its own Replacement_textures array. However, unlike its counterpart from missionparse.cpp, this array doesn't then have all of its elements set to -1. Since it works just fine there, I copied that code here so both versions should behave the same.
The (length > base_length) conditional was redundant with the other conditions. Additionally, the code from the ID_FUEL case (thruster points) checking for "$engine_subsystem=" was making the exact same mistake, so I made the same changes there.
In a Release build, there was absolutely no code making sure that the text "$glow_texture=" was actually present in the properties field of a glow point bank, beyond a simple strlen() check. Even in Debug builds, there was no guarantee that the text was at the start of the properties field; it was just assumed (without even an assertion verifying it). Now, the assertions have been removed and the appropriate conditions are checked in both Release and Debug.
This was causing issues since the new bitmap data was never stored in
the internal buffer FSO uses for getting the image data. Instead, it was
only uploaded to the GPU texture which could be deleted at any time.
This was the case when changing the "3D Hardware Texture" setting which
causes a texture flush.
This fixes#1961.
This can be used by the various subsystems for cleaning up Lua
references before the Lua state is destroyed. This avoids having
dangling references to the Lua state which would cause segfaults later
on.
The first subsystem to use this is the dynamic SEXP system which had
dangling references due to keeping Lua references to the SEXP functions.
This fixes#1954.
Removed a lot of unused functions.
This is mostly a cleanup of a prior refactoring.
There where a lot of unimplemented functions remaining from renaming.
Removed several outcommented parts of code.
This makes some general changes to the particle parsing code. It moves
the trail effect option to the end of the options list to remove an
ambiguity in the resulting parsing code. This is done in a backwards
compatible manner so existing tables will not be broken by this.
This also introduces support for specifying single number ranges
without the parentheses to make that easier to use.
Bad data can cause the name search to fail, and if change-ai-class was called with an invalid AI class, it could cause later invalid array accesses (using an index of -1).
These were all cases where the parameter was the new value when setting
a variable. The variables should always be initialized when that code is
reached but it is still better to check the pointers before using them.
These were found by @niffiwan.
Previously, these two SEXPs could only be used in single-player; now they can be used in multiplayer. (This now allows Admiral MS's ship save/load script to work in multiplayer too.)
Inspired by Parias's patch included in the FSPort Co-Op Mod Beta (https://www.hard-light.net/forums/index.php?topic=88385.0) though with some modifications.
The code already only recomputed collisions if we moved a ship or a wing, but this further optimizes things so that only ships or wings that can collide will cause a recomputation.
precalculate warp values before beginning warp, and use them throughout the warp instead of recalculating in every function
standardize on always using the entire docked assembly for length and half-length calculation, instead of some places the assembly and some places just the dock leader
consolidate and simplify the compute_warpout* functions in light of the above
This will automatically call the destructor of a type of Lua calls the
garbage collector for an object of that type. This is the last step
towards fully supporting non-trivial objects in the Lua API and all
previous workarounds have been removed.
This is pretty much similar to the value setting changes. This is a much
safer solution for getting values out of the scripting system which has
compile time validation for move-only types.
This commit changes the way the scripting API works by properly using
the newly available type information for moving the FSO resources into
the memory supplied by lua. This has full support for rvalue references
which will make it possible to use move-only types with the scripting
API.
This also makes the API much safer to use since it doesn't use pointers
to local values anymore which made it very hard to use the API in a
different context without causing issues.
This only covers writing the FSO values to Lua. Getting values back is
not covered yet.
This was previously used for allowing scripts to set arbitrary values on
scripting objects. However, it was used by only a few scripting
functions and, as far as I know, no script uses this features.
This removes that feature which simplifies the code ade_index_handler
of.
This also simplifies the code that handles the userdata for libraries
provided by FSO.
They updated their Qt version and didn't update the documentation page.
This fixes the recent build errors by using the 5.9 symlink which is
linked to the most recent version.
This replaces the previously used defines with inline functions which
fixes a few warnings if the macros were ever used. This also changes
fsspeech.cpp so it is compiled always since it has no dependency on the
underlying speech system.
The changes from #1752 changed how the offset was computed but the
cubemap code did not update the initial offset computation to account
for this.
This fixes#1921.
Previously, the game uploaded all mipmap levels found in the image files
and then selected which ones it will use by using GL_TEXTURE_BASE_LEVEL.
This unnecessarily used additional GPU memory which is especially bad if
the player already needs to use a lower detail level. This fixes that by
only uploading the necessary mipmap levels.
This adds the "no sparks" flag for subsystems which disables the
generation of spark sources for that subsystem when it is hit.
This was requested by Axem.
Travis CI recently added support for running builds in Windows. This
adds support for testing compilation on Windows using that feature.
The newer version of Visual Studio and MinGW required some code changes
and an update of Google Test which is included in this commit.
* Adds Accept Mission Outcome Event to Game Events
Adds Accept Mission Outcome Event to Game Events, so scritps and other things can be called only when a campaign mission is accepted.
* Fixed double entry
* Define CHA_CMISSIONACCEPT
Adds line to define new conditional hook, CHA_CMISSIONACCEPT
* Add flag_def_list for On Campaign Mission Accept
Adds the proper flag_def_list for "On Campaign Mission Accept" CHA_CMISSIONACCEPT
* Runs New Conditional Hook
Runs the new conditional hook for "On Campaign Mission Accept"
* Reverts event changes
* Reverts state changese
* Reverts post_event change
This adds a new AI goal which is equivalent to play-dead except that it "sticks". It doesn't clear the goal list
so it will continue playing dead until the goal is removed or another goal with a higher priority is added.
In FRED, if all docked ships had their arrival cue set to false, none of them would be loaded
in the mission because there was no dock leader to bring in the entire group. This PR fixes that
by choosing an arbitrary ship (the biggest ship according to ship_class_compare) to be the
dock leader. This consequently fixes issue #1877 because the wing is able to find its ship.
This maintains the type information which can be used for enforce
const-correctness and also for implementing more advanced ways of
handling the type information.
This appears to be a leftover from the development of the shadow
rendering code. The shadow FBO was allocated twice but only one was
used. This removed the unused code and also ports the improved error
handling of that code over to the actual shadow FBO creation code.
This allows the WE_Default warp type to be used with any warp fireball in fireball.tbl. The fireball can be used by specifying its unique ID for the existing $Warpin type and $Warpout type options in ships.tbl. The warp type is managed by bitwise-OR'ing a flag to the fireball's index.
This was an oversight in the JSON changes since those were made long
before the CFile location flags were a thing. This uses the correct
location flags for enumerating pilots for conversion.
This changes the pilot reading code to always use JSON files for storing
the pilot data. Old pilots are converted to the new format when FSO
starts and after that point only JSON pilots will be used.
The warp-effect SEXP can now specify other animations from fireball.tbl that are not necessarily the standard or Knossos animations. Additionally, the SEXP can now specify the duration for the opening and closing of the warp effect.
Nobody ever thought to add a reset-post-effects SEXP to complement set-post-effects, so this remedies that. Also, a few minor edits were made to the scripting documentation.
This adds the runtime and compile version of the used SDL library to the
start of the debug log. This was requested by ngld and should make
diagnosing some errors easier.
The special value DIRECTIVE_WING_ZERO (defined to be -999) is used to
signify to the directives system that an is-destroyed SEXP was found
which specified an empty wing. However, if a second is-destroyed-delay
SEXP is present in the same directive then the count of the parameters
is added to -999 which makes means that the directives system then
displays it on the HUD as a negative number.
This fixes that by resetting the counter to 0 if a second SEXP
encounters the special value which fixes the issue in the supplied test
mission. There are probably other edge cases when using multiple
is-destroyed SEXPs in a directive so I added a warning to the SEXP help
which lets the mission designer know that it is preferable to specify
multiple parameters instead of using multiple is-destroyed SEXPs.
This fixes#1722.
This should make the line draw list class behave identically to the old
line rendering functions. This caused a few issues where the lines were
drawn outside the scissor area which made them invisible.
This fixes#1655.
This makes the deferred fog rendering code use the nebula background
instead of the single fog color for the background.
This is not an ideal solution since objects fade to the fog color
instead of the color of the background but it's better than rendering no
background.
This changes the FFmpeg code to not use av_seek_frame anymore if looping
is not required. This fixes an issue when playing MVE movies since that
format does not support seeking.
This fixes#1828.
Optionally play a sound when autoaim becomes active, and another sound
when autoaim becomes inactive
Credit to zookeeper - I'm just pushing this into master!
This was reported by ngld who experienced issues with Knossos since FRED
did not terminate properly when asked to provide the command line flags.
This should fix that.
This should fix an issue with the playback speed of APNG files which is
present in the current builds. This does not include the Mac libraries
since I cannot compile the libraries for that platform.
This adds a playback property for making the movie loop to the start
when the end is reached. The way this is done is by simply keeping the
decoder running even if the end of the movie is reached. Then the movie
is reset to the beginning and decoding continues. The player detects
this reset by examining the frame times which keeps the playback
constant.
This also includes support for this in the movie scripting API.
This was needed by the restart dialog action and got removed since the
Discord changes needed to know if a mission was active or not.
I removed the code which changed the mission file name and replaced it
with some internal handling in the discord code which should now handle
mission restarts better.
This fixes#1815.
The original issue was reported by Novachen in #1754 where a significant
slowdown was encountered in the controls menu (Ship and Misc tabs). I
traced the cause of the slowdown to repeated uploads of the NanoVG font
atlas texture even though no changes were necessary.
The root cause of the issue was that NanoVG did not handle invalid UTF-8
sequences at the end of a string properly. The UTF-8 decoder returned a
success code even though no code point was decoded which lead the rest
of the code to believe that the font atlas needed to be recreated.
This fixes#1754 by properly handling that case.
This also fixed an assertion failure if NanoVG was asked to render
2D elements without any vertices.
This adds a mission file option for ships which allows specifying a
different string which should be used for displaying the name of the
ship to the user. This name will not be used in SEXPs or other ship
lookup functions so it can be freely translated and two ships can also
have the same display name.
The new feature can be used by adding $Display name: <string> after $Name
for a ship in a mission file. I think I added proper support for FRED
(and qtFRED) so that this new value is properly saved but it would be
great if someone could test that.
This implements one of the features requested in #1730.
1. Removes unused parameter
2. Applies 'static' keyword to the routine.
Together, these two changes should help the compiler generate
more efficient code.
Signed-off-by: Peter Mitsis <[email protected]>
Removes two unused parameters from ai_ship_hit(). Instances where this
routine are called are also updated.
This should result in slightly more efficient code.
Signed-off-by: Peter Mitsis <[email protected]>
Removes the unused parameter from the routine. This has a small
ripple effect such that it results in an unused parameter in one
of the routines from which it is called.
Signed-off-by: Peter Mitsis <[email protected]>
1. Removes unused parameter
2. Applies the 'static' keyword to the routine.
Together, these two changes should help the compiler generate slightly
more efficient code.
Signed-off-by: Peter Mitsis <[email protected]>
1. Removes unused parameter
2. Applies 'static' keyword to the routine
Together, these two changes should help the compiler generate slightly
more efficient code.
Signed-off-by: Peter Mitsis <[email protected]>
1. Removes an unused parameter.
2. Applies the 'static' keyword to the routine.
3. Applies the 'const' keyword to the remaining parameter.
Together these changes should help the compiler generate slightly more
efficient code.
Signed-off-by: Peter Mitsis <[email protected]>
Applies the 'static' keyword to the routine as it is only used in the
module in which it is defined.
Removes an unused parameter.
Together, these two changes should help the compiler generate slightly
more efficient code.
Signed-off-by: Peter Mitsis <[email protected]>
Adds the 'static' keyword to the routine as it is only used in the
module in which it is defined.
Removes its unused parameter (and updates location where it is called).
Signed-off-by: Peter Mitsis <[email protected]>
Removes the unused parameter from the routine and adds the 'static'
keyword to the routine as it is only used in the module in which it
is defined.
Signed-off-by: Peter Mitsis <[email protected]>
This routine is only used in the module in which it is defined, so the
'static' keyword has been applied to it.
One of its three parameters was unused, so it has been removed.
Finally, the 'const' keyword has been applied to appropriate arguments.
These changes should help the compiler generate slightly more efficient
code.
Signed-off-by: Peter Mitsis <[email protected]>
The routine ai_turn_towards_vector() had an unused parameter (frametime)
and it has been removed.
Each of the instances where this routine is called have also been updated
to reflect the parameter removal. As this resulted in the routine
swarm_update_direction() suddenly having an unused parameter, that routine
and the places where it is called have also been updated (remove
unused parameter).
Signed-off-by: Peter Mitsis <[email protected]>
The files are now exclusively stored in the top level user directory to
make the shader cache not dependent on the current mod. This also adds
some code which removes all old shader cache files which may be stored
in the old (per-mod) location.
The amount of output parameters is becoming quite large which makes it
harder to add new input parameters. For that reason I converted the
existing output parameters to a struct which cleans up the function
signature a lot.
This is similar to the other changes I already posted. Here the sound
instance handles are converted to their own handle type which will make
it easier to use the sound API.
Removes the unused parameter from ai_big_maybe_enter_strafe_mode().
Each place where this routine is called has been corrected to reflect
the updated API.
The 'const' keyword has been applied to remaining parameters as
necessary.
Signed-off-by: Peter Mitsis <[email protected]>
Adds the 'const' keyword to the parameters in the routine
ai_big_strafe_maybe_attack_turret() as they are unchanged
by the routine.
Signed-off-by: Peter Mitsis <[email protected]>
The routine ai_big_strafe_maybe_retreat() is only used in the module in
which it is defined. Consequently it now sports the 'static' keyword, and
no longer uses the 'extern' keyword in its forward declaration (which has
been moved to be colocated with other forward declarations).
Secondly, since it was only using one of its two parameters, the unused
parameter has been removed.
Thirdly, since its only remaining parameter is not modified by the routine,
the 'const' keyword has been applied to it.
Signed-off-by: Peter Mitsis <[email protected]>
The routine ai_big_ship() is empty, and appears to have been since it
was initially added many years ago. Removing it helps eliminate some
unused code.
Signed-off-by: Peter Mitsis <[email protected]>
The routine ai_big_maybe_fire_weapons() is only used in the file in
which it is defined and is thus a good candidate for being declared
'static'.
Furthermore, as it was only using two of the five parameters, the
three unused parameters have been removed and all instances where the
routine is called have been updated.
Signed-off-by: Peter Mitsis <[email protected]>
This uses the Discord Rich Presence API for improving the integration of
FSO into Discord. At the moment this includes state notifications for
being in the main hall, the command and mission briefing and in-mission.
When in-mission it also includes the elapsed time of the mission with
support for time compression.
The details part of the notification includes the campaign name and
mission name if possible.
This will make the error message clearer instead of just showing a
cryptic Assert message. This cannot be handled by a simple warning since
capping num_debris_objects to MAX_DEBRIS_OBJECTS would then cause issues
when reading the rest of the header.
Some of those are fixed in the newest version from their git repository
but I don't want to do a full update just for that.
modernize-make-unique was disabled since clang-tidy apparently doesn't
respect the language setting and make_unique is only present in C++14.
This allows to use the built-in lua "require" function with our file
system. This will help organize complicated scripts and it will also
allow to use libraries which were designed for this system.
To enable this change, this includes a new mechanism which allows to
load scripts from the default file system so that the files don't need
to be included in every mod. The default files can be overridden by a
mod if a special mod-table option has been set, similar to how external
shaders are handled right now.
Nightmare discovered an off-by-one error when checking the validity of a
particle effect handle. Since the new ID system makes that much easier
and less error-prone I decided to go ahead and convert all handles to
an ID typedef which also fixes the reported bug.
This was causing issues when using the new scripting API in JAD where
there were a lot of 2D operations which filled up the immediate mode
buffer. The reason was that GL_ARB_vertex_attrib_binding the relative
offset is limited and the movie code adds the immediate buffer offset to
the vertex layout which then hit the offset limit set by OpenGL.
This fixes that by using the normal byte offset method which is already
used by the render_primitives functions.
This adds an API for the scripting system which allows it to load and
display movie files using the standard movie player code which includes
multi-threaded frame decoding.
This allows to directly display RGB(A) movies without transcoding them
to YUV first. This allows the movie player to support APNG files (which
are supported natively by FFmpeg) with an alpha channel and without
converting them to YUV first.
This unifies how our CMake system handles adding source files to the
project so that all subprojects use the same mechanism. This also makes
it easier to add a new source folder to the code project since you don't
need to editor three places at the same time anymore.
The bounds check was not correct for 1-based indices. I moved the
Lua->C++ index conversion before the bounds check so that it makes
more sense.
Also, atoi isn't a reliable way for converting a string to an integer.
The previous code simply set a boolean flag to indicate that the data is
"invalid" which failed the campaign loading operation. With these
changes, those entries will simply be skipped. That can happen if a mod
added or removed a ship or weapon class or if two campaigns share the
same campaign name.
Previously, if parse_weapon_targeting_priorities() couldn't find a weapon matching the name, it wouldn't parse the "+Target Priority:" line, so it would cause a parsing error when the parser failed to find "$Name:" or "#End" there. Now, the "match not found" codepath still parses it so that no mismatch occurs. Also, I reordered the function so that the parsing wasn't happening in the middle of a loop through the list of weapon types, because it made me cringe.
Ideally it wouldn't be an optional argument at all, but that would break backwards-compatibility, so instead it'll just return an invalid ship handle instead of calling ship_create() with a class of -1. In addition, the Assert from ship_create() meant to guard against invalid ship_type values is now an Assertion that actually says what the invalid value of ship_type was, to make future debugging easier.
I added this hack a long time ago and it always bothered me why I didn't
come up with a better solution. This is the better solution which uses
the popup_active function for determining if gr_flip is called within a
popup.
Lua's Ship.TargetSubsystem VIRTVAR, when set, would write to an attribute of the Ships[] array based on an objnum instead of a ship instance index. Since MAX_OBJECTS is drastically higher than MAX_SHIPS, then depending on how many objects happen to be in the mission, an out-of-bounds array access can be easily generated. This commit makes sure to use the objnum instead as an index to the Objects[] array, and then retrieve the ship instance from it.
This converts the previous int handles to a strongly-typed wrapper
handle which will make the API more self-documenting and will ensure
that wrongly used handles are detected at compile time.
I already found a few mistakes with these changes which I also fixed
here.
The current scripting hook is pretty simple and straight forward but it
makes a couple of scripting applications harder to implement than
needed.
For example, a lot of scripts need to do some work every frame
for all or some objects. The script needs to manage an internal list of
all the objects that are affected by that list which includes removing
invalid objects to conserve resources. This effectively mirrors what the
engine already does and adds unnecessary overhead.
In these changes I added a generic event system which can be used by any
part of the code for providing callbacks when a specific event occurs.
As an example, I added hooks for the pre- and post-move events to the
object class which are called before and after physics are applied to an
object.
I integrated that feature into the scripting system so now a script can
simply register a function as a callback which will be called whenever
the target event is executed.
This adds a scripting API which can be used for adding and removing
background from a mission similarly to the existing SEXPs but with full
support for floating point numbers.
This was requested by Axem on Discord.
This is present in the variable modification dialog but not in the
editor which is used for adding a variable. This also adds the
validation to the editor for adding a new variable.
Caching bitmaps between missions is no longer a problem for modern
system and this will improve the default load times when playing more
than one mission.
By enabling the "$Use Actual Primary Range:" profile flag (which can also be set on a per-AI-class basis), the code to determine if the AI should fire its primary weapons will not only perform its current "range based on speed of weapon and target" calculation, but it will also compute the weapon's actual range and not fire if the target is outside of it.
This was not present previously which meant that the command line values
were simply ignored by the engine. This adds the scaling back in which
should restore the lighting behavior to the previous status.
When a ship with three primary banks has a Nolink weapon in one bank, the other two banks are still allowed to link; if that Nolink weapon has a limited ammo supply, however, depleting that ammo supply would disallow primary linking even though the weapon never contributed to primary linking in the first place. This commit changes the logic to only care if the depleted weapon doesn't have the Nolink flag. The ideal solution is probably to change how primary linking works so that even if the weapon doesn't have the Nolink flag the remaining primaries can still link, but that would be much more involved.
If a sound did not receive a valid sound name then the parsing function
would exit early and not set the pitch range properly. This would cause
a divide by zero if the duration of the sound was queried.
This moves the initialization of the pitch range to the start of the
parsing functions which makes sure that the range is initialized even if
the function exits early.
This automatically removes old shader cache files from the mod directory
when FSO is started. Those old files are likely to not be used anymore
so this will reduce the amount of disk space FSO uses for the shader
cache.
This adds an identification of the OpenGL implementation to the shader
content hash to avoid issues when using the same FSO install with
multiple graphics drivers.
Also adds support for querying the supported binary formats and
gracefully handling missing support for the format of a stored shader.
This can be useful when downgrading the version of a graphics driver
since the older version may not support the binary format yet.
The TGA loading code pretends that it does pixel conversion but doesn't
actually do that. This changes ensures that this circumstance is
communicated to the caller of bm_lock which will allow that code to
handle the case properly.
This was reported by Bomb3rman on discord.
The cap-waypoint-speed sexp only works for speeds above 0; this PR changes the documentation to clarify that. I also tweaked an if() block in ship_return_time_to_goal because it used a >=0 comparison whereas every other comparison used >0. (This is only for consistency, because the >0 check is used before this point would be reached.)
This will make debugging config location issues easier since the log
will state which path os_is_legacy_mode took while determining the
legacy mode status.
This removes the clipping plane submodel removal code and replaces it
with shader code that generates vertices outside the clipping volume if
a model should not be rendered. This even improved performance since
clipping no longer needs to be active for all model rendering
operations.
This should finally fix#1579.
This can be used for mark parts of the code which should be unreachable
in normal execution. In debug mode, if such a statement is reached an
Error dialog is shown which aborts the execution. In release mode the
macro is replaced with a compiler specific expression that lets the
compiler know that this part is unreachable which allows it to optimize
the code better.
This allows to use external subtile files (currently only SRT is
configured) for providing subtitles for movie files. This should be more
universal since it also supports container formats with no support for
subtitle streams.
To use this code the srt file needs to be named
"<movie name>-<language code>.srt" where the language code is the file
extension name specified in the localization table. For english the
"-..." part can be omitted.
This adds support for rendering models using thick lines (that means
lines wider than 1 pixel) which is required by the hardpoint HUD gauge.
This feature was present before the switch to OpenGL code and had to be
removed since the core profile does not support rendering lines wider
than 1 pixel.
This uses a geometry shader for converting all the triangles from a
model to 3 quads along the triangle lines which are as thick as set by
the model renderer. Geometry shaders are quite slow if they generate a
lot of geometry (and this generates 4 times the usual amount of geometry
in the shader) so it's probably not a very fast rendering operation but
it is only needed once per frame so it shouldn't be too bad.
I also added support for the RenderDoc API since I needed that for
debugging and it might be useful in the future. It will only become
active if RenderDoc is actually attached to the process so in most cases
the new code will do nothing.
This is largely based on how the existing code is formatted and is in no
way enforced by CI or anything else. This is only so that we actually
have a clang format file in the VCS since it's very useful.
Since there is no OpenAL context if sound is disabled there were errors
when calling alGetError on a non-existant context. This fixes that by
aborting the sound API call when the sound system wasn't initialized.
The current code drops trailing white space which can cause issues if
the translated string is used in concatenations. The retail tstrings.tbl
has some entries with white space at the end but since those strings are
not used for concatenations (or else this issue would have been found
earlier) this change should not cause issues there.
This fixes#1739.
The assignment operator and copy constructors could be replaced with
their default implementations. The destrutor was also not needed since
it only executed the same action the default constructor would have
done.
I also fixed a few issues where the internal char array was used as a
mutable string which changed the string after it was parsed which is not
good(TM).
This also replaces all user-facing occurences of usages of name to use
the new function so that the correct, possibly translated, name is displayed
to the user.
This turns the Warning about missing 640 interface art into a log print. This applies to all instances of 640/1024: loading screens, cbrief and briefing backgrounds, and ship/weapon selection backgrounds.
There were some reports that using a newer launcher together with an
outdated launcher was causing some issues since the new launcher would
write the new config file which would cause FSO to ignore the changes of
the old launcher since the new config file already exists.
This fixes that by adding a check for when the config locations were
last modified. On Linux and Mac it checks when the old config locations
were modified last while on Windows it checks the registry to determine
if there was a change after the new config file was created.
Multiple function pointer dereferences are valid in C but do not change
the result of the operation. The graphics API had some function
definitions which used multiple pointer dereferences while the rest of
the functions did not.
This changes all occurences of the double dereferences to normal GR_CALL
declarations to keep the style in the API definitions consistent.
The code did not account for unicode escape sequences when inserting
scrambling characters which distorted the text and fequently caused
invalid UTF-8 sequences to appear in the text. This fixes that by
using the text iterators already present in the game code. I needed to
rewrite the logic of this block a bit since the previous logic could not
be converted to the way we need to handle unicode sequences at the
moment.
This fixes#1720.
This changes how the bitmap slots are managed by the bmpman system.
Instead of allocating a fixed-size array when the game starts this will
manage multiple "blocks" of bitmap slots. When the engine runs out of
slots in the already allocated blocks it simply creates a new block and
allocates the new slot in that.
This removed the hard limit on how many bitmaps can be loaded at the
same time and should fix issues encountered by mods which use a lot of
bitmap slots (I'm looking at you Spoon).
This implements the idea described in #1503.
Apparently, Appveyor has removed the Qt version 5.7 from their servers
which was used by FSO previously. I have updated the paths to use Qt
5.9.5 instead now but there is a problem with Visual Studio 2013 since
there is no 32-bit Qt version for that compiler installed in the
Appveyor system.
For that reason, I decided to use Visual Studio 2015 instead for the
32-bit builds which means that Visual Studio 2013 will not be tested by
Appveyor anymore. Since no one is using that compiler version anymore
that shouldn't be a big issue.
This should fix the CI issues seen on recent PRs and commits.
These operators used to warn and return NAN if they were given a bit index out of range. For FREDding convenience, out-of-range bit indexes are now a no-op. This is particularly helpful in the situation where a FREDder needs to evaluate an extended bit array, one 32-bit chunk at a time, e.g.
0-31 bits: offset 0
32-63 bits: offset -32
64-95 bits: offset -64
96-127 bits: offset -96
Because the sexp system always evaluates every argument, three out of four branches were always evaluated with invalid bit indexes (negative or too large) even if the sexp logic only used one branch. The new method silently bypasses this behavior.
The viewer mode check seemed to be wrong but I am not entirely sure if I
fixed this correctly. The Viewer_mode variable is a big mess of bitflags
that are not very consistent in what they mean.
This will report the usage of old coding patterns in new code.
modernize-raw-string-literal is disabled since it doesn't work right
with strings with special escape sequences in them.
modernize-use-using is disabled since typedefs are more common in the
FSO code.
This will only check the lines that were changed by a commit or pull
request. This makes it possible to enable more clang-tidy checks without
having to fix all occurences of the warnings in the code base.
Please note that the changes do not work correctly with rebased branches
due to the way Travis CI supplies the commit range. Pull requests will
always be checked properly though.
There were actually two bugs here that were fixed:
1. The model draw list code disabled the fog rendering when it thought
it was it deferred rendering mode but did not account for explicitly
disabling the deferred renderer.
2. The fog effect was applied to both the emissive color and the base
color simultaneously which caused visual errors when rendering fogged
objects using the deferred renderer.
This fixes#1717.
The unused parameter warning cannot be disabled easily in release mode
for clang-tidy so this needs to be done to avoid false-positived in
release mode.
This enabled qtFRED building for all deployments (releases, nightlies
and test builds). qtFRED is relatively stable now and should be
available for wider testing which may be provided by nightly builds.
This also adds AppImage support fot qtFRED although I still couldn't get
it to work entirely since there is some sort of libpng issue which
prevents icons from showing up correctly.
The sexp_tree widget makes the model based dialog a bit ugly here since
it is required for some model operations even though it is a UI
component. In the future it could be split into a model component and an
UI component to allow better separation between model and UI.
This adds a new class which allows to create type safe resource handle
types. At the moment, the engine uses ints pretty much everywhere for
providing handles to resources created by the specific subsystems. Since
all ints are the same to the C/C++ typesystem it is perfectly legal to
pass a sound handle to the graphics API as a buffer handle which will
obviously cause issues.
This adds a new type called "ID" which is a wrapper class for a generic
handle but with added type safety. An instance of this class cannot be
passed to a function expecting another type of handle which provided
compile-time type safety for these APIs.
As an initial test I converted the game sound handles to this new type.
I already found a bug in the mainhall system thanks to this new type.
The mainhall used the game sound handles as sound instance handles which
probably meant that that specific code never really worked right. I
removed the code since there was no better alternative for fixing it.
The current particle system uses dynamic allocation of particle
instances for keeping track of particle instances. This adds unnecessary
overhead in case the code does not need a handle to this particle which
is the case in pretty much all instances.
The new non-persistent particles are stored in a standard vector without
dynamic allocation which should make the processing steps using this
vector much faster and allow better scalability in case more particles
are used by a mission.
This is pretty much an exact copy of the mission save code of FRED2. I
removed the campaign save code for now since it requires some
interactions with the campaign editor which does not exist yet.
TeaCI is a CI service which provides MinGW CI builds (in Docker
containers so no "real" Windows machines). This would be useful for
validating the Windows only code with additional GCC warnings. It would
also make sure that the MinGW setup we currently have continues to work.
This fixes various issues I found while trying to compile FSO in a cross
compilation setup using MinGW. This is a prerequisite for merging Tea-CI
support.
The crash was caused by a static initialization order problem where the
static initializer of the FRED app was called before the initializer of
the outwnd filter vector.
This fixes that by initializing the vector as soon as necessary through
the use of a function with a static variable.
Synchronize the two subsystem-of-ship checks in sexp.cpp and sexp_tree.cpp. Mostly this is just adding OP_BEAM_FLOATING_FIRE to sexp_tree.cpp because whoever added that sexp forgot to add it there.
Returns true if the ship is in a turret's FOV, false otherwise. Requested by JSRNerdo. Uses the object_in_turret_fov internal function which is the same one used by the turret code when it checks whether it can fire.
The CMake code did not specify that qwindows.cll also needed to be
distributed with the application which caused errors for users who had
not installed Qt on their system.
This should make qtFRED redistributable without needing a QT
installation.
Applying the 'static' keyword to applicable routines both informs the
developer where the routine is likely to be used as well as allows the
compiler to perform additional optimizations.
Signed-off-by: Peter Mitsis <[email protected]>
Applies the 'static' keyword to applicable routines to both make it
more clear to the developer where such routines are likely to be used
as well as to provide additional information to the compiler so it can
make better optimizations.
Signed-off-by: Peter Mitsis <[email protected]>
Applying the static keyword to applicable routines makes it both
more clear to the developer where those routines are likely to be
used as well as provide additional information to the compiler to
allow it to make better optimization choices.
Signed-off-by: Peter Mitsis <[email protected]>
Applies the 'static' keyword to various sihp related routines. This both
makes it more clear to the developer where those routines might be used
as well as allowing the compiler to leverage that knowledge and potentially
make additional optimizations.
Signed-off-by: Peter Mitsis <[email protected]>
Removes the following two routines as not only are they unused, but
they have been unused for years.
get_debris_from_same_group()
asteroid_get_random_in_cone()
Signed-off-by: Peter Mitsis <[email protected]>
Applies the 'static' keyword to various asteroid routines. This both
makes it more clear to the developer where those routines might be used
as well as allowing the compiler to leverage that knowledge and potentially
make additional optimizations.
Signed-off-by: Peter Mitsis <[email protected]>
Removes the extern declaration of hud_target_asteroid() from
keycontrol.cpp as it is not used in that module.
Signed-off-by: Peter Mitsis <[email protected]>
This was missed when converting the model uniforms to a uniform buffer
and caused some issues with team colors. This sets that uniform to the
value it had before the uniform buffer changes.
This fixes#1683.
This copies the original FRED code for initializing the individual game
systems to qtFRED. This should fix the various issues caused by missing
game system initialization calls.
The initial JSON flags output lacked this information but it is needed
for proper support by the launcher. This adds a new entry in the JSON
structure without changing anything else so it does not require a new
output version.
This fixes two possible assertions and two possible buffer overflows
which could have been caused by a mission with wrong values for
$num_stages and $num_icons.
This fixes#1664.
Since atoi return 0 on error the code tries to access the waypoint list
with index -1 which causes an assert in the lookup code. This fixes that
by using the error detection capabilities of strtol.
This adds a step to the post-mission cleanup where we explicitly go through Objects and call obj_delete on everything not already deleted; this obviously needs testing.
Also a few cleanup steps in lab_init to make sure the lab isn't contaminated by leftover data from previously played missions.
FreeSpace: The Great War (Released 1998) and FreeSpace 2 (1999) are mission-based space combat simulators, like X-Wing/TIE Fighter and Wing Commander. Among the greatest games of the genre, they were also effectively the last.
The FreeSpace series follows humanity and their Vasudan allies as they fight to withstand the xenocidal, enigmatic Shivans, a species of unknown origin, vast technological capability, and seemingly limitless malice.
## FreeSpace Open
Thanks to Volition's generosity, we've continued development of FreeSpace 2 as FreeSpace Open, building graphical enhancements to bring the original games up to modern standards, telling new stories set in the FreeSpace universe and original worlds, and creating spectacular total conversions that let players fly in the beloved universes of Babylon 5, Battlestar Galactica, Wing Commander, and Star Wars.
## Hard-Light Productions
HLP is a fan community built on love and open-source code. We're dedicated to bringing modders together and giving them a place to share their own hard work and draw inspiration from the work of others. Thanks to Volition's generosity, we've continued development of FreeSpace 2 as FreeSpace Open, building graphical enhancements to bring the original games up to modern standards, telling new stories set in the FreeSpace universe and original worlds, and creating spectacular total conversions that let players fly in the beloved universes of Babylon 5, Battlestar Galactica, Wing Commander, and Star Wars.
Find us at:
- Our [website](http://www.hard-light.net/) and [forums](http://www.hard-light.net/forums/)
After installing retail FS2, use [Knossos](https://fsnebula.org/knossos/) to upgrade to the most recent release of FSO. Knossos is an advanced mod manager and launcher for FSO.
## Improvements
The new open source game engine has several distingushing features including:
- Linux and Mac OS X support
- OpenGL support
- OpenAL audio support
- Easy mod installation
- OGG support
- Hardware transform, clipping, and lighting
## The FreeSpace Upgrade Project
While the SCP improves the code of the game engine to enable new and exciting features, the FreeSpace Upgrade Project (FSU) creates material that takes advantage of the improved game engine.
The FSU improves the ships, effects, and background elements of FreeSpace 2. Every now and then these improvements are released as a pack called MediaVPs. These assorted improvements enhance the graphics of the game.
While the best way to experience the FSU is by playing the game with it, you can watch this [comparison video](https://www.youtube.com/watch?v=RM1YC_gK-qo) between 1999 and 2019 to have an idea of how much more beautiful FSU makes the game.
^(Much of this content was pulled from existing sources, such as InsaneBaron's "What Is Hard Light Productions" [thread](https://www.hard-light.net/forums/index.php?topic=86650.0), the Wiki's [Getting Started article](https://wiki.hard-light.net/index.php/Getting_started) and more.)
- With this release we decided to drop the "`3.Major_revision.Minor_revision`" versioning scheme in favor of a year based scheme since the Major and Minor versions did not have much meaning anymore. Instead the scheme will now be "`<year>.<number that is incremented every release>.0`". The last 0 is still there because some of our systems expect that. It will be gone at some point.
### Added
- Full Unicode text support: You can now use non-ASCII characters without having to worry about special fonts and special characters. This is an opt-in mod flag.
- Translation features for making it easier to only distribute one version of a mod which includes all languages.
- OpenAL Soft is included by default in binary distributions of FSO now.
- System for dynamically adding new SEXPs. With this a Lua script can expose functionality to the mission which can be used exactly the same as a standard SEXP with all the usual editing features in FRED.
- Support for displaying decals on the surface of an object.
- Integrated support for the [Discord Rich Presence API](https://discordapp.com/rich-presence).
- New markup based user interface system using [libRocket](https://github.com/libRocket/libRocket).
### Changed
- Exposed the movie player to the scripting API for advanced display features
- Various OpenGL optimizations for better graphics performance:
- Animations now use texture arrays
- Model uniforms get sent to the GPU using uniform buffers for less overhead
- Various other minor changes
- Converted pilot files from custom binary format to JSON
- Replaced Blinn-Phong BRDF with GGX BRDF
### Fixed
- Refactored bitmap slot handling and removed the fixed upper limit on the number of bitmaps. No more bmpman corruption!
- Support for APNG animations: [APNG](https://en.wikipedia.org/wiki/APNG) is a variant of the established PNG format which allows to store animations instead of single frames in a PNG file. This change allows to use these animation files in FSO which significantly improves usability for modders since they no longer have to store all individual frames as separate images.
- Physically-Based Rendering (PBR): This upgrade of our rendering engine allows to use [PBR](https://en.wikipedia.org/wiki/Physically_based_rendering) assets to make models look more realistic and allow more artistic freedom for modders since they have more control over how a model looks. This also added support for HDR lighting which should improve the overall graphics experience.
- Native particle systems: Particles have always been supported by FSO but the effects that could be created by them were very limited. There were some attempts to fix this by using Lua scripting for more advanced features but that suffered from performance issues. With these new particle systems that feature has been integrated directly into the engine which should improve performance and allow for better effects in the future.
- TrueType Font support: [TrueType](https://en.wikipedia.org/wiki/TrueType) fonts improve the text rendering capabilities of FSO by allowing to use freely scaleable font faces instead of the previous bitmap fonts.
### Changed
- We now use SDL2 on all platforms: SDL is a library for abstracting away the differences between different platforms. We now use SDL2 for all platforms which reduces the amount of platform-specific code tremendously and should result in better usability on all platforms. This was a major change that has been in development for several years. Here are a few key features that were added:
- Pilot and configuration data is now stored in the correct location across all platforms (this allows to run FSO on Windows from the Program Files directory without administrator rights)
- All platforms now use the ini files for storing settings. This fixes a lot of issues with the registry on Windows.
- Better support for input devices. Since SDL handles keyboard, mouse and joystick input we now have better support on newer OS versions. Note: This does not mean that we support multiple joysticks (yet). There is ongoing development effort to support this but this release does not have that yet.
- CMake build system generation: This isn't relevant for players but we are now using [CMake](https://en.wikipedia.org/wiki/CMake) for handling compiling our builds. This improves cross-platform support and allows to implement advanced compilation features across multiple platforms. Modders will like the new "FastDebug" builds which are like the previous "Debug" builds but are compiled with all the optimizations of normal Release builds. That should make modding a lot easier since you can now debug your mod with almost the same performance as a Release build.
- Improved shield effects: Rendering of the shields is now handled by special shaders which improves the overall quality of the effects and allows more freedom for future effects.
- Use OpenGL Core Profile for rendering: This is another major graphical upgrade which adds support for the OpenGL Core profile across all platforms (this was also made possible by the SDL2 integration). This upgrade allows us to use more modern rendering techniques and is especially useful for our Linux users who use the open-source Mesa drivers since our shaders failed to compile with those drivers. Now everyone will be able to enjoy the new graphical features added in this and previous releases. This also made some internal changes to how we handle rendering which improves the usability of our rendering engine within our code.
- Use FFmpeg for video & audio decoding: [FFmpeg](https://www.ffmpeg.org/) is a multi-media library which exposes functionality for decoding video and audio files to their raw form so that we can use that data. Thanks to this library we can now play 1080p cutscenes without any stuttering or frame-timing issues. It also allows to use more advanced audio and video codecs such as H.264 for video or Opus for audio.
- WebUI based multiplayer standalone server (for non-Windows platforms)
- Toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the `alter-ship-flag` SEXP
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization!
-`player-is-cheating` SEXP
- New ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the `free-afterburner-use` flag with `alter-ship-flag`)
- Experimental configurations to make AVX builds (see [this post](http://www.hard-light.net/forums/index.php?topic=85566.0) for more explanations)
- Frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders)
### Changed
- Unstretched interface screens
- Automatically non stretched HUD gauges and simpler modder options for placing HUD gauges
-`show-subtitle-text` can now display messages as well as raw text
- Allow a user-specified number of credit images
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state
- Allow the specification of the positions of medals, callsigns and labels on the medal screen.
- The number of medals is now dynamic!
-`is-facing` now works for things that aren't ships (like waypoints!)
- allowing `fade-in` and `fade-out` sexps to use any color, not just black, white and red.
- Objecttype tables support for deciding how enemies respond to ship classes when disabled
- Allow modders to set a [mood](http://www.hard-light.net/forums/index.php?topic=81991.msg1639770#msg1639770) for builtin messages and then switch the mood for the mission on the fly using a SEXP
- Allow modders to set the chance of builtin messages being sent, how many will be sent per mission and how long is the delay between two messages
- Allow campaigns to be hidden in the campaign and tech rooms ([Game settings.tbl](https://wiki.hard-light.net/index.php/Game_settings.tbl#.23Ignored_Campaign_File_Names))
- Allow mods to set a default campaign ([Game settings.tbl](https://wiki.hard-light.net/index.php/Game_settings.tbl#.24Default_Campaign_File_Name:))
- Split the Locked flag so that you can lock Ships or Weapons on the game loadout screen independently
- Mixed ammo for primary and secondary weapons - [`$Substitute`](http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Substitute:) - Allows you to have a weapon that fires other weapon ammo in a specific pattern (say a Gatling gun with tracers).
- The active support ship limit per side is now dynamic. See [`set-support-ship`](https://wiki.hard-light.net/index.php/SCP_SEXPs#set-support-ship) for more info.
### Fixed
- Various multiplayer SEXP fixes
-`rotating-subsys-set-time` now accelerates properly
- [Fixed a whole heap of memory, logic and coding errors](http://www.hard-light.net/forums/index.php?topic=78044.0) -- using PVS-Studio: C/C++ source code analysis and checking tool
- show-subtitle-text can now display messages as well as raw text - Goober5000
- toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the alter-ship-flag sexp - karajorma
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization! - karajorma
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state - karajorma
- added a player-is-cheating sexp - The E
- allow a user-specified number of credit images - Goober5000
- allow the specification of the positions of medals, callsigns and labels on the medal screen. - Goober5000
- lua function to check if a ship is warp capable, and access to a ship's auto-aim FOV - zookeeper
- is-facing now works for things that aren't ships (like waypoints!) - zookeeper
- experimental configurations to make AVX builds (see this post for more explainations) - The E
- new ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the free-afterburner-use flag with alter-ship-flag) - Admiral MS
- the number of medals is now dynamic! - Goober5000
- frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders) - Swifty + The E
- allowing fade-in and fade-out sexps to use any color, not just black, white and red. - Goober5000
Before you do anything, make sure you have updated your git submodules, either by running `git submodule update --init --recursive` or by cloning the repository with the `--recursive` flag.<br/>
<br/>
For building you will need [CMake](http://www.cmake.org/cmake/resources/software.html). Version 3.4 is required. Once you have installed CMake you should create a build directory where the project/make files should be created, **do not create them inside the source tree!**<br>
<br>
On Windows you can use the `cmake-gui` executable to get a nice GUI, on Unix just use `cmake`. Use the newly created directory as build directory (change to this directory on Unix) and run cmake. On Windows this can be done by clicking the `Configure` button. Choose your compiler version and hit `Generate` when configuring is done. <br>
Depending on the makefile generator used build the `all` or `ALL_BUILD` target to compile the project.<br>
### Available variables to control the build
*`FSO_BUILD_WXFRED2`: Build the wxfred2 project, requires wxWidgets
*`FSO_FREESPACE_PATH`: Sets the path of your FreeSpace install, can be used to automatically run the generated executables with the correct working directory, this is an optional variable. By default this will use the value of the `FS2PATH` environment variable.
*`FSO_BUILD_TOOLS`: Build some tools related to FSO
*`CMAKE_BUILD_TYPE`: Sets the binary build type between `Debug` and `Release` (default)
#### Windows only variables
*`FSO_BUILD_FRED2`: Build FRED2, requires a Visual Studio version that ships with MFC
*`FSO_USE_SPEECH`: Build a binary with text-to-speech support
*`FSO_USE_VOICEREC`: Build a binary with voice recognition support
#### Advanced variables
You should only use these variables if you know what you're doing
*`FSO_BUILD_INCLUDED_LIBS`: Build libraries from the included source
*`FSO_USE_OPENALSOFT`: Use [OpenALSoft](http://kcat.strangesoft.net/openal.html) for OpenAL support
*`FSO_USE_LUAJIT`: Use [luajit](http://luajit.org/) as a replacement for lua
*`FSO_DEVELOPMENT_MODE`: Toggles some development behavior, only use if you really need it.
*`FSO_RUN_ARGUMENTS`: If you run an executable from within the project, these arguments will also be passed to the executable
*`FSO_BUILD_POSTFIX`: Sets a postfix to be added to the executable name, may be useful for release candidates.
#### Visual Studio specific variables
*`MSVC_USE_RUNTIME_DLL`: Use the DLL version of the runtime, experimental and not well tested.
*`MSVC_SIMD_INSTRUCTIONS`: The instruction set the executables will be optimized for.
### Generating an installation package
CMake can automatically generate installation packages of the project. To do this you will just need to run the `package` target of the build system and the package will be placed inside your build directory. On Windows you will have to install [NSIS](http://nsis.sourceforge.net/Main_Page) to use this.
The main instructions for building can be found at our github wiki, on the [Building](https://github.com/scp-fs2open/fs2open.github.com/wiki/Building) page.
####The goal of this file is simply to offer a comprehensive checklist of things we must check when updating the documentation.
1. Changelog:
- Is [Changelog.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Changelog.md) up-to-date with the latest release?
- Is it in the proper [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format?
2. Build instructions:
- If a programmer who never built FSO before read the build instruction at [Readme.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Readme.md), would they manage to build FSO?
- Is the information in the file up-to-date regarding other matters (such as versions of tools mentioned, links to other guides, etc.)?
- Is the information in the [Building](https://github.com/scp-fs2open/fs2open.github.com/wiki/Building) article, and its sub-articles, still up-to-date?
3. Forums:
- Does the [Forum](https://www.hard-light.net/forums/index.php?board=50.0) contain enough clear information to help a new developer find their way into the up-to-date instructions?
- Is there anything that might mislead a new developer to stumble onto old tools, dead links and/or old versions of the project?
4. General documentation files:
- Is the information in the following files up-to-date?
- [About.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/About.md) (Should contain general information about FS, FS2, HLP, FSO and FSU)
- [Authors.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Authors.md) (Should contain information about the original developers, a way to see FSO's contributors, and special thanks to Volition and Dave Baranec)
- [Copying.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Copying.md) (Should contain Volition's Copyright terms and a way to check FSO's Licensing info)
@@ -10,27 +10,62 @@ if [[ ! "$(curl -V)" == *"sftp"* ]]; then
if["$TRAVIS_OS_NAME"="linux"];then
# Since the Travis CI people are not capable of enabling SSH/SCP support for their libcurl we need to build that manually...
# These commands are based on the tutorial from here: http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
# Since the Travis CI people are not capable of enabling SSH/SCP support for their libcurl we need to build that manually...
# These commands are based on the tutorial from here: http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
/wd4592# "symbol will be dynamically initialized" is being generated by a compiler bug, see https://stackoverflow.com/a/34027257 for an explanation - m!m
$<$<CONFIG:Release>:/wd4101># In release mode there are unreferenced variables because debug needs them
/wd4995# "'vsprintf': name was marked as #pragma deprecated" is being caused by our custom definition of vsprintf. I have no idea what causes this or how to fix it - m!m
/wd4723# "potential divide by 0" is caused by some code that definitely will not divide by zero - m!m
/wd4121# "alignment of a member was sensitive to packing" happens in a Windows header - m!m
set_flag(profile,"$ai can slow down when attacking big ships:",AI::Profile_Flags::Ai_can_slow_down_attacking_big_ships);
set_flag(profile,"$use actual primary range:",AI::Profile_Flags::Use_actual_primary_range);
if(optional_string("$override radius for subsystem path points:")){
intpath_radii;
stuff_int(&path_radii);
if(path_radii>=Minimum_subsystem_path_pt_dist){
profile->subsystem_path_radii=path_radii;
}else{
mprintf(("Warning: \"$override radius for subsystem path points:\" should be >= %i (read %i). Value will not be used. ",Minimum_subsystem_path_pt_dist,path_radii));
}
}
set_flag(profile,"$use POF radius for subsystem path points:",AI::Profile_Flags::Use_subsystem_path_point_radii);
mprintf(("Potentially incorrect behaviour in AI goal for ship %s: Ship %s could not be found among currently active, departed, or yet-to-arrive ships.\nPlease check the mission file.\n",Ships[objp->instance].ship_name,aigp->target_name));
status=SHIP_STATUS_UNKNOWN;
}
if(status==SHIP_STATUS_UNKNOWN)
{
mprintf(("Potentially incorrect behaviour in AI goal for ship %s: Ship %s could not be found among currently active, departed, or yet-to-arrive ships.\nPlease check the mission file.\n",Ships[objp->instance].ship_name,aigp->target_name));
}
}
// Goober5000 - before doing anything else, check if this is a disarm goal for an arrived ship...
DCF_BOOL2(asteroids,Asteroids_enabled,"enables or disables asteroids","Usage: asteroids [bool]\nTurns asteroid system on/off. If nothing passed, then toggles it.\n");
Assertion(goal_position>=cb->lib_offset,"Invalid offset values detected while seeking! Goal was "SIZE_T_ARG", lib_offset is "SIZE_T_ARG".",goal_position,cb->lib_offset);
Assertion(goal_position>=cfile->lib_offset,"Invalid offset values detected while seeking! Goal was "SIZE_T_ARG", lib_offset is "SIZE_T_ARG".",goal_position,cfile->lib_offset);
}
// If we only have a data pointer this will do all the work
cb->raw_position=goal_position-cb->lib_offset;
Assertion(cb->raw_position<=cb->size,"Invalid raw_position value detected!");
{"-noscalevid","Disable scale-to-window for movies",true,0,EASY_DEFAULT,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noscalevid",},
{"-nonormal","Disable normal maps",true,EASY_DEFAULT_MEM,EASY_MEM_ALL_ON,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-normal"},
{"-no_emissive_light","Disable emissive light from ships",true,0,EASY_DEFAULT,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_emissive_light"},
{"-3dshockwave","Enable 3D shockwaves",true,EASY_MEM_ALL_ON,EASY_DEFAULT_MEM,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dshockwave"},
{"-cache_bitmaps","Cache bitmaps between missions",true,0,EASY_DEFAULT_MEM,"Game Speed","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-cache_bitmaps",},
{"-nonormal","Disable normal maps",true,EASY_DEFAULT|EASY_HI_MEM_OFF,EASY_ALL_ON|EASY_HI_MEM_ON,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nonormal"},
{"-emissive_light","Enable emissive light from ships",true,0,EASY_DEFAULT,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-emissive_light"},
{"-3dshockwave","Enable 3D shockwaves",true,EASY_ALL_ON|EASY_HI_MEM_ON,EASY_DEFAULT|EASY_HI_MEM_OFF,"Graphics","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dshockwave"},
{"-dualscanlines","Add another pair of scanning lines",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dualscanlines",},
{"-targetinfo","Enable info next to target",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-targetinfo",},
{"-orbradar","Enable 3D radar",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-orbradar",},
{"-ballistic_gauge","Enable analog ballistic ammo gauge",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ballistic_gauge",},
{"-ship_choice_3d","Use 3D models for ship selection",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ship_choice_3d",},
{"-weapon_choice_3d","Use 3D models for weapon selection",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-weapon_choice_3d",},
{"-3dwarp","Enable 3D warp",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dwarp",},
{"-warp_flash","Enable flash upon warp",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-warp_flash",},
{"-stretch_menu","Stretch interface to fill screen",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-stretch_menu",},
{"-fps","Show frames per second on HUD",false,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fps",},
{"-dualscanlines","Add another pair of scanning lines",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dualscanlines",},
{"-targetinfo","Enable info next to target",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-targetinfo",},
{"-orbradar","Enable 3D radar",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-orbradar",},
{"-ballistic_gauge","Enable analog ballistic ammo gauge",true,0,EASY_DEFAULT,"HUD","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ballistic_gauge",},
{"-nosound","Disable all sound",false,0,EASY_DEFAULT,"Audio","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound",},
{"-window","Run in window",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-window",},
{"-fullscreen_window","Run in fullscreen window",false,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fullscreen_window",},
{"-stretch_menu","Stretch interface to fill screen",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-stretch_menu",},
{"-noscalevid","Disable scale-to-window for movies",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noscalevid",},
{"-ship_choice_3d","Use 3D models for ship selection",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ship_choice_3d",},
{"-weapon_choice_3d","Use 3D models for weapon selection",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-weapon_choice_3d",},
{"-3dwarp","Enable 3D warp",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dwarp",},
{"-warp_flash","Enable flash upon warp",true,0,EASY_DEFAULT,"Gameplay","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-warp_flash",},
{"-portable_mode","Store config in portable location",false,0,EASY_DEFAULT,"Launcher","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-portable_mode",},
{"-nosound","Disable all sound",false,0,EASY_DEFAULT,"Audio","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound",},
{"-standalone","Run as standalone server",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-standalone",},
{"-startgame","Skip mainhall and start hosting",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-startgame",},
{"-closed","Start hosted server as closed",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-closed",},
{"-portable_mode","Store config in portable location",false,0,EASY_DEFAULT,"Launcher","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-portable_mode",},
{"-no_set_gamma","Disable setting of gamma",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_set_gamma",},
{"-nomovies","Disable video playback",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomovies",},
{"-query_speech","Check if this build has speech",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-query_speech",},
{"-loadallweps","Load all weapons, even those not used",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-loadallweps",},
{"-ati_swap","Fix colour issues on some ATI cards",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ati_swap",},
{"-no_3d_sound","Use only 2D/stereo for sound effects",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_3d_sound",},
{"-use_gldrawelements","Don't use glDrawRangeElements",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-use_gldrawelements",},
{"-old_collision","Use old collision detection system",true,EASY_DEFAULT,EASY_ALL_ON,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-old_collision",},
{"-gl_finish","Fix input lag on some ATI+Linux systems",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gl_finish",},
{"-no_geo_effects","Disable geometry shader for effects",true,0,EASY_DEFAULT,"Troubleshoot","",},
{"-set_cpu_affinity","Sets processor affinity to config value",true,0,EASY_DEFAULT,"Troubleshoot","",},
{"-noshadercache","Disables the shader cache",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noshadercache",},
{"-standalone","Run as standalone server",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-standalone",},
{"-startgame","Skip mainhall and start hosting",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-startgame",},
{"-closed","Start hosted server as closed",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-closed",},
{"-gateway_ip","Set gateway IP address",false,0,EASY_DEFAULT,"Multiplayer","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gateway_ip",},
{"-no_set_gamma","Disable setting of gamma",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_set_gamma",},
{"-nomovies","Disable video playback",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomovies",},
{"-loadallweps","Load all weapons, even those not used",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-loadallweps",},
{"-ati_swap","Fix colour issues on some ATI cards",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ati_swap",},
{"-no_3d_sound","Use only 2D/stereo for sound effects",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_3d_sound",},
{"-use_gldrawelements","Don't use glDrawRangeElements",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-use_gldrawelements",},
{"-gl_finish","Fix input lag on some ATI+Linux systems",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gl_finish",},
{"-no_geo_effects","Disable geometry shader for effects",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_geo_effects",},
{"-set_cpu_affinity","Sets processor affinity to config value",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-set_cpu_affinity",},
{"-noshadercache","Disables the shader cache",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noshadercache",},
#ifdef WIN32
{"-fix_registry","Use a different registry path",true,0,EASY_DEFAULT,"Troubleshoot","",},
{"-fix_registry","Use a different registry path",true,0,EASY_DEFAULT,"Troubleshoot","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fix_registry",},
{"-fps","Show frames per second on HUD",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fps",},
{"-bmpmanusage","Show how many BMPMAN slots are in use",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-bmpmanusage",},
{"-pos","Show position of camera",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pos",},
{"-window","Run in window",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-window",},
{"-fullscreen_window","Run in fullscreen window",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fullscreen_window",},
{"-pofspew","Generate all ibx files immediately",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pofspew",},
{"-tablecrcs","Dump table CRCs for multi validation",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-tablecrcs",},
{"-missioncrcs","Dump mission CRCs for multi validation",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-missioncrcs",},
{"-output_sexps","Output SEXPs to sexps.html",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_sexps",},
{"-output_scripting","Output scripting to scripting.html",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_scripting",},
{"-save_render_target","Save render targets to file",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-save_render_target",},
{"-verify_vps","Spew VP CRCs to vp_crcs.txt",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-verify_vps",},
{"-reparse_mainhall","Reparse mainhall.tbl when loading halls",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-reparse_mainhall",},
{"-profile_write_file","Write profiling information to file",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_write_file",},
{"-no_unfocused_pause","Don't pause if the window isn't focused",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_unfocused_pause",},
{"-benchmark_mode","Puts the game into benchmark mode",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-benchmark_mode",},
{"-json_pilot","Dump pilot files in JSON format",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-json_pilot",},
{"-debug_window","Enable the debug window",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window",},
{"-bmpmanusage","Show how many BMPMAN slots are in use",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-bmpmanusage",},
{"-pos","Show position of camera",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pos",},
{"-pofspew","Dump model information to pofspew.txt",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pofspew",},
{"-weaponspew","Dump weapon stats and spreadsheets",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-weaponspew",},
{"-tablecrcs","Dump table CRCs for multi validation",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-tablecrcs",},
{"-missioncrcs","Dump mission CRCs for multi validation",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-missioncrcs",},
{"-output_sexps","Output SEXPs to sexps.html",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_sexps",},
{"-output_scripting","Output scripting to scripting.html",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_scripting",},
{"-output_script_json","Output scripting doc to scripting.json",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_script_json",},
{"-save_render_target","Save render targets to file",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-save_render_target",},
{"-verify_vps","Spew VP CRCs to vp_crcs.txt",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-verify_vps",},
{"-reparse_mainhall","Reparse mainhall.tbl when loading halls",false,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-reparse_mainhall",},
{"-no_unfocused_pause","Don't pause if the window isn't focused",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_unfocused_pause",},
{"-benchmark_mode","Puts the game into benchmark mode",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-benchmark_mode",},
{"-profile_write_file","Write profiling information to file",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_write_file",},
{"-debug_window","Enable the debug window",true,0,EASY_DEFAULT,"Dev Tool","http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window",},
Loaded 100 of 1779 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.