Just to comment on this, did you try changing the ID for "block hidden" in the Railcraft configs to "0?" I've heard a lot of grief about the "hidden block" RC has and it seems changing the ID to zero to disable it should do the trick.
I believe Covert also recently elaborated on this in his RC thread, explaining that it's a coding feature that's been in Forge for a while and mentioning something about modders failing to use proper code to account for this Forge feature with air blocks. You should be able to see his comments here at post 6074.
I do the design work in SketchUp and then build them in code... by hand. The code for the Whitehall's hull looks like this:
// 1 block is 16x16
int blocksize = 16;
int width = blocksize * 2;
int length = blocksize * 6;
int height = blocksize * 2;
int thickness = 2;
int draft = blocksize / 2;
float right_edge = width / 2;
float left_edge = -right_edge;
float stern_edge = length / 2;
float bow_edge = -stern_edge;
// arguments are: X, Y, Z, Xsize, Ysize, Zsize
// X = away (negative = away)
// Y = up (negative = up)
// Z = left-right (negative = left)
// Xsize, Ysize, and Zsize must be positive and
// grow toward, down, and right (respectively)
// origin is center of boat
float x = -(blocksize * 3.5F) + thickness;
float y = draft - 15;
float z = thickness / 2;
int idx = 0;
// bottom
idx = addBox(idx, -(blocksize * 3.5F) + thickness,
draft + 2,
-(thickness / 2),
length - thickness,
4,
thickness);
//
// bottom
//
x = -(blocksize * 3.5F) + 4;
y = draft - 2;
z = thickness / 2;
idx = addMirrorZ(idx, x, y, z, length - (thickness * 2), 4, 1);
x += 6;
y += 1;
z += 1;
idx = addMirrorZ(idx, x, y, z, 2, 1, thickness);
x += 2;
y += 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 62, 1, 3);
x += 62;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 10, 1, 3);
x += 10;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 8, 1, 3);
x += 8;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 4, 1, 3);
//
// bilge
//
x = -(blocksize * 3.5F) + 12;
y = draft - 1;
z = 5;
idx = addMirrorZ(idx, x, y, z, 4, 2, 1);
x += 4;
y += 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 8, 1, 3);
x += 8;
y += 0;
z += 0;
idx = addMirrorZ(idx, x, y, z, 40, 1, 5);
x += 40;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 10, 1, 5);
x += 10;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 10, 1, 5);
x += 10;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 8, 1, 4);
x += 8;
y -= 1;
z += 0;
idx = addMirrorZ(idx, x, y, z, 4, 1, 3);
I did the Whitehall in a weekend. It is made up of nine different models, each of which represents a different part (keel, hull, floor, seat, deck, etc).
The Hoy took several days. It has 24 separate models (3,435 lines of code in total). That sounds like a lot, but some of it is duplicative (I was lazy and duped a lot of code, need to go back and properly derive descendant classes to clean it up), and it's really "fast" coding, meaning I can crank it out quickly and easily.
The really tricky part is all in the design -- hence the use of SketchUp. Each piece on a boat that gets rendered as a different color is modeled seperately, making it easy to change textures later on. For example: Looking at the hull of the Hoy, there's a red section, a white stripe, a black section, the bottom of the hull (below the waterline), and the transom; that would translate to (a minimum of) five models. I say "a minimum of" because it's actually eleven separate models (it was just easier to build the code that way).
This is why I say that the design is the tricky part. When I'm laying things out in Sketchup, I have to make sure that no block crosses a color boundary line -- like the water line -- and, to a certain degree, I don't want to cross any standard block boundaries (because then the entities don't line up with the models).
Just to comment on this, did you try changing the ID for "block hidden" in the Railcraft configs to "0?" I've heard a lot of grief about the "hidden block" RC has and it seems changing the ID to zero to disable it should do the trick.
I believe Covert also recently elaborated on this in his RC thread, explaining that it's a coding feature that's been in Forge for a while and mentioning something about modders failing to use proper code to account for this Forge feature with air blocks. You should be able to see his comments here at post 6074.
Interesting...
Yup, that seems to have fixed it. Silly me, I was doing what Mojang did.
I looked into it, it's actually more difficult. Not as easy to use as a drawing/CAD program, and the code it generates is... less than optimal (it takes more work to fix it than it does to write it from scratch).
This version was posted over the top of the old 0.10.1 ... no need to update, unless you're having conflicts with another mod.
NP, happy to help. Been keeping tabs on this mod since I found it. Bit different from the old Ships & Boats mod I played with back in 1.2.5, but you got some really cool stuff going on.
Just curious: if you took a look at what Covert said, did you understand what he was talking about? If so, mind sharing your assessment of the RC block.hidden, "I did what Mojang does," and what Covert was talking about? You appear to be a modder happy to talk about and explain things, and it seems to be something particularly important for your mod!
NP, happy to help. Been keeping tabs on this mod since I found it. Bit different from the old Ships & Boats mod I played with back in 1.2.5, but you got some really cool stuff going on.
Thanks. I originally started this mod because there didn't seem to be anything like it in the works... everyone else seemed to want to build a boat from scratch with full-size blocks; I wanted something that looked nice.
Just curious: if you took a look at what Covert said, did you understand what he was talking about? If so, mind sharing your assessment of the RC block.hidden, "I did what Mojang does," and what Covert was talking about? You appear to be a modder happy to talk about and explain things, and it seems to be something particularly important for your mod!
Sure.
Every block and material has an integer ID ... a "normal" air block has an ID == 0.
A common function is to check the material type of block at a particular coordinate, like so:
int id = this.worldObj.getBlockId(x, y, z);
if (id == Block.snow.blockID)
...
This is fine if you're looking for a specific block, but not if you're checking for a type of block. For example, there are two different types of water (Block.waterStill and Block.waterMoving). A more appropriate method uses a different function:
if (this.worldObj.isAABBInMaterial(var9, Material.water))
...
In Mojang's code, there are various places where they took shortcuts, such as comparing a block ID to 0 (instead of Block.air.blockID). That seems like a minor thing, but will wreak havoc if the air block's ID ever changes.
Additionally, there is a Material.air which *should* have been a safe and complete comparison, as so:
if (this.worldObj.isAABBInMaterial(var9, Material.air))
...
... but it evidently wasn't. I was using both of those in my code, because I was looking at Mojang's code as an example.
I didn't know about the isAirBlock() function until you pointed me to that thread. This function takes into account that there are multiple types of block that should all be treated as air.
Amazing work and response,you rock dude. I wish more mod developers here were as fast, friendly and helpful as you. I will diffently enjoy this mod even more now and look forward to any new features and update you may have,keep up this kick ass work dude. If you were open to suggestions for new stuff, the lead for mobs in 1.6.2 would be a cool as a way to tie the ship up to a dock! lol, i dont know much about coding or modding,but you would think you could take the 2 tie points they use like the mobs neck and fence post,and use them on your ship and a "dock" or even for now just a fence post on a dock? idk,was worth the idea.
Oh,and you should keep this fixed version of 1.5.2 in your "older versions" if you haven't already. at least till the 1.5.2 people die down and convert to 1.6.2. take it easy!
Great response, thanks dude! Now I see why Covert is getting annoyed with people who are getting upset with him about his "hidden.block" yet not fully understanding the code functionality. Definitely looks like a fair number of modders are unaware of this too. Hopefully more and more modders who use the Mojang way to detect air blocks will catch on to the better method of doing so.
I imagine he would probably appreciate a modder or two who popped into his thread thanking him for pointing that out, if you haven't already.
Interesting tidbit about the desire to have ships that look nice as opposed to built-by-blocks. It takes out some of the creative freedom on the end-user's part, but yeah, your boats sure do look nice. Looking forward to fiddling around with them more when my time is less constrained.
The Meaning of Life, the Universe, and Everything.
Location:
Kassel
Join Date:
7/10/2011
Posts:
51
Location:
Kassel, Germany
Minecraft:
KS_HTK
Member Details
I realy Like this Mod, Great Work!!!
But I always get an Internal Server Error when I try conecting to a Server with this Mod, Still don't know why.
Gretings from Germany
KS_HTK
Rollback Post to RevisionRollBack
If Facebook, Myspace, and Twitter were all destroyed, 99% of teens would go insane. If you're one of the 1% that would be laughing at them, copy this into your signature and hope it happens.
May I suggest another considerations for speed? Purpose and hull dynamics.
For example, the Constitution class heavy frigates were far superior in speed and protection to any similar class of frigate specifically designed as such by the British (this does not count Razee Frigates - conversions from older ships of the line). This is due to exchanging building ideas -specifically hull designs- with the French. In general, a fishing boat simply isn't going to have the speed of a Guarda Coasta. Most cargo ships will be slower (unless you design a clipper sometime in the future); most warships warships depend on role.
I made a server to play this with my friends- spent like a week building two huge cities with extensive canals that are immense and awesome, installed this in the server, found it only lasts about 3 minutes before crashing (forge and small boats only) : ( I mostly blame me. There must be a recent post about this somewhere lol!
I made a server to play this with my friends- spent like a week building two huge cities with extensive canals that are immense and awesome, installed this in the server, found it only lasts about 3 minutes before crashing (forge and small boats only) : ( I mostly blame me. There must be a recent post about this somewhere lol!
0.10.4 (link above) should fix the server crashes. If not, I'll need logs from the server.
May I suggest another considerations for speed? Purpose and hull dynamics.
For example, the Constitution class heavy frigates were far superior in speed and protection to any similar class of frigate specifically designed as such by the British (this does not count Razee Frigates - conversions from older ships of the line). This is due to exchanging building ideas -specifically hull designs- with the French. In general, a fishing boat simply isn't going to have the speed of a Guarda Coasta. Most cargo ships will be slower (unless you design a clipper sometime in the future); most warships warships depend on role.
I don't know that "purpose" necessarily enters into it. Certainly purpose informs a design, but only inasmuch as it defines the desired attributes in the finished product. Example: a Hoy is a Hoy, doesn't matter if it has guns or not.
What does affect performance is hull and rig. Basic LWL/B and Cp go a long way to characterizing a hull's performance potential, and SA is a fair representation for motive power (taking into account the number and type of sails). Put those together with some basic load data, and I think it will cover most cases.
I don't expect to be getting too terribly complicated with the calculations, just enough to keep things sane and gameplay balanced. For the boats I build there shouldn't be any surprises; for boats that other people build using the framework -- well, that's where server admins will have to exercise their own judgement.
The framework will have some basic sanity checks, and some basic performance formula, but that's all they'll be -- basic. Performance limits will be enforced by the server. But as with any set of rules, someone will try to get around them; I'm not going to put a lot of effort into stopping them. I figure server admins are much better judges of what constitutes foul play than I am, at least on their own servers.
I realize you just posted a new fix for the server, but the latest update still creates a strange error for me. While it does not actually cause the server to crash, the item icons all appear as the missing texture checkerboard in my inventory. when I attempt to place the boats in the water, the entire vessel is invisible except for the chests. I am then unable to enter the boat or destroy it.
Really enjoy this mod, thanks for all of your hard work on it.
Verified the problem with chests (they stop working after exiting the world and re-entering). Looking into it.
Haven't seen a boat glitch out, but disappearing is the boat's way of giving up after not being able to get all the children reconnected to the parent.
I was seeing some control glitchiness in 1.5.2 ... MC just stopped sending motion events. Not sure if it was key binding related, but I haven't seen it under 1.6.2 and the new version of lwjgl.
It does no longer cause a server crash but the boats excluding chests are invisible and non functional.
edit:
Quote from / »
I realize you just posted a new fix for the server, but the latest update still creates a strange error for me. While it does not actually cause the server to crash, the item icons all appear as the missing texture checkerboard in my inventory. when I attempt to place the boats in the water, the entire vessel is invisible except for the chests. I am then unable to enter the boat or destroy it.
Really enjoy this mod, thanks for all of your hard work on it.
looks like he had the same issue
This is also what happens if you try running the 1.5.2 version in 1.6.2 btw.
Just to comment on this, did you try changing the ID for "block hidden" in the Railcraft configs to "0?" I've heard a lot of grief about the "hidden block" RC has and it seems changing the ID to zero to disable it should do the trick.
I believe Covert also recently elaborated on this in his RC thread, explaining that it's a coding feature that's been in Forge for a while and mentioning something about modders failing to use proper code to account for this Forge feature with air blocks. You should be able to see his comments here at post 6074.
Christ, looks too complicated for me. I haven't sprouted sea legs yet.
How about Techne?
Interesting...
Yup, that seems to have fixed it. Silly me, I was doing what Mojang did.
Pelirow, thanks for the pointer.
jaybowen, try this one: http://www.mediafire...49f60305lb6c7hg
This version was posted over the top of the old 0.10.1 ... no need to update, unless you're having conflicts with another mod.
I looked into it, it's actually more difficult. Not as easy to use as a drawing/CAD program, and the code it generates is... less than optimal (it takes more work to fix it than it does to write it from scratch).
NP, happy to help.
Just curious: if you took a look at what Covert said, did you understand what he was talking about? If so, mind sharing your assessment of the RC block.hidden, "I did what Mojang does," and what Covert was talking about? You appear to be a modder happy to talk about and explain things, and it seems to be something particularly important for your mod!
Thanks. I originally started this mod because there didn't seem to be anything like it in the works... everyone else seemed to want to build a boat from scratch with full-size blocks; I wanted something that looked nice.
Sure.
Every block and material has an integer ID ... a "normal" air block has an ID == 0.
A common function is to check the material type of block at a particular coordinate, like so:
This is fine if you're looking for a specific block, but not if you're checking for a type of block. For example, there are two different types of water (Block.waterStill and Block.waterMoving). A more appropriate method uses a different function:
In Mojang's code, there are various places where they took shortcuts, such as comparing a block ID to 0 (instead of Block.air.blockID). That seems like a minor thing, but will wreak havoc if the air block's ID ever changes.
Additionally, there is a Material.air which *should* have been a safe and complete comparison, as so:
... but it evidently wasn't. I was using both of those in my code, because I was looking at Mojang's code as an example.
I didn't know about the isAirBlock() function until you pointed me to that thread. This function takes into account that there are multiple types of block that should all be treated as air.
Oh,and you should keep this fixed version of 1.5.2 in your "older versions" if you haven't already. at least till the 1.5.2 people die down and convert to 1.6.2. take it easy!
I imagine he would probably appreciate a modder or two who popped into his thread thanking him for pointing that out, if you haven't already.
Interesting tidbit about the desire to have ships that look nice as opposed to built-by-blocks. It takes out some of the creative freedom on the end-user's part, but yeah, your boats sure do look nice. Looking forward to fiddling around with them more when my time is less constrained.
But I always get an Internal Server Error when I try conecting to a Server with this Mod, Still don't know why.
Gretings from Germany
KS_HTK
Yeah, I know that by now...
For example, the Constitution class heavy frigates were far superior in speed and protection to any similar class of frigate specifically designed as such by the British (this does not count Razee Frigates - conversions from older ships of the line). This is due to exchanging building ideas -specifically hull designs- with the French. In general, a fishing boat simply isn't going to have the speed of a Guarda Coasta. Most cargo ships will be slower (unless you design a clipper sometime in the future); most warships warships depend on role.
Regardless, thanks again; I do love this mod.
PS: Any projection on server compatibility?
Get it here: http://www.mediafire.com/download/y8lg3wldexlxwv4/smallboats.jar
Guten abend!
0.10.4 (link above) should fix the server crashes. If not, I'll need logs from the server.
I don't know that "purpose" necessarily enters into it. Certainly purpose informs a design, but only inasmuch as it defines the desired attributes in the finished product. Example: a Hoy is a Hoy, doesn't matter if it has guns or not.
What does affect performance is hull and rig. Basic LWL/B and Cp go a long way to characterizing a hull's performance potential, and SA is a fair representation for motive power (taking into account the number and type of sails). Put those together with some basic load data, and I think it will cover most cases.
I don't expect to be getting too terribly complicated with the calculations, just enough to keep things sane and gameplay balanced. For the boats I build there shouldn't be any surprises; for boats that other people build using the framework -- well, that's where server admins will have to exercise their own judgement.
The framework will have some basic sanity checks, and some basic performance formula, but that's all they'll be -- basic. Performance limits will be enforced by the server. But as with any set of rules, someone will try to get around them; I'm not going to put a lot of effort into stopping them. I figure server admins are much better judges of what constitutes foul play than I am, at least on their own servers.
Really enjoy this mod, thanks for all of your hard work on it.
It does no longer cause a server crash but the boats excluding chests are invisible and non functional.
edit:
looks like he had the same issue
This is also what happens if you try running the 1.5.2 version in 1.6.2 btw.
True story that... I somehow managed to upload the wrong version. Fresh upload, hould be fixed now.
Linkie: http://www.mediafire.com/?y8lg3wldexlxwv4
Thanks! Great mod support! unfortunately...
I know that is not code but it stands out if I post it that way : P
edit: I ran it again but I got spammed with 'warning!!! [forge mod loader] Parent is missing parts!!! ' or something like that anyhow.
Hmm... Check your controls, look for "SB Follow Cursor", and make sure it's set to something sane (maybe it's blank?).
I did a fresh install and it works so maybe that was the issue? XD Thanks again