Jump to content

NolValue

Members
  • Posts

    42
  • Joined

  • Last visited

Posts posted by NolValue

  1. 4 minutes ago, diesieben07 said:

    The thing to be careful about in Minecraft is that almost all data structures in Minecraft are not threadsafe.

    If you offload your AI to a separate thread, it cannot directly interact with the world, at all. You need to copy all data that the other thread needs to work on the main thread, before passing that copy on to the other thread to work on.

    Yeah, Minecraft really isn't inherently threadsafe. Thankfully, at least right now, the AI is going to only read data from other threads. It shouldn't be able to directly alter it. The most it'll do is maybe spawn an Entity like a projectile.

  2. This isn't really an outright request for help or support, more asking a question on what you guys would recommend in terms of this idea.

     

    I've been working on a mod as of late, if you guys know what CustomNPCs is, I'm working on my own type of mod in that sort of genre.

     

    So, right now, I'm working on a custom AI system based off Behaviour Trees. I chose this over using Minecraft's built in one because theirs feels kind of limited, plus it's easier to visualize what decisions my AI would make this way.

     

    After getting closer to completion, I've been thinking about how this system is a lot of overhead to add to Minecrafts already relatively bloated stack.

     

    Do you guys think it would be justifiable to move all my NPC entities AI onto their own thread? 

     

    As in, have a singleton AI Handler class in which it has it's own thread where it processes its children (at a fixed tickrate of course) on loop?

     

    (Accidentally posted in wrong section before. Reposting here and editing old thread)

  3. 14 hours ago, DaemonUmbra said:

    There's no way to get the original name out of that.

    Everything that has a name in that environment has been named by someone on the Forge dev team or a community member.

    That's most likely incorrect, these are Minecraft methods and parameter. Which means the user didn't run the gradle task setupDecompWorkspace

  4. So this isn't so much support, as I know how to do this, but I was wondering exactly why it's so frowned upon within this community? 

    The personal reasons I do this with a couple of mods are as followed
    1. Clients who I do mod development for would like mods to be obfuscated because they don't want the features within them to be replicated (Scummy in my opinion, but I go with it, especially when they pay me more.)
    2. Security reasons, packets can be surprisingly easy to manipulate if someone takes the time to research them and finds a vulnerability. While I try to avoid vulnerabilities by adding serverside checks, there's always going to be an exploit. This is what I do for my personal projects that are meant to be heavily serversided focus. 
    3. Avoidance of clientside exploits. A good example of this would be a 1.7.10 Mod called Dragon Block C, where due to the modder's failure to properly hide functions and what they do, I ended up able to create a mod that allows me to instantly transform and reach max output percentage of stats.


    These are my reasons, though I rarely do obfuscation aside from projects with very experimental and potentially exploitable features or upon specific request from a paying client. When I'm not worried about such issues they'll be left alone with no special obfuscation attempts

    I'd like to hear the thoughts of other modders, as I personally understand the need for it in certain situations. Normally however, while I don't frown upon it, I don't think it's outright necessary. 

  5. 53 minutes ago, diesieben07 said:

    Please keep this Forum in English, thank you.

     

    You have a mod for 1.7.10 or older installed on 1.8.9. You should not be using either version. Update to 1.12.2.

    Not every mod has updated to 1.12.2, and a lot of the really good ones are stuck in 1.7.10 due to the massive jump in difficulty to update from 1.7.1.0 to 1.8.

     

    Plus the newer versions of MC are a lot more resource intensive.

  6. 5 minutes ago, V0idWa1k3r said:

    Don't do this. First of all you don't need to do this. It also cases state leaks.

     

    If you are enabling blend then specify the blend function too, you never know what it was set to beforehand.

     

    Same here, actually. Maybe not as relevant in minecraft since hardly anyone changes the alpha test function but you never know.

    Even with both of those done, the Entity plain refuses to load the model in.

    Works just fine with regular GL11, but not GLState

  7. public class RenderAura extends Render implements IRenderFactory<EntityAura> {
        ModelBase model;
        public RenderAura(RenderManager renderManager) {
            super(renderManager);
            this.model = new ModelAura();
        }
    
        @Nullable
        @Override
        protected ResourceLocation getEntityTexture(Entity entity) {
            return new ResourceLocation(References.MOD_ID, "textures/entity/aura.png");
        }
    
    
        public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) {
            int[] AuraColor = entity.getCapability(ModCapabilities.AURA, null).getAuraColor();
            float[] color = new float[AuraColor.length];
            for(int i=0; i<AuraColor.length; i++) {
                color[i] = AuraColor[i]/10;
            }
            GlStateManager.pushAttrib();
            GlStateManager.pushMatrix();
            GlStateManager.enableAlpha();
            GlStateManager.enableBlend();
            GlStateManager.translate(x, y, z);
            GlStateManager.color(0.259f, 0.525f, 0.957f, 0.4f);
            this.model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
            GlStateManager.disableAlpha();
            GlStateManager.disableBlend();
            GlStateManager.popMatrix();
            GlStateManager.popAttrib();
        }
        @Override
        public Render<? super EntityAura> createRenderFor(RenderManager manager) {
            return new RenderAura(manager);
        }
    }

     

  8. So,  I have this code here, that is supposed to render my custom model.

    public class RenderAura extends Render implements IRenderFactory<EntityAura> {
        ModelBase model;
        public RenderAura(RenderManager renderManager) {
            super(renderManager);
            this.model = new ModelAura();
        }
    
        @Nullable
        @Override
        protected ResourceLocation getEntityTexture(Entity entity) {
            return new ResourceLocation(References.MOD_ID, "textures/entity/aura.png");
        }
    
    
        public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) {
            int[] AuraColor = entity.getCapability(ModCapabilities.AURA, null).getAuraColor();
            float[] color = new float[AuraColor.length];
            for(int i=0; i<AuraColor.length; i++) {
                color[i] = AuraColor[i]/10;
            }
            GL11.glPushMatrix();{
                GL11.glScaled(0.5, 0.5, 0.5);
                GL11.glColor4f(0.58f, 0.110f, 0.193f, 0.4f);
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    
                GL11.glTranslated(x, y, z);
    
                GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
                OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 128.0F, 128.0F);
    
                bindTexture(new ResourceLocation(References.MOD_ID, "textures/entity/aura.png"));
    
                this.model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
    
                GlStateManager.disableAlpha();
                GlStateManager.disableBlend();
                GL11.glPopAttrib();
            }
            GL11.glPopMatrix();
        }
        @Override
        public Render<? super EntityAura> createRenderFor(RenderManager manager) {
            return new RenderAura(manager);
        }
    }

    As you can see by the title, I want a color that changes.
    Whenever I try to get it to work, it fails to apply the color. I've tried various different methods in an attempt to get it to work

     

    The Alpha works perfectly, however the color of the texture does not.

  9. As it turns out, RenderPlayerEvent.post is not the proper way to do this, as I'm going to render something to a player when a button is pressed. It's going to take a lot more work than originally expected, as I need to write a custom .obj parser and renderer now using OpenGL, haha.

  10. 1 minute ago, Animefan8888 said:

    The code will crash if the mod isn't loaded, seeing as how he would be getting the Capability from one of that mods classes, this post was so that he could find a way around that. And he has, but now he needs to know if an Event exists which as far as I know he will have to do something like Loader.isModLoaded and then only do his registration that way.

    That wouldn't crash the code, hasCapability functions like a boolean from what I believe.

     

    Anyways, I'm not sure if there is any way to check if an event is there either. He'd just have to check if that other mod is there or not as you said.

  11. So, I have a .obj file, which I'd like to have the player sit in the center of. Not override the player's model, but have it rendered on top of them.

    I know it's possible, as I've seen it done before, however, I'm unsure how to go about doing it. I know I'll need a TESR but that's about it.

     

    I assume I'll have to get the player's coords then render it to that, however I've never done anything with a TESR before, which will make this difficult for me.

     

    Any form of help or advice on how to go about doing this is appreciated.

×
×
  • Create New...

Important Information

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