Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (799)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (865)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Moddius - A simple Modloader compatible with ANY Java game! (20+ Downloads!)  (Read 23380 times)
0 Members and 2 Guests are viewing this topic.
Offline lvivtotoro
« Posted 2014-09-25 18:28:47 »

(I dont know if this is the correct forum section, so "bear" with me persecutioncomplex )
Now, let me introduce you to Moddius!
This a Reflection based, complexly made, simple to use ModLoader that is
compatible with almost any Java game!

Installation:
To install this modloader onto a game, you must open its main jar file and insert the files contained in the modloaders jar.

How to use this in your game:
WARNING: This tutorial uses ECLIPSE!
You must first associate your game with the library so right click on your project
then select "Java Build Path", then you select the Libraries tab then click on
Add External JARs and select the library jar.
When you selected the jar click OK and you have associated the jar with this library!
Next import all Moddius classes using this import: "import org.moddius.*;"
Once imported create an annotation that the ModLoader will use to find mods.
The annotation can have any attributes you want the mod to specify.
Warning: The annotation must be annotated with
1  
2  
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
or else the ModLoader will NOT find any mods and a bunch of exceptions will occur.

Next use the following code to load mods:
1  
2  
ModLoader loader = new ModLoader(MyAnnotation.class);
Set<Class<?>> mods = loader.loadMods();

Replace MyAnnotation with your annotation!
Then modify your game to the way you want the mods to work and
YOU ARE COMPLETE!

How it finds mods:
The technique that this library uses is scanning ALL packages that is known to its classpath and search for any classes that use your annotation!

Upcoming features:
- Searching by Superclass (v3)
-

Download:
Direct - V1: https://www.mediafire.com/?szoy6w6d2x43dqm
Support - V1: ---
Direct - V2: http://www.mediafire.com/download/yg1kif42yd7uf8m/ModdiusModLoaderV2.jar
Support - V2: ---

Umm... i got notin' else to say...
Oh look a butterfly  Pointing!                           (Escapes)
Offline ClaasJG

JGO Coder


Medals: 43



« Reply #1 - Posted 2014-09-26 09:18:30 »

I will take a look into it later, providing you with some more feedback than.

Are you aware of: https://code.google.com/p/reflections/ and
 (a bit simpler) http://bill.burkecentral.com/2008/01/14/scanning-java-annotations-at-runtime/?

-ClaasJG
  Gimme time,.

My english has to be tweaked. Please show me my mistakes.
Offline lvivtotoro
« Reply #2 - Posted 2014-09-26 10:38:51 »

The topic says that this library is Reflection-based...  Cranky
Which means this library uses Reflections (the library).
But its bundled onto 1 jar, so you have the reflections library if you load this lib in.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ClaasJG

JGO Coder


Medals: 43



« Reply #3 - Posted 2014-09-26 10:48:51 »

Oh, as I said, in the moment I am not able to look into it, but I thought you ment the http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/package-summary.html package, not the https://code.google.com/p/reflections/ lib. I will edit this post in the evening with some feedback, so i dont have to double post all the time.

[EDIT]
Well, this would be my feedback too I guess.
[...]

ClaasJG

My english has to be tweaked. Please show me my mistakes.
Offline cylab

JGO Kernel


Medals: 195



« Reply #4 - Posted 2014-09-26 12:04:57 »

The topic says that this library is Reflection-based...  Cranky
Which means this library uses Reflections (the library).
But its bundled onto 1 jar, so you have the reflections library if you load this lib in.
What I am missing is some hint how to use your library to make your game moddable. It looks like it's just a wrapper for getting annotated classes. What does it provide on top of Reflections?

I would at least expect an api to manage mods inside a folder and to load,  enable or disable them dynamically. Maybe also some Resource abstraction to help exchanging textures and sounds in a running game. Sources, javadocs and examples would be nice,  too.

You did a fat jar with all dependencies. This might introduce conflicts with other versions of the included dependencies used by a game. Also I don't know, if the license of Refllections (or some of the dependencies) allows rebundling like this...

All in all a good idea, but not ready for prime time. Keep it up nonetheless!

Mathias - I Know What [you] Did Last Summer!
Offline lvivtotoro
« Reply #5 - Posted 2014-09-26 12:59:12 »

I am giving all credit to the Reflections library and all of its dependencies which includes:
  • Guava
  • Javassist
  • Log4J
  • SLF4J
None of the credit goes to me.
And your right, i like making libs that shorten code for people.
But you did give me an idea of making an external mod system and adding it here.
Thank you Grin
Offline lvivtotoro
« Reply #6 - Posted 2014-09-26 13:56:11 »

[size=17pt]V2 Released.[/size]
+ External Mod Loading
+ JavaDoc
* The method names have changed (lm_i is internal loading, lm_e is external loading)

