Jump to content

Frag

Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by Frag

  1. So would I need a specific Biome o Plenty API for the developers? So you are saying that when Biome O Plenty is installed, the BiomeDictionary should contains instances of BiomeGenBase for every biome contained in Biome O Plenty?
  2. Hi guys, my mod spawn my mobs without any issues, but I want now to support Biome O Plenty and spawn my mobs in those Biome as well. I was not able to pinpoint how to this, but I do not expect it to be really hard to do. Anyone could point me an example or give me some hint how to do it? I found some info on the net, but nothing really helpful and to the point. Thanks guys! Frag
  3. Surprised that I am the only one who has issue with this method ...
  4. How can I know the EnumCreatureType of a specific vanilla mob. This is the vanilla water squid... where can I know which creaturetype was used to spawn it. My guess is that it is EnumCreatureTpe.waterCreature ... but since the call does not seem to work. Maybe I have the wrong one. Still wondering how I can prevent that thing from spawning in specific biomes.
  5. Hi guys, I am wondering if I could miss something. I am playing around with the EntityRegistry.Remove spawn function and I can't get it to work properly. Example: If I am trying to stop the minecraft squids (EntitySquid) from spawning at the beaches, oceans and deep oceans, this is what I call. But it seems that the squid spawn anyway. Missing something? EntityRegistry.removeSpawn(EntitySquid.class, EnumCreatureType.waterCreature, new BiomeGenBase[]{BiomeGenBase.beach,BiomeGenBase.ocean, BiomeGenBase.deepOcean}); By the way I am using the spawn command as well in the same area, with no issue at all.
  6. This is indeed a very good theory ... I will look into it and let you know. Thanks A LOT.
  7. Hi guys, I have few fish mobs that swim gracefully in the ocean, but I noticed that when they are swimming close to the ocean floor, the collision box seems to grind against the floor ...making the movement jerky. It seems that the squid does not have the issue, but I can't pinpoint for the love of god what fixes this. Any hint?
  8. I just realized, while talking about it, that in a multiplayer environment, it will happen a lot that an entity will exist and will have some value set server side BEFORE a new client connects. Question. When a client connect, does ALL variables set server side will be fully synch with the brand new client side when it will connect?
  9. I have no idea what this does. The entity will be null if no entity with that ID exists on the client. Show where you send the packet. Actually I just want to get the worldobj object. Where can I get it from when in an iMessage? That depends. Are you calling that from the server side, or the client side? Thanks for the help TrashCaster. On the client side. I have a simple need, I am trying to get the worldobj from the clientside when the message is received so I can find the entity from its ID. Look at my 2 lines in bold. The first one get me the player, in the second one, I use the player to get the world object to find the entity with it. But I hate that method. I am pretty sure there a more effective way to get the entity from its ID. Tons of people use iMessage, just did not find an example where the Entity is found clientside from its ID. @Override public IMessage onMessage(AIStateMessage message, MessageContext ctx) { if (message!=null) { FantasticDebug.Output("MESSAGE RECEIVED. Entity: "+Integer.toString(message.entityId)+" AI State:"+Integer.toString(message.aiState)); EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx); if (player!=null) { Entity _ent = player.worldObj.getEntityByID(message.entityId); if (_ent!=null) { ((EntityFantasticFish)_ent).brain.SetCurrentAIState(message.aiState); FantasticDebug.Output("New AIState set to: Entity: "+Integer.toString(message.entityId)+" AIState:"+Integer.toString(message.aiState)); return null; } else { FantasticDebug.Output("Entity IS NULL! ",true); } } else { FantasticDebug.Output("PLAYER IS NULL!"); } } else { FantasticDebug.Output("MESSAGE IS NULL!",true); } return null; }
  10. I have no idea what this does. The entity will be null if no entity with that ID exists on the client. Show where you send the packet. Actually I just want to get the worldobj object. Where can I get it from when in an iMessage?
  11. Hi guys, I was wondering if using EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx) and Entity _ent = player.worldObj.getEntityByID(message.entityId) is a standard way to get the worldobj in iMessage. Is there any other way "safer"? I am asking because sometimes the Entity returned by my line Entity _ent = player.worldObj.getEntityByID(message.entityId) is null. Any cleaner way to get the entity id? I don't trust that one much... @Override public IMessage onMessage(AIStateMessage message, MessageContext ctx) { if (message!=null) { FantasticDebug.Output("MESSAGE RECEIVED. Entity: "+Integer.toString(message.entityId)+" AI State:"+Integer.toString(message.aiState)); EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx); if (player!=null) { Entity _ent = player.worldObj.getEntityByID(message.entityId); if (_ent!=null) { ((EntityFantasticFish)_ent).brain.SetCurrentAIState(message.aiState); FantasticDebug.Output("New AIState set to: Entity: "+Integer.toString(message.entityId)+" AIState:"+Integer.toString(message.aiState)); return null; } else { FantasticDebug.Output("Entity IS NULL! ",true); } } else { FantasticDebug.Output("PLAYER IS NULL!"); } } else { FantasticDebug.Output("MESSAGE IS NULL!",true); } return null; } Here is the full message code if you want to see it... package fantastic.network; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.relauncher.Side; import fantastic.FantasticDebug; import fantastic.FantasticMod; import fantastic.entities.EntityFantasticFish; public class AIStateMessage implements IMessage, IMessageHandler<AIStateMessage, IMessage> { private int entityId; private int aiState; public AIStateMessage() { } public AIStateMessage(int anEntityId,int anAIState) { entityId=anEntityId; aiState=anAIState; } @Override public void fromBytes(ByteBuf buf) { entityId = buf.readInt(); aiState = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(entityId); buf.writeInt(aiState); } @Override public IMessage onMessage(AIStateMessage message, MessageContext ctx) { if (message!=null) { FantasticDebug.Output("MESSAGE RECEIVED. Entity: "+Integer.toString(message.entityId)+" AI State:"+Integer.toString(message.aiState)); EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx); if (player!=null) { Entity _ent = player.worldObj.getEntityByID(message.entityId); if (_ent!=null) { ((EntityFantasticFish)_ent).brain.SetCurrentAIState(message.aiState); FantasticDebug.Output("New AIState set to: Entity: "+Integer.toString(message.entityId)+" AIState:"+Integer.toString(message.aiState)); return null; } else { FantasticDebug.Output("Entity IS NULL! ",true); } } else { FantasticDebug.Output("PLAYER IS NULL!"); } } else { FantasticDebug.Output("MESSAGE IS NULL!",true); } return null; } }
  12. Thanks to both of you! I was wondering because I have a small mobs that uses collision box to know if he touched the player and I was wondering how come the collision was not happening. Will try to figure something out...
  13. Hi guys, I just noticed that the player collision box (seen with F3+b) is over its shoulder ... its like it was moved two squares up. What the heck? I did the test with vanilla minecraft 1.7.10. I thought that a mod could do this ...so I tried vanilla. Same thing! Am I missing something?
  14. Hi guys, following CoolAlias good recommendation, I have set this line in my mobs constructor, so its animation will not be in synch with all other mobs of the same type and it worked. But I was wondering. By adding this line in the constructor ... ticksExisted=rand.nextInt(1000); It does mean that the tickExisted value will not be the same on the server and on the client side. Could it cause me some issues somewhere? I am wondering because my IMessage seems to be unstable the first few ticks after the creation of the mob ...some variable does not synch correctly between the server and the client (just for a very short time). I was wondering if it could be related.
  15. This is actually not a bad idea at all! I could reduce it slightly at every tick to avoid major value changes. This is the reason why I posted here, sometimes getting ideas from people outside the project make you think outside the box. This is a VERY good hint. I will look it up and let you guys know!
  16. Yes I read your tutorial on the subject. This is gold. Only thing is in my case, the table of values would need to be huge ... and with different speed, I would need many tables as well. The only issue I am having now is that when the speed of the tail change(variable _tailspeed), there is a abrupt change in the result value attributed to this.bodysection4.rotateAngleY ... this.bodysection4.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _tailSpeed * 0.527F - (float)(Math.PI/2)) ); So let's say the _tailspeed in 0.2 ... here is the debug output. You will notice that when the _tailSpeed change from 0.2 to 0.7, the angle value jump too fast from -0.18 to -0.11 ...which cause the jerky motion. In the following trace, f2 is the tick. f2: 1530.5969 Tail Speed: 0.2 Angle: -0.17856722 f2: 1530.917 Tail Speed: 0.2 Angle: -0.18150482 NEW TAIL FLAP SPEED IS SENT FROM SetCurrentTailFlapSpeed SPEED: 0.7 f2: 1531.2571 Tail Speed: 0.7 Angle: -0.11391987 f2: 1531.597 Tail Speed: 0.7 Angle: -0.09244798 f2: 1531.9171Tail Speed: 0.7 Angle: -0.07092236 I just need to find a way to smooth down those jumps ... If I cant find a way, I will go with large tables. But I would like to avoid this.
  17. 1. Thanks CoolAlias ... THAT did the trick. Worked on the first try! 2. YEs the partial tick is the third parameters (which is the parameter named f2 in my case). My issue is that my _fish.gettailflapspeed can change abruptly between two ticks ...which will make a huge jump of angles ... causing a jerky motion. Was just wondering is someone could suggest something by looking at my line. Example, the line this.bodysection5.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _fish.GetTailFlapSpeed() * 0.527F - (float)(2*Math.PI/3)) ); In this line, the value of _fish.GetTailFlapSpeed can change abruptly. Maybe there is a trick around from you rendering gurus ...
  18. Hi guys, two short rendering questions for you. I wrote a fish mob that animate correctly, but I have two issues, which I am pretty sure one of you guys can help me out with. 1. I noticed that, when many mobs are together, they are all animated at the same sequence. I remember reading somewhere that you can insert some kind of random value to let them start at a different stage of the animation. But I can't find this article anymore ... someone could hint me out? 2. The following code section is my animation loop. The float value returned by _fish.GetTailFlapSpeed can be from 0 to 4. I noticed that when the value returned by this method is changed, than the animation jerk (look like it reset). I understand for sure that changing that value during the animation will change the result of the calculated angles, switching the rendered object angle on the spot ...which cause the jerking animation. But anyone of you could look at this simple code snipet and tell how I could avoid this? I am a bit new to rendering ... its getting in slowly but surely. public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); EntityFantasticFish _fish = (EntityFantasticFish)entity; this.mouth.rotateAngleX = 0.17F*(MathHelper.cos(f2 * 0.06662F) ) + 0.8726646F; this.bodysection1.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _fish.GetTailFlapSpeed() * 0.527F) ); this.bodysection2.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _fish.GetTailFlapSpeed() * 0.527F - (float)(Math.PI/6)) ); this.bodysection3.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _fish.GetTailFlapSpeed() * 0.527F - (float)(Math.PI/3)) ); this.bodysection4.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _fish.GetTailFlapSpeed() * 0.527F - (float)(Math.PI/2)) ); this.bodysection5.rotateAngleY = 0.2F *(MathHelper.cos(f2 * _fish.GetTailFlapSpeed() * 0.527F - (float)(2*Math.PI/3)) ); }
  19. Actually the issue is at the height level. Width is fine in any sizes. Also, the model render is very jumpy (up and down) when I put the size smaller than 0.80. At 0.80 everything is fine. At 0.79 ...I am starting to see many up/down shake and bubbles (the particle effect ... no clue why). setSize drives me nuts.
  20. This would return true if its a water block ...or it is a block that has material as water (like underwater plants, which you can swim thru). (aWorld.getBlock((int)xPos, (int)yPos+up, (int)zPos).getMaterial() == Material.water)
  21. Is it something hardcoded in the SEUS code or my block could be added dynamically to one of the many text files in the SEUS shader?
  22. Hi guys, posted this on the SEUS shader forum, but since a lot of you are writing mods, I am pretty sure you guys also stumbled on this since this shader is really popular. I created a checkered white window in a mod that inherits for the glass panel class of forge (mostly the same code, but a different texture only). The texture is transparent, but end up blue when used with SEUS. The window on the left is my new window (which seus render in blue), the window at the right is the standard glass panel (which is fine). The only different thing is the texture used, so how come mine end up blue? Note that the item version held in hand is alright, proving that my transparency is fine. Is it a properties of some sort I need to set somewhere? http://i1211.photobucket.com/albums/cc438/Frag2000/2015-10-16_15.54.00.png[/img] If I disable the SEUS shader, then it is fine ... like shown in the next screenshot. http://i1211.photobucket.com/albums/cc438/Frag2000/2015-10-16_15.54.53.png[/img] Someone could tell me what I am missing there? Thanks guys
  23. Hi guys, I have a fish model that is scaled down to 0.10F in its render class as follow ... the scale end up fine. @Override protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { this.scaleFish((EntityClownFish)par1EntityLivingBase, par2); } protected void scaleFish(EntityClownFish par1, float par2) { float scale = (float)par1.GetRenderValueFromSize(); GL11.glScalef(scale, scale, scale); } BUT as soon as I am trying to set the collision box smaller than setsize(0.5F,0.5F), the fish is thrown to the ground and die after few seconds. In the following picture, I set it to setsize(0.3F,0.3F) ... this is the result. But like I said, if I set it to 0.5F,0.5F it is fine ... but the box is too big. Am I missing something? Is it because I scaled down the model too much?
  24. I had to go with option #1 even though I understood what you meant in the #2. The reason why I went with #1 is because I do not know yet what the size of my mob will be on a new spawn from minecraft ... I catch the entityjoinworld event and deicide there what size it will be. So it finally works there. Thanks for your help guys This forum is a bless!!!
  25. Hi guys, I am currently working on a complex water mobs project, which goes pretty good so far. I will link it here so you guys will know I am quite serious about it. At this point, my AI is top notch ... the performance is very good and I am in the last stage of testing. We do not see most of the issues in the video but I am still suffering from rough rendering ... and mostly the infamous rubber band effect ...where the mobs teleports of few blocks from time to time. I looked at the minecraft mobs code, but what I hate about them is that not two of them are coded the same way. So here is a very simple question: Someone could point me out a very smoothly rendered mob that he did so I could use it as a reference? I looked at all basic tutorial on the net and I am passed that point. There are nothing really advanced out there. I am mostly having issues with the pitch and the mobs "rubberbanding". Anyone helpful enough to point me at a Github mobs or something? I am far in my project, I am mostly looking for a rendering guru that could help me out here. I would like some kind of mentor that would exchange with me. As you will see in my video, I am not in the first step. I am software developer, but rendering is not my boat. Really need help here...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.