Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Wispborne

Pages: [1]
1
Modding / Additional mod_info flags / mod version stuff
« on: October 26, 2020, 12:53:01 PM »
What are the odds of having a `beforeGameLoad` hook added to `ModPlugin`?

The use case I'm thinking of is detecting save-breaking mod updates and showing an user-friendly message before the save file is deserialized and blows up.

Potential method signature:

Code: java
/* SaveDescriptor could be a representation of descriptor.xml (btw, syntax highlighter doesn't like double-slash comments, it comments out the rest of the code block */
abstract void beforeGameLoad(SaveDescriptor saveDescriptor);
/* or, more simply */
abstract void beforeGameLoad(String lastSavedModVersion);


The code I'm imagining using it for would look something like:

Code: java
@Override
void beforeGameLoad(String lastSavedModVersion) {
  /* Version.java is left as an exercise to the reader */
  Version oldVer = Version.parse(lastSavedModVersion);
  Version currentVer = Version.parse(Global.getSettings().getModManager().getModSpec("myMod").getVersion());

  if(oldVer.getMajor() < currentVer.getMajor()) {
    throw new RuntimeException("Updating from version " + oldVer.toString() + " of MyMod to version " + currentVer.toString() + " requires a new game. Please downgrade MyMod to " + oldVer.toString() + "  or start a new game to continue.");
  }
}

2
Modding / VRAM Usage Estimator 1.6.0
« on: September 16, 2020, 02:24:40 PM »



Are you curious how much VRAM each mod uses?
Well, look no further! This helpful thread by Dark.Revenant already has VRAM calculations for many mods: https://fractalsoftworks.com/forum/index.php?topic=8726.0

What's VRAM? How much do I need? What if I don't have enough?
Again, go check out Dark.Revenant's thread! https://fractalsoftworks.com/forum/index.php?topic=8726.0


Not all of my mods/versions are in that thread and/or I'm too lazy to add everything up!
Well, then, I have a tool for you. Based on a Python script by Dark.Revenant, converted to Kotlin, and modified...presenting the creatively-named VRAM Counter for Windows, Linux, and it might even work on MacOS, too!


Download

Source Code

What it does
- Gives mod-by-mod estimates of VRAM usage.
- Gives a total VRAM usage of all mods, plus a total including the vanilla game (this is the amount of VRAM your GPU needs to exceed)
- Additionally lets you see VRAM estimation with different GraphicsLib map options toggled; normal, material, and surface maps. Open up "config.properties" to configure.

What it does not do
- Tell you how much VRAM your computer has
- Tell you if you are exceeding what your PC can handle (just load the game and find out...)
- Promise to be exact. This is an estimate. For exact usage, run the game and compare before & after VRAM usage.

Usage
Unzip the folder into your mods folder, just like you were installing any other mod. Then open the folder and double-click on VRAM-Counter.bat.
On Linux/MacOS, try running "java -jar ./VRAM-Counter.jar" and see how that goes.



How do I check how much VRAM I have on Windows 10?
Spoiler
[close]

I'm a modder and I have a bunch of unused images in my mods that this tool is counting!
If you want, you can add "_CURRENTLY_UNUSED" to your image file name and the tool will ignore it. MesoTroniK specifically requested this feature.

How's it work?
Image VRAM use =
Code
((numOfChannels * bitsPerChannel) / bitsPerByte) * widthRoundedUpToNearestPowerOfTwo * heightRoundedUpToNearestPowerOfTwo * multiplier
Multiplier = 1x for background images and 1.33x for other images. The 1.33x is extra memory used for mipmapping.

Backgrounds are ignored if they are the same size as vanilla's backgrounds (because vanilla always has one background loaded, so a vanilla-sized background is not adding more VRAM use).
If the mod has one or more backgrounds that are larger than a vanilla background, then the largest of them is counted as additional VRAM used (additionalVRAMUse = modBackgroundVRAMUse - vanillaBackgroundVRAMUse).


