GithubHelp home page GithubHelp logo

wynntils / artemis Goto Github PK

View Code? Open in Web Editor NEW
155.0 9.0 80.0 19.91 MB

Artemis is a rewrite of Wynntils in 1.20.2 using Architectury, to support Fabric and Forge.

Home Page: https://wynntils.com

License: GNU Lesser General Public License v3.0

Java 99.99% Shell 0.01%
minecraft-mod wynncraft wynntils

artemis's Introduction

Artemis

Discord CurseForge Modrinth GitHub License

(Image in public domain)

Artemis is the greek goddess of hunting and the moon, born of Zeus and Leto, twin of Apollo.

Artemis is a rewrite of Wynntils (informally referred to as "Legacy") in 1.20.2 using Architectury, to support Fabric and Forge.

Downloading a release

You can download the latest build from our releases page. You can also download the latest build from our Modrinth Page and CurseForge.

Pull Requests

All pull requests are welcome. We'll analyse it and if we determine it should a part of the mod, we'll accept it. Note that the process of a pull request getting merged here is likely more strenuous than legacy. To begin, one pull request could be porting features from legacy.

We welcome all forms of assistance. =)

Make sure you set the title of your pull request according to the Conventional Commits specification. Otherwise, your pull request won't be visible in release logs, and will fail to auto-build.

Workspace Setup

Initial Setup

To set up the workspace, just import the project as a gradle project into your IDE. You might have to run ./gradlew --refresh-dependencies if your IDE does not automatically do it.

Building

To build the mod just run ./gradlew buildDependents and the artifacts should be generated in fabric/build/libs and forge/build/libs. There are a lot of jars there, use the jar which has the respective loader at the end (eg. wynntils-VERSION-fabric.jar).

Code Formatting

The code format is checked by Spotless using the Palantir engine. When opening a PR, Spotless checks will be run automatically by GitHub Actions. This bot runs the spotlessApply which fixes all formatting errors that it can find. If such errors are found, the bot will then push a commit to your branch with these fixes.

However, it can be nice to fix the formatting locally before pushing. There are several ways to do this.

  • The most basic is to run the same gradle target as the bot, spotlessApply. This can be done from the command line ./gradlew spotlessApply or as a gradle target from your IDE.

  • If you are using IntelliJ IDEA, you can install the Spotless Gradle plugin to get an easy and quick way of running the Spotless target for the current editor.

  • To make sure your commits always pass the Spotless check, you can install a git pre-commit hook. The hook is optional to use. If you want to use it, you must tell git to pick up hooks from the directory containing the hook. To do this, run this from your repo root: git config core.hooksPath utils/git-hooks.

  • Finally, you can also use the Palantir formatting directly. This will skip the additional non-Palantir rules we have in Spotless, but these are few and unlikely to affect most cases. For IntelliJ, there is the Palantir plugin that is supposed to do that, but at the moment it unfortunately seems to be broken.

Hot-swapping

Using the Hotswap Agent is recommended if you want to do live code editing. Please note that at the moment, only version Hotswap Agent 1.4.2 works. See Hotswap Agent installation instructions, but bear in mind that the instructions are incorrect (!). Don't "unpack" hotswap-agent.jar, instead rename the downloaded jar file to hotswap-agent.jar. Finally, add wynntils.hotswap=true in your personal gradle.properties file. By default, this is C:\Users\<your username>\.gradle\gradle.properties on Windows, or ~/.gradle/gradle.properties on Linux/MacOS. If the file does not exist, you can create it yourself. Don't forget to set the correct Java installation for your run configurations, and make sure to use these settings in IntelliJ IDEA. After this, start the game using your run configurations, you should see some logs about HotswapAgent. If you don't see any, you did something wrong. To hotswap, hit the build button (build, not rerun, restart, etc.).

Run Configurations and Authenticating

Architectury Loom currently only supports VSCode and IntelliJ IDEA. Eclipse is not supported by upstream at the moment. After running Initial Setup, run configurations should appear automatically (note that you might have to restart your IDE after Initial Setup).

The project has DevAuth set up by default. When you run the development run configurations, you will get a link to log in with your Microsoft account. After first login, you will be able to run the game like you would in a production environment. You can use an alt configuration by specifying -Ddevauth.account=alt in your JVM options, or by temporarily changing .devauth/config.toml.

Vineflower decompiler

The project has Vineflower for Loom set-up automatically. This is done so to highly increase the quality of decompiled sources. To use it, run ./gradlew genSourcesWithVineflower. After it finished, the decompiled Minecraft source will be in [email protected] You have to attach these sources in Intellij IDEA for Vineflower to take effect.

License

Artemis is licensed under the license GNU Lesser General Public License v3.0

