News:

Please request registration email again and then check your "Spam" folder

Former www.henthighschool.com

[Tool] Tiquionophist's Class Scheduler [1.6.0]

Started by tiquionophist, May 31, 2022, 06:19 AM

Previous topic - Next topic

tiquionophistTopic starter

I've created a standalone application which generates class schedules based on teacher assignments and the number of times each subject should be taught per week. This makes it easy to specify the way you want your school to be run and let this program figure out how to satisfy those requirements.

Latest release: 1.6.0, supporting HHS+ 1.10.5

Features:
  • choose the number of times per week each subject should be scheduled and which teachers are allowed to teach them
  • import settings (number of classes, teacher assignments) from a game save file and export schedules back to the safe file
  • see the weekly effects on student stats (corruption, etc)
  • add custom teachers or include teachers from Lexville
  • customize subject frequency per class
  • disallow the same subject back-to-back or twice in the same day

The source code can be found on GitHub; see the README for instructions on installation and usage. Please report issues, make feature requests, etc. there or in this thread.

Umgah

Thank you for restoring this topic! I was thinking that I might need to do it myself :)

nobby

Thank-you so much for posting. This is an invaluable tool.

This needs to get integrated into the base game asap. One of the least fun parts of the game.

Umgah

Quote from: nobby on May 31, 2022, 03:46 PMThis needs to get integrated into the base game asap.
Unfortunately that tool can't be directly integrated into the game because it's written on different programming language and runtime (game is DotNet-based and this tool is Java-based). There are few possible things that we can implement but we do not have much resources for that.

So for now things are likely to stay as it is. I think it's not that hard to save your game, run this tool to modify the saved schedule and the load your game from the edited save file.

tiquionophistTopic starter

Quote from: Umgah on May 31, 2022, 11:08 PM
Quote from: nobby on May 31, 2022, 03:46 PMThis needs to get integrated into the base game asap.
Unfortunately that tool can't be directly integrated into the game because it's written on different programming language and runtime (game is DotNet-based and this tool is Java-based). There are few possible things that we can implement but we do not have much resources for that.

So for now things are likely to stay as it is. I think it's not that hard to save your game, run this tool to modify the saved schedule and the load your game from the edited save file.

Agreed, frankly I'm not terribly interested in delving into HHS+'s codebase to work on a more direct integration. In the long term, it would be pretty straightforward from my side to expose a simple CLI which the game could invoke to generate schedules. I don't imagine the team will have the resources for that in the near future, but if it's ever something you're interested in do let me know.

And if anyone has ideas for lighter-weight ways to make the program easier to use I'd be happy to hear them :)

MindeKing

#5
Whenever I try to launch the tool using the .exe from the .zip download, I only get an error window that says "Failed to launch JMV". And I can't seem to get the .jar file working either. I even reinstalled java to see if that would do anything, and it didn't.
However, it does seem that the .msi version works perfectly fine (but only when I installed it to Program Files. It gives me the same error message when I try installing it around my hhs folder).
I wish I knew if I was doing something wrong, but I can't find anything that hints toward that possibility. So if I'm not doing anything wrong, treat this as some sort of bug report?
Thank you for all your hard work, regardless.

Umgah

Found an interesting piece of software for integration between Java and DotNet http://jni4net.com/
However it's quite dated :(

So it's unlikely to be useful but still interesting.

tiquionophistTopic starter

Quote from: MindeKing on Jun 02, 2022, 06:55 PMWhenever I try to launch the tool using the .exe from the .zip download, I only get an error window that says "Failed to launch JMV". And I can't seem to get the .jar file working either. I even reinstalled java to see if that would do anything, and it didn't.
However, it does seem that the .msi version works perfectly fine (but only when I installed it to Program Files. It gives me the same error message when I try installing it around my hhs folder).
I wish I knew if I was doing something wrong, but I can't find anything that hints toward that possibility. So if I'm not doing anything wrong, treat this as some sort of bug report?
Thank you for all your hard work, regardless.

Thanks for the report - not surprised that the .jar doesn't work since it will likely require a specific Java version (I build with 16.0.2 and you're likely to have 1.8 or 11 installed). The .zip does work for me and should be packaged with the same JVM as the .msi, but I'll do some more investigating and see if I can find any issues. Knowing that it may be installation location specific is useful, thanks!

I'll likely have a small release soon with a few tweaks and fixes which has a chance of inadvertently fixing the problem as dependencies are updated.

Anon888

Please update for 1.10.5.5, it doesn't work anymore

