#Leaf (forked from FabricMC/fabric)

1 messages ยท Page 4 of 1

fresh nexus
#

I can only assume log should show up.. somewhere in the PZ source..

rare mural
#

it's likely something to do with the way the sources are stored inside of a .jar rather than text but i don't really know tbh

fresh nexus
#

sighs.

#

scope is just LUA files...

#

anyone? how to find.. anything in the decompiled source?

valid nova
#

CTRL + n

floral sluice
#

^^^

valid nova
#

Read this page

#

I give tips

floral sluice
#

It might not apply to finding in files for sources

#

change to Scope > All Places and use the cog thing to add the tickboxes like search overrides and whatever else it shows

#

here let me bring it up, one sec

#

ok now I can't find what I did before...

fresh nexus
#

Yay I found carController

fresh nexus
rare mural
floral sluice
#

I ltierally wrote that up here...

rare mural
floral sluice
valid nova
#

Didn't knew about the ctrl + shift +F

floral sluice
#

it will automatically place the directory to look inside the -sources jar

floral sluice
rare mural
#

i always use ctrl-shift-f and do all places to get started heh

valid nova
#

Actually I did I put it in the wiki lmao

floral sluice
#

jvla can you please pin the message I wrote above (with the reaction on it)

floral sluice
#

thx

fresh nexus
#

Man I hate all this code, and only half because it uses unnamed variables.

#

Like how you get a 4x+ engine force buff if your towing in 1st gear...

#

now just have to figure out how to override the whole private void control_Forward(float f) function...

#

So, the ExampleMixin is.. injecting itself into the 'return' part of getVersion (that I can't seem to find anywhere?)

#

so how do I get the example mod in the game?

#

where do I find leaf to install into PZ?

valid nova
#

Pinned messages ?

fresh nexus
#

... download .jar, download jarfix, download java...

#

... 'A java exception has occured'

#

did I download the wrong java or something?

#

trying to run installer-1.1.0.jar

valid nova
#

Yea

#

That's the old Java

#

Java 8

#

You need Java 17 or more

floral sluice
#

if you have java 17 already, JarFix will use the first java version on the path, so you will probably need to move java 17 up to the top

fresh nexus
#

Yeaaaaa. your really gonna need to work on that installer if you want anyone to use this...

floral sluice
#

??? Not works for you != not works for everyone

#

It's not my fault you're using the wrong java on the path, thats something the user has to change

fresh nexus
#

needing to install the right version of a software that doesn't even come up as the first result in google to install your software to install a mod = nobodies ever getting around to installing my mod

floral sluice
#

fabric was looking at platform-native binaries for every operating system, but they still haven't gotten that fully complete because its a pain in the ass to do

valid nova
#

But a link to the latest Java version alongside the installer is a good idea I suppose

fresh nexus
#

You can't copy some files into pz's directory without using java?

floral sluice
#

And also, no one wont install your mod because of the installer requiring java to use, no one will install your mod because leaf isn't popular yet. 99% of people don't even know this exists

#

actually, this has been the most active the thread has been since I created it

fresh nexus
valid nova
#

I'm not familiar at all with the installer but does it need Java yea ?

#

Thought Java was going to be needed for Leaf itself to work

floral sluice
#

yes it uses java

valid nova
#

@fresh nexus also you need to chill a bit, it's been a one person project and like aoqia said the chat hasn't been this active ever. Some stuff are not fully fleshed out that's normal

floral sluice
#

I mean, you can even run the installer with the java version bundled with the game, ProjectZomboid\jre64\bin\java.exe -jar path\to\installer-1.1.0.jar
obviously it's not as simple as a double click though

fresh nexus
#

https://sourceforge.net/projects/nsis/ try this, iv had good success with it.

valid nova
#

Or is Java needed for Leaf to work anyway ?

floral sluice
#

yeah im not using some windows-specific installer for a program that essentially downloads 3 jar files and creates some text ina file

floral sluice
fresh nexus
#

And an installer for windows would cover 80%+ of your users...

floral sluice
valid nova
#

More seriously I trust you if you say it's needed

fresh nexus
#

So the other people can do it the other way.

floral sluice
#

people just installing to the game don't need java to run the game with leaf. But running the installer they do, as it uses java

valid nova
floral sluice
valid nova
floral sluice
#

if you want adoption in any capacity, it's basically a one-size-fits-all or nothing imo

valid nova
#

Agreed

fresh nexus
floral sluice
#

the only thing I've dropped support for so far was 32 bit systems, which isn't even fully removed, just disabled

floral sluice
valid nova
#

It's not perfection, it's common sense

#

The game works natively with Linux

#

I think it does with Mac too

floral sluice
#

people want convenience, I understand, but what im saying is making the installer fully cross platform isn't going to happen overnight

valid nova
#

So why tell a part of the player base to go fuck themselves

full mountain
#

i do think installation could be improved, from this thread it seems like you've had to personally debug for basically every single person who's tried to install leaf

fresh nexus
valid nova
#

Since I didn't get an answer to my question

floral sluice
#

consider this: Many people working on Fabric in the community, they've only just started to make installer native for Windows, but it's not fully ready yet. I'm simply following in their path. Once they finish their installer, I'll fork it like everything else and convert all of my code from the java installer to their native one. But I want to at least support win/linux first before I convert over from the cross-platform solution which is Java

floral sluice
#

literally everything

valid nova
#

You just said Leaf doesn't need the users to install Java for it to work

floral sluice
#

so does fabric

fresh nexus
valid nova
#

That's why I'm asking my question

floral sluice
floral sluice
valid nova
#

Let me try to install Leaf really quickly to see if it's terrible or not

floral sluice
#

and I said like a few days ago that I don't recommend anyone using the installer for now in prod because its buggy I still want to add server support

#

if you're doing it to just test your mod locally thats fine, but I wouldn't go out to a random PZ user right now and say "hey use the installer and install leaf" because it's not quite finished yet

fresh nexus
#

K, I think I misunderstood the project then.

valid nova
# fresh nexus K, I think I misunderstood the project then.

Like I told others many times, it's a promissing project that can only grow if it gets attention but aoqia here is a one man army doing everything on it and so the project goes at a logical rythm based on that and shit won't work with a finger snap

#

That's why check your attitude a bit here dude

floral sluice
#

I wonder, does drag and dropping onto java.exe with a JAR work?

valid nova
#

No idea

#

For Linux I had to use java -jar installer to run it

floral sluice
#

yeah thats what I normally use

floral sluice
valid nova
#

The installer worked, just one weird thing with my PZ installation idk if it's me or Steam doing weird things for Linux but my game location, to the folder Leaf wants isn't common/ProjectZomboid but common/ProjectZomboid/projectzomboid

fresh nexus
# valid nova That's why check your attitude a bit here dude

Well I was told to come try this out to make a mod only to find it very confusing, frustrating and exceptionally difficult compared to all the other modding iv done, where everyone here expected me to know terms in some IDE iv never used before and got mad at me for asking too many questions and talking too much here.

valid nova
#

So idk what black magic fuckery is going on but eh it works

valid nova
fresh nexus
#

And now im told the whole thing was a bad idea and even if I made a mod with it, I shouldn't even try to get other people to attempt using it.

fresh nexus
valid nova
#

Like I told ldlework the other day, the project is promising, but not proven working here, there isn't any mods that have been made with it that are on the Workshop

floral sluice
#

I'm not saying it's a bad idea, but it's not fully finished and bugs will happen. I haven't really had many people in the past to test it except gigawatte up until very recently when idlework and snejk joined.

floral sluice
#

it works, but I need to upload a newer jar to the workshop, because I put something wrong in the mod json

valid nova
floral sluice
#

oh if you mean a proper big project then yes that is true

valid nova
#

That's where the missunderstanding from the other day came from

floral sluice
#

I'm hoping they fare well with the npc mod, as that will help me squash more bugs

full mountain
floral sluice
#

yea I was just curious if it worked, since I never tried it before

full mountain
#

you're specifying the file as the name of a main class instead of as a jar file absically

floral sluice
#

but yeah, actually you dont even need java at all to install leaf. You can use purely the jre bundled with the game

#

Maybe I will recommend that over jarfix in the installer readme

valid nova
#

Actually aoqia I just noticed something with the installer, the task never seems to end in the console when running the jar tho I did get the popup that it is installed

fresh nexus
#

Most people couldn't execute a command line with proper paths to save their lives.

valid nova
valid nova
#

(On Windows at the very least)

floral sluice
# valid nova

im guessing the first error isn't an issue? just misconfigured path or something?

#

but yeah that is odd, it should quit

#

is the UI closed too?

valid nova
#

No

#

Also I didn't see the error no lol

full mountain
fresh nexus
fresh nexus
floral sluice
valid nova
#

I have the .leaf folder in the media folder

fresh nexus
#

I didn't know there still offering java 8 as the first result in google 'updated 2025'

full mountain
#

java 8 hogs the file association forever and the normal methods of changing it don't even work

valid nova
#

Got leaf-1.4.1 etc.json inside media

floral sluice
#

it should not be in media ata all

#

what path did you enter into the installer?

valid nova
#

Wait no no sorry

#

It isn't inside media

#

It's alongside it that's mb

floral sluice
#

yes thats correct

#

got me panicked for a minute

valid nova
#

For the PZ json files I have that on my end

valid nova
#

Same for .leaf it's alongside media

full mountain
#

there can be problems when messing with the game files on linux since the file structure is slightly different to windows

floral sluice
full mountain
#

they have nearly everything inside an extra ProjectZomboid/ProjectZomboid/ for some reason

floral sluice
#

you can "install leaf" to an empty folder with just the ProjectZomboid64.json file and it will work

valid nova
#

Wait

floral sluice
valid nova
#

I know why there's the error

#

It was the previous error I had

#

When giving common/ProjectZomboid like I said a bit earlier

#

I had to give it common/ProjectZomboid/projectzomboid instead

floral sluice
#

but the ProjectZomboid64.json isn't inside the second projectzomboid folder is it not?

valid nova
#

Also I need to remove that .leaf, seemed to have created it when I got that error

floral sluice
#

where is it on linux

#

wherever the ProjectZomboid64.json launcher config lies, thats the folder you need to install to

valid nova
#

This is the first ProjectZomboid

#

This is the second one

floral sluice
#

oh, what

valid nova
full mountain
#

two zombie folders...?

floral sluice
#

^^^

valid nova
#

I wonder if it's a quirk on my side yea

full mountain
#

only the inner one should exist afaik

valid nova
#

I'm gonna be honest I don't know myself why the fuck that's a thing

full mountain
#

that's the one zomboiddecompiler targets for decompilation

valid nova
#

I even reinstalled PZ yesterday and it did that too

floral sluice
#

I remember reading the steam depot to see where it was on linux, I was almost certain it was either in the inner projectzomboid folder or in the outer one, I dont know which one it is

valid nova
#

I think I had to run it with command lines

full mountain
#

i don't remember if it can autodetect the game path on linux but it didn't work at all on linux before i changed that

valid nova
#

I'll go try wait

full mountain
#

no idea what this is

valid nova
#

Yea the decompiler doesn't do anything when clicking on it

full mountain
#

it looks like it might be related to storm or something

valid nova
valid nova
full mountain
#

old java modding toolchain

#

never saw any popularity

floral sluice
#

pzstorm, I remember looking at it when I was seeing if there was a java modding for pz

valid nova
#

This works here

floral sluice
#

wasn't a bad solution, just some things I didnt like personally

valid nova
#

It seems it works

full mountain
#

it was made by the same guy as capsid so you can imagine its general quality ๐Ÿ˜…

valid nova
#

What's capsid

#

Yea the whole thing seems to work when feeding it the path manually, but my path wasn't the default one aoqia has set in the leaf installer either

#

So maybe it just doesn't find the steam path idk

full mountain
#

basically the predecessor to umbrella, insanely difficult to set up and pretty crappy output

#

how bad it was is how i got into making all this stuff ๐Ÿ˜…

floral sluice
#

who would've though there was like 3 different areas steam can install to?

valid nova
#

Yea I guess Linux in a nutshell on that one

#

In case you're curious this is my game path
/home/simon/.steam/debian-installation/steamapps/common/ProjectZomboid/projectzomboid

#

tho I have no idea about the second pz folder lol

#

idk if that's normal or not

#

Wait I know who to ask

floral sluice
#

I thik the debian-installation folder is not normal, probably debian-specific as the name implies

#

but the .steam folder in user home is standard I think

valid nova
#

@stiff depot what's your game install folder ?

floral sluice
#

currently in loom I've got it to .local/share/Steam

#

thats why it's so annoying for linux, it can be in .steam/, .local/share/Steam, some flatpak paths, and more specific paths like debian-installation folder that you have

#

I just gave up basically and rely on the user picking the folder, thats the best option to avoid issues imo

valid nova
#

That's okay

#

I mean there might be a way to get it with steam as a command ?

floral sluice
#

Though I should probably either specify in the readme to choose the folder with ProjectZomboid64.json in it, or to detect the inner folder

floral sluice
#

.

#

Although I guess that could be applied to the installer too, so it would be more beneficial

valid nova
#

That's fine, tbf if it's an issue for users it means they

  • either are on Windows and manually chose a custom installation path, so they should know it
  • are on Linux and already are not too retarded and should be able to find their game install folder
floral sluice
#

im not really interested in java code for leaf right now, im trying to get this stupid cmake stuff resolved, then I do docs for leaf

valid nova
floral sluice
#

This is what I do for context

public static Path getDefaultSteamLibraryPath() {
    if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
        return Path.of(System.getProperty("user.home"), "Library/Application Support/Steam");
    } else if (OperatingSystem.current() == OperatingSystem.LINUX) {
        return Path.of(System.getProperty("user.home"), ".local/share/Steam");
    }

    return Path.of("C:\\Program Files (x86)\\Steam");
}
#

