Jump to content

Recommended Posts

Posted

Modes anyone here know how to make a mob that has the line of sight of every spawned entity of the mob (please don't yell at me if this implies chunk lagging of some form)? I'm wanting to make a robot-ish mob that acts as a single army.

Posted

I am not too expirienced with this, but I am currently tinkering around with AIs so maybe this could be some way:

 

Look at the targeting AI, you could copy some things, and save all targeted entities (targeted by your robot mobs) into a list, and than create a method to choose which entity to target in the overall list.

Posted

First of all you should read about http://minecraft.gamepedia.com/Spawn

Unless you don't want your mobs to despawn ever you should consider Despawns.

 

It'd be pointless to make links between entities. I'd rather go with WorldSaveData and hold big pool of everything your "army" collects there. WSD is saved into world (per world). Same as entities, in case of taleportig entity into other dimension it will start using other pool (from that world obviously).

 

You should know that you can't (shouldn't) load entities in chunks that are not loaded. Loading chunks that are not needed for server to work will cause massive lags on big maps considering your entity will be present in many places (again - read about Spawning on wiki).

 

To get entities in world you can simply get entityList (from world) and check instanceof, or hold your own (weak?) list in WorldSaveData that will be filled on entity spawn.

 

Ye, as to rest - you need to code your AI that will actually use that data, nothing to tell you here since idk what you want.

1.7.10 is no longer supported by forge, you are on your own.

Posted
First of all you should read about http://minecraft.gamepedia.com/Spawn

Unless you don't want your mobs to despawn ever you should consider Despawns.

 

First of all, how is that even relevant?

 

It'd be pointless to make links between entities. I'd rather go with WorldSaveData and hold big pool of everything your "army" collects there. WSD is saved into world (per world). Same as entities, in case of taleportig entity into other dimension it will start using other pool (from that world obviously).

 

Pointless because there are workarounds, or pointless because you just don't personally like it? That would make sense except for where I have no idea what this "WSD" is. (I know what it stands for, but I have no idea how to access it).

 

You should know that you can't (shouldn't) load entities in chunks that are not loaded. Loading chunks that are not needed for server to work will cause massive lags on big maps considering your entity will be present in many places (again - read about Spawning on wiki).

 