⚧ Squark

Quote from: Anon888 on May 21, 2023, 12:22 PMPlease update for 1.10.5.5, it doesn't work anymore
I've just found that it still works. At least, the Standalone Zip file does.

Anon888

#10
Quote from: ⚧ Squark on May 21, 2023, 02:54 PM
Quote from: Anon888 on May 21, 2023, 12:22 PMPlease update for 1.10.5.5, it doesn't work anymore
I've just found that it still works. At least, the Standalone Zip file does.
I also tried it with the 1.4.0 standalone zip, but I'm gonna retry and edit this message with the result, maybe it was a one-time error.

Edit 1:
It doesn't work. I even tried disabling all mods and making a new save, and it gives me a slightly different error, but still an error nonetheless.

This is the error without mods:
com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 middle byte 0x0 (at char #102, byte #-1)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._initializeXmlReader(XmlFactory.java:734)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:600)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:30)
at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:1031)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3542)
at com.tiquionophist.io.SaveFileIO.read(SaveFileIO.kt:30)
at com.tiquionophist.ui.MenuBarKt$MenuBar$4$1$3$1$1.invokeSuspend(MenuBar.kt:122)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x0 (at char #102, byte #-1)
at com.ctc.wstx.sr.StreamScanner.constructFromIOE(StreamScanner.java:653)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1017)
at com.ctc.wstx.sr.StreamScanner.getNext(StreamScanner.java:770)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2096)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1180)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._initializeXmlReader(XmlFactory.java:729)
... 12 more
Caused by: java.io.CharConversionException: Invalid UTF-8 middle byte 0x0 (at char #102, byte #-1)
at com.ctc.wstx.io.UTF8Reader.reportInvalidOther(UTF8Reader.java:318)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:208)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:88)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1011)
... 16 more

This is the error with mods:
com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0x9e (at char #32, byte #-1)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._initializeXmlReader(XmlFactory.java:734)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:600)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:30)
at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:1031)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3542)
at com.tiquionophist.io.SaveFileIO.read(SaveFileIO.kt:30)
at com.tiquionophist.ui.MenuBarKt$MenuBar$4$1$3$1$1.invokeSuspend(MenuBar.kt:122)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x9e (at char #32, byte #-1)
at com.ctc.wstx.sr.StreamScanner.constructFromIOE(StreamScanner.java:653)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1017)
at com.ctc.wstx.sr.StreamScanner.getNext(StreamScanner.java:770)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2096)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1180)
at com.fasterxml.jackson.dataformat.xml.XmlFactory._initializeXmlReader(XmlFactory.java:729)
... 12 more
Caused by: java.io.CharConversionException: Invalid UTF-8 start byte 0x9e (at char #32, byte #-1)
at com.ctc.wstx.io.UTF8Reader.reportInvalidInitial(UTF8Reader.java:307)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:192)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:88)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1011)
... 16 more

TBBle

Quote from: tiquionophist on Jun 01, 2022, 05:46 AMAnd if anyone has ideas for lighter-weight ways to make the program easier to use I'd be happy to hear them :)

What about a HHS+ mod that outputs the current timetable as a string to be copied into the tool, and can take a string back from the tool to overwrite the timetable. That would isolate the tool from parsing the save-game format, at least.

barteke22

The save format has changed from XML to SQL.  If you want to go back to the old format (which should fix this) you can:

1. Open hhs+exe.config and change save_useSQLiteSaves to False.
2. Run exe & load save.
3. Save to new slot, this save (and new games) should use the old format now.

dalzomo

Quote from: barteke22 on May 21, 2023, 09:36 PMThe save format has changed from XML to SQL.  If you want to go back to the old format (which should fix this) you can:

1. Open hhs+exe.config and change save_useSQLiteSaves to False.
2. Run exe & load save.
3. Save to new slot, this save (and new games) should use the old format now.
Aside from being able to use this tool, what are the pros and cons of one save format over the other?

Anon888

#14
Quote from: barteke22 on May 21, 2023, 09:36 PMThe save format has changed from XML to SQL.  If you want to go back to the old format (which should fix this) you can:

1. Open hhs+exe.config and change save_useSQLiteSaves to False.
2. Run exe & load save.
3. Save to new slot, this save (and new games) should use the old format now.
Yeah, I imagined it had to do with the change in save format from what the errors tell me, but I didn't know that I could change it. Now I'll try doing so and edit this message with the results, thanks in advance.

Edit 1:
It works, thanks