Usage of lm_e:
The external loading method has 1 parameter, and thats the folder to scan.
This method does NOT use the reflections library but normal java reflection.

Warning: I do NOT know if lm_e works so please test if it works.

Download in main thread.
Offline lvivtotoro
« Reply #7 - Posted 2014-09-27 13:02:21 »

Also i forgot to say you must modify your game so that mods that modify it, for an example if you have an NPC with health, and its a private field, make it public and mods will be able to change it.
The way you load the mods is getting the classes, and have the classes have methods or runnables in your annotation that you will run from the main game.
Offline Grunnt

JGO Kernel


Medals: 143
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #8 - Posted 2014-09-29 14:52:56 »

Interesting idea. However, I have a hard time understanding how this will be useful. What does it do?

I mean, it's not terribly hard to add a jar to a classpath:
1  
java -cp game.jar;mods.jar ...


How does your mod loader help with this?

Offline lvivtotoro
« Reply #9 - Posted 2014-10-06 16:14:11 »

It only shortens about a 100 lines of code which includes loading the mods.
I will say it again and the last time:
The library loads modifications that people created externally and internally, but you must modify your game to build an API that the mods will use.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
Administrator

« JGO Overlord »


Medals: 1370
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #10 - Posted 2014-10-06 21:02:51 »

Nasty ad.fly links removed. Cranky

Don't try to squeeze a few bucks out of the exposure JGO provides you with, giving your potential users a horrible experience when clicking the link.

Meanwhile, it wouldn't hurt to make an example game+mod, and opensource it, so people get an idea of what you're actually sharing with the world. Right now it feels like somebody is plugging the
misc.Thing
interface, pointing out how it makes life easy, integrates into everything, and scales from embedded systems to server clusters... leaving your target audience scratching their heads and moving on.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #11 - Posted 2014-10-07 09:13:49 »

*scratches head*

maybe i'm missing the point but we have ..

http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileVisitor.html

and reflections already. just stick these together and you have a plugin system.  Clueless
Offline lvivtotoro
« Reply #12 - Posted 2014-10-07 13:50:09 »

Im telling you this USES THE REFLECTIONS LIBRARY ALREADY!
THIS ONLY SHORTENS CODE
Offline Riven
Administrator

« JGO Overlord »


Medals: 1370
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #13 - Posted 2014-10-07 13:50:32 »

That explains everything, thanks!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline saucymeatman
« Reply #14 - Posted 2014-10-07 20:28:46 »

Does this library use the Reflections Library?
If it doesnt, it would be a great alternative to Java's native reflection API.
Here is a link :
code.google.com/p/reflections
Offline lvivtotoro
« Reply #15 - Posted 2014-10-08 07:02:49 »

Did you not read my last post?
Offline Grunnt

JGO Kernel


Medals: 143
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #16 - Posted 2014-10-08 08:49:09 »

@lvivtotoro: I think most people on this thread sincerely try to understand what you are trying to do here, but fail to do so. Yelling at them will not improve their understanding.

Maybe you could post the source code to your library? That might help.

Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #17 - Posted 2014-10-08 08:56:49 »

it's clear now tho'. .. i guess.

it uses https://code.google.com/p/reflections/ .. not "just" the java reflections. ja ?

@lvivtotoro, you're saying it uses reflections already while i'm wondering why it's not just java.lang.reflect.
Offline lvivtotoro
« Reply #18 - Posted 2014-10-08 16:06:32 »

Ok ill post it, i need to get it first.
Offline saucymeatman
« Reply #19 - Posted 2014-10-09 20:52:56 »

Did you not read my last post?
Oops, I must not have.
I just kinda filter out messages that are all capital letters.

I'm a little confused as to what the Library does, I understand generally that it SHORTENS CODE, but a demonstration of the library would really help me understand the code-shortening capabilities of Moddius.
Offline lvivtotoro
« Reply #20 - Posted 2014-10-10 07:18:13 »

Umm... i think a tutorial is already on the first post...
Offline Grunnt

JGO Kernel


Medals: 143
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #21 - Posted 2014-10-10 10:56:11 »

Ok, I give up...

Offline lvivtotoro
« Reply #22 - Posted 2014-10-10 12:47:51 »

Me too.
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (188 views)
2019-09-04 15:33:17

hadezbladez (4874 views)
2018-11-16 13:46:03

hadezbladez (1786 views)
2018-11-16 13:41:33

hadezbladez (5147 views)
2018-11-16 13:35:35

hadezbladez (1017 views)
2018-11-16 13:32:03

EgonOlsen (4368 views)
2018-06-10 19:43:48

EgonOlsen (5217 views)
2018-06-10 19:43:44

EgonOlsen (2947 views)
2018-06-10 19:43:20

DesertCoockie (3868 views)
2018-05-13 18:23:11

nelsongames (4294 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!