I'm aware of that. The entity won't be left spawned all the time (although, I might have them stay in the memory similar to how friendlier mobs don't despawn completely). The idea is that the one's that /are/ spawned are linked together, as well as any other's that spawn later on. I am well aware for the potential for lag.

 

Ye, as to rest - you need to code your AI that will actually use that data, nothing to tell you here since idk what you want.

 

Assuming I can get them to all see what each other sees, there is little I need to do with regards to AI. I recently saw a video where they greatly extended a zombies LOS and it was able to run through an entire labyrinth, so minecraft already has the potential for long-range seeing meelee mobs.

Posted

Ok, so, here's the thing.

 

You need an object...er,

Object

that represents your hivemind and makes each Hive distinct from each other Hive.  If there's only one Hive, that's ok too, all we need to do is have a class that represents the collective, whether it be One or Many.

 

This object will be created on world load (or at the very least on startup, then have members inserted into it on world load and removed on world unload) and hold references to each currently active Entity within the Hive.  That is, when a chunk unloads and the Entity is saved to disk, the Hive needs to forget that it exists, because it can't do anything to it, so you may as well free up the RAM.

 

The point of this Hive

Object

is so that you have an upper level for your hive members to communicate through.  "I see the player" is emitted from one member, up to the hive, and back down to each other hive member.  "Can the hive see the player?" can then also be polled, asking the Hive and getting a response because the Hive

Object

stores those variables that you're interested in.  The Hive can also have its own AI task list, goals, and such just like any other Entity, but instead of being an Entity itself, it's merely an

Object

that interacts with the world through its myriad member Entities.

 

You can't just "create a hivemind" with entities and an AI task, you need to actually instantiate the hivemind as an object so that you can manage its goals, current tasks, and various members and provide a clean method of inter-member communication.

 

The alternative is far more complicated, and involves creating a set of rules that two members interacting with each other follow in order to determine what task each is carrying out and what needs to be done.  This is how real insect hives work: by statistical analysis of how many of its fellows its found performing a given task (indicated my pheromones*), an individual can discern what tasks are being under-performed and switch over to that task, maintaining a goal balance of workload.  Figuring out what rules and signals  you need is going to be far more work.

 

*This can be observed in ants by coating a living ant in the pheromone that says "I'm a dead body" and watching other ants pick up its fellow and hauling it to the garbage pile.  The victim ant will repeatedly attempt to clean itself and return to the colony only to get hauled back repeatedly (until the artificial scent is wiped clean again).  It reeks very much of "

" and shows off that each ant is actually unaware of what every other ant is doing, except by those pheromone signals and a small set of rules.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I think the way mobs like wolves and pets attack is pretty much the same as what you want to do. Basically, if one of the entities gets a target, then all of them in the nearby region also get the same attack target. I know you might say that is "communication", but really that is the same thing -- all of them collectively getting same target.

 

If you want to be literal about it and actually combine what they can all see, I think there is a canEntityBeSeen() method in the EntityLivingBase class. You could iterate through all your entities and check any of them can see the player.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
Ok, so, here's the thing.

 

You need an object...er, Object that represents your hivemind and makes each Hive distinct from each other Hive.  If there's only one Hive, that's ok too, all we need to do is have a class that represents the collective, whether it be One or Many.

 

This object will be created on world load (or at the very least on startup, then have members inserted into it on world load and removed on world unload) and hold references to each currently active Entity within the Hive.  That is, when a chunk unloads and the Entity is saved to disk, the Hive needs to forget that it exists, because it can't do anything to it, so you may as well free up the RAM.

 

The point of this Hive Object is so that you have an upper level for your hive members to communicate through.  "I see the player" is emitted from one member, up to the hive, and back down to each other hive member.  "Can the hive see the player?" can then also be polled, asking the Hive and getting a response because the Hive Object stores those variables that you're interested in.  The Hive can also have its own AI task list, goals, and such just like any other Entity, but instead of being an Entity itself, it's merely an Object that interacts with the world through its myriad member Entities.

 

You can't just "create a hivemind" with entities and an AI task, you need to actually instantiate the hivemind as an object so that you can manage its goals, current tasks, and various members and provide a clean method of inter-member communication.

 

The alternative is far more complicated, and involves creating a set of rules that two members interacting with each other follow in order to determine what task each is carrying out and what needs to be done.  This is how real insect hives work: by statistical analysis of how many of its fellows its found performing a given task (indicated my pheromones*), an individual can discern what tasks are being under-performed and switch over to that task, maintaining a goal balance of workload.  Figuring out what rules and signals  you need is going to be far more work.

 

*This can be observed in ants by coating a living ant in the pheromone that says "I'm a dead body" and watching other ants pick up its fellow and hauling it to the garbage pile.  The victim ant will repeatedly attempt to clean itself and return to the colony only to get hauled back repeatedly (until the artificial scent is wiped clean again).  It reeks very much of "I'm not dead yet!" and shows off that each ant is actually unaware of what every other ant is doing, except by those pheromone signals and a small set of rules.

 

That's funny how you say that, because I was planning to somehow implement a leader (the only difficulty was seeing how that would work). Thank you very much.

 

If you want to be literal about it and actually combine what they can all see, I think there is a canEntityBeSeen() method in the EntityLivingBase class. You could iterate through all your entities and check any of them can see the player.

 

Would that also work for block entities? (doors, chests, walls, etc)?

Posted

Block entities might be trickier, but there are ways to detect those too.

 

If world#getEntitiesInAABB(<Class>) doesn't work, you can just loop through the blocks "in range" and see if any of them have a TE and what kind of TE.  It's fast (0.6ms for a whole chunk worth of observation) but I still wouldn't do it very often.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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