I've yet to find someone with a mac, but thats I think I got the mac location from just lurking in the PZ discord or something

stiff depot
floral sluice
#

ok that looks like its debian-based distro specific too then

#

which theres nothing bad to that btw, just means auto detection wont work.

valid nova
#

Thank you

valid nova
stiff depot
#

@valid nova do you ask because of your borderless window issue?

valid nova
#

No no has nothing to with that ๐Ÿ˜„

#

You're in the thread of a tool to mod the Java

#

And it has an installer which needs the game path

floral sluice
valid nova
#

And in my case my game path a tiny bit weird due to the projectzomboid at the end that Windows doesn't have

valid nova
floral sluice
#

you can set it as the user, which will show up in installer and for loom, but no not for Steam

valid nova
#

Tbf I think it's fine

#

It's nothing critical

fresh nexus
valid nova
#

Ok and what about this part lmao

find Steam installation folder

fresh nexus
#

You can find Steam InstallPath in windows registry:

#

the annoying part is libraryfolders.vdf

full mountain
#

i already do this for windows, aoqia probably does too, but it is literally windows specific ๐Ÿ˜…

floral sluice
#

I did have it working in loom before, but I removed it, it's not worth it and windows specific yes

#

it increased time for loom to configure, and I don't think it's worth it, especially when you don't always want to use Steam's game folder like in Idlework's case

jagged scarab
valid nova
#

Nice good start !

fresh nexus
# jagged scarab Viewport

Nice. Long has man asked the question: "But does it run doom?" And soon, PZ will be doom complete.

jagged scarab
#

The program halts at
LOG : Mod f:0, t:1755618010701> The game starts!
In this part of the constructor :

    public ViewportUI() {
    super();
    this.visible = this.defaultDraw = true;
    createTexture();
    cells = new ArrayList<>(); // <--- Makes the program crash!!
}
jagged scarab
#

Why I cannot instantiate a simple array list ?

floral sluice
#

good question

#

debug it and check the exception/stacktrace

jagged scarab
#

Maybe it's my mixin

@Mixin(IsoCell.class)
public class IsoCellMixin {
    @Inject(method = "render", at = @At("RETURN"), cancellable = false)
    private void render(CallbackInfo ci) {
        System.out.println("Rendering iso cell Mixin");
        IsoCell cell = (IsoCell)(Object)this;
        System.out.println("AAAAAAA");
        ViewportUIWrapper.renderCell(cell);
        System.out.println("BBBBBBB");
    }
}
#
LOG  : Mod          f:0, t:1755642211453> The game starts!
LOG  : Mod          f:0, t:1755642211503> Viewport instantiated
floral sluice
#

Can you not run the game in debug mode and see where the program crash happens?

jagged scarab
#

I'm already running with the -debug parameter

floral sluice
#

I mean debug in the IDE. -debug is only for the in-game lua debugger

jagged scarab
#

yeah

floral sluice
#

assuming your crash is crashing the jvm, you should be able to debug the Zomboid Client run configuration which debugs the game jvm

#

And is there a stacktrace anywhere in the log?

#

My first guess was it's probably was the unchecked cast you're doing from IsoCell to Object to IsoCell (?) which creates a runtime exception, but it's hard to say for sure since I don't know everything you're doing

#

That is the correct way to cast this to the calss's this object, but I think it can still fail sometimes, though im not sure on the details about that

#

anyway, posting a stacktrace would help if one is generated

jagged scarab
#

No error message

#

Just crashing

#

How should I cast this object ?

#
LOG  : Mod          f:0, t:1755642604569> The game starts!
LOG  : Mod          f:0, t:1755642604587> Viewport instantiated
LOG  : General      f:0, t:1755642605281> Rendering iso cell Mixin
LOG  : General      f:0, t:1755642605281> AAAAAAA
LOG  : General      f:0, t:1755642605282> Adding cell
LOG  : General      f:0, t:1755642605282> Cell added
LOG  : General      f:0, t:1755642605282> BBBBBBB
#

My methods are okay (?)

#

For non-void injected methods, should I return a value ??

#

Like for render

floral sluice
floral sluice
jagged scarab
#

At = RETURN

floral sluice
#

Yes, are you using CallbackInfo or CallbackInfoReturnable

jagged scarab
#

Yes I'm using CallbackInfo as parameter but I do not use it

floral sluice
#

First off, basically all inject mixin methods should be void, and use the returnable to return and or cancel the original method

#

If it's just a normal inject then I don't see why you would need to return a value in a void function...

jagged scarab
#

render is void right

floral sluice
#

You only return values in mixin class methods if you're doing redirects or using ModifyArg etc

floral sluice
jagged scarab
floral sluice
#

You are using cancellable there without even using a CallbackInfoReturnable, im not sure what the behaviour for that is

#

usually, you cancel the original method if you want to return your own value

#

but here you are not, so what is the point?

jagged scarab
#

It's maybe this (I'm actually on phone rn)

floral sluice
#

also cancelling a render method sounds like a bad idea anyway

jagged scarab
#

But cancellable is false?

floral sluice
#

oh it is too, I misread it

#

but don't specify it at all

#

You're not using a returnable, there's no point in having cancellable there at all, especially if it's false (it defaults to false)

jagged scarab
#

Ok

floral sluice
#

And your methods inside the mixin class should always return void if they are injects

jagged scarab
#

It does not return anything

floral sluice
#

yes, I'm just saying that to make sure

jagged scarab
#

So what can cause the crash? I just added minor changes

floral sluice
#

We won't know until it's fixed

jagged scarab
#

I'll come back fix it tomorrow

floral sluice
#

Keep in mind that injecting at RETURN injects at every return statement in the method, not just the last one

jagged scarab
#

I need to call it once

floral sluice
#

If you can comment out all your render mixin code and remove cancellable = false and it still crashes, probably an issue with where you are injecting to, or some other specific thing probably

jagged scarab
#

Okay

jagged scarab
#

When I uncomment this snippet, the output is

LOG  : General      f:0, t:1755680675902> Rendering iso cell Mixin
LOG  : General      f:0, t:1755680675902> AAAAAAA
LOG  : General      f:0, t:1755680675902> Adding cell
LOG  : General      f:0, t:1755680675903> Cell added
LOG  : General      f:0, t:1755680675903> BBBBBBB

And the game crash

#

Here is the Wrapper code with a static ViewportUI

package com.example;

import zombie.iso.IsoCell;
import zombie.ui.ISUIWrapper.ISUIElementWrapper;

public class ViewportUIWrapper extends ISUIElementWrapper {
    private static ViewportUI viewport;
    private static ViewportUIWrapper wrapper;