Changelog
Spoiler
1.6.0
- Prompt for GraphicsLib settings on each run.

1.5.0
- Make it clearer what it and isn't counted when user only copy/pastes a single line from the output.
- Add all enabled mods to the summary view.
- Copy the summary to the clipboard so it may be easily pasted into chat.

1.4.0
- Total estimated use no longer counts images with the same relative path and name multiple times.
  - So if Mods A and B both have /graphics/image.png, both will have the size counted in the per-mod display, but it will be only counted once in the total.

1.3.0
- Now prints out estimated usage of *enabled mods*, in addition to all found mods.
- For readability, only the currently chosen GraphicsLib settings (in 'config.properties') are shown.
- Fixed the # images count incorrectly counting all files.
- Now shows mod name, version, and id instead of mod folder name.
[close]


3
Modding Resources / How To: Host your Version Checker file on Github
« on: August 29, 2020, 07:01:43 PM »
As of the the time of writing, BitBucket has made a change on their side that is incompatible with Version Checker. This means that a mod's myMod.version file may not be hosted on BitBucket anymore. One of the best alternatives is GitHub, which is free and has been working nonstop with Version Checker for years.

This short guide does not require any knowledge of coding or git. We'll simply move a myMod.version file over to be hosted on GitHub instead of BitBucket.


If your online masterVersionFile is located in the "Sources" part of BitBucket (ie in git), not the "Downloads" part, then your job is even simpler.

1. Follow these steps here: https://gist.github.com/mandiwise/5954bbb2e95c011885ff#gistcomment-1833787(credit to Histidine for finding this)
Spoiler


[close]

2. Continue from step 6 below by clicking to open your .version file.



Otherwise, if your version file is located in the "Downloads" tab of Bitbucket, not the "Sources" tab.

1. Create a GitHub account at https://github.com/join.

2. Create a new repository by heading to https://github.com/new.
  a. Set the name to your mod's name.
  b. Ensure the repository is public (this is the default).
  c. Click Create Repository.
Spoiler
[close]

3. Next, click the button to upload a file.
Spoiler
[close]

