MachineMuse / MachineMusePowersuits

Minecraft mod, take 2
236 stars 105 forks source link

1.8.9 Porting #681

Closed lehjr closed 8 years ago

lehjr commented 8 years ago

1.7.10 has been mostly busy work for awhile now, for mods, for Forge, and for players stuck on the sidelines waiting for updates. Aside from the nightmare of the rendering, there are also several dependencies that may not be available. Maybe it's time to start working on the port and disable the modules that have dependencies that can't be met until they become available. I just hope the performance is better than 1.7.10.

eyeonus commented 8 years ago

Just curious here, what exactly is the nightmare with rendering?

lehjr commented 8 years ago

There are some long winded explanations around but basically it requires a complete rewrite of all the mod's rendering code. The player really won't notice other than the time it takes to get the mod ported, but the developer will pretty much look like this to get it done:

programmer

lehjr commented 8 years ago

Checked out how bad Numina will be with 1.8.8, so far got it down to 45 errors.

MachineMuse commented 8 years ago

Cool, let's prioritize that for now then. I'll have to fiddle with the build scripts to get a proper separation between 1.7.10 and 1.8.8 builds.

lehjr commented 8 years ago

It's the render code that will be the toughest to deal with. I looked at a short block tutorial for 1.8.8 and almost immediately lost my faith in humanity. Edit: http://bedrockminer.jimdo.com/modding-tutorials/basic-modding-1-8/model-files/

MachineMuse commented 8 years ago

Yes, I remember begging Grum not to do this.

lehjr commented 8 years ago

Just a thought, but how is the player going to charge the armor in 1.8.x? Edit, looks like there might be some work on Buildcraft for 1.8.x builds, so there must be some sort of power API.

On a side note, LOL!!

I was expecting that, just not worded quite like that.

MachineMuse commented 8 years ago

I'm sure there is some kind of power API in 1.8+.

Regarding rendering, we will have to circumvent the new rendering system rather than using it directly, since it is limited to cubic shapes - pretty much just like before. Does the updated Forge have working wavefront obj support?

Xen1290 commented 8 years ago

If i remember correctly, in Forge 1.8.9/1.8.8 there is a new rendering system, Made by @RainWarrior. For power api, the only that exist is the unofficial RF api ported by Progressive Automation devs.

MachineMuse commented 8 years ago

Might be a good opportunity to go power-free instead. Limit modules by power generation of a generator module, instead of batteries.

lehjr commented 8 years ago

Yes, it appear according to one of the issues on Forge's github. As far as power goes, an API is one thing, a way to generate it is another.

MachineMuse commented 8 years ago

Alternatively just keep it as-is and let people charge using MPSA generators.

lehjr commented 8 years ago

They are very slow to charge. Edit: maybe change their charge rate until there is stable way to charge them externally?

MachineMuse commented 8 years ago

ok. We could also finally implement a 'storage' module with a UI that contains several slots which are unlockable by different modules:

This was a planned feature from the start but I got frustrated with minecraft's UI system (obviously) and never got around to it.

lehjr commented 8 years ago

Sounds interesting. Looks like this is going to be quite an overhaul. By the looks of it, none of the modules with external dependencies will carry over for awhile.

lehjr commented 8 years ago

Progress so far, LOL!!! : https://gist.github.com/lehjr/1709dfde96643ee8ff2d

That's Numina and MPS in the same workspace.

Xen1290 commented 8 years ago

Update directly to 1.8.9 if possible

lehjr commented 8 years ago

Actually, I'm currently considering falling back to 1.8 and starting from there.

1.8.9 isn't really an option at this time. With a new version every day, it's too unstable to target, I'm not even sure about 1.8.8 at the moment since several dependencies including NEI are missing.

Xen1290 commented 8 years ago

I think you can use JEI, every 1.8.9 mod uses It as far as I know, like blood magic, tech reborn and others. I read that is a nei replacement with an easy-to-use API. Maybe @mezz can clarify.

mezz commented 8 years ago

1.8.9 should be the current target for mods doing updates. By the time you finish, 1.8 will be completely dead, especially now that Thaumcraft has updated to 1.8.9. Mods with JEI support in 1.8.9 include Chisels & Bits, Tinker's, Blood Magic, and ExU. You can get started with JEI here.

lehjr commented 8 years ago

Well, at least the MCP mappings for 1.8.9 haven't changed for a few days. Wait, "This set of MCP mappings was designed for MC 1.8.8. Use at your own peril." Um...

MachineMuse commented 8 years ago

Yes, a few other sources have confirmed that JEI+1.8.9 is the standard to shoot for if we can get this done in any reasonable amount of time. Though there is still much uncertainty about power systems.

lehjr commented 8 years ago

I don't think it's impossible. I wish my skill level and experience were a little more fitting for the task, but I'll learn as I go, as I always do. My biggest setback is a lack of working examples and documentation, making it hard to figure out how to go from "what was" to "what is". Some of it is cleaner with the use of pos instead of x, y, and z, but some things are quite intimidating. And ffs, it's like someone is getting a commission for every json file needed.

Right now, the only working example I have to work from is this: https://github.com/MightyPirates/TIS-3D

It does have a couple of things though, like OBJ rendering.