    public ViewportUIWrapper(double x, double y, double width, double height) {
        super(x, y, width, height);
    }

    @Override
    protected void instantiate() {
        viewport = new ViewportUI();
        this.table.rawset("javaObject", viewport);
        viewport.setTable(this.table);
        viewport.setX(this.getX());
        viewport.setY(this.getY());
        viewport.setWidth(this.getWidth());
        viewport.setHeight(this.getHeight());
    }

    public ViewportUI getViewport() {
        return viewport;
    }

    public static void addToUI(double x, double y, double width, double height) {
        wrapper = new ViewportUIWrapper(x, y, width, height);
        wrapper.initialise();
        wrapper.addToUIManager();
    }

    public static void renderCell(IsoCell cell) {
        viewport.renderCell(cell);
    }
}```
#

And the actual render function is just

    public synchronized void renderCell(IsoCell cell) {
        /*IsoWorld isoWorld = IsoWorld.instance;
        IsoCell currentCell = isoWorld.CurrentCell;*/
        System.out.println("Adding cell");
        this.cells.add(cell);
        System.out.println("Cell added");
    }
jagged scarab
#

So I don't understand

jagged scarab
#

But if I remove this line in renderCell ...

this.cells.add(cell)

...It works

#
private final List<IsoCell> cells;

public ViewportUI() {
    super();
    this.visible = this.defaultDraw = true;
    createTexture();
    cells = Collections.synchronizedList(new ArrayList<>());
}```
#

You see the list is thread-safe

#

What's my mistake?

#

Hello

#

I tried in enter but it crashes the game in the end