4. And now, drag and drop to upload your myMod.version file (click "Choose your files" if that doesn't work).
Spoiler
[close]

5. Almost done. Add a short description of what we just did, like "Added version checker file.", and then click "Commit changes".
Spoiler
[close]

6. Click on the file we just uploaded to open it in the GitHub viewer.
Spoiler
[close]

7. Then click "Raw" to open the pure text file.
Spoiler
[close]

8. Now, just copy the url. For example, https://raw.githubusercontent.com/yourUserName/my-mod/master/myMod.version. That's the new, permanent online location for your version file.

9. You'll need to take that url and put it into your myMod.version file, replacing the old BitBucket url, and then repeat the file upload process with the newly edited file so that the myMod.version file on GitHub has "masterVersionFile" as a link to GitHub.
Spoiler
[close]

10. And, last step, the next release of your mod should have this new myMod.version file with the now-working Version Checker file.

4
Modding / Guide: Easier Mod Releases Using GitHub
« on: December 27, 2019, 12:31:59 PM »
Who is this guide for?
Any modders who wish that they could create a new release of their mod with a single terminal command.

This does use the version tracking program git. Basic usage of it is not complicated, but it is a very powerful program and if you wander off the simple workflow path, it can be difficult to fix things. It is the industry standard for software developers, used to sync, back up, and track changes to code (and other files), making it very easy to see changes over time and/or restore previous versions.

You should have basic familiarity with the Terminal/Command Prompt, such as how to open it and navigate to your mod folder.
You do not need to know how to use git to follow this guide, but you will learn the basics.

"Hmm, how should I distribute my mod?"

This is a question that every modder has to answer at some point. There are a large number of options:

- Google Drive or other file upload site; Pros: simple. Cons: can't find earlier mod versions easily, no system for tracking code changes, must manually create zip files.
- Bitbucket Downloads section; Pros: simple, easy to see other available downloads. Cons: no system for tracking code changes, must manually create zip files.
- Bitbucket/GitHub using git + downloads/releases section; Pros: easy to see other available versions, can track code changes. Cons: must manually create zip files.
- Bitbucket/GitHub using git + downloads/releases section + continuous integration; Pros: everything. Cons: not simple, which is why there's this guide.

What does this guide actually cover?

- How to get started with git and GitHub, using guides that other people have already written.
- How and why to add meaningful versions to each release of your mod.
- How to set up GitHub and CircleCI to automatically create a new release of your mod whenever you assign a new version (aka "push a tag to github").

Step 1: Create a release tag
Code: bash
git tag 1.0.0-alpha && git push origin 1.0.0-alpha

There is no step 2: A release is automatically created with your zipped mod!


With the version appended so that users won't merge folders when updating!




The Guide

If you already have your mod hosted on GitHub, skip to step 5.

1. First, you need a GitHub, account and a repository for your mod.
  - Sign up for an account at https://github.com/
  - In the top-right corner, click "+", then "Add new repository"
  - Name it after your mod and click "Create repository".

2. At this point, you may be wondering what git, GitHub, and repositories are. If so, take a read through this guide for an introduction: https://guides.github.com/introduction/git-handbook/.

3. Now you'll need to install git. There are two options: terminal-based or visual-based (the visual-based ones simply hide the terminal behind nice buttons and stuff).
  - The terminal is the most powerful and ubiquitous, so that it what I recommend and what the guide will describe. However, feel free to use a UI-based git client and perform the same steps using it; I'd recommend GitKraken, which is free to use for Open Source projects. Sourcetree is good as well.
  - Follow the relevant guide to install git on your operating system here: https://www.atlassian.com/git/tutorials/install-git#windows
  - You should now have a terminal open that recognizes the command "git" by printing out a bunch of information on how to use it.

4.  Navigate to your mod folder (typing "ls" should show your "mod_info.json") and let's get your code up on GitHub.
  - Type "git init" and hit enter to create a git repository.
  - Type "git add ." and hit enter.
      - This marks all files as "staged", which means that they will be included when you make a snapshot ("commit").
      - Note: make sure that your mod folder does not include anything other than your mod (eg don't include starsector.api.jar or lazylib.jar). If it does, look up how to use a .gitignore file.
  - Type
Code
git commit -m "Initial commit"
and hit enter.
      - This creates a snapshot of your mod, called a commit. It doesn't upload it; right now it only exists on your computer. You can always type "git log" to see your commits (press "q" to get out).
  - Open your repository on GitHub (it will still be empty because we haven't uploaded anything yet), click "Clone or download" and make sure "HTTPS" is selected ("Use HTTPS"). Copy the text, which should look similar to https://github.com/your-name/your-repo.git.
      - If you don't want to enter your password every time you make a change, you can instead use SSH and create an SSH key, but you will need to figure that out yourself :)
  - In the terminal, type
Code
git remote add origin <paste url here>
and hit enter, then type
Code
git push -u origin master
    You'll need to enter your GitHub password.
      - This tells git where to upload your mod to, then goes ahead and uploads ("pushes") it.

5. If you look at your repository on GitHub, it should now have your mod files!
    From here, follow the steps described in this readme: https://gist.github.com/davidwhitman/727d589cdc8d8e2774ce258838476d93

[attachment deleted by admin]

5
Mods / [0.9.1a] Gates Awakened (updated 2021-01-12)
« on: September 12, 2019, 04:32:18 PM »

Gates Awakened
v2.1.1

Gates Awakened adds a short series of quests that open up instantaneous travel between Gates and are intended to feel like a natural extension to the vanilla game.


Download

Updating from a v1.x version of Gates Awakened to a v2.x version (eg v1.3.1 to v2.0.0) will NOT WORK without creating a new save.
Updates from v1.x to v1.y are save-compatible, as are v2.x to v2.y.
requires LazyLib

or view on NexusMods

Source CodePrevious Versions



Gates Awakened gives you access to a small number of fast-travel Gates, changing up exploration and colony planning. While it is, of course, not canon, the mod is intended to fit into the game's lore (if you squint a little bit). To keep the activation of the gates a secret from the rest of the Sector, the player will not use the Gates while being observed.

The mod tries to encourage early exploration and ease later-game traveling, without feeling like a cheat.
Once a Gate is activated, the player may travel to any other active Gate for a fuel cost based on the distance traveled.

To get started, simply check around at bars until something Gate-related pops up.

Features
Spoiler
- Total of five gates allowing instant travel (two random, three player choice)
- Travel cost is 80% of the fuel a direct route would otherwise take
- First exploration mission found randomly at bars, immediately available, that activates one Gate in the Core and one near the edge of the Sector
- Second exploration mission from the bar, available once player has a midgame-sized fleet or established colony, that lets the player choose more Gates to activate
- Third exploration mission available through play, available once player has an endgame-sized fleet or multiple, very established colonies
- A Gate cannot be used while another fleet is observing you. We do not want the attention this would draw
- Should be fine to add to a save at any time
[close]


Massive thanks to toast for his inspirational mod, Active Gates, without which this mod would not exist.
If activating every gate and being able to jump all over the Sector sounds better than only getting to play with a few gates, go check out Active Gates!
Where Active Gates allows you to jump right in and activate everything (for a price), Gates Awakened introduces gates more slowly and in a limited amount, making an attempt at acknowledging the game lore.


Bugs? Suggestions? Questions? Want me to talk about why you should be coding in Kotlin instead of Java until you can't take it any more? Ping me on Discord @Wisp#0302, or just leave a comment in this thread.

Changelog
Spoiler
2.1.1 (2021-1-12)
- Save-compatible back to 2.0.0
- Fixes crash when using gates with no orbit, such as one in Interstellar Imperium (thanks to @Freetimez on Discord for the report)

2.1.0 (2020-11-1)
- Save-compatible back to 2.0.0
- Added sound and visual effects to gate use. Sounds created by MesoTroniK.
- Inactive, discovered gates are now displayed as intel.
    - This may be toggled off by selecting the intel.
- The third quest will now always trigger if prereqs are met (previously 33% chance).
- The GatesAwakenedViewInfo console command will now show what is missing for the second and third quests to trigger.

2.0.5.1 (2020-8-21)
- Save-compatible back to 2.0.0
- Fixes interactions with gates not working (thanks to @Apky for report)

2.0.5 (2020-8-18)
- Save-compatible back to 2.0.0
- Adds a better error message if LazyLib is missing (this patch dedicated to @MesoTroniK)
- Because this update is so tiny and is targeted toward first-time users of Gates Awakened, I will not bump this thread or trigger a Version Checker prompt.

2.0.4 (2020-2-6)
- Save-compatible back to 2.0.0
- Fixes gate icon not showing sometimes (thanks to those who reported, including @Ner'zhulAI)
- Fixes crash when loading save game after taking a GA quest from the bar (reported by Atopo on the forums and QA'ed by @Bribe Guntails)
Spoilers for third mission (just more bugfixes)
Spoiler
- Fixes gate defense fleet spawning on star instead of gate (reported by @Ner'zhulAI)
- Fixes invalid character in gate defence fleet name (reported by @Ner'zhulAI)
[close]

2.0.3 (2020-1-7)
- Save-compatible back to 2.0.0
- Added support for jumping to Boggled's player constructed gates
- If no Remnant systems exist, second quest uses a non-Remnant system instead (reported by Tiberiumkyle on the forums)
- Fixed third quest intel showing planet type instead of name (reported by Avanitia on Discord)
- Possibly fixed quest intel icon showing incorrectly (unconfirmed)
- Fixed bug where declining a quest, then trying to start it again would crash
- Fixed bug where final quest epilogue could be triggered by interacting with any active gate  (reported by Histidine on Discord)
- Adds forum id to version checker

2.0.2 (2019-11-30)
- Save-compatible back to 2.0.0
- Added console command to force start the first quest
- Fixed bug where some players were kicked out of the planet dialog when trying to start
 the first quest (thanks to Kraosdada#8765 on Discord and Sartek on the forums for the reports)

2.0.1 (2019-11-27) (Discord-first)
- Save-compatible back to 2.0.0
- Not save compatible with v1.x (eg v1.3.1)
- Fixed bug where you couldn't use gates :S
    - Caused by a last-minute change to mod prefix that wasn't correctly updated in rules.csv
    - Thanks to Sunflare#3581 on Discord for the report!

2.0.0 (2019-11-25) (Discord-only for testing)
- Not save compatible with v1.x (eg v1.3.1)
- Added final quest, which allows the player (wouldn't you rather have a surprise?)
Spoiler
to spawn a new gate
[close]
- Polished existing quests and intel. New icon, intel is now marked as completed, better wording, etc
- Fixed compatibility issue with Vayra's Sector where a gate-related event in VS was not shown
- Hopefully fixed bug where the dialog did not appear after jumping in the first quest
- Added Gates-Awakened-related Console Commands (including spawning a gate)
- Readded LazyLib as dependency (to use its Kotlin stdlib)
- Way more refactoring than was necessary

1.3.1 (2019-10-9)

- Fix for crash when completing a question after the intel has timed out
    - Thanks to Liork on Discord for the report
- Known issue: intel can time out, apparently :(

1.3.0 (2019-10-02)

- Gates now get their original name back after being deactivated
- Slightly improved gate intel formatting
- Balance is for gymnasts. Added configuration for # of activation codes

1.2.0 (2019-9-29)

- Gates may now be deactivated to reclaim an activation code
- Number of reward activation codes increased to 3 from 2
- Now prompts player to enable transponder when needed
- Added hyperspace transition animation
- Gates Awakened quests are now marked with the Story intel tag

1.1.1 (2019-9-25)

- Fixed crash that could occur when updating gate intel (thanks to Sunflare#3581 on Discord for the report and QA)

1.1 (2019-9-24)

- Added new intel that displays all active gates
- Updated intel icons to be cooler
- Reduced fuel requirement to use gates to 80%
- Removed dependency on LazyLib

- Fixed bug where the second quest would not appear, even if you met the requirements

1.0.1 (2019-9-12)

- Fixed jump using double the stated fuel price.
- Fixed typo in the second mission opening.

1.0.0 (2019-9-12)

- Initial Release
[close]

"I want to activate all of the gates and travel for free!"
Spoiler
The game is balanced around travel. This mod exists because I started to find it tedious in the late-game, but being able to activate any gate will make the distance between places largely meaningless and remove some of the strategy/decision-making/gameplay loop. I'd caution against going too crazy.

That said, it's your decision, not mine. In "mods/Gates-Awakened/data/config/settings.json", there is a setting called "gatesAwakened_midgameQuestRewardCodeCount".
Simply change that to the number of gate activation codes you want (+ you will have an additional two from the first quest that activates two gates) and restart Starsector.
Note that you must have finished the second (final) quest to unlock at-will gate activate/deactivation.

You may also change the fuel cost ratio in the same file, using "gatesAwakened_FuelMultiplier".
[close]

Compatibility
Boggled's Terraforming Mod: Can jump both to and from Boggled's player-built astral gates.
Active Gates: Untested, but it should be possible to jump to gates activated in Active Gates.


Credits
toast: The original Active Gates mod
LazyWizard: LazyLib, Console Commands, and a font of knowledge
Many others on Discord for help, support, reports, and being a motivating community
And of course Fractal Softworks for this incredible game


Pages: [1]