Edit: for power I'm using the RF API copied from buildcraft's experimental builds.

lehjr commented 8 years ago

This is a great read: https://docs.google.com/document/d/1c8uipS3BOe0BQKH6-kVFCQh8BaXOdRn8SFaAa7HmgWU

lehjr commented 8 years ago

So it looks like Buildcraft has an Alpha build for 1.8.9. That should be a good start for getting power.

For 1.8.9 I think it would be best to add "optional recipes" so that the default recipes are overwritten on update. That will address the insanity of having to constantly address recipe issues have already been fixed.

lehjr commented 8 years ago

Sort of have something rendering, too bad it's stuck to the player: 2016-01-14_12 29 03

MachineMuse commented 8 years ago

ahahaha adorable :>

lehjr commented 8 years ago

Sadly, I'm still looking at what to use for rendering the TinkerTable. Since IBSR's were removed in 1.8 I used a TESR just to see it working in the current workspace. I'm not entirely sure if I can avoid using one, but I'm looking at alternatives.

lehjr commented 8 years ago

The armor models will be the next challenge. I'm reasonably confident that will be easier. On a side note, the 1.8.9 mods seed to have more than doubled in the past week.

lehjr commented 8 years ago

Well, that took longer than it should have, but I did gain some knowledge from it. 2016-01-15_15 33 07

eyeonus commented 8 years ago

I was going to say it looks a little blocky, but then I thought you might not get the joke.

lehjr commented 8 years ago

LOL

lehjr commented 8 years ago

@MachineMuse which side if the TinkerTable is the front or does it really matter?

MachineMuse commented 8 years ago

It doesn't matter. In fact in 1.7 and earlier it could not be rotated at all because it was the very first block I made and it was symmetrical on 4 axes before I replaced it with SebK's model. I never went back and made it properly rotation-sensitive.

lehjr commented 8 years ago

Making some progress, but still have issues to work around. There are lots of changes, some small, some large. Some stuff I have no idea what to do with, like this: https://github.com/MachineMuse/Numina/blob/experimental/src/main/scala/net/machinemuse/numina/render/MuseIconUtils.scala#L62-L65 because addVertexWithUV no longer exists I've yet to find a replacement. There are other fun things as well, like OBJ rendering (currently I'm using the old OBJ setup that's in Thaumcraft 5). I have about 50 or so errors to contend with just to get things to where they will build. Running might be another story :P

RainWarrior commented 8 years ago

Please don't do what TC5 did with OBJs. There's a loader in forge now, use it.

lehjr commented 8 years ago

No worries. I know the old rendering was removed for a reason and I'm only using the old setup just to clean up everything else to where it will build. After that I'll dig into the new setup and do things right.

AlexIIL commented 8 years ago

Instead of using the tessellator to add vertexes, you use

WorldRenderer wr = tess.getWorldRenderer();
// There are several to choose from, look at DefaultVertexFormats for more info
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
// Imaginary class Point that contains the position and texture coordinates
for (Point p : points) {
  wr.pos(p.x, p.y, p.z);
  wr.tex(p.u, p.v);
  // This is very important
  wr.endVertex();
}
tess.draw();

One thing you need to make sure is that you call pos(), tex(), normal() and color() in the same order as they are defined in the vertex format you are using.

lehjr commented 8 years ago

Thanks!!!

MachineMuse commented 8 years ago

by the way, a TESR is fine. sorry, should have mentioned that earlier.it's not a block that will be in worldgen, and most people aren't making buildings out of them, so it's OK to have them as tile entities with no stored information (or they can be tile entities with information stored about orientation, nbd either way)

lehjr commented 8 years ago

about 40 errors to go for a successful build. Then I need to figure out the new rendering for OBJ.

lehjr commented 8 years ago

Took the day off yesterday to build a new Linux kernel (yes people still do that) and update my video drivers, so not much progress atm. However, I am quite certain I am going to reach a point where I will need help because some of this is quite hard to follow, some of it I just have no idea what to do with it. I'll be uploading what I have so far later today, but keep in mind that is an absolute mess.

MachineMuse commented 8 years ago

okay :> that's super cool anyway. No pressure.

lehjr commented 8 years ago

I still have a lot more to upload, but I'm holding off on that while I experiment a bit with the armor rendering in a lighter/less complex setup since the rendering itself will be a bit for me to figure out.

lehjr commented 8 years ago

I guess this could be a fallback option until I figure out the rendering: 2016-01-28_15 23 02

MachineMuse commented 8 years ago

I'm sure a vocal minority of users will be very happy about that, lehjr :)

MachineMuse commented 8 years ago

We don't have to update the custom rendering if it's too much effort. It was entirely a cosmetic feature, deliberately divorced from the functionality of the mod.

lehjr commented 8 years ago

It's too early for me to say for sure if it's too much effort to get working. The only big issue I have is lack of examples, but I'm going to give it a week and see if I can figure it out. Everything that isn't model or texture related looks easy.

Razorskills commented 8 years ago

Sometimes I wish there was a config to switch it to this armor instead of the new one, just for nostalgia purposes.

MachineMuse commented 8 years ago

Yes, it has been requested in the past. I think I closed it once during a period of grumpiness, but it's a reasonable request.