@Inject(method = "enter", at = @At("RETURN"), cancellable = false)
    private void enter(CallbackInfo ci) {
        LOGGER.println("The game starts!");
        ViewportUI.addToUI(100, 100, 512, 512);
        ViewportUIWrapper.renderCell(new IsoCell(0, 0));
        ViewportUIWrapper.renderCell(new IsoCell(1, 0));
        ViewportUIWrapper.renderCell(new IsoCell(2, 0));
        ViewportUIWrapper.renderCell(new IsoCell(0, 1));
        ViewportUIWrapper.renderCell(new IsoCell(1, 1));
        ViewportUIWrapper.renderCell(new IsoCell(2, 1));
        LOGGER.println("Viewport instantiated");
    }```
#
LOG  : Mod          f:0, t:1755685025056> Viewport instantiated
ERROR: General      f:0, t:1755685025064> ExceptionLogger.logException> Exception thrown
    java.lang.NullPointerException at ArrayDeque.addFirst(ArrayDeque.java:286).
    Stack trace:
        java.base/java.util.ArrayDeque.addFirst(ArrayDeque.java:286)
        java.base/java.util.ArrayDeque.push(ArrayDeque.java:579)
        knot//zombie.audio.parameters.ParameterInside$FloodFill.push(ParameterInside.java:261)
        knot//zombie.audio.parameters.ParameterInside$FloodFill.calculate(ParameterInside.java:171)
        knot//zombie.audio.parameters.ParameterInside.calculateInsideFraction(ParameterInside.java:128)
        knot//zombie.audio.parameters.ParameterInside.calculateCurrentValue(ParameterInside.java:48)
        knot//zombie.audio.FMODParameter.update(FMODParameter.java:41)
        knot//zombie.AmbientStreamManager.update(AmbientStreamManager.java:291)
        knot//zombie.SoundManager.Update(SoundManager.java:1106)
        knot//zombie.GameWindow.logic(GameWindow.java:403)
        knot//zombie.GameWindow.frameStep(GameWindow.java:916)
        knot//zombie.GameWindow.mainThreadStep(GameWindow.java:642)
        knot//zombie.MainThread.mainLoop(MainThread.java:76)
        java.base/java.lang.Thread.run(Thread.java:840)
floral sluice
#

why is it crashing in sound manager update loop??

jagged scarab
floral sluice
#

can you please reword that, I dont understand

jagged scarab
jagged scarab
floral sluice
#

hmm crashing without any exceptions at all either means something really went bad or for some reason the loader didnt catch it

jagged scarab
#

But it works when I remove the List.add call in my code

#

The bug come from my source but I'm doing very basic things ! Did you read it?

floral sluice
#

where did you post the code that you are using right now

jagged scarab
#

I think it's an access/instantiation problem

#

But the ViewportUI is not null at renderCell, neither the inner List

#

@floral sluice what do you think

floral sluice
#

Can the parameter of renderCell be null?

#

you dont do any checks, thats my only though right now

#

actually, but you construyct the cell. Maybe something is going wrong with the cell construction?

#

but the fact that it either gives no stracktrace or one in SoundManager update method is very weird

#

Also, I am pretty sure you aren't even meant to construct multiple IsoCell, @full mountain would know much more about that than me

jagged scarab
floral sluice
jagged scarab
full mountain
#

you will definitely crash the game doing that

jagged scarab
#

Actually I take the instanciated "this" IsoCell inside his render method

#

Maybe I'm more looking for IsoGrid I don't know

#

Did I post the Mixin already?

floral sluice
#

So you mixined IsoCell#render?

jagged scarab
floral sluice
#

What do you plan to use the IsoCell for

jagged scarab
#

Especially the one being visible by the game character

floral sluice
#

Ok, getting the cell is a start, but it's a singleton as far as I am aware, meaning it's only meant to be instantiated once only.

#

An IsoCell is the 256x256 grid of loaded squares around players. Each player has one

jagged scarab
#

Could be useful tho

floral sluice
#

I don't know what IsoGrid is. All I know is about isoGridSquare which is the small 1x1 square you think of, with the tile image on it

jagged scarab
full mountain
floral sluice
#

Maybe just from the name, you can look at IsoChunkMap.processAllLoadGridSquare() too

full mountain
#

it's not 256x256 either but i don't have the exact values on me: it's 200x200 in b41 and smaller in b42

floral sluice
#

oh I thought they upped it to 256x256 because memory alignment or whatever

full mountain
#

no, they decreased it so they could say they optimised the engine ๐Ÿ˜…

floral sluice
#

l.l

full mountain
#

they use powers of two in other places now but i don't think the cell size could be as small as 128x128

jagged scarab
#

If I successfully build my mod it would be interesting to have a long distance of view

floral sluice
#

But anyway, I would look at IsoCell#getChunkMap and other methods in IsoCell. It's the best place to start to get square around the player.

#

Even has methods in it like getGridSquare(x, y, z)

floral sluice
#

I'd imagine if you increase the cell size past 512x512 most peoples games would probably die

full mountain
#

it does actually seem to be 256x256 ...???

#

i wonder what it was before, i was always only able to scan out 100 tiles from the player as far as i can remember

floral sluice
#

thats what I got told at the start, I assumed it was 300x300 from mapping, then I got corrected by somebody saying it was 256x256 and now I've just been using that for the time

jagged scarab
full mountain
#

people used to say it depended on your resolution but i was sceptical that that was actually true

floral sluice
full mountain
#

oh well that's pretty definitive

floral sluice
#

In all seriousness though, if you want it to be a faithful implementation, take a feature like molotovs or other throwables which are sprites, you now have to make it 3d too...

full mountain
#

i'll never doubt you again

floral sluice
#

please doubt me again ๐Ÿ˜ญ I'm wrong a lot of the time

jagged scarab
#

First I'll display walls without textures. Computer time, I'll try to inject IsoGridSquare#render and come back to you in a few minutes

#

But I'm pretty sure it will keep crashing

floral sluice
#

In any case, if you know for sure it's something to do with adding a cell to the list, it's either the cell or the list that's the problem, and since lists usually work fine I'd bet it's something with the cell. I wouldn't even personally have a list of cells at all

jagged scarab
#

Hummm there is no render method inside IsoGridSquare ...

jagged scarab
#
    private final IsoGridSquare[][] gridSquares = GameServer.bServer ? null : new IsoGridSquare[4][IsoChunkMap.ChunkWidthInTiles * IsoChunkMap.ChunkWidthInTiles * 64];
#

It stopped crashing I found the bug

#
IsoGridSquare cell;
for (int j = 0; j < 5; j++)
    for (int i = 0; i < 5; i++) {
        cell = isoCell.getRelativeGridSquare(i, j, (int)IsoCamera.frameState.CamCharacterZ);
        ViewportUIWrapper.renderCell(cell);
    }
#

But the array is filled with null values

LOG  : General      f:1106, t:1755767614096> CELL : [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
jagged scarab
#

It's moving !

floral sluice
#

epic

floral sluice
#

thanks to chuck and jvla we now have a Java channel, so please move any non leaf related topics there. When asking questions specific to leaf, you might have to specify that you are using leaf but it should be ok regardless.

#

I'll still be active in here though, it will be only for leaf topics like bug reports (though id MUCH rather people use github), suggestions, etc

jagged scarab
jagged scarab
#

It wouldn't be so hard if the game started in less than 5 minutes each time.....

floral sluice
#

your game is taking more than 5 minutes to start?????

#

with a fresh cachedir, it shouldnt take that long

#

additionally, using a mini map like MicroMap would help your loading times too.

jagged scarab
jagged scarab
#

It takes 2:40 fucking minutes

#

On each fucking try

jagged scarab
#

Developping a mod = waiting years before the game load

floral sluice
#

is that to load a save, or the first start of the actual game?

#

mine does not take this long. are you on a hdd?

#

also, you should be using hot reloading where possible

vital bloom
#

I finally got this working a few minutes ago, thanks for putting in the work

#

I had a few hiccups but got through most of it by reading the thread

jagged scarab
#

It's almost working, in fact it SHOULD work but some obscure geometry bug persists ..... anxiety

#

looks like IA are useless polluting shit

#

WTF is wrong with my code ????????

#

Also colors are fucked up

#

Red become yellow

#

    private int OLDgetColor(byte r, byte g, byte b)
    {
        return (((int)r << 24) + ((int)g << 16) + ((int)b << 8) + 0xff);
    }

    private int getColor(byte r, byte g, byte b) {
        return (0xff << 24) | ((int)r << 16) | ((int)g << 8) | (int)b;
    }
floral sluice
#

I already said to move this to #java

#

"my code isn't working" isn't related to leaf, id like to know here when bugs come up

floral sluice
#

one you resolve the user error with mixins (which seems like you have), it is going to be work on your own

floral sluice
#

it probably requires you to link your Steam to discord or something like all the other channels

floral sluice
#

#linked-roles

valid nova
valid nova
vital bloom
#

How do I get the mod's jar? I ran the publish gradle job, but I don't see any /dist or /libs folder in the project structure on IDEA It was Build, not Publish, sorry

vital bloom
#

I don't understand how to deploy the jar with mixins to the game.
I checked the readme at https://github.com/aoqia194/leaf-example-mod.
This explains how to distribute the mod to the workshop, but not how to actually use the file.
I tried copying the generated mixin's class file from the jar into the game's folder that would match the package, but that did nothing.
I also tried to copy the whole original class file, tweak it, compile it and then replace the original .class file in the game folder with the output file, but the compiler won't let me use the same class name twice in the same assembly, and it won't let me compile a source file without the other references to classes in the assembly that the class depends on so, that went nowhere.

#

So the changes work fine when launching the game from the IDE on the dev env, but I can't deploy them to my regular steam installed game instance to test them on a saved file, and I wouldn't know how to write install instructions since I can't install them on my own game instance either

floral sluice
#

If you want to install it in the prod environment like a normal user, the leaf-installer is what you want to look at.

#

It's not fully finished, and has some bugs I want to fix, so I don't recommend relying on it, just for testing or seeing how it works is fine though.

vital bloom
#

Well I'm not planning to distribute anything to the store, I want to finish the whole cycle of development, like, "this is how I would do things at go time"

#

I think I can omit the part where the jar is uploaded to steam and not miss out on anything of substance

floral sluice
#

Yes, you can use it locally. The mods/ModId/leaf/mods/ folder in the game folder can be used to manually load mods

#

let me double check the path though, im not sure what i set it to

vital bloom
#

Yup, going through the git repo's notes right now.
I'm very new at this so it's throwing me on a bit of a loop

#

thanks again for putting in the work to make this work at all though

#

it's a cool idea, even if it's still a work in progress

floral sluice
#

actually it's not in the git notes, since I didnt think anyone would use it

#

turns out its the same as the workshop ones, just in the mod folder

#

for example, ZomboidGameFolder/mods/YourMod/leaf/mods/YourLeafMod.jar

#

Follows traditional PZ mod structure

#

But you shouldn't need anything else, juist that folder structure and the jar at the end

vital bloom
#

I'll take a crack at it after food, fingers crossed it's all smooth sailing
Thanks for the help!

floral sluice
#

I just thought how I don't have any support for the B42 modding structure where there's multiple version folders. It's possible though. I'll add it to the issues so I dont forget

vital bloom
#

If I find anything of note during the process I'll chime in here

floral sluice
#

Please do, I can't think of everything because im biased, so naturally there are oversights

fresh nexus
#

Really looking forward to leaf becoming bigger. I sooo don't want to do a java file replacement for editing baseVehicle.java (12,000 lines long) as it would almost guarantee my mod breaks every update.

floral sluice
#

imagine you just want to change one or two things, now you have to fix(!!) and also recompile the whole thing

#

There is some classes in the game that are impossible to do without leaf or using a bunch of different compiler as trial and error

fresh nexus
#

Yea, there is literally just a few tiny functions in baseVehicle.java, mainly related to how the vehicle starts atm, that id love to tweak. (make it fail more with poor starter condition, maybe play different sounds, etc)

#

take longer with a poor starter (hence more battery draw)

#

But replacing a 12,000 line file for that? haha.. just no.

rare mural
#

This is why I suggested leaf in the first place, then you called me stupid

fresh nexus
#

More I didn't want to use chatGPT, since chatGPT generally fails at modding games and you proceeded to overcomplicate things.

rare mural
#

In my view using steamcmd is a simplification. I asked GPT for steamcmd commandsโ€ฆ

#

The only thing it got wrong, aoqia a human, also got wrong

#

A numerical id, something they are particularly bad at, that I even anticipated in that very conversation would be wrong

#

You overreacted

fresh nexus
#

Sorry. I was exhausted and I had been up to late.

rare mural
#

np

floral sluice
#

Also @full mountain when you are not busy (and anyone else that can chime in), I need the rundown for B42 mod structure. Mainly the caveats, as most of the actual general information I can get from the wiki page. I have a feature idea where leaf can load the correct mod based on the version folder, instead of just one folder. Not sure if this is a good idea for Java mods, but it seems logical if there is say a b41 and b42 mod. Obviously this would rely on the game's mod structure (notably because of how non-existent it is on B41). I also thought about having my own structure in the leaf/mods folder like leaf/mods/41.78.16 and leaf/mods/42.11.0-unstable.30715, but I'll need more people's thoughts about that.

full mountain
#

there's not too much to say about it

#

when trying to load a file, the highest version folder that doesn't exceed the current version is queried, and if there is no file with that path in that folder, then common is queried instead

#

the version and common folders are structured exactly like the root mod folder would be in b41

floral sluice
#

So if you are on 42.11.0 and only a 42.10.0 folder exists, it will load the older version?

full mountain
#

as long as there isn't a 42.11.0

floral sluice
#

hmm ok

full mountain
#

to be honest, most people haven't done much with it still, because older versions aren't available anyway

floral sluice
#

In my case, it's independent of the game, so I'd just be replicating what the game does

full mountain
#

it'll probably be more meaningful after mp comes out (41 had many builds remain available for servers) and between builds

floral sluice
#

yea, I do see the appeal for it too. many people having their separate [B42] version of their mod lol

#

Wait, what is the behaviour when you load a b42-structured mod in b41? like does b41 load common too, or does it just expect a media folder like normal

full mountain
#

b41 won't load anything from the new structure and vice versa

#

the files are still there of course and some things that take file paths might be able to reach them, b41 doesn't do anything to explicitly ignore them, but since the root folder is different it just never looks in there on its own

full mountain
floral sluice
#

i figured as such

full mountain
#

because of the versioning system there's no actual need to do that, it's just to get a second initial release

floral sluice
#

Maybe it's a feature to be added once b42 releases it's stable version? I don't know how they will change the structure in the future anyway

full mountain
#

i wouldn't expect them to change that but the modding features in b42 are very wip

#

basically none of the new mod.info stuff works, mod options is a liiiiitle rough, and the ongoing workshop id thing

floral sluice
#

oof

full mountain
#

i don't see them doing 'break every single mod' changes though

floral sluice
#

I really do have better things to focus on though, such as the installer needing installer script editing

full mountain
#

i suspect that's the reason they haven't fixed the workshop id thing even though it's a one-line change

full mountain
#

it's a nice to have

floral sluice
#

I'm working on trying to get the loader to use log4j, because I don't like the current logging system, namely it's cluttered, looks ugly, and if the game halts or crashes then no logging can be output, even if there is an exception @jagged scarab found this edge case.

#

I tried in the past, but I didn't have enough knowledge about the logging system to do it. Also, a challenge will be keeping it compatible with every version of Zomboid's logging system, so it means I probably will have to ditch reflection calls to the game's logging classes (yet again more effort needed).

It's just a huge pain to do, but I think it will be worth it.

dusk pebbleBOT
#
PZwiki

โ€‹ โ€‹ โ€‹ โ€‹ This article is about modding structure of Project Zomboid.ย For game files of Project Zomboid, see Game files.ย For explanations of file formats, see File formats.
Local mods are recognized in two different folders which each have their own rules and structure and are both in the cache folder:
โ€ข Zomboid/mods/ - place to put mods to install manually โ€ฆ

Mod folder

The files of your mods are placed in the folder Contents/mods/ alongside a mod.info file which is the core of your mod. The folder structure of your mod folder should be as follows:
Build 41
Build 41 uses the following modding structure.

Contents/
โ””โ”€โ”€ mods/
    โ”œโ”€โ”€ MyMod1/
    โ”‚   โ”œโ”€โ”€ media/
    โ”‚   โ”‚   โ””โ”€โ”€ ...
    โ”‚   โ”œโ”€โ”€ mod.info
    โ”‚   โ”œโ”€โ”€ poster.png
    โ”‚   โ””โ”€โ”€ ...
    โ””โ”€โ”€ MyMod2/             <--- for extra mods, simply add a new mod folder
        โ”œโ”€โ”€ media/
        โ”‚   โ””โ”€โ”€ ...
        โ”œโ”€โ”€ mod.info
        โ”œโ”€โ”€ poster.png
        โ””โ”€โ”€ ...

Build 42

Build 42 uses the following modding structure.

Contents/
โ””โ”€โ”€ mods/
    โ”œโ”€โ”€ MyMod1/
    โ”‚   โ”œโ”€โ”€ common/         <--- common folder is mandatory, even if emptyย !
    โ”‚   โ”‚   โ””โ”€โ”€ media/
    โ”‚   โ”‚       โ””โ”€โ”€ ...
    โ”‚   โ”œโ”€โ”€ 42/
    โ”‚   โ”‚   โ”œโ”€โ”€ media/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
    โ”‚   โ”‚   โ”œโ”€โ”€ mod.info
    โ”‚   โ”‚   โ””โ”€โ”€ poster.png
    โ”‚   โ”œโ”€โ”€ 42.1/           <--- for extra versions, simply add a new version folder
    โ”‚   โ”‚   โ”œโ”€โ”€ media/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
    โ”‚   โ”‚   โ”œโ”€โ”€ mod.info
    โ”‚   โ”‚   โ””โ”€โ”€ poster.png
    โ”‚   โ”œโ”€โ”€ 42.1.5/         <--- same here, another different version
    โ”‚   โ”‚   โ”œโ”€โ”€ media/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
    โ”‚   โ”‚   โ”œโ”€โ”€ mod.info
    โ”‚   โ”‚   โ””โ”€โ”€ poster.png
    โ”‚   โ””โ”€โ”€ ...
    โ””โ”€โ”€ MyMod2/            <--- for extra mods, simply add a new differently named mod folder
        โ””โ”€โ”€ ...

valid nova
#

@floral sluice this might interest you regarding the general mod structure

floral sluice
#

Albion explained everything I needed to know regarding it, there's not many downsides as I expected, but again it's extra work on top of an unstable release, so I wont prioritise it right now

#

Especially when I've already got an unstable system in the loader already which I dont like, using reflection to access the game's logging system. It's not ideal at all, and is very shaky for future releases. I'm honestly not quite sure how I will circumvent this, it might require a complex bytecode patch to automatically find the functions necessary and redirect them.

#

in fact, it already broke twice before, just because TIS decided to change function names and move them to different classes, etc

vital bloom
#

I tried to install leaf-loader and the jar errored out because the main class couldn't be found

#

I checked the jar manually and there is a main class in it though

rare mural
#

Reflection isnโ€™t intrinsically unreliable, if you are doing the standard things itโ€™s probably not a catastrophic situation

vital bloom
vital bloom
#

23.0.1

rare mural
#

no idea

vital bloom
#

I think maybe the project didn't set the main class correctly and that's why it can't be found on the jar

#

because it is in there

#

Maybe I can specify it manually via args, lets try that

#

Nope, and the main is in the manifest

#

There were several jars in the maven, maybe I got a bad one, I'll try a different jar

floral sluice
#

it is expecting a class name without -jar

floral sluice
#

It's worse that the downside to them changing it isn't just "the game doesn't work in this one specific area" but the fact that you wont get any logging

rare mural
#

It kinda seems like Leaf versions should have targetted compatibility with specific game versions anyway

floral sluice
#

I am not doing the similar version system as fabric where they maintain pretty much all versions from 1.3 to 1.12 etc, im doing it so that the latest version should be able to be used on every game version

#

It ends up being less maintenance overall, and I like it better. Also, I cant update previous versions even if I wanted to.

#

Well "all versions" is an overstatement, since I cant test them all, but as many that makes sense, eg I plan on 41.78.16 upwards

vital bloom
#

TIS only includes some previous versions in the beta testing anyway, like, AFAIK we can't roll back to 42.6 for instance, so that seems like that effort wouldn't justify the payoff

full mountain
#

it's not like minecraft, mods don't really tend to break between most updates so nobody plays on older versions in the first place

floral sluice
#

it'll mainly be between the latest stable release, and unstable release, though im questioning to support unstable either

#

im only doing it right now because its so popular, 42 unstable

#

I guarantee if I didnt support 42 unstable, I'd probably get ridiculed for it lol

rare mural
#

Seems like latest release should support the latest stable, and our dev branch should be working towards unstable support.

#

"our", you know what I mean

floral sluice
# rare mural Seems like latest release should support the latest stable, and our dev branch s...

dev is mainly an intermediary branch for feature branches to sync to, wihch then gets merged to main. I don't think a separate branch for unstable release support is necessary, when I can include it in the main release. If the features aren't fully stable, I can only enable them if an unstable version is detected (what I do for the b41 logger and b42 logging system patches separately)

#

Right now I don't use any feature branch yet, because im "rushing" to get it to a good point, theres not that many commiter other than me currently, its not necessary now

full mountain
floral sluice
#

why cant they just go back to closed testing exclusively ๐Ÿ™

#

it even generates more hype

full mountain
#

because then people start calling the game a scam ๐Ÿ˜…

floral sluice
#

people load up the public unstable release and expect it to be the "full" release version, then hype dies quickly

#

"im on b42, whers the NPCs!!!!" like this

#

and you tell them "its not finished yet" and they dont like it

floral sluice
#

they probably make more money overall then I will in my lifetime, yet it feels like I could add some of these features in a day...

rare mural
#

as we all know, their codebase is absolute disarray

#

i imagine the struggle is actual and real

floral sluice
#

unironically with leaf I probably could actually add some of these features in a day, maybe I'll live stream it for proof or somethin ๐Ÿ˜‚

vital bloom
#

Maybe I'm biased from lack of skill, but I've seen their codebase and I wouldn't want to commit to release dates for anything either

full mountain
#

i'm not sure what features you're referring to but please don't feed the scam crowd ๐Ÿ˜ญ

rare mural
#

nah they seem allergic to basic nominal refactors

vital bloom
#

accessors and mutators are implemented and not used, code is commented out on a distributed branch, I can't see DI being applied anywhere

floral sluice
#

but, they have no one to blame. They can say "well it's not our fault it's the previous devs fault" but maybe they look back and see it was them who made the system before them

rare mural
#

game devs don't know what DI is

vital bloom
#

there's lots of code that could be refactored into functions but is instead copy-pasted all over

full mountain
#

tbf the accessor/mutator spam is for lua

vital bloom
#

and for the life of me I still don't understand the point of the PZ helper "Clamp" function

rare mural
#

it's not even about duplication. refactoring a long function as a high-level composition of calls to smaller well-named functions is worth doing even if you're not reducing duplication

#

Same with large classes that compose and delgate to other smaller well-named single purpose classes

floral sluice
vital bloom
#

and there's so many classes that are essentially DTOs while a few class files are like, 5000+ lines long

floral sluice
#

Most of the small bugs in their c ode like the fields in mod list not being implemented could be done by junior on 2$ hour in like 2 hours

#

Why dont they hire just a person to only fix the bugs? and a person for features, split the tasks, its beyond me

rare mural
#

I agree that if they just hired a young nerd who found the joy of nominal refactoring early, they would have quite the boon

vital bloom
#

it's also weird that they have what looks like systems interacting, but instead of having them neatly divided and have APIs defined for them, it's all just globbed together haphazardly

floral sluice
#

they will struggle in the future too. Their features and bug fix wont be able to be released fast enough, probably the game will lower in players since b42

#

But I don't get it, some of the people will completely forget every bad thing they did previously when they release a flashy feature, like ragdolls. Ok cool, the zombies have physics, a good feature imo. But then they act like the game is now bug free and they've fixed it

vital bloom
#

I mean, I remember when people praised ragdolls for a couple of weeks

#

and then they started complaining that ragdolls broke cars and guns

#

because now you have to step on zombies to double tap them or you can miss several shots at point blank range

rare mural
#

gamedev is really really hard. it's wildly multi-disciplinary and i appreciate the challenge for any gamedev

#

but they make it so much harder by writing the kind of code they do

#

it's typical in the industry

floral sluice
#

I don't mind bad game dev, everyone starts from somewhere. I don't like not owning your shit code and knowing when it hurts you more than helps

vital bloom
#

I don't feel competent to critique that, because I know I don't understand the reason behind these choices

rare mural
full mountain
#

i'm not entirely sure they have been ignoring the problem

vital bloom
#

enterprise software is rich in that kind of (maybe overly) robust engineering, but also, pretty much nobody cares about performance in that like 99% of the time

floral sluice
#

but then they've been just bandaid fixing the issues that come up instead of fixing them properly.. that's ignoring it imo, or not wanting to deal with it now

#

and then it probably makes issues in the future too, you could probably name a situation where this happened, im not knowledgable enough in their update history though

rare mural
#

we don't need to know specific examples not really

#

when you have a long functions that's immersed in the low level details of the overall objective

#

then every time you don't read that function for a few weeks, you have to reverse engineer it the next time you come to it

#

if your whole codebase is like this, you're just asking for regressions

#

it's entropy

#

you have to actively spend energy to work against it

#

you don't have to be a genius super programmer either

floral sluice
#

reminds me of what I think jab posted a screenshot of, "When I wrote this, only God and I knew what it meant. Now, only God knows."

vital bloom
#

I mean it's called technical debt because it also accrues interest until it becomes unmanageable

rare mural
#

just some standards around nominal refactors, and vertical segregation like haiscod was saying, it only takes a little gardening

#

you can actually have IDE's like IDEA do this kind of nominal refactoring automatically

#

highlight some lines and move to local method, and it'll move take all the locals and make them parameters and replace the lines with a call to the new method

floral sluice
#

I still think they need to go away from Java. Or convert lots to natives, even with there interop cost too. this is my opinion though, im ok with them not doing this, its their game not mine

rare mural
#

eh modern java is totally fine imo

#

even 17

vital bloom
#

Java's not my favorite, but there's nothing particularly wrong with it, and it's all implemented in Java now anyway

rare mural
#

it's come a long way since the 90's ๐Ÿ˜›

vital bloom
#

Reading the Lua scripts made me appreciate Java tbh

rare mural
#

lol well yeah

#

my own PZ mod is in TypeScript because imo lua is just that bad

vital bloom
#

I don't know if it's bad per se, I just don't like the quirks I've been running into

#

maybe if I actually learned to use it I'd also learn to appreciate the quirks in context

rare mural
#

it's not like php in the 90's bad, where it's like broken

vital bloom
#

or maybe that's just Stockholm syndrome by another name

rare mural
#

it's more like it's just wayyy too primitive experience with the panoply of great choices today

full mountain
#

i don't think lua works well at scale, particularly pre-type annotations

rare mural
#

there are so many ways to embed javascript today, with so many transpilation choices, it feels like lua is riding a deprecated momentum and mindshare for gamedev scripting

floral sluice
#

Lua is ok, just you have to make it a simple interface with the game. If you make it too complicated, not user friendly enough, it will turn into its own thing

rare mural
#

not that js is the only choice, i'm just saying lua is silly choice

#

yeah but that's like how all embedding works

vital bloom
rare mural
#

you expose some interface to the scripting runtime

full mountain
#

i'm very fond of lua personally

floral sluice
#

I think its good because its very lightweight. And if you use luaJIT, or luaU, very performant

#

Javascript I dont know about how the GC works

rare mural
#

js is just a more featureful langague with a lot of great transpilation options

vital bloom
#

and so many libraries...

rare mural
#

at least with v8 and spidermonkey, not many language runtimes has had more manhours and dollars invested into it

#

we're talking billions of dollars

#

v8 is one of the most optimized pieces of software that exists

#

i have a little altar/shrine in the corner of my room

#

where i do daily prayers, that Jab will bring pipewrench back to life

#

๐Ÿ˜‚

#

๐Ÿ™

jagged scarab
#

Jab is such a Chad at PZ modding. Hi everyone

vital bloom
#

The mod's not getting picked up.
Is the location for the leaf mods folder configurable?

#

I think that's matching the location given

#

The console shows the debugger working on the dev env and the hutches are at 0 dirt,
on the actual game instance ("Prod" IG, but it makes me feel a bit pretentious), no messages and dirty hutches

#

I also tried to set it up as if it were a lua B42 mod, that's not fixing it either

floral sluice
#

hmm I haven't tested it in a while. It's possible I broke it somehow

#

either that or it's not actually loading it from the mods folder for whatever reason

vital bloom
#

I tried checking the leaf config json but I don't see any directory paths to /mods in it

#

I'll try the other mods folder

floral sluice
#

I might've messed up, it's possibly looking for a cursed path

#

hmm no, it should be looking in the mods folder

#

try the mods folder in the cachedir yes

vital bloom
#

Just to confirm, it's normal for it not to show up on the mods menu right? Because it's injected Java not lua scripts and assets with a manifest, yes?

#

and since it's getting injected at runtime I need to shut down and restart the game every time I test

rare mural
#

check the pinned comment

vital bloom
#

I'll take a look when I get the mod to load

#

Turns out there's two Zomboid directories with a .leaf subdirectory

#

Ah nope it was neither

floral sluice
#

the .leaf processedMods folder is normal, it's the loader extracting mixinextras jar at runtime

#

Though I don't need to do it at runtime for prod (only dev), I can do it at install time, now that I think about it.

floral sluice
vital bloom
#

Yeah, might be something wrong with my env too, I've noticed Steam makes multiple mod folders for PZ.
I've tried those too though, I've just about tried everything I could think of atm. :/
Better walk away from it for a bit

floral sluice
#

I can usually tell when it's a user issue vs loader issue, this is probably the loader not you

fresh nexus
vital bloom
#

Dunno if this helps but, I tried the installation for server option and it errored out

floral sluice
#

Yes the server installer section is not done

vital bloom
#

These are all "mods folders"

#

@valid nova Pick a mod folder, they all work in one way or another

full mountain
#

projectzomboid/mods doesn't

#

projectzomboid/steamapps is only used by the server

vital bloom
full mountain
vital bloom
#

That seems needlessly convoluted

full mountain
#

it was probably the easiest way to create a default but it endlessly confuses people

vital bloom
#

Ok. What's the deal with the other two?

full mountain
#

steam/steamapps/content/108600/ is where steam installs mods, ProjectZomboid/steam/steamapps/content/108600/ is where in-game hosted servers install their steam mods (it's not clear why it's separate but it doesn't seem to be considered a bug), Zomboid/Workshop/ is where local mods are stored, ProjectZomboid/mods/ is nothing

vital bloom
#

Thank you

fresh nexus
#

had to delete it, validate files and run it again..every..single.. mod..update

full mountain
#

yeah, i really don't get it

fresh nexus
#

Come to think of it, couldn't you just symlink the two directories? -_-

full mountain
#

that's what i've done

fresh nexus
#

rofl.

#

hard drive manufactures hate this one simple trick to half your zomboid install size!

valid nova
#

Might help lessen the confusion

fresh nexus
#

Hu.. I think if I had access to basevehicle (without having to overwrite the entire file), I could add burnouts (visual) and raised suspensions... Looks like wheel rotation is line 4356

floral sluice
fresh nexus
floral sluice
#

If its changing an if statement or field value, is within reason. doing multiple function calls and branches is annoying though

fresh nexus
#

yea I need to add some new logic so meh.

vital bloom
#

@floral sluice how do you run the leaf-loader project? I'd like to know what's happening here

#

But I can't find a Main in the project to run

#

Sorry, it's been on my mind and I couldn't leave it alone

floral sluice
#

getModsDirectory0 will return path/to/zomboid/mods if you dont override it with leaf.modsFolder=C:\path\to\mods

vital bloom
#

Thanks

fresh nexus
#

Yaknow, mods download steam\blahblah.. and zomboid is (generally..) installed in steam\blahblah. There should be nothing stopping you from having a .bat file be the installer for leaf that is just copy stuff/*.* ../../../common/project zomboid/

#

(for end users)

#

That'd at least reduce it down to finding the right directory, clicking thing, no other installs? (Assuming installing leaf for the end user can be done by just copying the files to the correct directory?)

#

Sure: doesn't work on linux/mac, but Im sure they have their own simple script.

#

(idea is basically: use relative paths to bypass the whole 'figuring out where the hell steam/zomboid is actually installed')

floral sluice
#

Steam can install to any path, not just C:\Program Files (x86)\Steam

#

On Mac/Linux, completely different paths, can be user specified too

#

Zomboid can also be located at any location and still work

#

Getting the user to put the path of zomboid in isn't hard. Most people already know where their PZ install is anyway

#

And why would I get the user to manually copy files to the install? That's one of the purposes of the installer

#

Not to mention that the installer doesn't just copy files to the game folder..

#

If downloading Java is such an issue for people, I will make it a point in the readme to use the game's JRE which comes downloaded with the game. If you want to use it, it's as simple as:

cd "path/to/zomboid"
"./jre64/bin/java.exe" -jar "path/to/installer-1.2.3.jar"
#

I did also think about forking PrismLauncher so that Zomboid can have a launcher, because Steam is unreliable and replaces files which makes the install/maintenance step harder

#

But I didn't follow through with it because most people are used to Steam, and I would still need to worry about Steam replacing files too

#

Unfortunately, nothing is going to be as pretty as an official implementation of Java modding. Of which, I am not sure they will do in the future.

tropic stirrup
#

I don't think it's necessary to stick with the current game workshop to distribute Java mods.
For example, Satisfactory has a completely separate launcher for the game with mods, which allows users to browse and download them. However, this approach comes with additional infrastructure costs.
Another example is Terraria. tModLoader is a completely separate Steam title with its own workshop.

Oh, and I remember the early days of Minecraft modding - no workshop, no launchers. Just manually installing mods by copying and praying the game would launch ๐Ÿ˜…

Those who truly want to play with Java mods will find a way to install them

valid nova
#

That's so stupid

#

Idk man all of your ideas seem to be more centered around frustration that a system is being made to make it easy and just pure hate of having to download Java ?

#

I don't get the point of not sticking to the workshop lmao this is so stupid

#

It's the sole reason players don't use Java mods, bcs they need to manually install them and they aren't viable

#

The goal of Leaf is to simplify all of that for both the users and the modders

#

If we don't utilize the workshop, no java mod loader will ever be viable ...

#

Players are too used to the click and play. Making a whole different system would need one or more extremely impressive mods for the community, like Bandits level of impact on the community

tropic stirrup
#

Itโ€™s not very hard to install another Steam title or launcher to make managing mods easier, even if itโ€™s only used once. It also provides an opportunity to update the launcher and mod loader without needing to download and reinstall it from the repository. So basically, you need to consider all the pros, cons, and requirements. Currently it's too hard to predict what would be simple or not with java mods

fresh nexus
#

It could even use mods on PZ's steam workshop, just installing the java portion. Just having steam for updates, ease of install and legitamacy when mod authors say "Go download and install this!", its a bit easier sell when a steam workshop mod just directs to a tool hosted on steam (And presumably would have been removed quick if it was something bad)

#

(Id say keep the mods on PZ's workshop, so PZ can still easily handle the LUA part of mods, and so java mods will have visibility on the main workshop)

fresh nexus
#

Java mods can also have some LUA part that opens a dialog box telling users to install leaf with a nice steam URL if leaf isn't installed.

vital bloom
fresh nexus
#

Ah.

vital bloom
#

I tried different folders because I guessed the mod loader might be checking those since aoqia said it's meant to follow the normal PZ mod structure

#

But because the normal PZ mod structure is kind of ass, this meant checking multiple places

#

None of them worked anyway, so I figured I'd give it a shot myself and see what leaf was doing

#

Maybe aoqia will have time to find out what the issue is first, maybe I'll get lucky first

#

That's the beauty of open source

floral sluice
fresh nexus
floral sluice
#

oh you meant in game UI, ignore me then

fresh nexus
#

Yea im just saying, someone installs java mod, PZ style, loads it, LUA detects leaf isn't installed, opens SOME kinda dialog box mid-game saying "hey this mod isn't properly working cause X!"

#

Im already figuring out how to do it for the java files in my mod.

#

(right now im thinking java code that sets a LUA global in my mod? or something.)

#

Since the java class im editing isn't exposed to LUA ๐Ÿ˜ข

floral sluice
#

Yes that is definitely possible.

#

I could bytecode patch somewhere good that does rawset on the global table, I just don't like doing too much bytecode patches because its a point of breaking

#

That might be something for the leaf api (??)

fresh nexus
#

Erm, isn't there just java (kualua?) for editing the LUA tables?

#

I know they can be read by java..

floral sluice
#

But then again, you can reasonably tell when a leaf mod is installed based on the class. For example if you have an exposed class Foo and it has a method named bar which is also exposed, checking if Foo and or bar exists means the leaf mod must've been loaded correctly

fresh nexus
#

Mmm good point. Sadly I can't do that.

floral sluice
#

though I do understand that's a bit of a hard point to make when you don't have to expose anything. An api function like isLeafLoaded or something, alongside getLoadedLeafMods

fresh nexus
#

(with my java file replacement of a non exposed class)

fresh nexus
floral sluice
#

Also, I know Gigawatt mentioned it with good intentions, but using Steam as basically what is the github page for leaf now, for hosting leaf installer is out of scope for even me

#

Like I said, if someone wants to go that route, they can always fork PrismLauncher and do that, but that would be another thing to maintain that I probably wouldn't have time for

valid nova
#

You end up having multiple systems to load mods, instead of sharing common grounds between Leaf mods and game mods. Also Leaf mods are not meant to replace normal mods, they complete each others

#

Unless I'm missunderstanding your idea

#

But like every mods that modify the mod menu etc would still apply too

floral sluice
#

Leaf is just too independent of Steam to have it on there also, especially only in Steam. Ideally you can install leaf to a GOG version of the game, or to an install of PZ that doesn't use Steam, etc

vital bloom
#

I'd be excited to get it running completely

#

Not too hung up on the particulars

fresh nexus
#

(although completely rewriting the startup code for engines to involve setting your starter on fire if you hold the key to long would be fun)

tropic stirrup
tropic stirrup
rare mural
#

We probably donโ€™t need to call other peoples ideas stupid, itโ€™s a boon that anyone takes an interest in Leaf

valid nova
#

You're right I'm sorry, I don't know why but I've been very tense in my reactions and embittered for the past week and I don't know why, while I had managed to chill

floral sluice
#

@vital bloom Turns out im incredibly stupid, I made the mods load from the cachedir folder...

#

I made it this way so it's gamedir independent, I don't know why I thought otherwise anyway

#

So if you put your mod in cachedir/mods/YourModID/leaf/mods/YourModJar.jar it will work

#

Also, you can put it directly in cachedir/mods/leaf/mods/YourModJar.jar but I would recommend following the normal zomboid mod structure

vital bloom
#

at least to add an optional -withLogging arg at launch and have it generate logs to a folder to troubleshoot stuff

floral sluice
#

I did forget to mention, the loader has a test run configuration that mimics a mod environment, so you can breakpoint the loader and stuff. It's :zomboid:zomboid-test subproject. If you're using IDEA, it should automatically show up once the gradle is synced

vital bloom
#

Oh, I figured how to set breakpoints in the library code from IDEA, which was doing kinda the same thing
Side note, I also saw that the env is loading the mod classes themselves and skipping any jars, at least on my machine

#

I figured this was intended behavior but I literally just started messing with this about 30 mins ago

floral sluice
#

im going to double check here in a minute that the mods are actually being loaded properly

vital bloom
#

I'm going to do the cachedir workaround, just out of curiosity

#

wait. When you say "cachedir", do you mean steamapps/common/{pzinstall}/cachedir ?

floral sluice
#

no, by default its in %USERPROFILE%/Zomboid

vital bloom
#

I.E. a directory that doesn't exist by default?

#

Uh ok

floral sluice
#

I still dont think its loading them correctly. I wonder what I did to break it, since it was loading correctly when I added this

vital bloom
#

I don't recall a logging system in leaf being there by default

#

really wish I had logs to at least get clues because I don't have any concrete ideas as to what's wrong

vital bloom
floral sluice
#

Uhhh I think I tested it ages ago on like 1.3.0 or 1.2.0 when I added it, but I wouldn't recommend going that far back

#

In the meantime, there's already a system to load mods externally. Do it via:

-Dleaf.addMods=C:\path\to\mod.jar;C:\path\to\another.jar
#

You can add that to the Zomboid Client run configuration's JVM args

vital bloom
floral sluice
#

Not the normal way until I can figure out why it broke

vital bloom
#

It broke because we displeased the machine spirits by using the wrong sacred incense

#

It's crashing on startup without an error message

#

lemme see if I can find some logs in steam

#

Uh the order of the args doesn't matter right?

floral sluice
#

You can't put JVM args after normal game args

#

needs to be in this format:

-Dsome=123 -Danother=456 -- -debug -pzexeconfig ...
#

Wait, you are trying to load mods from prod environment and they aren't working?

#

Also I got it to work fine, I was putting it in the wrong folder myself...

vital bloom
#

Yes.
The mod I made worked fine in dev (from IDEA using the run client job).
I installed leaf-loader with the installer, put in the args from the launcher on the steam args, started the game, and it ran fine, but it didn't apply the mod

#

I placed the mod in the folder that you specified before, and it's not working in the game, so I figured it's not picking up the mods and it's probably a path issue

#

(When I say before, I mean last week when I ran into this issue)

#

I can show you what's happening on call if that'd help eliminate ambiguity, if it's convenient for you

#

No, scratch that, sorry, I see a new log file

#

Yeah no it's my fault, the mod's using java 23 and apparently 17 is required

#

It'll probably work when I change that, gonna do that now

vital bloom
#

It's working.
It's not logging anything to console, but that's a minor gripe.

fresh nexus
#

"But the java 23 compiler can target 17" "OK but till I get things working, Im'a do it the easy way"

floral sluice
vital bloom
#

I wanna do other stuff, but I figured I should start as simple as possible

#

I'm not quite sure what to do next, because the things I keep thinking about imply a lot of changes that'd just get wrecked by the devs, so I'll just keep fiddling with the code making changes here and there to get my feet wet

#

The first thing I'd really like to do is find a way to fix the driving stutter, but that might be a bridge too far

floral sluice
vital bloom
#

and I mostly stayed away from mixins for simplicity reasons

floral sluice
#

Once you learn mixin, it feels like getting all of the infinity stones

#

You basically have the power to modify any class any way you want

#

Choosing the best mixin type for the job will help you as well

vital bloom
#

I'd tell you what I'd like to do on impulse is break up all those damned 5k plus classes in the game but that would just be rewriting half the damned game

#

it triggers my ocd like mad but it's a blatantly bad idea

floral sluice
#

Yes I wouldn't bother with that, you're basically doing dev work for no reason. If you want to retain compatibility with the standard game, it would be hard to

#

No matter how aggravating the original code is, not much we can do about it from a modder perspective to rewrite it all.

vital bloom
#

Yes, at that point it'd just be an alternate engine for the game

#

and that's infeasible and pointless

rare mural
#

yeah at that point we just make a new github repo community game ๐Ÿ˜›

vital bloom
#

That's probably how that other game that was "inspired" by PZ started

#

the one about plants in a space station

#

anyway I think I'll start by actually documenting the process of getting this thing running in case something messes up

floral sluice
#

I'm actually going to improve the example mod's readme some more. I am trying to think of what more to add, and I will scroll up in this chat later to see what else I can add to it

#

For now, I've done a quick edit on it

fresh nexus
#

it has better logic and is shorter now.

rugged fog
floral sluice
#

๐Ÿ˜‚

fresh nexus
rugged fog
fresh nexus
#

shrugs

rugged fog
#

Although if you go back even further, they've adopted mods too. And even hired modders to integrate their work directly into java. So ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

#

Cars have been on the agenda for reworking for a while - the render depth changes and z heights, ramps etc, were cited as reason for delays.

fresh nexus
#

Might help that im only altering 1 file too..

#

... completely altering.

#

But hey, I added in (less annoying and constantly on) tire squeals (the built in ones where turned down crazy low because they are CONSTANTLY occuring, with the front wheels slipping like 90% of the time in a turn) (I'll not spam here lol..)

vital bloom
floral sluice
floral sluice
#

If someone asks what leaf is currently in terms of progress, its basically in the "Do it live!" stage where everyone gets to be a QA tester ๐Ÿ˜‚

vital bloom
#

Happy to contribute in whatever capacity is needed

floral sluice
#

Feel free to commit anything to the readme (or anything else) to help it if you want. I will accept all PRs. The only thing I ask for people to follow is conventional commits which is a straightforward specification for commit messages: https://www.conventionalcommits.org/en/v1.0.0/#summary

#

I will admit to not having worked on actual feature/fix commits to leaf for a week or two, because IRL stuff catches up to me slowly, and in the meantime I'd rather deal with the stress of things by playing games and not coding, because coding makes me stressed more when I'm already stressed enough

#

As much as I'd like to have everything done immediately, I can't without at least some financial security so IRL has got me occupied, and I'm moving places in a few days, long story short it's just been a hassle with lots of things at once.

vital bloom
#

It's a free volunteer thing, I don't believe anyone seriously expects this to be priority 1

#

Or at least nobody who should be taken seriously expects this

floral sluice
floral sluice
#

Also, the not being able to see decompiled game sources properly is a bug. You shouldn't need to search filter via directory, it should just show up under "Project and Libraries" general search filter. I'll look into this soon

floral sluice
#

@vital bloom I read the attached PDF. Do you know what you mean by the "Run zomboid client gradle job failure"? If you could provide an example or two, this would be great. I personally haven't experienced this yet.

#

Most likely what is happening is that when the game version changes, IDEA doesn't refresh these run configurations, so the version stays on the old one. This has been an issue for some time, and it's on my todo list to manually recreate/refresh the run configurations where needed, though I'm still trying to figure out a proper mechanism to do it.

vital bloom
# floral sluice <@553825372135882765> I read the attached PDF. Do you know what you mean by the ...

Unfortunately I can't say what triggers this, but it seems not to be tied with game version changes.
I've only tried to use leaf with B42.11, and it still breaks occasionally.
I didn't document the issue at the time, I'll do it if it happens again.
Specifically, the IDE says it can't find a Main class, despite having the correct fully qualified class in the config. There's no way to make it recognize the class either. The only fix I found was what's in the PDF, delete the .idea folder and let the IDE recreate it

floral sluice
#

hmmm ok, let me know when it happens again. assuming it's something related to the run config, you only need to delete the .idea/runConfigurations folder

#

Also I just realised that the run config also doesn't follow GRADLE_HOME, so if you have it set then it gets ignored.

#

Something even Fabric overlooked I guess

#

I keep mixing these up. For reference, if I ever refer to GRADLE_HOME as the user directory's .gradle folder, I meant to say GRADLE_USER_HOME

#

I actually can't wait for the day I can add unit tests back, with maybe more unit tests specifically for zomboid runtime, similar to how fabric has it

#

so many issues though purely from TIS not having the game publicly downloadable, which wouldn't even be an issue normally

vital bloom
#

I didn't actually get anything done thanks to crippling migraines :/

vital bloom
novel crow
#

How is this coming along now?

valid nova
novel crow
valid nova
#

Project got a lot of attention in the past weeks

#

Which led to the creation of #java

novel crow
#

What finally sparked the interest

valid nova
novel crow
#

Thank the gods

#

Now to untangle the entire lua side of the codebase into a java api. And then we will have truly peaked ๐Ÿ˜‚

#

Gonna be that scene from lord of the rings where gandalf purges saroman from the theodean ๐Ÿ˜‚

#

The Lua side of the code:
"If i go, the UI logic dies"

The Java Devs:
"You did not kill me, and you won't kill them. I Will draw you out Lua like poison from a wound"

๐Ÿ˜‚

floral sluice
#

yeah there's been bug fixes and some small things over the past month or so but nothing too crazy, I've been preparing to move and some other irl stuff over that time period, and I just moved majority of my stuff yesterday, so I don't have anything set up currently. As you can probably imagine, everything is on hold right now

#

also, i dont think the converting lua to java is a good idea, mainly bc lua is so integrated into pz that every update you're going to have to manually like merge changes from game lua to java, means uploading the games lua to a repository to track changes etc

#

if you really hate lua, i think a better p
options is maybe to use jab's typescript to lua transpiler

rare mural
#

though i still think the idea of building some kind of demo ontop of PZ minus all its lua, would be kinda funny just for fun

floral sluice
novel crow
#

Like a link that is

floral sluice
#

i've added a little note for it on the main leaf repository, but there's not really anywhere specific to put it

#

for a couple reasons like:
- the board isn't repository specific, it covers every issue/pr on every repository (though i have to add them manually for now, i will be able to eventually set up an action to auto label it)
- the information on the board is, for the most part, available on any issue you click on, so if someone wanted to work on a certain issue, the board isn't much use

#

and, unironically, the main gathering point for leaf as a project is currently only here. i haven't my own discord or anything of that nature. though i leave discussions on the repositories open, most people dont use them and find leaf through the modding discord

floral sluice
#

i just want to take a small amount of chat space to say thank you to everyone who's been nice to me since i started modding for this game. you all are the only reason i mod this game at all, seriously.

fresh nexus
#

Same here and I am looking forward to leaf blowing up! So much cool stuff could be done with java modding.

floral sluice
#

I'm still very conflicted, should log4j logging be a separate mod or be integrated into the loader?

#

actually no it kinda has to be in the loader (because of some of the game's libs including only some old log4j classes), ignore me

#

the only downside I can think of is that everyone will have log4j logging (which imo isn't a downside). I could make it a switch to turn it off though too.

floral sluice
#

When I finally get my other separate PC running so that I can add back unit tests, I might have an idea for how to do the whole game not being available easily issue for github workflows

#

I can eventually have my runner pc have a py script that runs steamcmd periodically and checks for game updates, and if one is found it updates the game and then generates and uploads manifests for the game to leaf automatically (which would be super nice), and then store an archived version of the game

#

that only came to me now, and I'm still wondering how I can do it without making things too complicated

#

a few downsides to that though, mainly the fact that the runner pc I have to keep online 24/7 if I want any testing done. could separate it so that only local pc does testing, while the github runners do building without tests?
also my pc would be less reliable than a datacenter

floral sluice
tropic stirrup
#

I think it would work nicely as a separate mod. The average player doesnโ€™t care about logging, but developers could install the mod if necessary

fresh nexus
#

I mean, chances are stuff is going to break every other update, so I wouldn't worry about having to fix stuff on an update...

#

because.. your gonna have to reguardless of your decisions as you just don't know what TIS is gonna do to their code

floral sluice
#

its hard to decide because every time I make a decision some roadblock comes up lol

#

like now, my issue is that game libraries (at least in dev anyway) take precedent on the classpath over loader libs, so it's loading a half-baked log4j version that's shaded in a lib they use called javacord

#

in prod I do remember making the installer force loader+deps first on the classpath to avoid this, but in dev it still happens

#

I also dont like the idea of log4j updating (like the infamous issue) and then having to update the entire loader to be able to get the benefit of that

#

It's either add it to the loader and download it when the installer installs stuff like mixin, or add it as a separate mod but we have to shade it

#

I think I will go with separate mod, but I still need to add support for it in the loader. the reason is because it is much more practical to nuke the in game logging and just redirect it to slf4j in a separate mod (and the loader just use a "log4j mode") than it is to do it from the loader and have it still use reflection to access game logging classes (which would essentially be hollow anyway), would be very painful otherwise

floral sluice
#

Anyone got any name suggestions for the log4j mod?

#

I thought of maybe just making it "zomboid-slf4j" but not sure

#

requires an update to the loader to actually use, but once I release that it should be fine

floral sluice
#

just for now, I've went with zomboid-slf4j but any recommendation is welcome

novel crow
#

So if they do decide to do it, it won't screw the whole project up too badly.

#

And you can swap it out for another solution without massive refactors

#

As my papa once said "don't hold in a fart out of fear of shitting yourself" ๐Ÿ˜‚

floral sluice
#

yeah leaf already has this with the different log handlers

#

it can support the old zomboid logger pre 42, the new one in b42, and soon to be slf4j/log4j (I removed them previously due to some issues)

#

Just running into yet again some more roadblocks, which I have to ask around about from the fabric maintainers

novel crow
#

Oh aye? What roadblocks be that?

floral sluice
#

mainly the fact that as a separate mod, I need to basically shade/JiJ the log4j/slf4j into the mod, but they aren't being put on the compile/runtime classpaths

#

and also if something breaks in the loader relating to newer log4j/slf4j version, the loader would have to be updated too anyway (even with a separate mod) though it's unlikely. There's basically not a viable way to have it completely separate from the loader that I can think of rn

rare mural
#

zomboid-logger

#

etc

novel crow
warped gyro
#

ah, another fabric using game provider

floral sluice
#

another?

warped gyro
#

i mean in general

floral sluice
#

I forked the major repositories for fabric, its not just a game provider for fabric loader

warped gyro
#

at least this loader has more of a separation from fabric

#

thankfully this has mixin support

floral sluice
#

I needed it to because my goals for it are different and I need to be able to change most of it at will.

floral sluice
warped gyro
floral sluice
#

I've only created this project recently (since 2024-09 roughly) and I'm only maintainer, its still in progress and not as production ready as I'd like it

warped gyro
#

ah, i made mine in ~2024-03(august)

#

rebuilt & modularized it to be easier to maintain and use

floral sluice
#

most notably server support in the installer, because I need to edit scripts for the server. currently I only wrote the code for client. Server is more frustrating because it doesn't use a bootstrapper like the client does

#

the active issues in the pinned message in the github project, that's all for now. I'm adding them as myself and others find the issues

fresh nexus
#

I can't wait for this to be a major thing and me stop having to field so many install instructions.. Instead, that can be your job! bhwahaha.

#

But seriously. I have a lot of ideas for minor/major java mods and it would be sweet if I didn't have to make some kinda installer/updater thing so im chopping at the bit for this project to become the next big thing. Go leaf! im rooting for ya.

warped gyro
#

from what i have seen it doesn't need to be remapped as it is not obfuscated

full mountain
#

it's not 'not obfuscated', it's just less obfuscated

warped gyro
#

its not less obfuscated?, its just in their 'style' which is a bit confusing until ya learn it

#

also i dont recommend making a de/reobfuscator by yourself, its painful

full mountain
#

the names of local variables and method parameters are lost in compilation

#

the mappings would theoretically restore these, but afaik leaf's mappings are not actually populated with anything?

#

i'm not actually sure if this is strictly obfuscation or just something java bytecode doesn't bother storing to begin with but either way it's something mappings exist for

warped gyro
full mountain
#

well whatever purpose it exists for the result is the same

warped gyro
fresh nexus
#

(or at least, half of it)

full mountain
#

you'd have to talk to aoqia about that, i have no idea if or how you can actually contribute

fresh nexus
#

some variables I didn't really bother to figure out and just wrote my own stuff.

fresh nexus
#

@floral sluice if you ever want carcontroller.java mappings I can likely help with that.

#

worked enough with it I know most of the variables.

#

I dunno who that helps but I think more car physics mods would be awesome ๐Ÿ˜‰

floral sluice
#

mainly because I don't have time to map everything. its definitely a super easy thing to contribute to, but there's a lot of code to cover even with importing other third party javadoc. most if the time you just grab some coffee and put on music while you rename "setInvisible(bl)" to "setInvisible(invisible)" or something like that

floral sluice
floral sluice
#

I think yarn has a good readme to explain it, i don't remember if I did add instructions though.

#

I would recommend no for the time being, unstable might change more than you like (assuming you're doing it in b42 and not b41), I'm not sure how easy it will be to remove invalid mapping entries

#

at the end of the day, mappings not being necessary for leaf to function, is more a quality of life thing. you can still mostly read what the function did from the decompile alone

fresh nexus
#

k

warped gyro
floral sluice
#

the rest was me just adding zomboid-specific stuff

#

like the game manifests which the game has none of

#

im not gonna act like it was a walk in the park, but it wasnt a project rewrite of fabric either

floral sluice
#

honestly a bit of issues with the development time is just me losing motivation for the game, then it comes back a little and repeat

warped gyro
#

yeah, i get that, motivation comes in waves

floral sluice
#

I think the only way I will be able to have consistent motivation is to eventually make my own games which is a goal I want to reach in my lifetime just in general

#

though literally every possible irl friend I have which is unsurprisingly not that many doesn't want to create any, and the one person that did want to was "envisioning" the next GTA 6 as a 2 person dev team like yeah no thx

warped gyro
#

yeah most my friends either dont know how to code, the ones who do are workin on drastically different things, or dont wana partake in gamedev

vital bloom
vital bloom
#

Figured if it's 2d (top down and side view) and the systems are built correctly, it's a lot easier to layer complex mechanics on top of relatively simple genres (side scrolling shooter, top down shooter, top down nodes view like cities in Highfleet)

floral sluice
#

I feel like I just need to add something fun to leaf to bring back some incentive for me

#

so im probably going to add some normal map support as a basic first thing

#

not like normal maps themselves are that fun, but anyway

fresh nexus
floral sluice
#

I was under the impression that hte game doesn't support normal maps (and others) for textures like vehicles/items

#

I understand that depth map support is available for tiles (unsure how that works though) but its different for texture, not the same

full mountain
#

model shaders only get provided the one texture so you just can't do anything that needs a map

#

would probably be fairly easy to change with a java mod

fresh nexus
#

starts babbling incoherently about PZ's render system

full mountain
#

i mean all you need to do is send the texture to the shader, the rest is the shader's job which TIS can't really mess up for you

fresh nexus
#

Iv written a 3d engine from scratch and their camera system alone (or lack thereof) scares the crap outta me.

#

I spent an entire day just trying to get it to stop moving stuff and best I could do is "Hey this works so long as you don't turn or anything"

fresh nexus
#

all the render code in the game uses hardcoded ints since its been decompiled instead of opengl constants anymore

floral sluice
#

I can actually fix that in the mappings too

fresh nexus
#

and opengl OR's bitflags too.

fresh nexus
#

there should be a way to get what enum each opengl function should be, and then just walk through the bitflags

#

(In C/C++ I think it was a giant file of defines...)