Giter Club home page Giter Club logo

Comments (24)

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Hey no worries, all of this is on me. I've been prioritising new features over user accessibility, so it's no wonder you hit some errors.

Both of those failures are to do with me including some code I made for another project - https://github.com/TheG-Meister/render-maps. The only class that uses this code is BooleanMapGenerators.java, however, which generates simple shapes in the context of editing overworld maps. This code has long been out of date and out of scope, so I'll deprecate it and keep a copy on my local computer. I can always reimplement it when it becomes relevant again. I have some time tonight so I'll tidy that one up.

I do have some hard coded file paths in there too, hence why it requires recompilation. I'll think about that down the line, but I have some ideas in mind.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

After a bit of work, including tinkering with the environment and modifying the pom to force maven's "source" and "target" to be 1.8, I got it to successfully build..... though it appears to not be doing anything, unless I'm supposed to run it with some parameters. I run it, nothing happens, I check the pokecrystal copy - no changes there either, I assume that's not intended behavior, right?

(It took me a while as I've never actually dealt with Maven before whatsoever, this was the first time I even heard of the thing).

Either way, it's getting a bit late here so I'll go to sleep, get through tomorrow and then try further.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

If you managed to actually run the compiled project it should have immediately thrown an error because of the hard-coded file paths. Have you modified any of the Java code?

The whole maven aspect should be irrelevant in the latest commit; I published some changes that removed the dependency a little earlier. What commit are you on?

No worries on the timing - we're coming at this from very different angles and with very different skillsets. We'll find a way to get it up and running for you eventually.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

If you managed to actually run the compiled project it should have immediately thrown an error because of the hard-coded file paths. Have you modified any of the Java code?

I've modified exclusively the input and output file paths in Notes.java, so it points to my copy of pokecrystal. The paths that are left in there by default aren't exactly clear.

The whole maven aspect should be irrelevant in the latest commit; I published some changes that removed the dependency a little earlier. What commit are you on?

The latest, it still kept failing to build unless I explicitly made it go through the maven script, which by itself was complaining about the defined, source option no longer being supported, and that 7 should be used instead of 5. Trying to modify the language level from the IDE itself resulted in nothing.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Well that sounds like a nightmare. I'll download the code on my laptop tomorrow and hopefully I can spot some similar issues.

In addition, I realised I can probably throw together a really basic command line jar that can run some of the prefab randomisers I already have set up. I don't know why I didn't think of that one earlier. At least it gives options.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Okay, I've installed fresh JDKs and a new eclipse version, and got the rando working in a new workspace. In terms of actually getting the code I've written here to run, I documented everything in a Wiki page - https://github.com/TheG-Meister/pkc-mms-rando/wiki/Loading-and-running-in-Eclipse. At least that way the process is now standardised lmao. I didn't end up hitting any issues with Maven in the end, I think Eclipse handles it all. Try what's in there and let me know how you get on.

Of course, to get a ROM requires even more steps, so I'll think about documenting that another time.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

Alright, so.
I got the project imported into Eclipse and the JDK set up (on a VM, as I don't want to clog up and potentially cause conflicts on my host), however upon trying to build - it evidently can't find the Notes class,

Error: Could not find or load main class com.gmeister.temp.pkcmmsrando.Notes
Caused by: java.lang.ClassNotFoundException: com.gmeister.temp.pkcmmsrando.Notes

even though I put it in the Main Class field as described (I even tried both typing in "Notes" by itself as well as using the Search button, both result in the same issue.
There's no red exclamation on the project in the package explorer either.

It also complains about a missing src/test/resources directory but that doesn't stop execution, at least initially.

Of course, to get a ROM requires even more steps, so I'll think about documenting that another time.

Don't worry about that, I've worked with pokecrystal quite a bit in the past, so I know what I'm doing on that front.

Update: upon messing around (and having the rather dumb idea of copying the contents of src/main into src/test) I got it to partially function, but it errors out on trying to randomize warps, maybe it's meant for a slightly-older pokecrystal?

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Nice, I'm glad you're getting somewhere.

You've mentioned building a few times, what do you mean by that? Are you running it or trying to turn the code into a jar? Just wanted to make sure we're on the same page.

It could very well be that newer pokecrystal versions have changed formats. I've been pretty religiously working with dabomstew's pokecrystal-speedchoice, which hasn't been updated in a while now. Could you copy-paste the stack trace of the error?

I don't want to clog up and potentially cause conflicts on my host

For reference, if you download the JDK using the second link, you can hide it away neatly in a folder somewhere without it being installed, and then point eclipse to it using the "Add JRE" option I mentioned in the wiki. That should be conflict-less.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

Sorry, I've been busy for the past couple days. Here's the stack trace you wanted.

Exception in thread "main" java.lang.NumberFormatException: For input string: "const_value - 1"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:660)
	at java.base/java.lang.Integer.parseInt(Integer.java:778)
	at com.gmeister.temp.pkcmmsrando.io.DisassemblyReader.importConstants(DisassemblyReader.java:474)
	at com.gmeister.temp.pkcmmsrando.io.DisassemblyReader.readMaps(DisassemblyReader.java:275)
	at com.gmeister.temp.pkcmmsrando.Notes.randomiseWarpAreas(Notes.java:120)
	at com.gmeister.temp.pkcmmsrando.Notes.main(Notes.java:459)

Hence why I think it might just be a newer pokecrystal change, I've not been following that closely though.

By "building it a few times" i meant running the task, sorry I could have mixed up the terminology.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Many thanks - looks like a "total number of tilesets" constant was added and my code couldn't interpret "const_value - 1". I've fixed that in the latest commit, which ran bug-less for me using pokecrystal commit 40b6f22 (which was uploaded 5 days ago at the time or writing).

Oh, and if you're new to Eclipse, to update the project to a new commit, Right click on it in the package explorer > Team > Pull. Just bear in mind that this overwrites any changes you've made on your local.

By "building it a few times" i meant running the task, sorry I could have mixed up the terminology.

Ah yeah, it seems like we're doing the same thing now!

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

It seems to be doing the same thing, i pulled both your new commit and updated pokecrystal to the commit you were working with. I even hard-reset my local copy to this new commit just to be 100% sure i'm infact on it and it doesn't appear to have done anything.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Huh. I also tried it on my laptop and that worked for me. If it's an issue with the code now I'm genuinely unsure where the error could be.

To try a couple shots in the dark:
If you open com.gmeister.temp.pkcmmsrando.io.DisassemblyReader, and scroll to line 474, does it say else if (args[1].equals("const_value - 1")) value = count - 1;?
Are you setting the input and output folders to different locations?
And I assume you're inputting "true" for all three randomisers?

If it's yes to all of those then I'm gonna need a break and to do everything again hahahaha

Oh, and for consistency, the exact commit of pkc-mms-rando I'm on is 775091e

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

If you open com.gmeister.temp.pkcmmsrando.io.DisassemblyReader, and scroll to line 474, does it say else if (args[1].equals("const_value - 1")) value = count - 1;?

Yes.

Are you setting the input and output folders to different locations?

Yes, though the input folder is technically on a network share with full read/write access (It does work, though), see below.

And I assume you're inputting "true" for all three randomisers?

And yes, and the music/sfx pointer ones finish and output successfully.

And I am on the exact same commit.
obraz

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Crud. I'm completely stumped then, I could swear there's nothing we're doing different. Anyway, I'll have a think and get back if I have any ideas, and if you have any yourself I'm all ears.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Ah wait, could you try running the rando specifically on the disassembly I've been using? It's commit 4958f9b from https://github.com/Dabomstew/pokecrystal-speedchoice. And again, stack traces of any errors would be great.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

I tried doing that and it didn't crash this time, but in the output asms, warp destinations don't seem to have changed.
obraz

Support for vanilla would be greatly appreciated, as I plan on stacking this with a few more tools, including the ZX fork of UPR (https://github.com/Ajarmar/universal-pokemon-randomizer-zx) which doesn't have speedchoice support.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Hey, we got something working! With the way I have the warp rando set up, Cianwood doesn't have any of its warps randomised. Basically, I tried playing a game where every warp was randomised, and it had two issues: it wasn't always completable, and it was really complicated (we're talking 800 different warps being randomised). Instead I've chopped the maps into groups and randomised the warps between them. This makes it easier, but still doesn't mean it's always completable. I'm working on that second part on and off at the moment.

If you want to check that it really has randomised warps, check Saffron City, there's like 8 different warps that should be randomised to a total of 5 places there (so both steps on each of the 3 doormats lead to the same place).

Considering that the tool ran error-less on speedchoice, and it runs fine for me on vanilla pokecrystal, the only thing I can see that's different between us is that our files are different - unless running the tool on vanilla pokecrystal outputs a different error for you than the one you sent earlier. I'll have a play on my laptop again but I'm about 80% sure it's an issue on your end :(

If you can get vanilla roms working then the patching process I outline in the readme should still work. All of the changes this tool can make don't offset any addresses in the ROM as far as I know.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

Hmmm, I initially hoped warp randomization would function like the Emerald or Platinum entrance randos (neither are currently public but I roughly know how they work), where warps would take you to a different location entirely. With enough tinkering around, the game could be made beatable, but even without level scaling it could serve as an interesting challenge.

Worst case scenario that approach could work for a "1-hour challenge", ala PM: TTYD.

I'll look into re-setting my setup and re-cloning everything when I'm back home.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

So, I did exactly what I said: re-cloned everything just to be sure.

Now it can't find the Notes class again, fun.

Error: Could not find or load main class com.gmeister.temp.pkcmmsrando.Notes
Caused by: java.lang.ClassNotFoundException: com.gmeister.temp.pkcmmsrando.Notes

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

I have some old code I can re-jig into a function, if potentially impossible full warp randomiser. I always intended to have that as an option, it's just not quite there yet (a bit like all the warp rando stuff).

Now it can't find the Notes class again, fun.

Oh great. Can eclipse find your java version? Is there a red exclamation point on the project icon, or any warnings/errors in the "Problems" tab?

Edit - you might have to remove the old run configuration and re-make it.

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

Oh great. Can eclipse find your java version? Is there a red exclamation point on the project icon, or any warnings/errors in the "Problems" tab?

There are no red exclamation points, Eclipse can find Java I'm pretty sure, as it was working before and I didn't touch Eclipse's own settings.
As for the problems tab:
image
I re-made the configuration and hit the same error.

I have some old code I can re-jig into a function, if potentially impossible full warp randomiser. I always intended to have that as an option, it's just not quite there yet (a bit like all the warp rando stuff).

We can probably make it possible once we get it working.

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

I managed to replicate the error and the problems when my newly-imported project didn't have the right JRE. Even without the red exclamation point, this seems to be typical of build path errors. Could you try the "Setting up pkc-mms-rando with the JDK" step in the wiki again?

from pkc-mms-rando.

FrostedGeulleisia avatar FrostedGeulleisia commented on July 19, 2024

Alright, I did just that and turns out everything magically works now! Even with vanilla pokecrystal!
Looks like Eclipse by default set itself to the wrong JDK version (SE-14 instead of SE-15) and I just never noticed. I guess this particular issue's now resolved. Eagerly waiting for full entrance randomization so we can make it a "fun" (depends on what you consider as fun) or at least interesting challenge, while still being beatable.
An idea could be to have a toggle for scaling wild/trainer/static levels to the badge count you're supposed to have, or at the very least making sure you need all 8 Johto badges before entering the Elite Four and all 8 Kanto badges to access Red's chamber in Mt. Silver, and either moving starter selection into the player's house, making said house exit to Elm's Lab, or just not randomizing New Bark Town altogether. I have a few ideas on how that could be handled, but that probably deserves another issue (GitHub doesn't really have any other way of starting a thread).

from pkc-mms-rando.

TheG-Meister avatar TheG-Meister commented on July 19, 2024

Awesome! I'm glad the code works for someone other than myself. Thanks for bringing to light a bunch of stuff I take for granted considering I've been developing in Java for so long. I'll look into releasing JAR files in future so all of this isn't necessary to access basic randomisers.

Thanks for the ideas, I had some of those already in mind and others already implemented. If you've got other suggestions that don't relate to a particular bug or problem then feel free to message me on discord (The G-Meister#4275) or email me ([email protected]). Happy randomising!

from pkc-mms-rando.

Related Issues (8)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.