Unless specified otherwise, All the assets are over Wynntils domain © Wynntils.

artemis's People

Contributors

bybackfish avatar cmkohnen avatar coehlrich avatar dalwynwastaken avatar devscyu avatar donkeyblaster avatar ekgame avatar enormouz avatar github-actions[bot] avatar halcyonsuoh avatar highcrit avatar incompleteusern avatar jadedbay avatar jh-devv avatar joshieman06 avatar kristofbolyai avatar magicus avatar mbnkwm avatar mcplayhd avatar mcrtin avatar p0kedev avatar rafii2198 avatar re-vc avatar san7890 avatar shadowcat117 avatar shadowshift avatar spacemonkeyy86 avatar tomasajt avatar wiji1 avatar wynntilsbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

artemis's Issues

InfoMessageFilterFeature regex incorrect

I think the LEVEL_UP_1 regex is incorrect. I played today, and the message looked like user is now combat level 10, not matching the regex, ^§6.* is now level .* in §.*$. Is that regex only working for professions?

ChatManager wrong chat type

@magicus
image
[21:45:06] [Render thread/INFO] (Minecraft) [CHAT] BACKGROUND-PARTY: §r§8[§r§7VIP+§r§8] §r§7FancyFedora§r§8 has just logged in!

This breaks InfoMessageFilterFeature as expected.

Overlays merging into Features

After looking at the code from the Wynntils and seeing the changes implemented so far during the port to Artemis, I believe that this is an obvious next step.

Reasons for this move:

Simplicity
Instead of splitting features into multiple different things, keeping it all the same essential thing which can have addons like keybinds, config and in this case a visual feature (or overlay, not too sure about the naming since it's an addon so VisualFeature feels more appropriate than Overlay). This makes making new features easy as all you have to do is add what you want and no need to find what goes where and how.

Benefits:
In Wynntils it was easy to use hookElements in the RenderGameOverlayEvent and it makes sense, but with the cross version this causes some issues. Mainly that events are now done by Architectury or Mixins. This change will allow you to simply import and subscribe to the render event needed for the situation.

This will allow for Visual stuff to be completely redone and made more appropriate for the situation it finds itself in.

Now we have reasons and benefits for the move lets answer the "how":

What we need to store about the Visual part is it's location on screen, yeah, that's all. I mean we could store the name of the overlay but simply getting the feature name it's a part of is way more practical.

Well this will make Feature Registry a lot simpler and easier to follow as it does its steps.

Last issue to tackle, how do we make a way to allow for the user to move their displays around (no need to add the ability to toggle since that can be done by the feature itself). Remember how we need to store the location? Well we have 2 possibilities, we can use annotations or we can use a custom class that stores the data (the former will be easier to store cross instance though). Yeah, this kind of invalidates my draft PR. Anyway, so what we can do with this stored data is just load it like what was done in Wynntils, but with some UI Improvements since it feels a little clunky.

Thank you for reading this, I hope this can atleast show there are some other ways to handle Overlays

`WorldStateImpl` occasionally has wrong world state

During development I have found that WorldStateImpl#onServer returns false on multiple occasions, while connected to the server. This is likely related to the mixins that call the world state change events.

UserFeatures config problems

I was going to create a PR fixing this, but this one is a controversial topic, so I thought an issue might be better to start with.

ConfigManager has a requirement that a Feature must be annotated with FeatureInfo to get the Feature's category or else config options won't load. This is obviously not a good thing.

Here is the things we could do:

  • Make FeatureInfo annotation required by throwing Exception on feature registration
  • Make ConfigManager assume blank ("") category for features without annotation (the annotation already has "" as default category).

Malformed Dialog / Failed to parse NPC dialog

[14:07:05] [Render thread/WARN]: Malformed dialog [#3]: [§r , , §7[1/4] §r§2Bandit Leader: §r§aHere-- maybe you'll help us pull the heist if I give you some of this gold we just stole.§r]
[14:07:16] [Render thread/INFO]: [CHAT]  
[14:07:18] [Render thread/WARN]: Malformed dialog [#3]: [§r , , §7[2/4] §r§2Bandit Leader: §r§aAhah. I had a feeling we had a guard on our tail.§r]
[14:07:19] [Render thread/WARN]: Malformed dialog [#3]: [§r , , §7[3/4] §r§2Bandit Leader: §r§aI wouldn’t want to wear out my new-stolen weapons killing you... I'll just trap you in here with all of this TNT!§r]
[14:07:29] [Render thread/INFO]: [CHAT]  
[14:07:31] [Render thread/WARN]: Malformed dialog [#3]: [§r , , §7[4/4] §r§2Bandit Leader: §r§aThis'll blow up in a few seconds. Good luck getting out of here!§r]

Happened in Sandy Scandal quest.

Test Result of Item Tier / Scroll Letters

Success:

  • scrolls have the town letter
  • powders have their tier

Fail:

  • Town pairs like Nesaak and Nemract get same letter
  • boat passes don't have letters
  • broken keys where the Forgery note is missing don't have letters
  • old dungeon keys don't have letters
  • emerald pouches don't have their tier

Info variable system in Artemis

The time has come to deal with this.

My idea is to have features expose variables (to an InfoVariableManager?) and the user can use all enabled info variables. This is clear and easy for not so basic variables, but the question comes, where do we put the simple info variables (FPS, player coordinates). Simple info variables do not require processing, so making a feature for all of them seems unnecessary. My idea would be to put them into a singular InternalFeature (as disabling them would not give any performance benefit).

I hope to hear your opinion.

@magicus @HighCrit @Incompleteusern @P0keDev @DonkeyBlaster

Assign stable UUIDs to characters

I have a plan, but I'm not going to be able to address it for a while. I'll sketch my idea here, and leave it open for anyone else to implement if they want. (Otherwise I'll do it when I get around to it.)

From the Wynncraft API we can get a json description of a player. Here is one describing me: https://api.wynncraft.com/v2/player/ca3ee631-a36c-48f4-9007-3c3c52c79840/stats
This contains, among other things, an array with all classes. The order in this array is similar to the order in the class selection screen, but not the same. API order is "total level", but class selection is "combat level". So there is not a simple 1-to-1 match that way. Also, API updates rather slowly. Actual changes in the characters take time (hours?) to propagate.

But. Thew good news is that the API has a stable naming of characters. In the object describing each class, there is a field "name", which will be unique per character. It is comprised of the class type (e.g. "archer") plus a monotonically increasing number (starting at 0, which is omitted). So the first archer you create is named "archer", the second "archer1", the next "archer2" etc. Even if you create and remove classes, numbers are not reused (confirmed).

What remains is to match characters found in the class selection screen with these characters from the API. We'll have to do a bit of fuzzy matching, but I think it'll be okay for all practical purposes. We can match on:

  • class
  • reskinned or not (the API name is "darkwizard" for a reskinned mage)
  • combat level (bearing in mind that the class selection level can be slightly higher, but never lower, since the API lags a bit)
  • combat XP percentage (with the same caveat; also if level has increased then XP can be lower as well)
  • number of finished quests

It would be really bad luck if a player has two characters that match on all these properties. If that happens I think we might be excused if we make a mismatch. (We can detect if this happens and either print a warning, or refuse to do matching until they have changed level/number of quests) on one of them.)

Finally, I think we should assign these characters an unique UUID. We can do this by:

String uniqueName = player.getUUID() + "-" + character.getName();
characterUUID = UUID.nameUUIDFromBytes(uniqueName.getBytes());

or if we want to be really fancy and do it the Right Way for v3 UUIDs:

public static final UUID WYNNCRAFT_CHARACTER_NAMESPACE = new UUID("ac64c234-48c3-4e3f-ad29-6694affcfbfa"); // randomly generated UUID that just needs to be kept the same

String uniqueName = WYNNCRAFT_CHARACTER_NAMESPACE + "-" + player.getUUID() + "-" + character.getName();
characterUUID = UUID.nameUUIDFromBytes(uniqueName.getBytes());

OverlayManagementScreen: Bugs

List:

  • Minimum width/height, disallow negative sizing
  • Only snap if dragged edge/corner is relevant to snapping point

Item Tooltip Sizing and Positioning

When I halve my Minecraft window to one side of the screen (yes, I do that sometimes - don't beat me - for item management stuff where I need several things next to each other), the tooltip on some items isn't inside the game window bounds, but it pushed out to the side. It becomes unreadable when the left half of a tooltip is missing.

Encode Component into strings losslessly

Several parts of Wynntils (like the ChatManager, and the Translation API) would benefit from us being able to convert a Component into a text encoding, which can then losslessly be converted back to a Component. Basically, I'm thinking something like this:

§6{Hello there, }§7{Stranger!} §0{Click on §L{http://www.wynntils.com;this link}!}

In the best of all worlds, we could even use this encoding to do regexp matching. The current code that converts to the "classic" format codes is a one-way street, basically since we lose the "end of formatting" information that is present in the Component. While it might have it's uses (it's served us well, so far), I think it is suboptimal. But the regexp matching on strings is much easier than trying to match an actual Component. So a faithful but still readable representation of Components as a string would be a benefit for all of the mod.

Before deciding on a format, I need to look into what kind of formatting is allowed by Component. The format also needs to be regexp friendly. And trivial to parse and generate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.