Anuken / Mindustry-Suggestions

Repository for Mindustry suggestions and feedback
130 stars 58 forks source link

Java Mods should be "directly" playable! #3600

Closed Evo04Taser closed 2 years ago

Evo04Taser commented 2 years ago

Describe what you would like changed, and why.

I would like to change how moding the game works.

Describe the changes you want to propose. Include possible alternatives.

Pls allow the game to "directly" use java Mods instead of having to convert them into jar files before playing/importing. It will intensely help me and others because I struggle converting it to jar files, especially if you update the mod often. But allow jar files to be still used for balance.

How this works.

(I'm bad at English)

If the system detects a "src", "assets", and/or "assets-raw", they'll look what's inside that file, anything, except for invalid files/file type, example: "content.html"

end-me-please commented 2 years ago

...This is just not possible

also, most Java mods offer pre-built jar files, you almost never have to build from source yourself

Evo04Taser commented 2 years ago

most Java mods

How then? My java mod doesn't even have a JAR file.

end-me-please commented 2 years ago

not sure if I understand you correctly, you made a Java mod without knowing how to build a Java project? If you need help with that, ask in #modding-general

Evo04Taser commented 2 years ago

you made a Java mod without knowing how to build a Java project?

ITS my first java mod, so I don't know, what would you expect?

What's "#modding general" though, is it on GitHub?

Mnemotechnician commented 2 years ago

so, basically, you are suggesting anuke to embed the whole jdk 8, which is 80 mb in size, into mindustry? and considering that almost all mods use gradle (7.3), he will also have to embed it as well, so another 120 mb (iirc).

Gradle takes 40 seconds to start up from the fresh state on an average mobile device, and an average java mod (not even talking about kotlin, groovy and other languages, since they require their own compilers) takes from 10 to 40 seconds to compile.

So, what do we get in the end:

What are the benefits of these sacrifices:

Mnemotechnician commented 2 years ago

tl; dr:

Evo04Taser commented 2 years ago

Your lazy self

Look, I don't wanna start a chaos here, BUT DONT BLAME ME JUST FOR THAT, it's my first time creating a Java mod, and it will take me a lot of time just to understand jdk, and Gradle deploy.

I'm just grade five here in Philippines.

Mnemotechnician commented 2 years ago

Ok? Everything above still applies. If you don't know how to do something, either read the README.md files attached to most sane things or google it.

Evo04Taser commented 2 years ago

README.md files attached to most "sane" things

What do you mean with "sane"?

Mnemotechnician commented 2 years ago

mod templates, for example. almost all mindustry mod templates (of which there's not many) have instructions on how to compile them.

btw, #modding-general is a channel on the official mindustry discord sevrer.

Evo04Taser commented 2 years ago

have instructions on how to compile them.

Yes it's true, I've seen a few of them, but as I said, I don't understand it.

btw, #modding-general is a channel on the official mindustry discord sevrer.

I can't join the Mindustry discord, and the community just calls it "you're banned", "you're IP banned" when the screenshot clearly shows that it's invalid or expired.

BasedUser commented 2 years ago

btw, #modding-general is a channel on the official mindustry discord sevrer.

I can't join the Mindustry discord, and the community just calls it "you're banned", "you're IP banned" when the screenshot clearly shows that it's invalid or expired.

I'll look into this. Expect an email shortly.

Bottinator22 commented 2 years ago

have instructions on how to compile them.

Yes it's true, I've seen a few of them, but as I said, I don't understand it.

btw, #modding-general is a channel on the official mindustry discord sevrer.

I can't join the Mindustry discord, and the community just calls it "you're banned", "you're IP banned" when the screenshot clearly shows that it's invalid or expired.

Discord shows invites as invalid/expired when you're banned. It's odd, but that is what it says when you are banned from a server and you have an invite.

LixieWulf commented 2 years ago

I can't join the Mindustry discord, and the community just calls it "you're banned", "you're IP banned" when the screenshot clearly shows that it's invalid or expired.

The main invite (https://discord.gg/mindustry) CANNOT expire or become invalid. Mindustry is a partnered discord server, and this is a permanent link.

If you want faster editing of simple stuff in a Java mod, make the basic content in a JSON mod first. considering you are likely doing stuff more or less in the realm of JSON, this shouldn't be hard.

SMOLKEYS commented 2 years ago

Honestly, don't even fucking try to make java mods if you don't even know how to compile them.

SMOLKEYS commented 2 years ago

If you want java mods, learn how to compile them, not ask for a built-in compiler.

Bottinator22 commented 2 years ago

they DID say they're just grade 5, maybe tone down the rudeness a bit

Probably shouldn't start with Mindustry mods if you're starting with Java. If you want to make mods, try a JSON/JS mod first, assuming you haven't already made one.

(assuming you know nothing about Java here) Personally I learned Java from something called Robocode, although something else may or may not teach you better. Javascript is interpreted, so it needs no compilation to run code. (as compiling happens on run) Java, however, is not, so you must compile your code first before you can run it.

MEEPofFaith commented 2 years ago

do not the js, it's a mess

code-explorer786 commented 2 years ago

for real

I have never expected this issue.

why java mods should be compiled

As you can see, Java is a compiled programming language, which means you should actually compile it. And yes, you can do java a.java, but I have never seen that in the source code, or anything similar If Mindustry does that, it'll be very slow at loading the mods.

how to easily make a java mod

First off, you should generate a repository from this template

Second, you have to modify some values on build.gradle according to the comments.

And then, make your content.

You can see the wiki about JVM and Plugin mods on https://mindustrygame.github.io/wiki/modding/2-plugins/

Evo04Taser commented 2 years ago

Pls Read the How this works

Bottinator22 commented 2 years ago

No

Bottinator22 commented 2 years ago

We have told you enough, Java doesn't work like this

itcannotbe commented 2 years ago

Pls Read the How this works

It doesn't work that way.

itcannotbe commented 2 years ago

so, basically, you are suggesting anuke to embed the whole jdk 8, which is 80 mb in size, into mindustry? and considering that almost all mods use gradle (7.3), he will also have to embed it as well, so another 120 mb (iirc).

Gradle takes 40 seconds to start up from the fresh state on an average mobile device, and an average java mod (not even talking about kotlin, groovy and other languages, since they require their own compilers) takes from 10 to 40 seconds to compile.

So, what do we get in the end:

* The size of mindustry executable rises from 58 mb to 250 mb

* The average loading time with some java mods installed rises from 5-15 seconds to 1 / 2 / 3 / 10 / infinity minutes

* The average network load during the loading of mindustry rises from 0 to some undefined number, since gradle will have to fetch dependencies before compiling.

What are the benefits of these sacrifices:

* Your lazy self will not have to run `gradle deploy` to compile your mod

This is how it would work, if this would be a thing.

Evo04Taser commented 2 years ago

so, basically, you are suggesting anuke to embed the whole jdk 8, which is 80 mb in size, into mindustry? and considering that almost all mods use gradle (7.3), he will also have to embed it as well, so another 120 mb (iirc). Gradle takes 40 seconds to start up from the fresh state on an average mobile device, and an average java mod (not even talking about kotlin, groovy and other languages, since they require their own compilers) takes from 10 to 40 seconds to compile. So, what do we get in the end:

* The size of mindustry executable rises from 58 mb to 250 mb

* The average loading time with some java mods installed rises from 5-15 seconds to 1 / 2 / 3 / 10 / infinity minutes

* The average network load during the loading of mindustry rises from 0 to some undefined number, since gradle will have to fetch dependencies before compiling.

What are the benefits of these sacrifices:

* Your lazy self will not have to run `gradle deploy` to compile your mod

This is how it would work it this would be a thing.

Everyone is rude 🙃🙃

itcannotbe commented 2 years ago

More like

"EvErY oNe Is RuDe."

Since this suggestion is technical in nature we already explain how would this impact the game and the user experience quite concisely already.

So how about you present to use how this would actually work then.

Evo04Taser commented 2 years ago

Pls Read the How this works

It doesn't work that way.

This is hard then?!

itcannotbe commented 2 years ago

It's doable,

BUT IT'S IMPRACTICAL.

The cons severely outweighs the pros of this suggestion for mostly everyone, except an extremely niche group of people.

Evo04Taser commented 2 years ago

It's doable,

BUT IT'S IMPRACTICAL.

There cons severely outweighs the pros of this suggestions for mostly everyone. Except an extremely niche group of people.

I OPENED THIS BCUZ ITS HARD AND GRADLE THINKS THIS "}" IS AN ILLEGAL START OF EXPRESSION WHEN IT'S THE CLOSING BRACKET OF MY CODE

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

close this fucking issue and cope

SMOLKEYS commented 2 years ago

It's doable,

BUT IT'S IMPRACTICAL.

There cons severely outweighs the pros of this suggestions for mostly everyone. Except an extremely niche group of people.

I OPENED THIS BCUZ ITS HARD AND GRADLE THINKS THIS "}" IS AN ILLEGAL START OF EXPRESSION WHEN IT'S THE CLOSING BRACKET OF MY CODE

thats a problem with your own fucking code stop bringing shit here

SMOLKEYS commented 2 years ago

close this fucking issue and cope

Evo04Taser commented 2 years ago

It's doable,

BUT IT'S IMPRACTICAL.

There cons severely outweighs the pros of this suggestions for mostly everyone. Except an extremely niche group of people.

I OPENED THIS BCUZ ITS HARD AND GRADLE THINKS THIS "}" IS AN ILLEGAL START OF EXPRESSION WHEN IT'S THE CLOSING BRACKET OF MY CODE

thats a problem with your own fucking code stop bringing shit here

If I can send a picture THEN YOU CAN UNDERSTAND

SMOLKEYS commented 2 years ago

i do not fucking care anymore

close this issue, leave this fucking repo, learn to code and cope, and fucking LEARN TO USE THE TERMINAL

SMOLKEYS commented 2 years ago

god

phinner commented 2 years ago

Smolkeys, stay kalm

Evo04Taser commented 2 years ago

i do not fucking care anymore

close this issue, leave this fucking repo, learn to code and cope, and fucking LEARN TO USE THE TERMINAL

SHUT UP BTCH

SMOLKEYS commented 2 years ago

gradle and java are already enough of a storagefuck

SMOLKEYS commented 2 years ago

Smolkeys, stay kalm

i tried

not anymore

phinner commented 2 years ago

It's doable,

BUT IT'S IMPRACTICAL.

There cons severely outweighs the pros of this suggestions for mostly everyone. Except an extremely niche group of people.

I OPENED THIS BCUZ ITS HARD AND GRADLE THINKS THIS "}" IS AN ILLEGAL START OF EXPRESSION WHEN IT'S THE CLOSING BRACKET OF MY CODE

Maybe because you have a missing parenthesis like there -> https://github.com/Evo04Taser/Frozen-Wasteland/blob/6701733836a68586df2f8a33526a09d1fda78c10/src/frozen/world/blocks/power/DoubleCoolantReactor.java#L94

Complaining about the difficulty is not the way to go my friend, everything is not easy in the first try. Like others said, you can ask help in the discord server or if you still can't join the mindustry discord, join a mindustry community discord. If you want modding, I recommend :

SMOLKEYS commented 2 years ago

man

once in a while i lose my fucking temper

phinner commented 2 years ago

man

once in a while i lose my fucking temper

You just look cringe right now...

SMOLKEYS commented 2 years ago

hell